Compoze Software, Inc.

com.compoze.exchange.webdav.sql
Class NotCondition


java.lang.Object

  |

  +--com.compoze.exchange.webdav.sql.AbstractSqlFragment

        |

        +--com.compoze.exchange.webdav.sql.Condition

              |

              +--com.compoze.exchange.webdav.sql.NotCondition

All Implemented Interfaces:
ISqlFragment, java.io.Serializable

public class NotCondition
extends Condition

This class provides the implementation for creating a 'NOT' condition statement.

The following example demonstrates how to use this class:

 Condition cond = NotCondition.create(new GreaterThanOperator("urn:schemas:contacts:givenName", "Skip"), true);
 cond.add(new GreaterThanOperator("urn:schemas:contacts:givenName", "Skippy"), true);

 System.out.println(cond);
 

Calling toSQL() or toString() will return the SQL representation of this object. For example, the above example would yield:

 NOT (("urn:schemas:contacts:givenName" > 'Skip') OR ("urn:schemas:contacts:givenName" > 'Skippy')) 
 

See Also:
Serialized Form

Constructor Summary
protected NotCondition()
          Constructor.
protected NotCondition(Condition condition, boolean bOr)
          Constructor.
protected NotCondition(IOperator op, boolean bOr)
          Constructor.
protected NotCondition(IPredicate predicate, boolean bOr)
          Constructor.
 
Method Summary
static Condition create()
          Creates an empty condition statement.
static Condition create(Condition condition)
          Creates a condition with a specfied condition statement.
static Condition create(Condition condition, boolean bOr)
          Creates a condition with a specfied condition statement.
static Condition create(IOperator op)
          Creates a condition with a specfied operator clause.
static Condition create(IOperator op, boolean bOr)
          Creates a condition with a specfied operator clause.
static Condition create(IPredicate predicate)
          Creates a condition with a specfied predicate clause.
static Condition create(IPredicate predicate, boolean bOr)
          Creates a condition with a specfied predicate clause.
static void main(java.lang.String[] args)
           
 java.lang.String toSQL()
          Returns a SQL representation of the condition statement.
 
Methods inherited from class com.compoze.exchange.webdav.sql.Condition
add, add, add, add, add, add, getCondition, isEmpty, isOr
 
Methods inherited from class com.compoze.exchange.webdav.sql.AbstractSqlFragment
escape, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotCondition


protected NotCondition()
Constructor.

NotCondition


protected NotCondition(Condition condition,
                       boolean bOr)
Constructor.
Parameters:
condition - the condition statement.
bOr - true to or together; false otherwise.

NotCondition


protected NotCondition(IOperator op,
                       boolean bOr)
Constructor.
Parameters:
op - the operator statement.
bOr - true to or together; false otherwise.

NotCondition


protected NotCondition(IPredicate predicate,
                       boolean bOr)
Constructor.
Parameters:
predicate - the predicate statement.
bOr - true to or together; false otherwise.
Method Detail

create


public static Condition create()
Creates an empty condition statement.
Returns:
the condition

create


public static Condition create(Condition condition)
Creates a condition with a specfied condition statement.
Parameters:
condition - the condition statement to create condition with.
Returns:
the condition.

create


public static Condition create(Condition condition,
                               boolean bOr)
Creates a condition with a specfied condition statement.
Parameters:
condition - the condition statement to create condition with.
bOr - true to or together; false otherwise.
Returns:
the condition.

create


public static Condition create(IOperator op)
Creates a condition with a specfied operator clause.
Parameters:
op - the operator clause to create condition with.
Returns:
the condition.

create


public static Condition create(IOperator op,
                               boolean bOr)
Creates a condition with a specfied operator clause.
Parameters:
op - the operator clause to create condition with.
bOr - true to or together; false otherwise.
Returns:
the condition.

create


public static Condition create(IPredicate predicate)
Creates a condition with a specfied predicate clause.
Parameters:
predicate - the predicate clause to create condition with.
bOr - true to or together; false otherwise.

create


public static Condition create(IPredicate predicate,
                               boolean bOr)
Creates a condition with a specfied predicate clause.
Parameters:
predicate - the predicate clause to create condition with.
bOr - true to or together; false otherwise.

toSQL


public java.lang.String toSQL()
Returns a SQL representation of the condition statement.
Overrides:
toSQL in class Condition
Returns:
the SQL representation of the condition statement.

main


public static void main(java.lang.String[] args)

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.