Package org.intermine.sql.query
Class Field
- java.lang.Object
-
- org.intermine.sql.query.AbstractValue
-
- org.intermine.sql.query.Field
-
- All Implemented Interfaces:
SQLStringable
public class Field extends AbstractValue
A representation of a field in a table.- Author:
- Andrew Varley
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
protected AbstractTable
table
-
Fields inherited from class org.intermine.sql.query.AbstractValue
EQUAL, GREATER, INCOMPARABLE, LESS, NOT_EQUAL
-
-
Constructor Summary
Constructors Constructor Description Field(java.lang.String name, AbstractTable table)
Constructor for this Field object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(AbstractValue obj, java.util.Map<AbstractTable,AbstractTable> tableMap, java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
Compare this field to another AbstractValue.boolean
equals(java.lang.Object obj)
Overrides Object.equals().boolean
equalsTableOnlyAlias(AbstractValue obj)
Compare this Field to another AbstractValue, including only the table alias.java.lang.String
getName()
Returns the name of the field.java.lang.String
getSQLString()
Returns a String representation of this Field object, suitable for forming part of an SQL query.AbstractTable
getTable()
Returns the table of this field.int
hashCode()
Overrides Object.hashcode().boolean
isAggregate()
Returns true if this value is an aggregate function.-
Methods inherited from class org.intermine.sql.query.AbstractValue
greaterOrEqual, greaterThan, lessOrEqual, lessThan, notEqualTo, valueEquals
-
-
-
-
Field Detail
-
name
protected java.lang.String name
-
table
protected AbstractTable table
-
-
Constructor Detail
-
Field
public Field(java.lang.String name, AbstractTable table)
Constructor for this Field object.- Parameters:
name
- the name of the field, as the database knows ittable
- the name of the AbstractTable to which the field belongs, as the database knows it
-
-
Method Detail
-
getSQLString
public java.lang.String getSQLString()
Returns a String representation of this Field object, suitable for forming part of an SQL query.- Specified by:
getSQLString
in interfaceSQLStringable
- Specified by:
getSQLString
in classAbstractValue
- Returns:
- the String representation
-
equals
public boolean equals(java.lang.Object obj)
Overrides Object.equals().- Specified by:
equals
in classAbstractValue
- Parameters:
obj
- an Object to compare to- Returns:
- true if the object is of the same class, and with the same name
-
hashCode
public int hashCode()
Overrides Object.hashcode().- Specified by:
hashCode
in classAbstractValue
- Returns:
- an arbitrary integer based on the contents of the Field
-
equalsTableOnlyAlias
public boolean equalsTableOnlyAlias(AbstractValue obj)
Compare this Field to another AbstractValue, including only the table alias.- Parameters:
obj
- an AbstractField to compare to- Returns:
- true if the object is of the same class, and with the same value
-
getTable
public AbstractTable getTable()
Returns the table of this field.- Returns:
- table
-
getName
public java.lang.String getName()
Returns the name of the field.- Returns:
- name
-
compare
public int compare(AbstractValue obj, java.util.Map<AbstractTable,AbstractTable> tableMap, java.util.Map<AbstractTable,AbstractTable> reverseTableMap)
Compare this field to another AbstractValue. Compare the value of this AbstractValue with another.- Specified by:
compare
in classAbstractValue
- Parameters:
obj
- an AbstractValue to compare totableMap
- a mapping between tablenames of the two elementsreverseTableMap
- a reverse of tableMap- Returns:
- EQUAL, LESS, GREATER, NOT_EQUAL, or INCOMPARABLE
-
isAggregate
public boolean isAggregate()
Returns true if this value is an aggregate function.- Specified by:
isAggregate
in classAbstractValue
- Returns:
- a boolean
-
-