Package org.eclipse.rdf4j.model.impl
Class SimpleIRI
- java.lang.Object
-
- org.eclipse.rdf4j.model.base.AbstractIRI
-
- org.eclipse.rdf4j.model.impl.SimpleIRI
-
public class SimpleIRI extends AbstractIRI
The default implementation of theIRIinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringiriStringThe IRI string.private intlocalNameIdxAn index indicating the first character of the local name in the IRI string, -1 if not yet set.private static longserialVersionUID
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetLocalName()Gets the local name part of this IRI.java.lang.StringgetNamespace()Gets the namespace part of this IRI.protected voidsetIRIString(java.lang.String iriString)protected voidsetIRIString(java.lang.String namespace, java.lang.String localname)java.lang.StringstringValue()Returns the String-value of a Value object.-
Methods inherited from class org.eclipse.rdf4j.model.base.AbstractIRI
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.model.Resource
isResource
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
iriString
private java.lang.String iriString
The IRI string.
-
localNameIdx
private int localNameIdx
An index indicating the first character of the local name in the IRI string, -1 if not yet set.
-
-
Constructor Detail
-
SimpleIRI
protected SimpleIRI()
Creates a new, un-initialized IRI. This IRI's string value needs to besetbefore the normal methods can be used.
-
SimpleIRI
protected SimpleIRI(java.lang.String iriString)
Creates a new IRI from the supplied string.Note that creating SimpleIRI objects directly via this constructor is not the recommended approach. Instead, use a
ValueFactory(obtained from your repository or by usingSimpleValueFactory.getInstance()) to create new IRI objects.- Parameters:
iriString- A String representing a valid, absolute IRI. May not benull.- Throws:
java.lang.IllegalArgumentException- If the supplied IRI is not a valid (absolute) IRI.- See Also:
SimpleValueFactory.createIRI(String)
-
SimpleIRI
protected SimpleIRI(java.lang.String namespace, java.lang.String localname)
-
-
Method Detail
-
setIRIString
protected void setIRIString(java.lang.String namespace, java.lang.String localname)
-
setIRIString
protected void setIRIString(java.lang.String iriString)
-
stringValue
public java.lang.String stringValue()
Description copied from interface:ValueReturns the String-value of a Value object. This returns either aLiteral's label, aIRI's URI or aBNode's ID.- Specified by:
stringValuein interfaceValue- Overrides:
stringValuein classAbstractIRI
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:IRIGets the namespace part of this IRI.The namespace is defined as per the algorithm described in the class documentation.
- Returns:
- the namespace of this IRI
-
getLocalName
public java.lang.String getLocalName()
Description copied from interface:IRIGets the local name part of this IRI.The local name is defined as per the algorithm described in the class documentation.
- Returns:
- the local name of this IRI
-
-