public abstract class Edges extends Fields
Node
fields representing the set of inputs for the node or the set of the
node's successors.Modifier and Type | Class and Description |
---|---|
static class |
Edges.Type
Constants denoting whether a set of edges are inputs or successors.
|
Fields.ObjectTransformer
Constructor and Description |
---|
Edges(Edges.Type type,
int directCount,
ArrayList<? extends FieldsScanner.FieldInfo> edges) |
Modifier and Type | Method and Description |
---|---|
void |
clear(Node node)
Clear edges in a given node.
|
boolean |
contains(Node node,
Node value) |
void |
copy(Node fromNode,
Node toNode)
Copies edges from
fromNode to toNode . |
int |
getDirectCount()
Get the number of direct edges represented by this object.
|
static Node |
getNode(Node node,
long[] offsets,
int index)
|
static NodeList<Node> |
getNodeList(Node node,
long[] offsets,
int index)
|
static NodeList<Node> |
getNodeListUnsafe(Node node,
long offset) |
static Node |
getNodeUnsafe(Node node,
long offset) |
Iterable<Position> |
getPositionsIterable(Node node) |
void |
initializeList(Node node,
int index,
NodeList<Node> value) |
void |
initializeLists(Node node,
Node prototype)
Initializes the list edges in a given node based on the size of the list edges in a prototype
node.
|
void |
initializeNode(Node node,
int index,
Node value)
Sets the value of a given edge without notifying the new and old nodes on the other end of
the edge of the change.
|
static void |
putNodeListUnsafe(Node node,
long offset,
NodeList<?> value) |
static void |
putNodeUnsafe(Node node,
long offset,
Node value) |
void |
set(Object node,
int index,
Object value) |
void |
setNode(Node node,
int index,
Node value)
Sets the value of a given edge and notifies the new and old nodes on the other end of the
edge of the change.
|
static void |
translateInto(Edges edges,
ArrayList<NodeClass.EdgeInfo> infos) |
Edges.Type |
type() |
abstract void |
update(Node node,
Node oldValue,
Node newValue) |
appendFields, copy, copy, create, forClass, get, getBoolean, getByte, getChar, getCount, getDeclaringClass, getDouble, getFloat, getInt, getLong, getName, getObject, getOffsets, getRawPrimitive, getShort, getType, isSame, putObject, setRawPrimitive, toString, translateInto
public Edges(Edges.Type type, int directCount, ArrayList<? extends FieldsScanner.FieldInfo> edges)
public static void translateInto(Edges edges, ArrayList<NodeClass.EdgeInfo> infos)
public int getDirectCount()
public static Node getNode(Node node, long[] offsets, int index)
node
- one end point of the edgeindex
- the index of a non-list the edge (must be less than Edges.getDirectCount()
)public static NodeList<Node> getNodeList(Node node, long[] offsets, int index)
node
- one end point of the edgeindex
- the index of a non-list the edge (must be equal to or greater than
Edges.getDirectCount()
)NodeList
at the other edge of the requested edgepublic void clear(Node node)
node
- the node whose edges are to be clearedpublic void initializeLists(Node node, Node prototype)
node
- the node whose list edges are to be initializedprototype
- the node whose list edge sizes are used when creating new edge listspublic void copy(Node fromNode, Node toNode)
fromNode
to toNode
. The nodes are expected to be of the
exact same type.fromNode
- the node from which the edges should be copied.toNode
- the node to which the edges should be copied.public void initializeNode(Node node, int index, Node value)
node
- the node whose edge is to be updatedindex
- the index of the edge (between 0 and Fields.getCount()
)value
- the node to be written to the edgepublic void setNode(Node node, int index, Node value)
node
- the node whose edge is to be updatedindex
- the index of the edge (between 0 and Fields.getCount()
)value
- the node to be written to the edgepublic Edges.Type type()