org.basex.query.xquery.expr
Enum Cmp

java.lang.Object
  extended by java.lang.Enum<Cmp>
      extended by org.basex.query.xquery.expr.Cmp
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Cmp>

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

This enumeration assembles different item comparisons. Note that the order of the enumerations is important for a correct parsing of the XQuery input; longer tokens have to be put in front of short ones. As an example, the node comparison ">>" has to be placed in front of the general comparison ">".

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

Enum Constant Summary
GEQ
          General Comparison: equal.
GGE
          General Comparison: greater of equal.
GGT
          General Comparison: greater.
GLE
          General Comparison: less or equal.
GLT
          General Comparison: less.
GNE
          General Comparison: not equal.
NEQ
          Node Comparison: same.
NET
          Node Comparison: before.
NGT
          Node Comparison: after.
VEQ
          Item Comparison:equal.
VGE
          Item Comparison:greater of equal.
VGT
          Item Comparison:greater.
VLE
          Item Comparison:less or equal.
VLT
          Item Comparison:less.
VNE
          Item Comparison:not equal.
 
Field Summary
 byte[] name
          String representation.
 
Method Summary
abstract  boolean e(Item a, Item b)
          Evaluates the expression.
 java.lang.String toString()
           
static boolean valCheck(Item a, Item b)
          Checks if the specified items can be compared.
static Cmp valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Cmp[] 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

GEQ

public static final Cmp GEQ
General Comparison: equal.


GGE

public static final Cmp GGE
General Comparison: greater of equal.


GGT

public static final Cmp GGT
General Comparison: greater.


GLE

public static final Cmp GLE
General Comparison: less or equal.


GLT

public static final Cmp GLT
General Comparison: less.


GNE

public static final Cmp GNE
General Comparison: not equal.


NEQ

public static final Cmp NEQ
Node Comparison: same.


NET

public static final Cmp NET
Node Comparison: before.


NGT

public static final Cmp NGT
Node Comparison: after.


VEQ

public static final Cmp VEQ
Item Comparison:equal.


VGE

public static final Cmp VGE
Item Comparison:greater of equal.


VGT

public static final Cmp VGT
Item Comparison:greater.


VLE

public static final Cmp VLE
Item Comparison:less or equal.


VLT

public static final Cmp VLT
Item Comparison:less.


VNE

public static final Cmp VNE
Item Comparison:not equal.

Field Detail

name

public final byte[] name
String representation.

Method Detail

e

public abstract boolean e(Item a,
                          Item b)
                   throws XQException
Evaluates the expression.

Parameters:
a - first item
b - second item
Returns:
result
Throws:
XQException - evaluation exception

toString

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

valCheck

public static boolean valCheck(Item a,
                               Item b)
Checks if the specified items can be compared.

Parameters:
a - first item
b - second item
Returns:
result of check

valueOf

public static Cmp 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 Cmp[] 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 (Cmp c : Cmp.values())
    System.out.println(c);

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