public abstract class AbstractLiteral extends Object implements Literal
Literal
, offering common functionality.Constructor and Description |
---|
AbstractLiteral() |
Modifier and Type | Method and Description |
---|---|
boolean |
booleanValue()
Returns the boolean value of this literal.
|
byte |
byteValue()
Returns the byte value of this literal.
|
XMLGregorianCalendar |
calendarValue()
Returns the
XMLGregorianCalendar value of this literal. |
BigDecimal |
decimalValue()
Returns the decimal value of this literal.
|
double |
doubleValue()
Returns the double value of this literal.
|
boolean |
equals(Object o)
Compares this literal to another object.
|
float |
floatValue()
Returns the float value of this literal.
|
int |
hashCode()
Computes the hash code of this literal.
|
BigInteger |
integerValue()
Returns the integer value of this literal.
|
int |
intValue()
Returns the int value of this literal.
|
long |
longValue()
Returns the long value of this literal.
|
short |
shortValue()
Returns the short value of this literal.
|
String |
stringValue()
Returns the String-value of a Value object.
|
java.time.temporal.TemporalAccessor |
temporalAccessorValue()
Retrieves the
temporal accessor value of this literal. |
java.time.temporal.TemporalAmount |
temporalAmountValue()
Retrieves the
temporal amount value of this literal. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDatatype, getLabel, getLanguage, isLiteral
isBNode, isIRI, isResource, isTriple
public String stringValue()
Value
Literal
's label, a
IRI
's URI or a BNode
's ID.stringValue
in interface Value
public boolean booleanValue()
Literal
booleanValue
in interface Literal
public byte byteValue()
Literal
public short shortValue()
Literal
shortValue
in interface Literal
public int intValue()
Literal
public long longValue()
Literal
public float floatValue()
Literal
floatValue
in interface Literal
public double doubleValue()
Literal
doubleValue
in interface Literal
public BigInteger integerValue()
Literal
integerValue
in interface Literal
public BigDecimal decimalValue()
Literal
decimalValue
in interface Literal
public java.time.temporal.TemporalAccessor temporalAccessorValue() throws java.time.DateTimeException
Literal
temporal accessor
value of this literal.
A temporal accessor representation can be given for literals whose label conforms to the syntax of the following XML Schema 1.1 date/time datatypes:
Temporal accessor representations may be converted to specific java.time
values like
OffsetDateTime
using target static factory methods, for instance
OffsetDateTime.from(literal.temporalAccessorValue())
.
Note however that java.time
doesn't include dedicated classes for some legal XML Schema date/time values,
like offset dates (for instance, 2020-11-16+01:00
) and xsd:gDay
(for instance, ---16
).
temporalAccessorValue
in interface Literal
java.time.DateTimeException
- if this literal cannot be represented by a TemporalAccessor
valuepublic java.time.temporal.TemporalAmount temporalAmountValue() throws java.time.DateTimeException
Literal
temporal amount
value of this literal.
A temporal amount representation can be given for literals whose label conforms to the syntax of the XML Schema 2 xsd:duration datatype.
The adoption of the XML Schema 2 definition is a known deviation from the RDF 1.1 standard; well-formedness rules are relaxed to consider all duration components as optional and freely mixable.
Temporal amount representations may be converted to specific java.time
values like Duration
using
target static factory methods, for instance Duration.from(literal.temporalAmountValue())
.
Note however that java.time
doesn't include dedicated classes for legal XML Schema duration values
including both date and time components (for instance, P1YT23H
).
temporalAmountValue
in interface Literal
java.time.DateTimeException
- if this literal cannot be represented by a TemporalAmount
valuepublic XMLGregorianCalendar calendarValue()
Literal
XMLGregorianCalendar
value of this literal. A calendar representation can be given for
literals whose label conforms to the syntax of the following XML
Schema datatypes: dateTime, time, date, gYearMonth, gMonthDay,
gYear, gMonth or gDay.calendarValue
in interface Literal
public boolean equals(Object o)
Literal
public int hashCode()
Literal
hashCode
in interface Literal
hashCode
in class Object
Literal.getLabel()
.hashCode()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.