Package org.intermine.objectstore.query
Class QueryCast
- java.lang.Object
-
- org.intermine.objectstore.query.QueryCast
-
- All Implemented Interfaces:
QueryEvaluable
,QueryNode
,QueryOrderable
,QuerySelectable
public class QueryCast extends java.lang.Object implements QueryEvaluable
Represents a type cast in a Query.- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description QueryCast(QueryEvaluable value, java.lang.Class<?> type)
Construct a QueryCast.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getApproximateType()
Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.java.lang.Class<?>
getType()
Get Java type represented by this item.QueryEvaluable
getValue()
Returns the QueryEvaluable that is the actual value.int
hashCode()
void
youAreType(java.lang.Class<?> cls)
Allows a caller to suggest to this object that it holds a value of a certain type.
-
-
-
Constructor Detail
-
QueryCast
public QueryCast(QueryEvaluable value, java.lang.Class<?> type)
Construct a QueryCast.- Parameters:
value
- the value of this QueryCasttype
- the type of the value for this QueryCast to represent
-
-
Method Detail
-
getType
public java.lang.Class<?> getType()
Get Java type represented by this item.- Specified by:
getType
in interfaceQueryOrderable
- Specified by:
getType
in interfaceQuerySelectable
- Returns:
- class describing the type
-
getValue
public QueryEvaluable getValue()
Returns the QueryEvaluable that is the actual value.- Returns:
- the value
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
youAreType
public void youAreType(java.lang.Class<?> cls)
Allows a caller to suggest to this object that it holds a value of a certain type. This method should only be called on objects which report their type to be UnknownTypeValue. Otherwise, this method will throw and exception.- Specified by:
youAreType
in interfaceQueryEvaluable
- Parameters:
cls
- the Class of the type to be imposed on this object
-
getApproximateType
public int getApproximateType()
Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.- Specified by:
getApproximateType
in interfaceQueryEvaluable
- Returns:
- an int, as described in UnknownTypeValue
-
-