org.apache.jena.riot.lang
Class BlankNodeAllocatorLabel

java.lang.Object
  extended by org.apache.jena.riot.lang.BlankNodeAllocatorLabel
All Implemented Interfaces:
BlankNodeAllocator

public class BlankNodeAllocatorLabel
extends Object
implements BlankNodeAllocator

Allocate blank nodes according to the label given. The reverse operation is NodeToLabel.createBNodeByLabelAsGiven() but it is unsafe in general. Use BlankNodeAllocatorLabelEncoded and NodeToLabel.createBNodeByLabelEncoded() for round-tripping output-input.


Constructor Summary
BlankNodeAllocatorLabel()
           
 
Method Summary
 Node alloc(String label)
          Allocate based on a non-null label.
 Node create()
          Create a fresh blank node, different from anything generated so far.
 void reset()
          Reset allocation state - calls to BlankNodeAllocator.alloc(java.lang.String) or BlankNodeAllocator.create()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlankNodeAllocatorLabel

public BlankNodeAllocatorLabel()
Method Detail

reset

public void reset()
Description copied from interface: BlankNodeAllocator
Reset allocation state - calls to BlankNodeAllocator.alloc(java.lang.String) or BlankNodeAllocator.create()

Specified by:
reset in interface BlankNodeAllocator

alloc

public Node alloc(String label)
Description copied from interface: BlankNodeAllocator
Allocate based on a non-null label. Calling this twice, with the same label will generate equivalent nodes but they may not be identicial (i.e they are .equals but may not be ==)

Specified by:
alloc in interface BlankNodeAllocator

create

public Node create()
Description copied from interface: BlankNodeAllocator
Create a fresh blank node, different from anything generated so far. Will not clash with a node allocated by BlankNodeAllocator.alloc(java.lang.String)

Specified by:
create in interface BlankNodeAllocator


Licenced under the Apache License, Version 2.0