public class MemValueFactory extends AbstractValueFactory
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,
IRI datatype)
Calls
AbstractValueFactory.createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters. |
protected Literal |
createIntegerLiteral(Number n,
IRI datatype)
Calls
AbstractValueFactory.createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters. |
IRI |
createIRI(String uri)
Creates a new IRI from the supplied string-representation.
|
IRI |
createIRI(String namespace,
String localName)
Creates a new IRI from the supplied namespace and local name.
|
Literal |
createLiteral(boolean value)
Creates a new xsd:boolean-typed literal representing the specified value.
|
Literal |
createLiteral(String value)
Creates a new literal with the supplied label.
|
Literal |
createLiteral(String value,
IRI datatype)
Creates a new literal with the supplied label and datatype.
|
Literal |
createLiteral(String value,
String language)
Creates a new literal with the supplied label and language attribute.
|
Literal |
createLiteral(XMLGregorianCalendar calendar)
Calls
ValueFactory.createLiteral(String, IRI) with the String-value of the supplied calendar and the
appropriate datatype as parameters. |
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.
|
MemIRI |
getMemURI(IRI uri)
See getMemValue() for description.
|
Set<MemIRI> |
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. |
MemIRI |
getOrCreateMemURI(IRI uri)
See
getOrCreateMemValue(Value) for description. |
MemValue |
getOrCreateMemValue(Value value)
Gets or creates a MemValue for the supplied Value.
|
createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, createNumericLiteral, createStatement, createStatement, createTriple, initBNodeParams
createLiteral, createLiteral
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createLiteral, createStatement, createStatement, createURI, createURI
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<MemIRI> 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 MemIRI getOrCreateMemURI(IRI uri)
getOrCreateMemValue(Value)
for description.public MemBNode getOrCreateMemBNode(BNode bnode)
getOrCreateMemValue(Value)
for description.public MemLiteral getOrCreateMemLiteral(Literal literal)
getOrCreateMemValue(Value)
for description.public IRI createIRI(String uri)
ValueFactory
createIRI
in interface ValueFactory
createIRI
in class AbstractValueFactory
uri
- A string-representation of a IRI.public IRI createIRI(String namespace, String localName)
ValueFactory
createIRI(namespace+localName)
, but allows the ValueFactory to reuse supplied
namespace and local name strings whenever possible. Note that the values returned by IRI.getNamespace()
and IRI.getLocalName()
are not necessarily the same as the values that are supplied to this method.createIRI
in interface ValueFactory
createIRI
in class AbstractValueFactory
namespace
- The IRI's namespace.localName
- The IRI's local name.public BNode createBNode(String nodeID)
ValueFactory
createBNode
in interface ValueFactory
createBNode
in class AbstractValueFactory
nodeID
- The blank node identifier.public Literal createLiteral(String value)
ValueFactory
Literal.getDatatype()
for the returned
object must be xsd:string
.createLiteral
in interface ValueFactory
createLiteral
in class AbstractValueFactory
value
- The literal's label, must not be null.public Literal createLiteral(String value, String language)
ValueFactory
Literal.getDatatype()
for the returned object must be
rdf:langString
.createLiteral
in interface ValueFactory
createLiteral
in class AbstractValueFactory
value
- The literal's label, must not be null.language
- The literal's language attribute, must not be null.public Literal createLiteral(String value, IRI datatype)
ValueFactory
createLiteral
in interface ValueFactory
createLiteral
in class AbstractValueFactory
value
- The literal's label, must not be null.datatype
- The literal's datatype. If it is null, the datatype
xsd:string
will be assigned to this
literal.public Literal createLiteral(boolean value)
ValueFactory
createLiteral
in interface ValueFactory
createLiteral
in class AbstractValueFactory
value
- The value for the literal.protected Literal createIntegerLiteral(Number n, IRI datatype)
AbstractValueFactory
AbstractValueFactory.createNumericLiteral(Number, IRI)
with the supplied value and datatype as parameters.createIntegerLiteral
in class AbstractValueFactory
protected Literal createFPLiteral(Number n, IRI datatype)
AbstractValueFactory
AbstractValueFactory.createNumericLiteral(Number, IRI)
with the supplied value and datatype as parameters.createFPLiteral
in class AbstractValueFactory
public Literal createLiteral(XMLGregorianCalendar calendar)
AbstractValueFactory
ValueFactory.createLiteral(String, IRI)
with the String-value of the supplied calendar and the
appropriate datatype as parameters.createLiteral
in interface ValueFactory
createLiteral
in class AbstractValueFactory
calendar
- The value for the literal.XMLGregorianCalendar.toXMLFormat()
,
XMLGregorianCalendar.getXMLSchemaType()
,
XMLDatatypeUtil.qnameToURI(javax.xml.namespace.QName)
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.