public class ResultItem
extends Object
Represents an item from an multiple result.
-
Field Summary
Fields
static final short
The result item is a common node (we can't tell if it is Atomic or Node).
The content representation of the item.
Use this string in the result set tree for the node to be represented to user.
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
Create a new result item.
-
Method Summary
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
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
Set the display tooltip for the node in the tree.
void
void
Set the item start offset.
void
Set a new type for the result item.
Gets the string representation.
-
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
The content representation of the item.
-
displayTitle
Use this string in the result set tree for the node to be represented to user.
-
-
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.
-
-
-
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
Gets the string representation.
- Overrides:
toString
in class Object
- See Also:
-