|
Siena (v.1.5.5) API documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsiena.Filter
public class Filter
a selection predicate defined over notifications.
The form of a Filter
is a conjunction of
constraints (see AttributeConstraint
). Each
constraint poses an elementary condition on a specific attribute
of the event. For example a contraint[price < 10]
requires that the event contain an attribute named "price" whose
value is a number less than 10. A Filter
can have
more that one constraint for an attribute. For example, a
Filter
can express things like [model="custom",
price > 10, price <= 20].
Every constraint in a Filter
implicitly
expresses an existential quantifier over the event. The filter
of the previous example ([model="custom", price > 10,
price <= 20]) requires that an event contain an attribute
named "model", whose value is the string "custom", and an
attribute named "price" whose value is a number between 10 and 20
(20 included).
The valid syntax for attribute names is the same for Notification
.
AttributeConstraint
,
Notification
,
Serialized FormConstructor Summary | |
---|---|
Filter()
creates an empty filter. |
|
Filter(Filter f)
creates a (deep) copy of a given filter. |
|
Filter(java.lang.String s)
|
Method Summary | |
---|---|
void |
addConstraint(java.lang.String name,
AttributeConstraint a)
puts a constraint a on attribute name. |
void |
addConstraint(java.lang.String s,
boolean bval)
puts a constraint on attribute name using the equality operator and a boolean argument
bval. |
void |
addConstraint(java.lang.String s,
byte[] sval)
puts a constraint on attribute name using the equality operator and a byte[] argument
sval. |
void |
addConstraint(java.lang.String s,
double dval)
puts a constraint on attribute name using the equality operator and a double argument
dval. |
void |
addConstraint(java.lang.String s,
long lval)
puts a constraint on attribute name using the equality operator and a long argument
lval. |
void |
addConstraint(java.lang.String s,
short op,
boolean bval)
puts a constraint on attribute name using comparison operator op and a boolean argument
bval. |
void |
addConstraint(java.lang.String s,
short op,
byte[] sval)
puts a constraint on attribute name using comparison operator op and a byte[]
argument sval. |
void |
addConstraint(java.lang.String s,
short op,
double dval)
puts a constraint on attribute name using comparison operator op and a double argument
dval. |
void |
addConstraint(java.lang.String s,
short op,
long lval)
puts a constraint on attribute name using comparison operator op and a long argument
lval. |
void |
addConstraint(java.lang.String s,
short op,
java.lang.String sval)
puts a constraint on attribute name using comparison operator op and a String
argument sval. |
void |
addConstraint(java.lang.String s,
java.lang.String sval)
puts a constraint on attribute name using the equality operator and a String argument
sval. |
void |
clear()
removes all constraints. |
java.util.Iterator |
constraintNamesIterator()
returns an iterator for the set of attribute (constraint) names of this Filter . |
java.util.Iterator |
constraintsIterator(java.lang.String name)
returns an iterator for the set of constraints over attribute name of this Filter . |
boolean |
containsConstraint(java.lang.String s)
returns true if this filter contains at least one constraint for the specified attribute |
boolean |
isEmpty()
true iff this filter contains no constraints |
static Filter |
parseFilter(java.lang.String s)
|
boolean |
removeConstraints(java.lang.String s)
removes all the constraints for the specified attribute. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Filter()
public Filter(Filter f)
public Filter(java.lang.String s) throws SENPInvalidFormat
SENPInvalidFormat
Method Detail |
---|
public static Filter parseFilter(java.lang.String s) throws SENPInvalidFormat
SENPInvalidFormat
public boolean isEmpty()
true
iff this filter contains no constraints
public void addConstraint(java.lang.String name, AttributeConstraint a)
Filter f = new Filter();
AttributeConstraint a;
a = new AttrbuteConstraint(Op.SS, "soft")
f.addConstraint("subject", a);
public void addConstraint(java.lang.String s, short op, java.lang.String sval)
String
argument sval.
Filter f = new Filter();
f.addConstraint("subject", Op.SS, "soft");
public void addConstraint(java.lang.String s, short op, byte[] sval)
byte[]
argument sval.
public void addConstraint(java.lang.String s, short op, long lval)
long
argument
lval.
public void addConstraint(java.lang.String s, short op, boolean bval)
boolean
argument
bval.
Filter f = new Filter();
f.addConstraint("failed", Op.EQ, true);
public void addConstraint(java.lang.String s, short op, double dval)
double
argument
dval.
public void addConstraint(java.lang.String s, java.lang.String sval)
String
argument
sval.
Example:
Filter f = new Filter();
f.addConstraint("name", "Antonio");
public void addConstraint(java.lang.String s, byte[] sval)
byte[]
argument
sval.
public void addConstraint(java.lang.String s, boolean bval)
boolean
argument
bval.
public void addConstraint(java.lang.String s, long lval)
long
argument
lval.
public void addConstraint(java.lang.String s, double dval)
double
argument
dval.
public boolean containsConstraint(java.lang.String s)
public boolean removeConstraints(java.lang.String s)
public void clear()
public java.util.Iterator constraintNamesIterator()
Filter
.
public java.util.Iterator constraintsIterator(java.lang.String name)
Filter
.
public java.lang.String toString()
toString
in class java.lang.Object
|
Siena (v.1.5.5) API documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |