public class Matcher extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Matcher>
Modifier and Type | Class and Description |
---|---|
protected static class |
Matcher.IndexIterator |
protected static class |
Matcher.LTRIterator |
static class |
Matcher.PrecedenceNode |
protected static class |
Matcher.RTLIterator |
Modifier and Type | Field and Description |
---|---|
protected Matcher.PrecedenceNode[] |
after |
protected int |
allocation |
protected Matcher |
alternate |
protected Matcher.PrecedenceNode[] |
before |
protected GroupCache |
cache |
protected int |
childCount |
static java.util.Comparator<SearchConstraint> |
CONSTRAINT_PRIORITY_SORTER |
protected SearchConstraint[] |
constraints |
protected int |
descendantCount |
protected SearchEdge |
edge |
protected EntryBuilder |
entryBuilder |
protected boolean |
exclusionMember |
protected Matcher[] |
exclusions |
protected boolean |
exhaustive |
protected int |
height |
protected int |
id |
protected Matcher.IndexIterator |
indexIterator |
protected boolean |
leftToRight |
protected Matcher |
next |
protected SearchNode |
node |
protected Matcher[] |
options |
protected Matcher |
parent |
protected Matcher |
previous |
protected SearchMode |
searchMode |
protected TargetTree |
targetTree |
protected NodeType |
type |
Constructor and Description |
---|
Matcher(SearchNode node,
SearchEdge edge) |
Modifier and Type | Method and Description |
---|---|
protected void |
allocate() |
protected void |
cacheHits() |
Matcher |
clone() |
void |
close() |
protected void |
commit() |
int |
compareTo(Matcher other) |
void |
deallocate() |
Matcher.PrecedenceNode[] |
getAfter() |
int |
getAllocation() |
Matcher |
getAlternate() |
Matcher.PrecedenceNode[] |
getBefore() |
GroupCache |
getCache() |
int |
getChildCount() |
SearchConstraint[] |
getConstraints() |
int |
getDescendantCount() |
SearchEdge |
getEdge() |
EntryBuilder |
getEntryBuilder() |
Matcher[] |
getExclusions() |
int |
getHeight() |
int |
getId() |
int |
getMaxIndex()
Finds the maximum allowed index for this matcher
considering the allocation of all previous matchers.
|
int |
getMinIndex()
Finds the minimum allowed index for this matcher
considering the allocation of all previous matchers.
|
Matcher |
getNext() |
SearchNode |
getNode() |
Matcher[] |
getOptions() |
Matcher |
getParent() |
Matcher |
getPrevious() |
SearchMode |
getSearchMode() |
TargetTree |
getTargetTree() |
protected void |
innerClose() |
boolean |
isExclusionMember() |
boolean |
isExhaustive() |
boolean |
isLeftToRight() |
boolean |
isLegalIndex(int position) |
void |
link() |
boolean |
matches() |
protected boolean |
matchesConstraints() |
protected boolean |
matchesExclusions()
Returns
true if at least on of the
Matcher instances registered as exclusions
returns a successful match. |
protected boolean |
matchesNext() |
protected boolean |
matchesType() |
void |
prepare() |
protected void |
prepareGroupConstraints() |
void |
setAfter(Matcher.PrecedenceNode[] after) |
void |
setAlternate(Matcher alternate) |
void |
setBefore(Matcher.PrecedenceNode[] before) |
void |
setCache(GroupCache cache) |
void |
setConstraints(SearchConstraint[] constraints) |
void |
setDescendantCount(int descendantCount) |
void |
setEntryBuilder(EntryBuilder entryBuilder) |
void |
setExclusionMember(boolean exclusionMember) |
void |
setExclusions(Matcher[] exclusions) |
void |
setHeight(int height) |
void |
setId(int id) |
void |
setLeftToRight(boolean leftToRight) |
void |
setNext(Matcher next) |
void |
setOptions(Matcher[] options) |
void |
setParent(Matcher parent) |
void |
setPrevious(Matcher previous) |
void |
setSearchMode(SearchMode searchMode) |
void |
setTargetTree(TargetTree targetTree) |
protected final SearchNode node
protected final SearchEdge edge
protected boolean exclusionMember
protected int id
protected SearchConstraint[] constraints
protected Matcher parent
protected Matcher[] exclusions
protected Matcher next
protected Matcher previous
protected Matcher alternate
protected Matcher.PrecedenceNode[] before
protected Matcher.PrecedenceNode[] after
protected Matcher[] options
protected TargetTree targetTree
protected GroupCache cache
protected EntryBuilder entryBuilder
protected int allocation
protected int height
protected int descendantCount
protected int childCount
protected NodeType type
protected boolean exhaustive
protected SearchMode searchMode
protected boolean leftToRight
protected Matcher.IndexIterator indexIterator
public static java.util.Comparator<SearchConstraint> CONSTRAINT_PRIORITY_SORTER
public Matcher(SearchNode node, SearchEdge edge)
public void prepare()
public boolean matches()
protected boolean matchesExclusions()
true
if at least on of the
Matcher
instances registered as exclusions
returns a successful match.protected boolean matchesType()
protected boolean matchesNext()
protected boolean matchesConstraints()
protected void commit()
protected void cacheHits()
public int getAllocation()
public void deallocate()
protected void allocate()
public boolean isLegalIndex(int position)
public int getMinIndex()
public int getMaxIndex()
public int getChildCount()
public SearchNode getNode()
public SearchEdge getEdge()
public int getId()
public SearchConstraint[] getConstraints()
public Matcher getParent()
public Matcher getNext()
public TargetTree getTargetTree()
public GroupCache getCache()
public EntryBuilder getEntryBuilder()
public boolean isExclusionMember()
public Matcher[] getExclusions()
public Matcher getAlternate()
public Matcher.PrecedenceNode[] getBefore()
public Matcher.PrecedenceNode[] getAfter()
public int getHeight()
public int getDescendantCount()
public void setExclusionMember(boolean exclusionMember)
public boolean isLeftToRight()
public void setLeftToRight(boolean leftToRight)
public void setId(int id)
public Matcher getPrevious()
public void setPrevious(Matcher previous)
public void setParent(Matcher parent)
public void setExclusions(Matcher[] exclusions)
public void setNext(Matcher next)
public void setAlternate(Matcher alternate)
public void setBefore(Matcher.PrecedenceNode[] before)
public void setAfter(Matcher.PrecedenceNode[] after)
public Matcher[] getOptions()
public void setOptions(Matcher[] options)
public void setHeight(int height)
public void setDescendantCount(int descendantCount)
public boolean isExhaustive()
public SearchMode getSearchMode()
protected void prepareGroupConstraints()
public void setConstraints(SearchConstraint[] constraints)
public void setTargetTree(TargetTree targetTree)
public void setCache(GroupCache cache)
public void setEntryBuilder(EntryBuilder entryBuilder)
public void setSearchMode(SearchMode searchMode)
protected void innerClose()
public void close()
public void link()
public int compareTo(Matcher other)
compareTo
in interface java.lang.Comparable<Matcher>
Comparable.compareTo(java.lang.Object)
public Matcher clone()
clone
in class java.lang.Object