Class Regex.Rank
- java.lang.Object
-
- edu.isi.pegasus.planner.selector.replica.Regex.Rank
-
- All Implemented Interfaces:
java.lang.Comparable
- Enclosing class:
- Regex
private static class Regex.Rank extends java.lang.Object implements java.lang.Comparable
A Data class that allows us to compile a regex expression and associate a rank value with it.
-
-
Constructor Summary
Constructors Constructor Description Rank(int rank, java.lang.String regex)
The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 passedint
getPriority()
Returns the priorityint
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 expressionprivate void
setPriority(int priority)
java.lang.String
toString()
Returns the textual representation of this
-
-
-
Method Detail
-
matches
public boolean matches(java.lang.String input)
Matches a string against the compiled regex expression- Parameters:
input
- the input string to be matched- Returns:
- boolean indicating whether input matches or not.
-
getRegex
public java.util.regex.Pattern getRegex()
Returns the underlying regex pattern associated with the Rank object.- Returns:
- the regex pattern
-
getRank
public int getRank()
Returns the rank associated with it.- Returns:
- the int value of the rank
-
compareTo
public int compareTo(java.lang.Object o)
Compares the Rank object with another rank object.- Specified by:
compareTo
in interfacejava.lang.Comparable
- Parameters:
o
- the object to be compared.- Returns:
- int
-
toString
public java.lang.String toString()
Returns the textual representation of this- Overrides:
toString
in classjava.lang.Object
-
computePriority
public void computePriority(int maxRank)
Computes priority based on the max rank passed- Parameters:
maxRank
- the maximum rank
-
getPriority
public int getPriority()
Returns the priority- Returns:
- priority
-
setPriority
private void setPriority(int priority)
-
-