@Override public String toString() { if ( this == NodeDoesNotExist ) return "[DoesNotExist]"; if ( this == NodeIdAny ) return "[Any]"; if ( this == NodeIdInvalid ) return "[Invalid]"; if ( this == NodeIdDefined ) return "[Defined]"; if ( this == NodeIdUndefined ) return "[Undefined]"; if ( this.isInline() ) { String displayName = this.type().toString(); return String.format("[%s 0x%014X]", displayName, value2); } // [64 bits] //return String.format("[%08X-%016X]", value1, value2); return String.format("[0x%16X]", value2); }
private static long encode(NodeId nodeId) { long x = nodeId.value2; switch(nodeId.type()) { case PTR: return x; case XSD_DOUBLE: // XSD_DOUBLE is special. // Set value bit (63) and bit 62 x = DoubleNode62.insertType(x); return x ; default: // Bit 62 is zero - tagt is for doubles. x = BitsLong.pack(x, nodeId.getTypeValue(), 56, 62); // Set the high, value bit. x = BitsLong.set(x, 63); return x; } }
@Test public void nodeId_special_01() { assertFalse(NodeId.isConcrete(NodeId.NodeDoesNotExist)); assertEquals(NodeIdType.SPECIAL, NodeId.NodeDoesNotExist.type()); }
@Test public void nodeId_special_02() { assertFalse(NodeId.isConcrete(NodeId.NodeIdAny)); assertEquals(NodeIdType.SPECIAL, NodeId.NodeIdAny.type()); }
@Test public void nodeId_special_02() { assertFalse(NodeId.isConcrete(NodeId.NodeIdAny)); assertEquals(NodeIdType.SPECIAL, NodeId.NodeIdAny.type()); }
@Test public void nodeId_special_01() { assertFalse(NodeId.isConcrete(NodeId.NodeDoesNotExist)); assertEquals(NodeIdType.SPECIAL, NodeId.NodeDoesNotExist.type()); }
@Test public void nodeId_ptr_02() { NodeId nodeId = NodeIdFactory.createPtr(37); assertEquals(NodeIdType.PTR, nodeId.type()); // assertEquals(37L, nodeId.getPtrLo()); // assertEquals(0, nodeId.getPtrHi()); assertEquals(37L, nodeId.getPtrLocation()); }
@Test public void nodeId_ptr_02() { NodeId nodeId = NodeIdFactory.createPtr(37); assertEquals(NodeIdType.PTR, nodeId.type()); // assertEquals(37L, nodeId.getPtrLo()); // assertEquals(0, nodeId.getPtrHi()); assertEquals(37L, nodeId.getPtrLocation()); }
@Test public void nodeId_ptr_01() { NodeId nodeId = NodeIdFactory.createPtrLong(17, 37); assertEquals(NodeIdType.PTR, nodeId.type()); // assertEquals(37L, nodeId.getPtrLo()); // assertEquals(17, nodeId.getPtrHi()); assertEquals(37L, nodeId.getValue2()); assertEquals(17, nodeId.getValue1()); }
@Test public void nodeId_ptr_01() { NodeId nodeId = NodeIdFactory.createPtrLong(17, 37); assertEquals(NodeIdType.PTR, nodeId.type()); // assertEquals(37L, nodeId.getPtrLo()); // assertEquals(17, nodeId.getPtrHi()); assertEquals(37L, nodeId.getValue2()); assertEquals(17, nodeId.getValue1()); }
return null; NodeIdType type = nodeId.type(); if ( type == PTR || type == NodeIdType.SPECIAL) return null;