org.basex.query.xpath.values
Enum Comp

java.lang.Object
  extended by java.lang.Enum<Comp>
      extended by org.basex.query.xpath.values.Comp
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Comp>

public enum Comp
extends java.lang.Enum<Comp>

This enumeration assembles different value comparisons.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Christian Gruen

Enum Constant Summary
APPR
          Expression Type: approximate.
APPRWORD
          Expression Type: approximate.
EQ
          Expression Type: equal.
FTCONTAINS
          Expression Type: ftcontains.
GE
          Expression Type: greater of equal.
GT
          Expression Type: greater.
LE
          Expression Type: less or equal.
LT
          Expression Type: less.
NE
          Expression Type: not equal.
WORD
          Expression Type: contains.
 
Method Summary
abstract  boolean eval(Item v1, Item v2)
          Evaluates the expression.
 java.lang.String toString()
           
static Comp valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Comp[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

APPR

public static final Comp APPR
Expression Type: approximate.


APPRWORD

public static final Comp APPRWORD
Expression Type: approximate.


EQ

public static final Comp EQ
Expression Type: equal.


FTCONTAINS

public static final Comp FTCONTAINS
Expression Type: ftcontains.


GE

public static final Comp GE
Expression Type: greater of equal.


GT

public static final Comp GT
Expression Type: greater.


LE

public static final Comp LE
Expression Type: less or equal.


LT

public static final Comp LT
Expression Type: less.


NE

public static final Comp NE
Expression Type: not equal.


WORD

public static final Comp WORD
Expression Type: contains.

Method Detail

eval

public abstract boolean eval(Item v1,
                             Item v2)
Evaluates the expression.

Parameters:
v1 - first value
v2 - second value
Returns:
result

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<Comp>

valueOf

public static Comp valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

values

public static Comp[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Comp c : Comp.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared