private static class PhraseMatcher.Phrase.MatchedComposite extends PhraseMatcher.Phrase.Matched
Modifier and Type | Field and Description |
---|---|
private int |
initialOwnerLength |
private int |
length
The number of phrase items
|
private CompositeItem |
owner
The item having the phrase words as direct descendants
|
private List<String> |
replace
The word to replace by at the given index, or null if none of the phrase words should be replaced
This is either null, or of length
length , with null values where nothing should be replaced |
private int |
startIndex
The (0-base) index of the first phrase word item in the owner
|
private Item |
startItem
The first matched item
|
Constructor and Description |
---|
MatchedComposite(CompositeItem owner,
List<String> replace,
int startIndex,
int length) |
Modifier and Type | Method and Description |
---|---|
private void |
adjustIfBackingChanged()
Detects and attemts to compensate for a changed backing.
|
int |
getBackedLength()
Returns the length of the underlying item
|
TermItem |
getItem(int index) |
int |
getLength() |
CompositeItem |
getOwner() |
String |
getReplace(int index) |
int |
getStartIndex() |
boolean |
hasItemAt(int index)
Returns whether there is an index at the current item
|
boolean |
hasReplaces() |
boolean |
isComplete() |
void |
remove() |
void |
replace() |
private void |
replace(TermItem item,
int index) |
private CompositeItem owner
private int length
private int initialOwnerLength
private int startIndex
private Item startItem
public MatchedComposite(CompositeItem owner, List<String> replace, int startIndex, int length)
public CompositeItem getOwner()
getOwner
in class PhraseMatcher.Phrase.Matched
public int getStartIndex()
getStartIndex
in class PhraseMatcher.Phrase.Matched
public int getLength()
getLength
in class PhraseMatcher.Phrase.Matched
public int getBackedLength()
PhraseMatcher.Phrase.Matched
getBackedLength
in class PhraseMatcher.Phrase.Matched
public boolean hasItemAt(int index)
PhraseMatcher.Phrase.Matched
hasItemAt
in class PhraseMatcher.Phrase.Matched
public boolean isComplete()
isComplete
in class PhraseMatcher.Phrase.Matched
public TermItem getItem(int index)
getItem
in class PhraseMatcher.Phrase.Matched
public String getReplace(int index)
getReplace
in class PhraseMatcher.Phrase.Matched
public void replace()
replace
in class PhraseMatcher.Phrase.Matched
private void replace(TermItem item, int index)
public void remove()
remove
in class PhraseMatcher.Phrase.Matched
public boolean hasReplaces()
hasReplaces
in class PhraseMatcher.Phrase.Matched
private void adjustIfBackingChanged()
Copyright © 2018. All rights reserved.