Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hp.hpl.jena.datatypes.xsd.impl
Class XSDBaseNumericType  view XSDBaseNumericType download XSDBaseNumericType.java

java.lang.Object
  extended bycom.hp.hpl.jena.datatypes.BaseDatatype
      extended bycom.hp.hpl.jena.datatypes.xsd.XSDDatatype
          extended bycom.hp.hpl.jena.datatypes.xsd.impl.XSDBaseNumericType
All Implemented Interfaces:
com.hp.hpl.jena.datatypes.RDFDatatype
Direct Known Subclasses:
XSDByteType

public class XSDBaseNumericType
extends com.hp.hpl.jena.datatypes.xsd.XSDDatatype

Base implementation for all numeric datatypes derived from xsd:decimal. The only purpose of this place holder is to support the isValidLiteral tests across numeric types. Note that float and double are not included in this set.

Version:
$Revision: 1.13 $ on $Date: 2005/02/21 12:02:20 $

Field Summary
 
Fields inherited from class com.hp.hpl.jena.datatypes.xsd.XSDDatatype
javaClass, typeDeclaration, XSD, XSDanyURI, XSDbase64Binary, XSDboolean, XSDbyte, XSDdate, XSDdateTime, 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
 
Fields inherited from class com.hp.hpl.jena.datatypes.BaseDatatype
uri
 
Constructor Summary
XSDBaseNumericType(java.lang.String typeName)
          Constructor.
XSDBaseNumericType(java.lang.String typeName, java.lang.Class javaClass)
          Constructor.
 
Method Summary
protected  void checkWhitespace(java.lang.String lexicalForm)
          Check for whitespace violations.
 boolean isEqual(com.hp.hpl.jena.graph.impl.LiteralLabel value1, com.hp.hpl.jena.graph.impl.LiteralLabel value2)
          Compares two instances of values of the given datatype.
 boolean isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
          Test whether the given LiteralLabel is a valid instance of this 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 value
 
Methods inherited from class com.hp.hpl.jena.datatypes.xsd.XSDDatatype
convertValidatedDataValue, extendedTypeDefinition, getJavaClass, isBaseTypeCompatible, loadUserDefined, loadUserDefined, loadXSDSimpleTypes, main, parseValidated, trimPlus, unparse
 
Methods inherited from class com.hp.hpl.jena.datatypes.BaseDatatype
getURI, isValid, langTagCompatible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSDBaseNumericType

public XSDBaseNumericType(java.lang.String typeName)
Constructor.


XSDBaseNumericType

public XSDBaseNumericType(java.lang.String typeName,
                          java.lang.Class javaClass)
Constructor.

Method Detail

isValidLiteral

public boolean isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
Test whether the given LiteralLabel is a valid instance of this datatype. This takes into accound typing information as well as lexical form - for example an xsd:string is never considered valid as an xsd:integer (even if it is lexically legal like "1").


isValidValue

public boolean isValidValue(java.lang.Object valueForm)
Test whether the given object is a legal value form of this datatype. Brute force implementation.


parse

public java.lang.Object parse(java.lang.String lexicalForm)
                       throws com.hp.hpl.jena.datatypes.DatatypeFormatException
Parse a lexical form of this datatype to a value


checkWhitespace

protected void checkWhitespace(java.lang.String lexicalForm)
Check for whitespace violations. Turned off by default.


isEqual

public boolean isEqual(com.hp.hpl.jena.graph.impl.LiteralLabel value1,
                       com.hp.hpl.jena.graph.impl.LiteralLabel value2)
Compares two instances of values of the given datatype. This ignores lang tags and just uses the java.lang.Number equality.