db4o 6.1

com.db4o.query
Interface Constraint

All Known Subinterfaces:
Constraints

public interface Constraint

constraint to limit the objects returned upon query execution.

Constraints are constructed by calling Query.constrain().

Constraints can be joined with the methods and(com.db4o.query.Constraint) and or(com.db4o.query.Constraint).

The methods to modify the constraint evaluation algorithm may be merged, to construct combined evaluation rules. Examples:


Method Summary
 Constraint and(Constraint with)
          links two Constraints for AND evaluation.
 Constraint contains()
          sets the evaluation mode to containment comparison.
 Constraint endsWith(boolean caseSensitive)
          sets the evaluation mode to string endsWith comparison.
 Constraint equal()
          sets the evaluation mode to ==.
 java.lang.Object getObject()
          returns the Object the query graph was constrained with to create this Constraint.
 Constraint greater()
          sets the evaluation mode to >.
 Constraint identity()
          sets the evaluation mode to identity comparison.
 Constraint like()
          sets the evaluation mode to "like" comparison.
 Constraint not()
          turns on not() comparison.
 Constraint or(Constraint with)
          links two Constraints for OR evaluation.
 Constraint smaller()
          sets the evaluation mode to <.
 Constraint startsWith(boolean caseSensitive)
          sets the evaluation mode to string startsWith comparison.
 

Method Detail

and

Constraint and(Constraint with)
links two Constraints for AND evaluation.

Parameters:
with - the other Constraint
Returns:
a new Constraint, that can be used for further calls to and() and or()

or

Constraint or(Constraint with)
links two Constraints for OR evaluation.

Parameters:
with - the other Constraint
Returns:
a new Constraint, that can be used for further calls to and() and or()

equal

Constraint equal()
sets the evaluation mode to ==.

Returns:
this Constraint to allow the chaining of method calls.

greater

Constraint greater()
sets the evaluation mode to >.

Returns:
this Constraint to allow the chaining of method calls.

smaller

Constraint smaller()
sets the evaluation mode to <.

Returns:
this Constraint to allow the chaining of method calls.

identity

Constraint identity()
sets the evaluation mode to identity comparison.

Returns:
this Constraint to allow the chaining of method calls.

like

Constraint like()
sets the evaluation mode to "like" comparison.

Constraints are compared to the first characters of a field.

Returns:
this Constraint to allow the chaining of method calls.

contains

Constraint contains()
sets the evaluation mode to containment comparison.

Returns:
this Constraint to allow the chaining of method calls.

startsWith

Constraint startsWith(boolean caseSensitive)
sets the evaluation mode to string startsWith comparison.

Parameters:
caseSensitive - comparison will be case sensitive if true, case insensitive otherwise
Returns:
this Constraint to allow the chaining of method calls.

endsWith

Constraint endsWith(boolean caseSensitive)
sets the evaluation mode to string endsWith comparison.

Parameters:
caseSensitive - comparison will be case sensitive if true, case insensitive otherwise
Returns:
this Constraint to allow the chaining of method calls.

not

Constraint not()
turns on not() comparison.

Returns:
this Constraint to allow the chaining of method calls.

getObject

java.lang.Object getObject()
returns the Object the query graph was constrained with to create this Constraint.

Returns:
Object the constraining object.

db4o 6.1