Package org.intermine.api.results
Class ResultElement
- java.lang.Object
-
- org.intermine.api.results.ResultElement
-
- All Implemented Interfaces:
java.io.Serializable
,ResultCell
- Direct Known Subclasses:
InlineTableResultElement
public class ResultElement extends java.lang.Object implements java.io.Serializable, ResultCell
Cell of results table containing information for the parent Object- Author:
- Xavier Watkins
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
field
protected java.lang.String
htmlId
protected FastPathObject
imObj
protected boolean
keyField
boolean protected as we need to determine if the element is a key field from JSP
-
Constructor Summary
Constructors Constructor Description ResultElement(java.lang.Object fieldValue)
Create a ResultElement that displays a single raw value.ResultElement(FastPathObject imObj, Path path, boolean isKeyField)
Constructs a new ResultCell object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Object
getField()
Get the field valuejava.lang.Integer
getId()
Get the Id.java.lang.String
getLinkRedirect()
FastPathObject
getObject()
Return the Object contained in this result element.Path
getPath()
java.lang.String
getType()
Get the typeint
hashCode()
boolean
isKeyField()
Return true if this object represents a field that is an identifying field (according to ClassKeyHelper.isKeyField())void
setField(java.lang.Object field)
Set the field valuevoid
setLinkRedirect(java.lang.String linkRedirect)
void
setSimpleCellId()
Set a hopefully unique persistent local id for simple objects.java.lang.String
toString()
Returns a String representation of the ResultElement.
-
-
-
Field Detail
-
field
protected java.lang.Object field
-
imObj
protected FastPathObject imObj
-
htmlId
protected java.lang.String htmlId
-
keyField
protected final boolean keyField
boolean protected as we need to determine if the element is a key field from JSP
-
-
Constructor Detail
-
ResultElement
public ResultElement(FastPathObject imObj, Path path, boolean isKeyField)
Constructs a new ResultCell object- Parameters:
imObj
- the InterMineObject or SimpleObject to wrappath
- the PathisKeyField
- should be true if this is an identifying field
-
ResultElement
public ResultElement(java.lang.Object fieldValue)
Create a ResultElement that displays a single raw value.- Parameters:
fieldValue
- the value to hold in this object
-
-
Method Detail
-
getField
public java.lang.Object getField()
Get the field value- Specified by:
getField
in interfaceResultCell
- Returns:
- the value
-
setField
public void setField(java.lang.Object field)
Set the field value- Parameters:
field
- the field
-
getType
public java.lang.String getType()
Get the type- Specified by:
getType
in interfaceResultCell
- Returns:
- the type
-
isKeyField
public boolean isKeyField()
Return true if this object represents a field that is an identifying field (according to ClassKeyHelper.isKeyField())- Specified by:
isKeyField
in interfaceResultCell
- Returns:
- true if this is a key field
-
getId
public java.lang.Integer getId()
Get the Id.- Specified by:
getId
in interfaceResultCell
- Returns:
- the id, which may be a simpleCellId if set, or null
-
setSimpleCellId
public void setSimpleCellId()
Set a hopefully unique persistent local id for simple objects. This allows jsonobjects queries to work on queries with simple objects. Does nothing if simpleCellId has already been set.
-
getPath
public Path getPath()
- Specified by:
getPath
in interfaceResultCell
- Returns:
- the path
-
getObject
public FastPathObject getObject()
Return the Object contained in this result element.- Specified by:
getObject
in interfaceResultCell
- Returns:
- the InterMineObject
-
setLinkRedirect
public void setLinkRedirect(java.lang.String linkRedirect)
- Parameters:
linkRedirect
- the linkRedirect to set
-
getLinkRedirect
public java.lang.String getLinkRedirect()
- Returns:
- the linkRedirect
-
toString
public java.lang.String toString()
Returns a String representation of the ResultElement.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-