@Test(expected = IllegalStateException.class) public void testUpdateOutgoingEdge_NonExistentEdge() throws Exception { Node node = new ByteArrayNodeDefault("FOO", null, Collections.<Node>emptyList()); node.updateOutgoingEdge(new ByteArrayNodeDefault("BAR", 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); }
ByteArrayNodeDefault 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); } }
ByteArrayNodeDefault 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); } ByteArrayNodeDefault(CharSequence edgeCharSequence, Object value, List<Node> outgoingEdges); }
ByteArrayNodeDefault 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); } ByteArrayNodeDefault(CharSequence edgeCharSequence, Object value, 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(); }
ByteArrayNodeDefault 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); } ByteArrayNodeDefault(CharSequence edgeCharSequence, Object value, 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();  }