Package org.eclipse.rdf4j.model.impl
Class NumericLiteral
- java.lang.Object
-
- org.eclipse.rdf4j.model.base.AbstractLiteral
-
- org.eclipse.rdf4j.model.impl.NumericLiteral
-
- All Implemented Interfaces:
Serializable
,Literal
,Value
public class NumericLiteral extends AbstractLiteral
An extension ofAbstractLiteral
that stores a numeric value to avoid parsing.- Author:
- David Huynh, Jerven Bolleman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NumericLiteral(byte number)
Creates an xsd:byte typed litral with the specified value.protected
NumericLiteral(double n)
Creates an xsd:double typed litral with the specified value.protected
NumericLiteral(float n)
Creates an xsd:float typed litral with the specified value.protected
NumericLiteral(int number)
Creates an xsd:int typed litral with the specified value.protected
NumericLiteral(long n)
Creates an xsd:long typed litral with the specified value.protected
NumericLiteral(short number)
Creates an xsd:short typed litral with the specified value.protected
NumericLiteral(Number number, CoreDatatype datatype)
protected
NumericLiteral(Number number, IRI datatype)
Creates a literal with the specified value and datatype.protected
NumericLiteral(Number number, XSD.Datatype datatype)
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
byteValue()
double
doubleValue()
boolean
equals(Object o)
float
floatValue()
CoreDatatype
getCoreDatatype()
IRI
getDatatype()
String
getLabel()
Optional<String>
getLanguage()
int
intValue()
long
longValue()
short
shortValue()
-
Methods inherited from class org.eclipse.rdf4j.model.base.AbstractLiteral
booleanValue, calendarValue, decimalValue, hashCode, integerValue, stringValue, temporalAccessorValue, temporalAmountValue, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isResource, isTriple
-
-
-
-
Constructor Detail
-
NumericLiteral
protected NumericLiteral(Number number, IRI datatype)
Creates a literal with the specified value and datatype.
-
NumericLiteral
@Deprecated(since="4.0.0", forRemoval=true) protected NumericLiteral(Number number, XSD.Datatype datatype)
Deprecated, for removal: This API element is subject to removal in a future version.
-
NumericLiteral
protected NumericLiteral(Number number, CoreDatatype datatype)
-
NumericLiteral
protected NumericLiteral(byte number)
Creates an xsd:byte typed litral with the specified value.
-
NumericLiteral
protected NumericLiteral(short number)
Creates an xsd:short typed litral with the specified value.
-
NumericLiteral
protected NumericLiteral(int number)
Creates an xsd:int typed litral with the specified value.
-
NumericLiteral
protected NumericLiteral(long n)
Creates an xsd:long typed litral with the specified value.
-
NumericLiteral
protected NumericLiteral(float n)
Creates an xsd:float typed litral with the specified value.
-
NumericLiteral
protected NumericLiteral(double n)
Creates an xsd:double typed litral with the specified value.
-
-
Method Detail
-
byteValue
public byte byteValue()
- Specified by:
byteValue
in interfaceLiteral
- Overrides:
byteValue
in classAbstractLiteral
-
shortValue
public short shortValue()
- Specified by:
shortValue
in interfaceLiteral
- Overrides:
shortValue
in classAbstractLiteral
-
intValue
public int intValue()
- Specified by:
intValue
in interfaceLiteral
- Overrides:
intValue
in classAbstractLiteral
-
longValue
public long longValue()
- Specified by:
longValue
in interfaceLiteral
- Overrides:
longValue
in classAbstractLiteral
-
floatValue
public float floatValue()
- Specified by:
floatValue
in interfaceLiteral
- Overrides:
floatValue
in classAbstractLiteral
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in interfaceLiteral
- Overrides:
doubleValue
in classAbstractLiteral
-
getLabel
public String getLabel()
-
getDatatype
public IRI getDatatype()
-
getCoreDatatype
public CoreDatatype getCoreDatatype()
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceLiteral
- Overrides:
equals
in classAbstractLiteral
-
-