Single instance holds a list of tokens. Tokens can be substrings of each other. The implementation performs greedy replacement: longer tokens are replaced first.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private static final Object | |
| private final transient List | |
| private final String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public static TokenReplace | |
| public static Function | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public String | |
| public String |
| NULL_SUPPLIED | back to summary |
|---|---|
| private static final Object NULL_SUPPLIED | |
| regexps | back to summary |
|---|---|
| private final transient List<Pattern> regexps | |
| tokens | back to summary |
|---|---|
| private final String[] tokens | |
| TokenReplace | back to summary |
|---|---|
| public TokenReplace(String... tokens) | |
| applyTo | back to summary |
|---|---|
| public String applyTo(String str, Function<String, Object> tokenValueSupplier) | |
| combine | back to summary |
|---|---|
| public static TokenReplace combine(TokenReplace x, TokenReplace y) | |
| createCachingTokenValueSupplier | back to summary |
|---|---|
| public static Function | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| recursiveApplyTo | back to summary |
|---|---|
| public String recursiveApplyTo(String str, Function<String, Object> tokenValueSupplier) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static TokenReplace. | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public String[] | |
| pack-priv static String[] | |
| public String[] | |
| public String | toString()
Implements abstract java. Returns a string representation of the record. |
| main | back to summary |
|---|---|
| private final String[] main Record Component accessed by main(). | |
| sub | back to summary |
|---|---|
| private final String[] sub Record Component accessed by sub(). | |
| TokenCut | back to summary |
|---|---|
| private TokenCut(String[] main, String[] sub) | |
| createFromOrderedTokens | back to summary |
|---|---|
| pack-priv static TokenReplace. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| main | back to summary |
|---|---|
| public String[] main() Record Component getter of main. | |
| orderTokens | back to summary |
|---|---|
| pack-priv static String[] orderTokens(String... tokens) | |
| sub | back to summary |
|---|---|
| public String[] sub() Record Component getter of sub. | |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |