|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.collab.Restriction
public abstract class Restriction
Restricts the items returned from a query. Restrictions are built up into a hierarchy of conditions that are turned into an appropriate query or API call by the provider.
IContainer.getItemCount(Restriction)
Field Summary | |
---|---|
static int |
EQUAL
Represents a ValueRestriction 'equal to' comparison. |
static int |
GREATER
Represents a ValueRestriction 'greater than' comparison. |
static int |
GREATER_EQUAL
Represents a ValueRestriction 'greater than or equal to' comparison. |
static int |
LESS
Represents a ValueRestriction 'less than' comparison. |
static int |
LESS_EQUAL
Represents a ValueRestriction 'less than or equal to' comparison. |
static int |
NOT_EQUAL
Represents a ValueRestriction 'not equal' comparison. |
static int |
TYPE_AND
Indicates the restriction is a Logical AND restriction. |
static int |
TYPE_BINARY
Indicates the restriction is a binary restriction. |
static int |
TYPE_COMPARE
Indicates the restriction is a Compare restriction. |
static int |
TYPE_CONTENT
Indicates the restriction is a Content restriction. |
static int |
TYPE_EXISTS
Indicates the restriction is an Exists restriction. |
static int |
TYPE_NOT
Indicates the restriction is a NOT restriction. |
static int |
TYPE_OR
Indicates the restriction is a Logical OR restriction. |
static int |
TYPE_SIZE
Indicates the restriction is a Size restriction. |
static int |
TYPE_VALUE
Indicates the restriction is a Value restriction. |
static int |
WHERE_FULLSTRING
Indicates the ContentRestriction should match the full string. |
static int |
WHERE_PREFIX
Indicates the ContentRestriction should match the prefix ('string starts with'). |
static int |
WHERE_SUBSTRING
Indicates the ContentRestriction should match any part of the string. |
Constructor Summary | |
---|---|
Restriction()
|
Method Summary | |
---|---|
abstract boolean |
containsKey(Key k,
boolean bRecursive)
Determines if the restriction contains a particular key or potentially has sub-restrictions which contain the specified key. |
static Restriction |
createAndRestriction(Restriction[] subRestrictions)
Create an AndRestriction ANDing two or more Restrictions. |
static Restriction |
createAndRestriction(Restriction restriction1,
Restriction restriction2)
Create an AndRestriction ANDing exactly two Restrictions. |
static Restriction |
createBinaryRestriction(Key key,
int iRelation,
byte[] yBinary)
Creates a binary restriction. |
static Restriction |
createCompareRestriction(Key key1,
int iRelation,
Key key2)
Constructs a Restriction comparing two properties of the same type. |
static Restriction |
createContentRestriction(Key key,
String sValue,
int iWhereType,
boolean bIgnoreCase)
Create a ContentRestriction on a property. |
static Restriction |
createExistsRestriction(Key key)
Create a Restriction testing whether a property exists. |
static Restriction |
createNotRestriction(Restriction subRestriction)
Create a NotRestriction inverting the sense of a Restriction |
static Restriction |
createOrRestriction(Restriction[] subRestrictions)
Create an OrRestriction ORing two or more Restrictions. |
static Restriction |
createOrRestriction(Restriction restriction1,
Restriction restriction2)
Create an OrRestriction ORing exactly two Restrictions. |
static Restriction |
createSizeRestriction(Key key,
int iRelation,
int iValue)
Create a SizeRestriction on a property. |
static Restriction |
createValueRestriction(Key key,
int iRelation,
int iValue)
Create a ValueRestriction on a property with an int. |
static Restriction |
createValueRestriction(Key key,
int iRelation,
Object value)
Create a ValueRestriction on a property. |
abstract int |
getType()
Gets the type of the restriction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.compoze.collab.util.IDigestSupport |
---|
updateDigest |
Field Detail |
---|
public static final int TYPE_AND
public static final int TYPE_OR
public static final int TYPE_NOT
public static final int TYPE_CONTENT
public static final int TYPE_VALUE
public static final int TYPE_COMPARE
public static final int TYPE_EXISTS
public static final int TYPE_SIZE
public static final int TYPE_BINARY
public static final int WHERE_FULLSTRING
public static final int WHERE_PREFIX
public static final int WHERE_SUBSTRING
public static final int LESS
public static final int LESS_EQUAL
public static final int EQUAL
public static final int NOT_EQUAL
public static final int GREATER_EQUAL
public static final int GREATER
Constructor Detail |
---|
public Restriction()
Method Detail |
---|
public abstract int getType()
TYPE_
constants in this class)public static Restriction createValueRestriction(Key key, int iRelation, Object value) throws CollaborationException
key
- key that identifies the propertyiRelation
- LESS, LESS_EQUAL, EQUAL, NOT_EQUAL, GREATER_EQUAL, GREATER,value
- constant to compare against; must be compatible with key's type
null
)
CollaborationException
- if value
is not compatible
with the type of key
public static Restriction createValueRestriction(Key key, int iRelation, int iValue) throws CollaborationException
key
- key that identifies the propertyiRelation
- LESS, LESS_EQUAL, EQUAL, NOT_EQUAL, GREATER_EQUAL, GREATER,iValue
- int to compare against; must be compatible with key's type
null
)
CollaborationException
- if int is not compatible
with the type of key
public static Restriction createAndRestriction(Restriction[] subRestrictions)
subRestrictions
- the Restrictions to AND together
null
)public static Restriction createAndRestriction(Restriction restriction1, Restriction restriction2)
restriction1
- the first Restrictionrestriction2
- the second Restriction
null
)public static Restriction createOrRestriction(Restriction[] subRestrictions)
subRestrictions
- the Restrictions to OR together
null
)public static Restriction createOrRestriction(Restriction restriction1, Restriction restriction2)
restriction1
- the first Restrictionrestriction2
- the second Restriction
null
)public static Restriction createContentRestriction(Key key, String sValue, int iWhereType, boolean bIgnoreCase)
key
- the key to filter onsValue
- the value to filteriWhereType
- the WHERE_ constant to defined how a match is
made; this parameter may be ignored if an invalid
property is specified.bIgnoreCase
- whether the restriction should ignore case
null
)
InvalidArgumentException
- if key
does not have VALUE_STRINGpublic static Restriction createCompareRestriction(Key key1, int iRelation, Key key2)
key1
- key that identifies the first propertyiRelation
- LESS, LESS_EQUAL, EQUAL, NOT_EQUAL, GREATER_EQUAL, GREATERkey2
- key that identifies the second property
null
)
InvalidArgumentException
- if key1
and key2
are not the same typepublic static Restriction createExistsRestriction(Key key)
key
- key that identifies the property
null
)public static Restriction createSizeRestriction(Key key, int iRelation, int iValue)
key
- key that identifies the propertyiRelation
- LESS, LESS_EQUAL, EQUAL, NOT_EQUAL, GREATER_EQUAL, GREATER,iValue
- int size to compare against
null
)public static Restriction createNotRestriction(Restriction subRestriction)
subRestriction
- the Restriction to NOT
null
)public static Restriction createBinaryRestriction(Key key, int iRelation, byte[] yBinary)
key
- the key to use for the restriction.iRelation
- the type of relation for this binary restriction.
(EQUAL, NOT_EQUAL).yBinary
- the binary value
null
)public abstract boolean containsKey(Key k, boolean bRecursive)
k
- the key to search for (not null
)bRecursive
- if true
, check sub-restrictions
as well
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |