Modifier and Type | Method and Description |
---|---|
static int |
binarySearchForEdge(AtomicReferenceArray<Node> childNodes,
Character edgeFirstCharacter)
Returns the index of the node in the given
AtomicReferenceArray whose edge starts with the given
first character. |
static void |
ensureNoDuplicateEdges(List<Node> nodes)
Throws an exception if any nodes in the given list represent edges having the same first character.
|
public static int binarySearchForEdge(AtomicReferenceArray<Node> childNodes, Character edgeFirstCharacter)
AtomicReferenceArray
whose edge starts with the given
first character.
This method expects that some constraints are enforced on the AtomicReferenceArray
:
childNodes
- An AtomicReferenceArray
of Node
objects, which is used in accordance with
the constraints documented in this methodedgeFirstCharacter
- The first character of the edge for which the associated node is requiredpublic static void ensureNoDuplicateEdges(List<Node> nodes)
nodes
- The list of nodes to validateIllegalStateException
- If a duplicate edge is detectedCopyright © 2019. All rights reserved.