public class LiteralImpl extends Object implements Literal
Literal interface.| Modifier | Constructor and Description |
|---|---|
protected |
LiteralImpl() |
|
LiteralImpl(String label)
Creates a new plain literal with the supplied label.
|
|
LiteralImpl(String label,
String language)
Creates a new plain literal with the supplied label and language tag.
|
|
LiteralImpl(String label,
URI datatype)
Creates a new datyped literal with the supplied label and datatype.
|
| 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 a literal object to another object.
|
float |
floatValue()
Returns the float value of this literal.
|
URI |
getDatatype()
Gets the datatype for this literal.
|
String |
getLabel()
Gets the label of this literal.
|
String |
getLanguage()
Gets the language tag for this literal, normalized to lower case.
|
int |
hashCode()
Returns the literal's hash code.
|
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.
|
protected void |
setDatatype(URI datatype) |
protected void |
setLabel(String label) |
protected void |
setLanguage(String language) |
short |
shortValue()
Returns the short value of this literal.
|
String |
stringValue()
Returns the String-value of a Value object.
|
String |
toString()
Returns the label of the literal.
|
protected LiteralImpl()
public LiteralImpl(String label)
label - The label for the literal, must not be null.public LiteralImpl(String label, String language)
label - The label for the literal, must not be null.language - The language tag for the literal.protected void setLabel(String label)
public String getLabel()
Literalprotected void setLanguage(String language)
public String getLanguage()
LiteralgetLanguage in interface Literalprotected void setDatatype(URI datatype)
public URI getDatatype()
LiteralgetDatatype in interface Literalpublic boolean equals(Object o)
Literalpublic int hashCode()
Literalpublic String toString()
public String stringValue()
ValueLiteral's label, a URI's URI or a BNode's ID.stringValue in interface Valuepublic boolean booleanValue()
LiteralbooleanValue in interface Literalpublic byte byteValue()
Literalpublic short shortValue()
LiteralshortValue in interface Literalpublic int intValue()
Literalpublic long longValue()
Literalpublic float floatValue()
LiteralfloatValue in interface Literalpublic double doubleValue()
LiteraldoubleValue in interface Literalpublic BigInteger integerValue()
LiteralintegerValue in interface Literalpublic BigDecimal decimalValue()
LiteraldecimalValue in interface Literalpublic XMLGregorianCalendar calendarValue()
LiteralXMLGregorianCalendar 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 LiteralCopyright © 2001-2014 Aduna. All Rights Reserved.