Class XSDDouble
- java.lang.Object
-
- org.apache.jena.datatypes.BaseDatatype
-
- org.apache.jena.datatypes.xsd.XSDDatatype
-
- org.apache.jena.datatypes.xsd.impl.XSDDouble
-
- All Implemented Interfaces:
RDFDatatype
public class XSDDouble extends XSDDatatype
Datatype representation for xsd:float. Can't just use XSDBaseNumericType because float, double and decimal are all disjoint in XSD. Can use plain XSDDatatype because the equality function needs overriding.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
XSDDatatype.XSDGenericType
-
Nested classes/interfaces inherited from class org.apache.jena.datatypes.BaseDatatype
BaseDatatype.TypedValue
-
-
Field Summary
-
Fields inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
XSD, XSDanyURI, XSDbase64Binary, XSDboolean, XSDbyte, XSDdate, XSDdateTime, XSDdateTimeStamp, XSDdayTimeDuration, XSDdecimal, XSDdouble, XSDduration, XSDENTITY, XSDfloat, XSDgDay, XSDgMonth, XSDgMonthDay, XSDgYear, XSDgYearMonth, XSDhexBinary, XSDID, XSDIDREF, XSDint, XSDinteger, XSDlanguage, XSDlong, XSDName, XSDNCName, XSDnegativeInteger, XSDNMTOKEN, XSDnonNegativeInteger, XSDnonPositiveInteger, XSDnormalizedString, XSDNOTATION, XSDpositiveInteger, XSDQName, XSDshort, XSDstring, XSDtime, XSDtoken, XSDunsignedByte, XSDunsignedInt, XSDunsignedLong, XSDunsignedShort, XSDyearMonthDuration
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEqual(LiteralLabel value1, LiteralLabel value2)
Compares two instances of values of the given datatype.boolean
isValidValue(java.lang.Object valueForm)
Test whether the given object is a legal value form of this datatype.java.lang.Object
parse(java.lang.String lexicalForm)
Parse a lexical form of this datatype to a valuejava.lang.Object
parseValidated(java.lang.String lex)
Parse a validated lexical form.java.lang.String
unparse(java.lang.Object value)
Convert a value of this datatype out to lexical form.-
Methods inherited from class org.apache.jena.datatypes.xsd.XSDDatatype
extendedTypeDefinition, getJavaClass, isBaseTypeCompatible, isValidLiteral, loadXSDSimpleTypes, main, trimPlus
-
Methods inherited from class org.apache.jena.datatypes.BaseDatatype
cannonicalise, getHashCode, getURI, isValid, langTagCompatible, normalizeSubType, toString
-
-
-
-
Constructor Detail
-
XSDDouble
public XSDDouble(java.lang.String typeName)
Constructor.- Parameters:
typeName
- the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory.
-
XSDDouble
public XSDDouble(java.lang.String typeName, java.lang.Class<?> javaClass)
Constructor.- Parameters:
typeName
- the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory.javaClass
- the java class for which this xsd type is to be treated as the cannonical representation
-
-
Method Detail
-
isValidValue
public boolean isValidValue(java.lang.Object valueForm)
Test whether the given object is a legal value form of this datatype. Brute force implementation.- Specified by:
isValidValue
in interfaceRDFDatatype
- Overrides:
isValidValue
in classBaseDatatype
-
parse
public java.lang.Object parse(java.lang.String lexicalForm) throws DatatypeFormatException
Parse a lexical form of this datatype to a value- Specified by:
parse
in interfaceRDFDatatype
- Overrides:
parse
in classXSDDatatype
- Throws:
DatatypeFormatException
- if the lexical form is not legal
-
unparse
public java.lang.String unparse(java.lang.Object value)
Description copied from class:XSDDatatype
Convert a value of this datatype out to lexical form.- Specified by:
unparse
in interfaceRDFDatatype
- Overrides:
unparse
in classXSDDatatype
-
parseValidated
public java.lang.Object parseValidated(java.lang.String lex)
Parse a validated lexical form. Subclasses which use the default parse implementation and are not converted by the explicit convertValidatedData cases should override this.- Overrides:
parseValidated
in classXSDDatatype
-
isEqual
public boolean isEqual(LiteralLabel value1, LiteralLabel value2)
Compares two instances of values of the given datatype. This ignores lang tags and just uses the java.lang.Number equality.- Specified by:
isEqual
in interfaceRDFDatatype
- Overrides:
isEqual
in classXSDDatatype
-
-