public class ReplPair extends Object implements Comparable<ReplPair>, UnaryOperator<String>
| Modifier and Type | Field and Description |
|---|---|
String |
find
The string to look for.
|
String |
name
The name of this replacement.
|
int |
priority
The priority for this replacement.
|
String |
replace
The string to replace it with.
|
| Constructor and Description |
|---|
ReplPair()
Create a new blank replacement pair.
|
ReplPair(String f,
String r)
Create a new replacement pair with a priority of 1.
|
ReplPair(String f,
String r,
int p)
Create a new replacement pair with a set priority.
|
ReplPair(String f,
String r,
int p,
String n)
Create a new replacement pair with a set priority and name.
|
ReplPair(String f,
String r,
String n)
Create a new named replacement pair with a priority of 1.
|
| Modifier and Type | Method and Description |
|---|---|
String |
apply(String inp) |
int |
compareTo(ReplPair rp) |
static List<ReplPair> |
readList(List<ReplPair> detals,
Scanner scn)
Read a list of replacement pairs from an input source, adding them to
an existing list.
|
static List<ReplPair> |
readList(List<ReplPair> detals,
Scanner scn,
List<ReplError> errs)
Read a list of replacement pairs from an input source, adding them to
an existing list.
|
static List<ReplPair> |
readList(Scanner scn)
Read a list of replacement pairs from an input source.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitidentitypublic int priority
public String name
public String find
public String replace
public ReplPair()
public ReplPair(String f, String r)
f - The string to find.r - The string to replace.public ReplPair(String f, String r, String n)
f - The string to find.r - The string to replace.n - The name of the replacement pair.public ReplPair(String f, String r, int p)
f - The string to find.r - The string to replace.p - The priority for the replacement.public static List<ReplPair> readList(Scanner scn)
scn - The source to read the replacements from.public static List<ReplPair> readList(List<ReplPair> detals, Scanner scn)
detals - The list to add the replacements to.scn - The source to read the replacements from.public static List<ReplPair> readList(List<ReplPair> detals, Scanner scn, List<ReplError> errs)
detals - The list to add the replacements to.scn - The source to read the replacements from.errs - The list to stick errors in.public int compareTo(ReplPair rp)
compareTo in interface Comparable<ReplPair>Copyright © 2019. All rights reserved.