@Test public void testUpdateOutgoingEdge() throws Exception { Node node = new CharSequenceNodeNonLeafVoidValue("FOO", Arrays.asList((Node) new CharSequenceNodeDefault("BAR1", 1, Collections.<Node>emptyList()))); node.updateOutgoingEdge(new CharSequenceNodeDefault("BAR2", null, Collections.<Node>emptyList())); }
@Override public void updateOutgoingEdge(Node childNode) { int index = NodeUtil.binarySearchForEdge(outgoingEdges, childNode.getIncomingEdgeFirstCharacter()); if (index < 0) { throw new IllegalStateException("Cannot update the reference to the following child node for the edge starting with '" + childNode.getIncomingEdgeFirstCharacter() +"', no such edge already exists: " + childNode); } outgoingEdges.set(index, childNode); }
CharSequenceNodeNonLeafVoidValue implements Node { @Override public void updateOutgoingEdge(Node childNode) { int index = NodeUtil.binarySearchForEdge(outgoingEdges, childNode.getIncomingEdgeFirstCharacter()); if (index < 0) { throw new IllegalStateException("Cannot update the reference to the following child node for the edge starting with '" + childNode.getIncomingEdgeFirstCharacter() +"', no such edge already exists: " + childNode); } outgoingEdges.set(index, childNode); } }
CharSequenceNodeNonLeafVoidValue implements Node { @Override public void updateOutgoingEdge(Node childNode) { int index = NodeUtil.binarySearchForEdge(outgoingEdges, childNode.getIncomingEdgeFirstCharacter()); if (index < 0) { throw new IllegalStateException("Cannot update the reference to the following child node for the edge starting with '" + childNode.getIncomingEdgeFirstCharacter() +"', no such edge already exists: " + childNode); } outgoingEdges.set(index, childNode); } CharSequenceNodeNonLeafVoidValue(CharSequence edgeCharSequence, List<Node> outgoingEdges); }
CharSequenceNodeNonLeafVoidValue implements Node { @Override public void updateOutgoingEdge(Node childNode) { int index = NodeUtil.binarySearchForEdge(outgoingEdges, childNode.getIncomingEdgeFirstCharacter()); if (index < 0) { throw new IllegalStateException("Cannot update the reference to the following child node for the edge starting with '" + childNode.getIncomingEdgeFirstCharacter() +"', no such edge already exists: " + childNode); } outgoingEdges.set(index, childNode); } CharSequenceNodeNonLeafVoidValue(CharSequence edgeCharSequence, List<Node> outgoingEdges); @Override CharSequence getIncomingEdge(); @Override Character getIncomingEdgeFirstCharacter(); @Override Object getValue(); @Override Node getOutgoingEdge(Character edgeFirstCharacter); @Override void updateOutgoingEdge(Node childNode); @Override List<Node> getOutgoingEdges(); @Override String toString(); }
CharSequenceNodeNonLeafVoidValue implements Node { @Override public void updateOutgoingEdge(Node childNode) { int index = NodeUtil.binarySearchForEdge(outgoingEdges, childNode.getIncomingEdgeFirstCharacter()); if (index < 0) { throw new IllegalStateException("Cannot update the reference to the following child node for the edge starting with '" + childNode.getIncomingEdgeFirstCharacter() +"', no such edge already exists: " + childNode); } outgoingEdges.set(index, childNode); } CharSequenceNodeNonLeafVoidValue(CharSequence edgeCharSequence, List<Node> outgoingEdges); @Override CharSequence getIncomingEdge(); @Override Character getIncomingEdgeFirstCharacter(); @Override Object getValue(); @Override Node getOutgoingEdge(Character edgeFirstCharacter); @Override void updateOutgoingEdge(Node childNode); @Override List<Node> getOutgoingEdges(); @Override String toString();  }