org.openanzo.glitter.util
Class TypeConversions

java.lang.Object
  extended by org.openanzo.glitter.util.TypeConversions

public class TypeConversions
extends java.lang.Object

A collection of utility methods related to type conversions.

Author:
lee

Method Summary
static boolean booleanValue(TriplePatternComponent term)
          Extract native boolean value from a literal with type boolean.
static boolean effectiveBooleanValue(TriplePatternComponent term)
          Extract native boolean value from a literal by using the SPARQL effective boolean value.
static boolean isNumeric(TriplePatternComponent term)
           
static boolean isSimpleLiteral(TriplePatternComponent term)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

booleanValue

public static boolean booleanValue(TriplePatternComponent term)
                            throws IncompatibleTypeException
Extract native boolean value from a literal with type boolean.

Parameters:
term - TriplePatternComponent to convert
Returns:
native boolean value from a literal with type boolean.
Throws:
IncompatibleTypeException

effectiveBooleanValue

public static boolean effectiveBooleanValue(TriplePatternComponent term)
                                     throws IncompatibleTypeException
Extract native boolean value from a literal by using the SPARQL effective boolean value.

Parameters:
term - TriplePatternComponent to convert
Returns:
native boolean value from a literal by using the SPARQL effective boolean value
Throws:
IncompatibleTypeException

isSimpleLiteral

public static boolean isSimpleLiteral(TriplePatternComponent term)
Parameters:
term -
Returns:
Whether or not the given term is a plain literal with no language tag

isNumeric

public static boolean isNumeric(TriplePatternComponent term)
Parameters:
term -
Returns:
Whether or not the given term is a typed literal with a numeric type


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.