org.openrdf.sesame.query.rql.model
Class CompareTo

java.lang.Object
  extended byorg.openrdf.sesame.query.rql.model.CompareTo
All Implemented Interfaces:
BooleanQuery, Query

public class CompareTo
extends Object
implements BooleanQuery

Comparison operators on various types of operands.


Field Summary
static int EQ
          EQual *
static int GE
          Larger or Equal *
static int GT
          Larger Than *
static int LE
          Lower or Equal *
static int LT
          Lower Than *
static int NE
          Not Equal *
 
Constructor Summary
CompareTo(ResourceQuery arg1, int op, ResourceQuery arg2)
           
 
Method Summary
 ResourceQuery getArg1()
           
 ResourceQuery getArg2()
           
 int getOperator()
           
 String getQuery()
           
 boolean isTrue(RdfSchemaSource rss)
          Determines what the boolean value of the comparison operator is.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LT

public static final int LT
Lower Than *

See Also:
Constant Field Values

LE

public static final int LE
Lower or Equal *

See Also:
Constant Field Values

EQ

public static final int EQ
EQual *

See Also:
Constant Field Values

GE

public static final int GE
Larger or Equal *

See Also:
Constant Field Values

GT

public static final int GT
Larger Than *

See Also:
Constant Field Values

NE

public static final int NE
Not Equal *

See Also:
Constant Field Values
Constructor Detail

CompareTo

public CompareTo(ResourceQuery arg1,
                 int op,
                 ResourceQuery arg2)
Method Detail

getArg1

public ResourceQuery getArg1()

getArg2

public ResourceQuery getArg2()

getOperator

public int getOperator()

isTrue

public boolean isTrue(RdfSchemaSource rss)
               throws QueryEvaluationException
Determines what the boolean value of the comparison operator is. Possible comparisons are <, <=, =, >, >=, !=. When incompatible datatypes are compared, all comparisons (except !=) evaluate to false.

Specified by:
isTrue in interface BooleanQuery
Parameters:
rss - the repository abstraction layer on which the query needs to be evaluated.
Returns:
true when the selected comparison operator evaluates to true,false otherwise.
Throws:
QueryEvaluationException - is thrown when the comparison is between a set and a single element, or when a variable has no assigned value.

getQuery

public String getQuery()
Specified by:
getQuery in interface Query

toString

public String toString()


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.