Class Match
- java.lang.Object
-
- com.yahoo.prelude.semantics.engine.Match
-
public class Match extends java.lang.Object
A match- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description Match(FlattenedItem item, java.lang.String replaceValue)
Creates a match
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
TermItem
getItem()
CompositeItem
getParent()
Returns the parent in which the item was matched, or null if the item was root.int
getPosition()
java.lang.String
getReplaceValue()
int
hashCode()
Item
toItem(java.lang.String label)
Returns a new item representing this match
-
-
-
Constructor Detail
-
Match
public Match(FlattenedItem item, java.lang.String replaceValue)
Creates a match- Parameters:
item
- the match to addreplaceValue
- the string to replace this match by, usually the item.getIndexedString() which is what the replace value will be if it is passed as null here
-
-
Method Detail
-
getPosition
public int getPosition()
-
getItem
public TermItem getItem()
-
getReplaceValue
public java.lang.String getReplaceValue()
-
getParent
public CompositeItem getParent()
Returns the parent in which the item was matched, or null if the item was root. Note that the item may subsequently have been removed, so it does not necessarily have this parent
-
toItem
public Item toItem(java.lang.String label)
Returns a new item representing this match
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-