public class SubstitutionGroupTest extends NodeTest
Note that the SubstitutionGroupTest only tests whether the element name is in the required set of names. It does not test that the content type matches. For this reason, it is always used as part of a CombinedNodeTest that also tests the type annotation.
Constructor and Description |
---|
SubstitutionGroupTest(int head,
int[] members)
Constructor
|
SubstitutionGroupTest(int head,
IntHashSet group)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
double |
getDefaultPriority()
Determine the default priority of this node test when used on its own as a Pattern
|
int |
getHeadFingerprint()
Get the fingerprint of the head of the substitution group
|
int |
getNodeKindMask()
Get a mask indicating which kinds of nodes this NodeTest can match.
|
int |
getPrimitiveType()
Determine the types of nodes to which this pattern applies.
|
IntHashSet |
getRequiredNodeNames()
Get the set of node names allowed by this NodeTest.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
matches(int nodeKind,
int nameCode,
int annotation)
Test whether this node test is satisfied by a given node
|
boolean |
matches(NodeInfo node)
Test whether this node test is satisfied by a given node.
|
boolean |
matches(TinyTree tree,
int nodeNr)
Test whether this node test is satisfied by a given node on a TinyTree.
|
java.lang.String |
toString(NamePool pool)
Display the type descriptor for diagnostics
|
getAtomizedItemType, getContentType, getFingerprint, getPrimitiveItemType, getSuperType, isAtomicType, isNillable, matchesItem
public SubstitutionGroupTest(int head, IntHashSet group)
head
- The name of the head element of the substitution groupgroup
- An IntSet containing Integer values representing the fingerprints
of element names included in the substitution grouppublic SubstitutionGroupTest(int head, int[] members)
head
- The name of the head element of the substitution groupmembers
- An array containing integer values representing the fingerprints
of element names included in the substitution grouppublic boolean matches(int nodeKind, int nameCode, int annotation)
public boolean matches(TinyTree tree, int nodeNr)
public boolean matches(NodeInfo node)
public final double getDefaultPriority()
getDefaultPriority
in class NodeTest
public int getPrimitiveType()
getPrimitiveType
in interface ItemType
getPrimitiveType
in class NodeTest
public int getNodeKindMask()
getNodeKindMask
in class NodeTest
public IntHashSet getRequiredNodeNames()
getRequiredNodeNames
in class NodeTest
public int getHeadFingerprint()
public java.lang.String toString(NamePool pool)
NodeTest
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object