com.bigdata.rdf.internal.impl.extensions
Class DateTimeExtension<V extends BigdataValue>

java.lang.Object
  extended by com.bigdata.rdf.internal.impl.extensions.DateTimeExtension<V>
All Implemented Interfaces:
IExtension<V>

public class DateTimeExtension<V extends BigdataValue>
extends Object
implements IExtension<V>

This implementation of IExtension implements inlining for literals that represent xsd:dateTime literals. These literals will be stored as time in milliseconds since the epoch. The milliseconds are encoded as an inline long.


Constructor Summary
DateTimeExtension(IDatatypeURIResolver resolver, TimeZone defaultTZ)
           
 
Method Summary
 V asValue(LiteralExtensionIV iv, BigdataValueFactory vf)
          Use the long value of the XSDLongIV delegate (which represents milliseconds since the epoch) to create a an XMLGregorianCalendar object (GMT timezone).
 LiteralExtensionIV createIV(Value value)
          Attempts to convert the supplied value into an epoch representation.
 Set<BigdataURI> getDatatypes()
          Return the fully resolved datatype(s) handled by this interface in the form of a BigdataURI with the TermId already set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeExtension

public DateTimeExtension(IDatatypeURIResolver resolver,
                         TimeZone defaultTZ)
Method Detail

getDatatypes

public Set<BigdataURI> getDatatypes()
Description copied from interface: IExtension
Return the fully resolved datatype(s) handled by this interface in the form of a BigdataURI with the TermId already set.

Specified by:
getDatatypes in interface IExtension<V extends BigdataValue>
Returns:
the datatype

createIV

public LiteralExtensionIV createIV(Value value)
Attempts to convert the supplied value into an epoch representation. Tests for a literal value with the correct datatype that can be converted to a positive long integer. Encodes the long in a delegate XSDLongIV, and returns an LiteralExtensionIV to wrap the native type.

Specified by:
createIV in interface IExtension<V extends BigdataValue>
Parameters:
value - The RDF Value
Returns:
The extension IV -or- null if the Value can not be inlined using this IExtension.

asValue

public V asValue(LiteralExtensionIV iv,
                 BigdataValueFactory vf)
Use the long value of the XSDLongIV delegate (which represents milliseconds since the epoch) to create a an XMLGregorianCalendar object (GMT timezone). Use the XMLGregorianCalendar to create a datatype literal value with the appropriate datatype.

Specified by:
asValue in interface IExtension<V extends BigdataValue>
Parameters:
iv - The extension IV
vf - The bigdata value factory
Returns:
The RDF Value


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.