com.sparsity.dex.gdb
Enum Condition

java.lang.Object
  extended by java.lang.Enum<Condition>
      extended by com.sparsity.dex.gdb.Condition
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Condition>

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

Condition operators enumeration.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Enum Constant Summary
Between
          In range operator condition ([x,y]).
Equal
          Equal condition (==).
GreaterEqual
          Greater or equal condition (>=).
GreaterThan
          Greater than condition (>).
LessEqual
          Less or equal condition (<=).
LessThan
          Less than condition (<).
Like
          Substring condition.
LikeNoCase
          Substring (no case sensitive) condition.
NotEqual
          Not equal condition (!=).
RegExp
          Regular expression condition.
 
Method Summary
static Condition valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Condition[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Equal

public static final Condition Equal
Equal condition (==).

Null values can be used together with this condition to retrieve all objects having a null value for an attribute.


GreaterEqual

public static final Condition GreaterEqual
Greater or equal condition (>=).

Null values cannot be used together with this condition.


GreaterThan

public static final Condition GreaterThan
Greater than condition (>).

Null values cannot be used together with this condition.


LessEqual

public static final Condition LessEqual
Less or equal condition (<=).

Null values cannot be used together with this condition.


LessThan

public static final Condition LessThan
Less than condition (<).

Null values cannot be used together with this condition.


NotEqual

public static final Condition NotEqual
Not equal condition (!=).

Null values can be used together with this condition to retrieve all objects having a non-null value for an attribute.


Like

public static final Condition Like
Substring condition.

Null values cannot be used together with this condition.

This condition can just be used together with String values. It allows for searching substrings (case sensitive). Ex:

'AAABBBCCCD' Like 'BBB' returns true

'AAABBBCCCD' Like 'bbb' returns false

'AAABBBCCCD' Like 'E' returns false


LikeNoCase

public static final Condition LikeNoCase
Substring (no case sensitive) condition.

Null values cannot be used together with this condition.

This condition can just be used together with String values. It allows for searching substrings (no case sensitive). Ex:

'AAABBBCCCD' LikeNoCase 'BBB' returns true

'AAABBBCCCD' LikeNoCase 'bbb' returns true

'AAABBBCCCD' LikeNoCase 'E' returns false


Between

public static final Condition Between
In range operator condition ([x,y]).

Null values cannot be used together with this condition.


RegExp

public static final Condition RegExp
Regular expression condition.

Null values cannot be used together with this condition.

This is condition can just be used together with String values. It allows for searching objects matching a given regular expression.

It is case sensitive.

Regular expression format conforms most of the POSIX Extended Regular Expressions.

Implemented operators are:

letter: expects that letter. Example: "a" true if it includes an a.

E1E2: two or more consecutive expressions are concatenated. Example: "b" true if it includes a substring ab.

E1|E2: expects one of both expressions. Example: "cat|dog" true if it includes cat or dog.

(E): groups an expression. Example: "r(u|a)n" true if it includes run or ran.

E{m,M}: an expression is repeated from a minimimum times, m, to a maximum times, M. If maximum, M, is zero, then unlimited number of repetitions is accepted. Example: "ab{1,3}" true if includes ab, abb or abbb.

E* E+ E?: equivalent to: E{0,0} E{1,0} E{0,1}.

[letters]: equivalent to: (letter1|letter2|...|lettern). Example: "[abc]" true if there is any of a or b or c.

[^letters]: expects none of those letters. Example: "[^abc]" false if there is any of a or b or c.

.: accepts any letter, equivalent to [^]

^E: expects an expression at the beginning. Example: "^a" true if it starts with a.

E$: expects an expression at the end. Example: "a$" true if it ends with a.

Some simple examples:

'AAABBBCCCD' ERE 'A+B*C+' returns true

'AAACCCD' ERE 'B*C+' returns true

'AAACCCD' ERE 'B+C+' returns false

'AAACCCD' ERE '^A[^]*D$' returns true

'AAACCCD' ERE 'B*C+$' returns false

Method Detail

values

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

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

valueOf

public static Condition 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