org.openrdf.sesame.sailimpl.nativerdf.model
Class NativeLiteral

java.lang.Object
  extended byorg.openrdf.model.impl.LiteralImpl
      extended byorg.openrdf.sesame.sailimpl.nativerdf.model.NativeLiteral
All Implemented Interfaces:
Comparable, Literal, NativeValue, Serializable, Value

public class NativeLiteral
extends LiteralImpl
implements NativeValue

See Also:
Serialized Form

Constructor Summary
NativeLiteral(NativeRdfRepository repository, String label)
           
NativeLiteral(NativeRdfRepository repository, String label, String lang)
           
NativeLiteral(NativeRdfRepository repository, String label, URI datatype)
           
 
Method Summary
 int getInternalId()
          Gets the ID that is used in the native RDF repository for this Value.
 StatementIterator getObjectStatements()
          Gets all statements from the RDF graph for which this value is the object.
 NativeRdfRepository getRepository()
          Returns the NativeRdfRepository that contains this NativeValue.
 ValueStoreRevision getValueStoreRevision()
          Gets the revision of the value store that created this value.
 void setInternalId(int id, ValueStoreRevision revision)
          Sets the ID that is used for this value in a specific revision of the value store.
 
Methods inherited from class org.openrdf.model.impl.LiteralImpl
compareTo, equals, getDatatype, getLabel, getLanguage, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

NativeLiteral

public NativeLiteral(NativeRdfRepository repository,
                     String label)

NativeLiteral

public NativeLiteral(NativeRdfRepository repository,
                     String label,
                     String lang)

NativeLiteral

public NativeLiteral(NativeRdfRepository repository,
                     String label,
                     URI datatype)
Method Detail

getRepository

public NativeRdfRepository getRepository()
Description copied from interface: NativeValue
Returns the NativeRdfRepository that contains this NativeValue. IDs are only unique within a single repository, but an application could use several repositories at the same time, passing NativeValue objects generated by one Sail to another Sail. In such situations, the ID of the first Sail cannot be used by the second Sail. Hence, the NativeRdfRepository should verify that it is the 'owner' of a value before using the recorded internal ID.

Specified by:
getRepository in interface NativeValue

setInternalId

public void setInternalId(int id,
                          ValueStoreRevision revision)
Description copied from interface: NativeValue
Sets the ID that is used for this value in a specific revision of the value store.

Specified by:
setInternalId in interface NativeValue

getInternalId

public int getInternalId()
Description copied from interface: NativeValue
Gets the ID that is used in the native RDF repository for this Value.

Specified by:
getInternalId in interface NativeValue
Returns:
The value's ID, or 0 if not yet set.

getValueStoreRevision

public ValueStoreRevision getValueStoreRevision()
Description copied from interface: NativeValue
Gets the revision of the value store that created this value. The value's internal ID is only valid when it's value store revision is equal to the value store's current revision.

Specified by:
getValueStoreRevision in interface NativeValue
Returns:
The revision of the value store that created this value, or null if the internal ID has not yet been set.

getObjectStatements

public StatementIterator getObjectStatements()
                                      throws GraphException
Description copied from interface: Value
Gets all statements from the RDF graph for which this value is the object.

Specified by:
getObjectStatements in interface Value
Overrides:
getObjectStatements in class LiteralImpl
Throws:
GraphException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.