public final class NodeClass<T> extends FieldIntrospection<T>
Node type. The metadata includes:
Node.Input and Node.Successor as well as methods
for iterating over such fields.IterableNodeType class.| Modifier and Type | Class and Description |
|---|---|
protected static class |
NodeClass.EdgeInfo
Describes a field representing an input or successor edge in a node.
|
protected static class |
NodeClass.InputInfo
Describes a field representing an input edge in a node.
|
protected static class |
NodeClass.NodeFieldsScanner |
| Modifier and Type | Field and Description |
|---|---|
static long |
LIST_MASK |
static long |
MAX_EDGES |
static long |
MAX_LIST_EDGES |
static long |
NEXT_EDGE |
static long |
OFFSET_MASK |
data| Constructor and Description |
|---|
NodeClass(Class<T> clazz,
NodeClass<? super T> superNodeClass) |
NodeClass(Class<T> clazz,
NodeClass<? super T> superNodeClass,
FieldsScanner.CalcOffset calcOffset,
int[] presetIterableIds,
int presetIterableId) |
| Modifier and Type | Method and Description |
|---|---|
Node |
allocateInstance()
Returns a newly allocated node for which no subclass-specific constructor has been called.
|
void |
applyInputs(Node node,
Node.EdgeVisitor consumer) |
void |
applySuccessors(Node node,
Node.EdgeVisitor consumer) |
static long |
computeIterationMask(Edges.Type type,
int directCount,
long[] offsets) |
static <T> NodeClass<T> |
create(Class<T> c)
|
NodeCycles |
cycles() |
boolean |
dataEquals(Node a,
Node b) |
boolean |
equalInputs(Node node,
Node other) |
boolean |
equalSuccessors(Node node,
Node other) |
static <T> NodeClass<T> |
get(Class<T> clazz) |
Fields[] |
getAllFields() |
EnumSet<InputType> |
getAllowedUsageTypes() |
Edges |
getEdges(Edges.Type type)
Gets the input or successor edges defined by this node class.
|
Edges |
getInputEdges() |
NodeIterable<Node> |
getInputIterable(Node node) |
Class<T> |
getJavaClass() |
int |
getLeafId() |
String |
getNameTemplate()
The template used to build the
Verbosity.Name version. |
Edges |
getSuccessorEdges() |
NodeIterable<Node> |
getSuccessorIterable(Node node) |
NodeClass<? super T> |
getSuperNodeClass() |
long |
inputsIteration() |
boolean |
isCanonicalizable()
Determines if this node type is
canonicalizable. |
boolean |
isCommutative()
Determines if this node type is
commutative. |
boolean |
isLeafNode() |
boolean |
isSimplifiable()
Determines if this node type is
simplifiable. |
boolean |
isValid(Position pos,
NodeClass<?> from,
Edges fromEdges) |
int |
iterableId() |
void |
pushInputs(Node node,
NodeStack stack) |
void |
registerAtSuccessorsAsPredecessor(Node node) |
boolean |
replaceFirstInput(Node node,
Node key,
Node replacement)
Finds the first
Node.Input or Node.OptionalInput in node whose value
== key and replaces it with replacement. |
boolean |
replaceFirstSuccessor(Node node,
Node key,
Node replacement)
|
String |
shortName() |
NodeSize |
size() |
String |
toString() |
void |
unregisterAtInputsAsUsage(Node node) |
void |
unregisterAtSuccessorsAsPredecessor(Node node) |
int |
valueNumber(Node n) |
boolean |
valueNumberable() |
getClazz, getDatapublic static final long MAX_EDGES
public static final long MAX_LIST_EDGES
public static final long OFFSET_MASK
public static final long LIST_MASK
public static final long NEXT_EDGE
public NodeClass(Class<T> clazz, NodeClass<? super T> superNodeClass, FieldsScanner.CalcOffset calcOffset, int[] presetIterableIds, int presetIterableId)
public NodeCycles cycles()
public NodeSize size()
public static long computeIterationMask(Edges.Type type, int directCount, long[] offsets)
public String shortName()
public Fields[] getAllFields()
getAllFields in class FieldIntrospection<T>public int iterableId()
public boolean valueNumberable()
public boolean isCanonicalizable()
canonicalizable.public boolean isCommutative()
commutative.public boolean isSimplifiable()
simplifiable.public int valueNumber(Node n)
public Edges getEdges(Edges.Type type)
public Edges getInputEdges()
public Edges getSuccessorEdges()
public Node allocateInstance()
public String getNameTemplate()
Verbosity.Name version. Variable parts are specified
using {i#inputName} or {p#propertyName}. If no
template is specified, it uses NodeInfo.shortName().
If none of the two is specified, it returns an empty string.public boolean isLeafNode()
public int getLeafId()
public long inputsIteration()
public NodeIterable<Node> getSuccessorIterable(Node node)
public NodeIterable<Node> getInputIterable(Node node)
public void applySuccessors(Node node, Node.EdgeVisitor consumer)
public void applyInputs(Node node, Node.EdgeVisitor consumer)
public void unregisterAtSuccessorsAsPredecessor(Node node)
public void registerAtSuccessorsAsPredecessor(Node node)
public boolean replaceFirstInput(Node node, Node key, Node replacement)
Node.Input or Node.OptionalInput in node whose value
== key and replaces it with replacement.
Pre-requisite: node.getNodeClass() == thistrue if a replacement was made, false if key was not an inputpublic boolean replaceFirstSuccessor(Node node, Node key, Node replacement)
Node.Successor in node whose value is key and replaces it
with replacement.
Pre-requisite: node.getNodeClass() == thistrue if a replacement was made, false if key was not an inputpublic void unregisterAtInputsAsUsage(Node node)