org.openanzo.glitter.rdf
Class PlainLiteral

java.lang.Object
  extended by org.openanzo.glitter.rdf.Literal
      extended by org.openanzo.glitter.rdf.PlainLiteral
All Implemented Interfaces:
ILiteralTerm, IPlainLiteralTerm, RDFTerm, TriplePatternComponent

public class PlainLiteral
extends Literal
implements IPlainLiteralTerm

An implementation of IPlainLiteralTerm to represent plain literals in a query parsed by Glitter.

Author:
lee

Constructor Summary
PlainLiteral(java.lang.String value)
          Build a plain literal from its lexical value.
PlainLiteral(java.lang.String value, java.lang.String language)
          Build a plain literal from its lexical value and language.
 
Method Summary
 int compareTo(TriplePatternComponent o)
          Compares to TriplePatternComponents for ordering.
 java.lang.String getLanguage()
           
 java.lang.String getLexicalForm()
           
 boolean hasLanguage()
           
 boolean isPlainLiteral()
           
 boolean isTypedLiteral()
           
 java.lang.String toString()
           
 
Methods inherited from class org.openanzo.glitter.rdf.Literal
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlainLiteral

public PlainLiteral(java.lang.String value,
                    java.lang.String language)
Build a plain literal from its lexical value and language.

Parameters:
value -
language -

PlainLiteral

public PlainLiteral(java.lang.String value)
Build a plain literal from its lexical value.

Parameters:
value -
Method Detail

getLanguage

public java.lang.String getLanguage()
Specified by:
getLanguage in interface IPlainLiteralTerm
Returns:
The language tag for this plain literal. May be null, unless IPlainLiteralTerm.hasLanguage() returns true.

hasLanguage

public boolean hasLanguage()
Specified by:
hasLanguage in interface IPlainLiteralTerm
Returns:
whether or not this literal has a language tag

getLexicalForm

public java.lang.String getLexicalForm()
Specified by:
getLexicalForm in interface ILiteralTerm
Specified by:
getLexicalForm in class Literal
Returns:
The lexical form of the literal.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(TriplePatternComponent o)
Description copied from interface: TriplePatternComponent
Compares to TriplePatternComponents for ordering.

Specified by:
compareTo in interface TriplePatternComponent
Returns:
-1 if this comes before other; 0 if TriplePatternComponent.equals(Object) is true, and 1 otherwise.

isPlainLiteral

public boolean isPlainLiteral()
Specified by:
isPlainLiteral in interface ILiteralTerm
Returns:
whether or not this is a plain literal.

isTypedLiteral

public boolean isTypedLiteral()
Specified by:
isTypedLiteral in interface ILiteralTerm
Returns:
whether or not this is a typed literal.


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