Class ResultItem

java.lang.Object
ro.sync.exml.editor.results.iterator.ResultItem

public class ResultItem extends Object
Represents an item from an multiple result.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
    The result item is a common node (we can't tell if it is Atomic or Node).
    protected String
    The content representation of the item.
    protected String
    Use this string in the result set tree for the node to be represented to user.
    protected String
    Use this string in the result set tree for the node to be represented to user as a tooltip on node.
    static final short
    The result item is a error node.
    protected static final int
    A text limit if no description is provided, after TEXT_LIMIT we add ...
    protected short
    Current type of the result item.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
    ResultItem(short type, String content)
    Create a new result item.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other result item is "equal to" this one.
    Get a string representation of the item.
    Get the display title for the node in the tree.
    Get the display title for the node in the tree.
    int
    Get the item end offset.
    int
    Get the item start offset.
    short
    Get the type of the result item.
    int
     
    void
    Set a new content for the result item.
    void
    setDisplayTooltip(String displayTooltip)
    Set the display tooltip for the node in the tree.
    void
    setEndOffset(int endOffset)
    Set the item end offset.
    void
    setStartOffset(int startOffset)
    Set the item start offset.
    void
    setType(short type)
    Set a new type for the result item.
    Gets the string representation.

    Methods inherited from class java.lang.Object

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

    • COMMON_TYPE

      public static final short COMMON_TYPE
      The result item is a common node (we can't tell if it is Atomic or Node).
      See Also:
    • ERROR_TYPE

      public static final short ERROR_TYPE
      The result item is a error node.
      See Also:
    • type

      protected short type
      Current type of the result item.
    • content

      protected String content
      The content representation of the item.
    • displayTitle

      protected String displayTitle
      Use this string in the result set tree for the node to be represented to user.
    • displayTooltip

      protected String displayTooltip
      Use this string in the result set tree for the node to be represented to user as a tooltip on node.
    • TEXT_LIMIT

      protected static final int TEXT_LIMIT
      A text limit if no description is provided, after TEXT_LIMIT we add ...
      See Also:
  • Constructor Details

    • ResultItem

      public ResultItem()
      Empty constructor.
    • ResultItem

      public ResultItem(short type, String content)
      Create a new result item.
      Parameters:
      type - The type of the result item (based on type an special icon will be associated).
      content - The content of the result item.
  • Method Details

    • getDisplayTitle

      public String getDisplayTitle()
      Get the display title for the node in the tree.
      Returns:
      displayTitle Display title of the node.
    • setDisplayTooltip

      public void setDisplayTooltip(String displayTooltip)
      Set the display tooltip for the node in the tree.
      Parameters:
      displayTooltip - Display tooltip of the node.
    • getDisplayTooltip

      public String getDisplayTooltip()
      Get the display title for the node in the tree.
      Returns:
      displayTitle Display title of the node.
    • getContent

      public String getContent()
      Get a string representation of the item.
      Returns:
      String representation of the item.
    • setType

      public void setType(short type)
      Set a new type for the result item.
      Parameters:
      type - A new type of the result item.
    • setContent

      public void setContent(String desc)
      Set a new content for the result item.
      Parameters:
      desc - A new content of the result item.
    • getType

      public short getType()
      Get the type of the result item.
      Returns:
      The type of the result item (can be error, more results available, node, atomic or common - if not known)
    • getStartOffset

      public int getStartOffset()
      Get the item start offset.
      Returns:
      The item start offset.
    • getEndOffset

      public int getEndOffset()
      Get the item end offset.
      Returns:
      The item end offset.
    • setStartOffset

      public void setStartOffset(int startOffset)
      Set the item start offset.
      Parameters:
      startOffset - The start offset.
    • setEndOffset

      public void setEndOffset(int endOffset)
      Set the item end offset.
      Parameters:
      endOffset - The endOffset to set.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other result item is "equal to" this one.
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • toString

      public String toString()
      Gets the string representation.
      Overrides:
      toString in class Object
      See Also: