public abstract class KiWiLiteral extends KiWiNode implements org.openrdf.model.Literal
Modifier | Constructor and Description |
---|---|
|
KiWiLiteral() |
protected |
KiWiLiteral(Date created) |
protected |
KiWiLiteral(Locale locale,
KiWiUriResource type) |
protected |
KiWiLiteral(Locale locale,
KiWiUriResource type,
Date created) |
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)
A separate equalsContent method for checking whether literals are equal in their content; we cannot override
the .equals function with this because it would break the system in cases where the same content is used in
different literals.
|
float |
floatValue()
Returns the float value of this literal.
|
abstract String |
getContent()
Return the content of the literal, using the parametrized Java type
|
org.openrdf.model.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.
|
Locale |
getLocale()
Get the locale representing the language this literal is in; returns null
if no language is associated with the literal
|
KiWiUriResource |
getType()
Return the RDF/XSD type of this literal.
|
int |
hashCode() |
BigInteger |
integerValue()
Returns the integer value of this literal.
|
int |
intValue()
Returns the int value of this literal.
|
boolean |
isAnonymousResource()
Return true in case the node is an anonymous resource / BNode (avoids instanceof test)
|
boolean |
isLiteral()
Return true in case the node is a literal (avoids instanceof test)
|
boolean |
isUriResource()
Return true in case the node is a uri resource (avoids instanceof test)
|
long |
longValue()
Returns the long value of this literal.
|
abstract void |
setContent(String content)
Set the content of the literal to the content provided as parameter.
|
void |
setLocale(Locale language)
Set the language of this literal to the given locale.
|
void |
setType(KiWiUriResource type)
Set the RDF/XSD type of this literal.
|
short |
shortValue()
Returns the short value of this literal.
|
String |
stringValue()
Returns the String-value of a Value object.
|
String |
toString() |
getCreated, getId, setCreated, setId
public KiWiLiteral()
protected KiWiLiteral(Date created)
protected KiWiLiteral(Locale locale, KiWiUriResource type)
protected KiWiLiteral(Locale locale, KiWiUriResource type, Date created)
public abstract String getContent()
public abstract void setContent(String content)
content
- public Locale getLocale()
public void setLocale(Locale language)
language
- public KiWiUriResource getType()
public void setType(KiWiUriResource type)
type
- public boolean equals(Object o)
public int hashCode()
public boolean isAnonymousResource()
KiWiNode
isAnonymousResource
in class KiWiNode
public boolean isLiteral()
KiWiNode
public boolean isUriResource()
KiWiNode
isUriResource
in class KiWiNode
public boolean booleanValue()
booleanValue
in interface org.openrdf.model.Literal
IllegalArgumentException
- If the literal's label cannot be represented by a boolean.public String getLabel()
getLabel
in interface org.openrdf.model.Literal
public String getLanguage()
getLanguage
in interface org.openrdf.model.Literal
public org.openrdf.model.URI getDatatype()
getDatatype
in interface org.openrdf.model.Literal
public byte byteValue()
byteValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal cannot be represented by a byte.public short shortValue()
shortValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label cannot be represented by a short.public int intValue()
intValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label cannot be represented by a int.public long longValue()
longValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label cannot be represented by to a long.public BigInteger integerValue()
integerValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label is not a valid integer.public BigDecimal decimalValue()
decimalValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label is not a valid decimal.public float floatValue()
floatValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label cannot be represented by a float.public double doubleValue()
doubleValue
in interface org.openrdf.model.Literal
NumberFormatException
- If the literal's label cannot be represented by a double.public XMLGregorianCalendar calendarValue()
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 org.openrdf.model.Literal
IllegalArgumentException
- If the literal cannot be represented by a
XMLGregorianCalendar
.public String stringValue()
Literal
's label, a URI
's URI or a BNode
's ID.stringValue
in interface org.openrdf.model.Value
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.