java.lang.Object
org.apache.jena.riot.lang.BlankNodeAllocatorCounter
- All Implemented Interfaces:
BlankNodeAllocator
Allocate blank nodes according a counter.
This can be used to track blank nodes by encounter order in a parser.
Use NodeToLabel.createBNodeByLabelEncoded() to recover the increment.
Use BlankNodeAllocatorLabelEncoded and NodeToLabel.createBNodeByLabelEncoded()
for round-trip of labels used in the original data input.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.jena.graph.NodeAllocate based on a non-null label.org.apache.jena.graph.Nodecreate()Create a fresh blank node, different from anything generated so far.voidreset()Reset allocation state - calls toBlankNodeAllocator.alloc(java.lang.String)will return a different blank node for a label than the one returned before the reset.
-
Constructor Details
-
BlankNodeAllocatorCounter
public BlankNodeAllocatorCounter()
-
-
Method Details
-
reset
public void reset()Description copied from interface:BlankNodeAllocatorReset allocation state - calls toBlankNodeAllocator.alloc(java.lang.String)will return a different blank node for a label than the one returned before the reset.- Specified by:
resetin interfaceBlankNodeAllocator
-
alloc
Description copied from interface:BlankNodeAllocatorAllocate based on a non-null label. Calling this twice, with the same label will generate equivalent nodes but they may not be identical (i.e they are .equals but may not be ==)- Specified by:
allocin interfaceBlankNodeAllocator
-
create
public org.apache.jena.graph.Node create()Description copied from interface:BlankNodeAllocatorCreate a fresh blank node, different from anything generated so far. Will not clash with a node allocated byBlankNodeAllocator.alloc(java.lang.String)- Specified by:
createin interfaceBlankNodeAllocator
-