public class MemValueFactory extends ValueFactoryBase
Constructor and Description |
---|
MemValueFactory() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
BNode |
createBNode(String nodeID)
Creates a new blank node with the given node identifier.
|
protected Literal |
createFPLiteral(Number n,
URI datatype)
Calls
ValueFactoryBase.createNumericLiteral(Number, URI) with the supplied value
and datatype as parameters. |
protected Literal |
createIntegerLiteral(Number n,
URI datatype)
Calls
ValueFactoryBase.createNumericLiteral(Number, URI) with the supplied value
and datatype as parameters. |
Literal |
createLiteral(boolean value)
Calls
ValueFactory.createLiteral(String, URI) with the
String-value of the supplied value and XMLSchema.BOOLEAN as
parameters. |
Literal |
createLiteral(String value)
Creates a new literal with the supplied label.
|
Literal |
createLiteral(String value,
String language)
Creates a new literal with the supplied label and language attribute.
|
Literal |
createLiteral(String value,
URI datatype)
Creates a new literal with the supplied label and datatype.
|
Literal |
createLiteral(XMLGregorianCalendar calendar)
Calls
ValueFactory.createLiteral(String, URI) with the
String-value of the supplied calendar and the appropriate datatype as
parameters. |
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Creates a new statement with the supplied subject, predicate and object.
|
Statement |
createStatement(Resource subject,
URI predicate,
Value object,
Resource context)
Creates a new statement with the supplied subject, predicate and object
and associated context.
|
URI |
createURI(String uri)
Creates a new URI from the supplied string-representation.
|
URI |
createURI(String namespace,
String localName)
Creates a new URI from the supplied namespace and local name.
|
MemBNode |
getMemBNode(BNode bnode)
See getMemValue() for description.
|
Set<MemBNode> |
getMemBNodes()
Gets all bnodes that are managed by this value factory.
|
MemLiteral |
getMemLiteral(Literal literal)
See getMemValue() for description.
|
Set<MemLiteral> |
getMemLiterals()
Gets all literals that are managed by this value factory.
|
MemResource |
getMemResource(Resource resource)
See getMemValue() for description.
|
MemURI |
getMemURI(URI uri)
See getMemValue() for description.
|
Set<MemURI> |
getMemURIs()
Gets all URIs that are managed by this value factory.
|
MemValue |
getMemValue(Value value)
Returns a previously created MemValue that is equal to the supplied value,
or null if the supplied value is a new value or is equal to
null.
|
MemBNode |
getOrCreateMemBNode(BNode bnode)
See
getOrCreateMemValue(Value) for description. |
MemLiteral |
getOrCreateMemLiteral(Literal literal)
See
getOrCreateMemValue(Value) for description. |
MemResource |
getOrCreateMemResource(Resource resource)
See
getOrCreateMemValue(Value) for description. |
MemURI |
getOrCreateMemURI(URI uri)
See
getOrCreateMemValue(Value) for description. |
MemValue |
getOrCreateMemValue(Value value)
Gets or creates a MemValue for the supplied Value.
|
createBNode, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, initBNodeParams
public void clear()
public MemValue getMemValue(Value value)
value
- The MemValue equivalent of the supplied value, or null.public MemResource getMemResource(Resource resource)
public MemLiteral getMemLiteral(Literal literal)
public Set<MemURI> getMemURIs()
Warning: This method is not synchronized. To iterate over the returned set in a thread-safe way, this method should only be called while synchronizing on this object.
public Set<MemBNode> getMemBNodes()
Warning: This method is not synchronized. To iterate over the returned set in a thread-safe way, this method should only be called while synchronizing on this object.
public Set<MemLiteral> getMemLiterals()
Warning: This method is not synchronized. To iterate over the returned set in a thread-safe way, this method should only be called while synchronizing on this object.
public MemValue getOrCreateMemValue(Value value)
value
- A Resource or Literal.public MemResource getOrCreateMemResource(Resource resource)
getOrCreateMemValue(Value)
for description.public MemURI getOrCreateMemURI(URI uri)
getOrCreateMemValue(Value)
for description.public MemBNode getOrCreateMemBNode(BNode bnode)
getOrCreateMemValue(Value)
for description.public MemLiteral getOrCreateMemLiteral(Literal literal)
getOrCreateMemValue(Value)
for description.public URI createURI(String uri)
ValueFactory
uri
- A string-representation of a URI.public URI createURI(String namespace, String localName)
ValueFactory
createURI(namespace+localName)
, but allows the ValueFactory to reuse
supplied namespace and local name strings whenever possible. Note that the
values returned by URI.getNamespace()
and
URI.getLocalName()
are not necessarily the same as the values that
are supplied to this method.namespace
- The URI's namespace.localName
- The URI's local name.public BNode createBNode(String nodeID)
ValueFactory
nodeID
- The blank node identifier.public Literal createLiteral(String value)
ValueFactory
value
- The literal's label.public Literal createLiteral(String value, String language)
ValueFactory
value
- The literal's label.language
- The literal's language attribute, or null if the literal
doesn't have a language.public Literal createLiteral(String value, URI datatype)
ValueFactory
value
- The literal's label.datatype
- The literal's datatype, or null if the literal doesn't
have a datatype.public Literal createLiteral(boolean value)
ValueFactoryBase
ValueFactory.createLiteral(String, URI)
with the
String-value of the supplied value and XMLSchema.BOOLEAN
as
parameters.createLiteral
in interface ValueFactory
createLiteral
in class ValueFactoryBase
value
- The value for the literal.protected Literal createIntegerLiteral(Number n, URI datatype)
ValueFactoryBase
ValueFactoryBase.createNumericLiteral(Number, URI)
with the supplied value
and datatype as parameters.createIntegerLiteral
in class ValueFactoryBase
protected Literal createFPLiteral(Number n, URI datatype)
ValueFactoryBase
ValueFactoryBase.createNumericLiteral(Number, URI)
with the supplied value
and datatype as parameters.createFPLiteral
in class ValueFactoryBase
public Literal createLiteral(XMLGregorianCalendar calendar)
ValueFactoryBase
ValueFactory.createLiteral(String, URI)
with the
String-value of the supplied calendar and the appropriate datatype as
parameters.createLiteral
in interface ValueFactory
createLiteral
in class ValueFactoryBase
calendar
- The value for the literal.XMLGregorianCalendar.toXMLFormat()
,
XMLGregorianCalendar.getXMLSchemaType()
,
XMLDatatypeUtil.qnameToURI(javax.xml.namespace.QName)
public Statement createStatement(Resource subject, URI predicate, Value object)
ValueFactory
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.public Statement createStatement(Resource subject, URI predicate, Value object, Resource context)
ValueFactory
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.context
- The statement's context.Copyright © 2001-2016 Aduna. All Rights Reserved.