Package org.intermine.sql.query
Class InListConstraint
- java.lang.Object
-
- org.intermine.sql.query.AbstractConstraint
-
- org.intermine.sql.query.InListConstraint
-
- All Implemented Interfaces:
SQLStringable
public class InListConstraint extends AbstractConstraint
A representation of a constraint where an AbstractValue is IN a list of constants.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractValue
left
protected java.util.Set<Constant>
right
-
Fields inherited from class org.intermine.sql.query.AbstractConstraint
BOTH_FALSE, BOTH_TRUE, EQUAL, EXCLUDES, IMPLIED_BY, IMPLIES, INDEPENDENT, LEFT_FALSE, LEFT_FALSE_RIGHT_TRUE, LEFT_TRUE, LEFT_TRUE_RIGHT_FALSE, OPPOSITE, OR, RIGHT_FALSE, RIGHT_TRUE
-
-
Constructor Summary
Constructors Constructor Description InListConstraint(AbstractValue left)
Constructor for InListConstraint object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Constant c)
Add constants to the list.void
addAll(java.util.Collection<? extends Constant> c)
Adds a Collection of Constants to the list.int
compare(AbstractConstraint obj, java.util.Map<AbstractTable,AbstractTable> tableMap, java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
Compare this InListConstraint with another AbstractConstraint, ignoring aliases in member fields and tables.AbstractValue
getLeft()
Returns the left AbstractValue.java.util.Set<Constant>
getRight()
Returns the right Set of Constants.java.lang.String
getSQLString()
Returns a String representation of this InListConstraint object, suitable for forming part of an SQL Query.int
hashCode()
Overrides Object.hashCode().-
Methods inherited from class org.intermine.sql.query.AbstractConstraint
alterComparisonAnd, alterComparisonAORB, alterComparisonNotObj, alterComparisonNotThis, alterComparisonSwitch, checkComparisonEquals, checkComparisonImplies, compare, equals
-
-
-
-
Field Detail
-
left
protected AbstractValue left
-
right
protected java.util.Set<Constant> right
-
-
Constructor Detail
-
InListConstraint
public InListConstraint(AbstractValue left)
Constructor for InListConstraint object.- Parameters:
left
- the AbstractValue on the left of the constraint
-
-
Method Detail
-
add
public void add(Constant c)
Add constants to the list.- Parameters:
c
- a Constant
-
addAll
public void addAll(java.util.Collection<? extends Constant> c)
Adds a Collection of Constants to the list.- Parameters:
c
- a Collection of Constants
-
getLeft
public AbstractValue getLeft()
Returns the left AbstractValue.- Returns:
- an AbstractValue
-
getRight
public java.util.Set<Constant> getRight()
Returns the right Set of Constants.- Returns:
- a Set
-
getSQLString
public java.lang.String getSQLString()
Returns a String representation of this InListConstraint object, suitable for forming part of an SQL Query.- Specified by:
getSQLString
in interfaceSQLStringable
- Specified by:
getSQLString
in classAbstractConstraint
- Returns:
- the String representation
-
compare
public int compare(AbstractConstraint obj, java.util.Map<AbstractTable,AbstractTable> tableMap, java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
Compare this InListConstraint with another AbstractConstraint, ignoring aliases in member fields and tables. Compare this AbstractConstraint with another, ignoring aliases in member fields and tables.- Specified by:
compare
in classAbstractConstraint
- Parameters:
obj
- an AbstractConstraint to compare totableMap
- a Map from tables in this constraint to tables in objreverseTableMap
- a reverse of tableMap- Returns:
- INDEPENDENT, IMPLIED_BY, IMPLIES, EQUAL, OPPOSITE, EXCLUDES, or OR, depending on the constraints.
-
hashCode
public int hashCode()
Overrides Object.hashCode().- Specified by:
hashCode
in classAbstractConstraint
- Returns:
- an arbitrary integer based on the contents of the Constraint
-
-