Class 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 value
      java.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 type
      int 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 value
      void 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • field

        protected java.lang.Object field
      • 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 wrap
        path - the Path
        isKeyField - 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 interface ResultCell
        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 interface ResultCell
        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 interface ResultCell
        Returns:
        true if this is a key field
      • getId

        public java.lang.Integer getId()
        Get the Id.
        Specified by:
        getId in interface ResultCell
        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.
      • getObject

        public FastPathObject getObject()
        Return the Object contained in this result element.
        Specified by:
        getObject in interface ResultCell
        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 class java.lang.Object
        Returns:
        a String
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object