private static class Regex.Rank
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
private java.util.regex.Pattern |
mPattern
The compiled regex expression
|
private int |
mPriority
The inverse of rank.
|
private int |
mRank
The rank value.
|
Constructor and Description |
---|
Regex.Rank(int rank,
java.lang.String regex)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o)
Compares the Rank object with another rank object.
|
void |
computePriority(int maxRank)
Computes priority based on the max rank passed
|
int |
getPriority()
Returns the priority
|
int |
getRank()
Returns the rank associated with it.
|
java.util.regex.Pattern |
getRegex()
Returns the underlying regex pattern associated with the Rank object.
|
boolean |
matches(java.lang.String input)
Matches a string against the compiled regex expression
|
private void |
setPriority(int priority) |
java.lang.String |
toString()
Returns the textual representation of this
|
private int mRank
private int mPriority
private java.util.regex.Pattern mPattern
public Regex.Rank(int rank, java.lang.String regex)
rank
- The rank value.regex
- The regex expression.public boolean matches(java.lang.String input)
input
- the input string to be matchedpublic java.util.regex.Pattern getRegex()
public int getRank()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the object to be compared.public java.lang.String toString()
toString
in class java.lang.Object
public void computePriority(int maxRank)
maxRank
- public int getPriority()
private void setPriority(int priority)