Package org.intermine.objectstore.query
Class BagConstraint
- java.lang.Object
-
- org.intermine.objectstore.query.Constraint
-
- org.intermine.objectstore.query.BagConstraint
-
- All Implemented Interfaces:
ConstraintWithBag
public class BagConstraint extends Constraint implements ConstraintWithBag
Constrain a QueryClass or QueryEvaluable to be within a bag.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<?>
bag
protected ObjectStoreBag
osb
protected QueryNode
qn
static java.util.List<ConstraintOp>
VALID_OPS
List of possible operations-
Fields inherited from class org.intermine.objectstore.query.Constraint
op
-
-
Constructor Summary
Constructors Constructor Description BagConstraint(QueryNode qn, ConstraintOp op, java.util.Collection<?> bag)
Construct a BagConstraint from a Collection.BagConstraint(QueryNode qn, ConstraintOp op, ObjectStoreBag osb)
Construct a BagConstraint from an ObjectStoreBag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.util.Collection<?>
getBag()
Get the bag Collection.ObjectStoreBag
getOsb()
Get the ObjectStoreBag.QueryNode
getQueryNode()
Get the QueryNode.int
hashCode()
-
Methods inherited from class org.intermine.objectstore.query.Constraint
getOp, negate
-
-
-
-
Field Detail
-
qn
protected QueryNode qn
-
bag
protected java.util.Collection<?> bag
-
osb
protected ObjectStoreBag osb
-
VALID_OPS
public static final java.util.List<ConstraintOp> VALID_OPS
List of possible operations
-
-
Constructor Detail
-
BagConstraint
public BagConstraint(QueryNode qn, ConstraintOp op, java.util.Collection<?> bag)
Construct a BagConstraint from a Collection. Note that the bag isn't copied so it should not be changed after the Query has been executed. BagConstraint will accept ONE_OF and NONE_OF as constraint op arguments but will use corresponding IN and NOT_IN.- Parameters:
qn
- the QueryNode to compare to the bagop
- the operationbag
- a Collection that represents the bag
-
BagConstraint
public BagConstraint(QueryNode qn, ConstraintOp op, ObjectStoreBag osb)
Construct a BagConstraint from an ObjectStoreBag.- Parameters:
qn
- the QueryNode to compare to the bagop
- the operationosb
- an ObjectStoreBag
-
-
Method Detail
-
getQueryNode
public QueryNode getQueryNode()
Get the QueryNode.- Returns:
- QueryNode
-
getBag
public java.util.Collection<?> getBag()
Get the bag Collection.- Specified by:
getBag
in interfaceConstraintWithBag
- Returns:
- a Set of objects in the bag
-
getOsb
public ObjectStoreBag getOsb()
Get the ObjectStoreBag.- Returns:
- an ObjectStoreBag
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-