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 ofAbstractLiteralthat stores a numeric value to avoid parsing.- Author:
- David Huynh, Jerven Bolleman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNumericLiteral(byte number)Creates an xsd:byte typed litral with the specified value.protectedNumericLiteral(double n)Creates an xsd:double typed litral with the specified value.protectedNumericLiteral(float n)Creates an xsd:float typed litral with the specified value.protectedNumericLiteral(int number)Creates an xsd:int typed litral with the specified value.protectedNumericLiteral(long n)Creates an xsd:long typed litral with the specified value.protectedNumericLiteral(short number)Creates an xsd:short typed litral with the specified value.protectedNumericLiteral(Number number, CoreDatatype datatype)protectedNumericLiteral(Number number, IRI datatype)Creates a literal with the specified value and datatype.protectedNumericLiteral(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 bytebyteValue()doubledoubleValue()booleanequals(Object o)floatfloatValue()CoreDatatypegetCoreDatatype()IRIgetDatatype()StringgetLabel()Optional<String>getLanguage()intintValue()longlongValue()shortshortValue()-
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:
byteValuein interfaceLiteral- Overrides:
byteValuein classAbstractLiteral
-
shortValue
public short shortValue()
- Specified by:
shortValuein interfaceLiteral- Overrides:
shortValuein classAbstractLiteral
-
intValue
public int intValue()
- Specified by:
intValuein interfaceLiteral- Overrides:
intValuein classAbstractLiteral
-
longValue
public long longValue()
- Specified by:
longValuein interfaceLiteral- Overrides:
longValuein classAbstractLiteral
-
floatValue
public float floatValue()
- Specified by:
floatValuein interfaceLiteral- Overrides:
floatValuein classAbstractLiteral
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein interfaceLiteral- Overrides:
doubleValuein classAbstractLiteral
-
getLabel
public String getLabel()
-
getDatatype
public IRI getDatatype()
-
getCoreDatatype
public CoreDatatype getCoreDatatype()
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceLiteral- Overrides:
equalsin classAbstractLiteral
-
-