NormalizedString allows representing text in a normalized fashion. Strings
with different character case or surrounding whitespace are considered the same.
Used to represent groups of fields, where users may refer to their names using
different character cases or whitespaces.
Where the character case or the surrounding space is relevant, the NormalizedString
will have its isLiteral() method return true, meaning the exact
character case and surrounding whitespaces are required for matching it.
Invoking valueOf(String) with a String surrounded by single quotes
will create a literal NormalizedString. Use literalValueOf(String)
to obtain the same NormalizedString without having to introduce single quotes.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final boolean | |
| private final String | |
| private final String | |
| private static final long | |
| private static final StringCache |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public char | charAt(int
the index of the index)char value to be returnedImplements java. char value at the specified index.
|
| public int | compareTo(NormalizedString
the object to be compared. o)Implements java. |
| public int | Returns: the result ofString#compareTo(String). If this NormalizedString
is a literal, the original argument string will be compared. If this NormalizedString
is not a literal, the result will be from the comparison of the normalized content of both strings
(i.e. surrounding whitespaces and character case differences will be ignored).a plain o)StringImplements java. NormalizedString against a String lexicographically.
|
| public boolean | equals(Object
the reference object with which to compare. anObject)Overrides java. |
| public static StringCache | Returns: the string cache used to storeNormalizedString instances associated with their original String.Returns the internal string cache to allow users to tweak its size limit or clear it when appropriate |
| private static <T extends Collection | |
| private static <T extends Collection | |
| private static <T extends Collection | |
| private static <T extends Collection | |
| public int | |
| public static boolean | Returns: true if any entry has been modified to be a literal, otherwise falsea group of identifiers that may contain ambiguous entries if their character case or surrounding whitespaces is not considered.
This array will be modified. strings)Analyzes a group of NormalizedString to identify any instances whose normalized content will generate clashes. |
| public static boolean | Returns: true if any entry has been modified to be a literal, otherwise falsea group of identifiers that may contain ambiguous entries if their character case or surrounding whitespaces is not considered.
This array will be modified. strings, boolean flag indicating that identifiers are stored in lower case (for compatibility with databases).
If a string has a uppercase character, it means it must become a literal. lowercaseIdentifiers, boolean flag indicating that identifiers are stored in upper case (for compatibility with databases).
If a string has a lowercase character, it means it must become a literal. uppercaseIdentifiers)Analyzes a group of NormalizedString to identify any instances whose normalized content will generate clashes. |
| public boolean | |
| public int | |
| public static NormalizedString | Returns: the literalNormalizedString version of the given string.the input string)StringCreates a literal |
| private String | |
| private static boolean | |
| public CharSequence | subSequence(int
the start index, inclusive start, int the end index, exclusive end)Implements java. CharSequence that is a subsequence of this sequence.
|
| public static NormalizedString[] | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts a collection of plain strings into an array of |
| public static NormalizedString[] | |
| public static String[] | Returns: theString representations of all input strings.the normalized strings to convert to args)StringConverts multiple normalized strings into an array of |
| public static ArrayList | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into an |
| public static ArrayList | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into an |
| public static ArrayList | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static ArrayList | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static HashSet | |
| public static HashSet | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into a |
| public static HashSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static HashSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static NormalizedString[] | Returns: the input string array, withNormalizedString literals in the positions where clashes would originally occur.a group of identifiers that may contain ambiguous entries if their character case or surrounding whitespaces is not considered.
This array will be modified. strings)Analyzes a group of NormalizedString to identify any instances whose normalized content will generate clashes. |
| public static NormalizedString[] | Returns: aNormalizedString array with literals in the positions where clashes would originally occur.a group of identifiers that may contain ambiguous entries if their character case or surrounding whitespaces is not considered. strings)Analyzes a group of String to identify any instances whose normalized content will generate clashes. |
| public static LinkedHashSet | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into a |
| public static LinkedHashSet | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into a |
| public static LinkedHashSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static LinkedHashSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public NormalizedString | Returns: the literal representation of the currentNormalizedStringReturns the literal representation of this |
| public String | toString()
Overrides java. Implements java. |
| public static String[] | Returns: theString representations of all normalized strings.the normalized strings to convert back to to args)StringConverts a collection of normalized strings into an array of |
| public static TreeSet | |
| public static TreeSet | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into a |
| public static TreeSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static TreeSet | Returns: the originalStrings of all input normalized strings.the normalized strings to convert to args)StringConverts multiple normalized strings into a |
| public static NormalizedString[] | Returns: theNormalizedString representations of all input strings.the strings to convert to args)NormalizedStringConverts multiple plain strings into an array of |
| public static NormalizedString | Returns: theNormalizedString of the given object.the input object whose o)String representation will be usedCreates a non-literal |
| public static NormalizedString | |
| public static String | Returns: the original string used to create the given normalized representation.the normalized string string)Converts a |
| hashCode | back to summary |
|---|---|
| private final int hashCode | |
| literal | back to summary |
|---|---|
| private final boolean literal | |
| normalized | back to summary |
|---|---|
| private final String normalized | |
| original | back to summary |
|---|---|
| private final String original | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| stringCache | back to summary |
|---|---|
| private static final StringCache<NormalizedString> stringCache | |
| NormalizedString | back to summary |
|---|---|
| private NormalizedString(String string) | |
| charAt | back to summary |
|---|---|
| public char charAt(int index) Implements java. Doc from java. Returns the If the
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(NormalizedString o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(String o) Implements java. Compares a
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object anObject) 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. | |
| getCache | back to summary |
|---|---|
| public static StringCache Returns the internal string cache to allow users to tweak its size limit or clear it when appropriate
| |
| getCollection | back to summary |
|---|---|
| private static <T extends Collection | |
| getCollection | back to summary |
|---|---|
| private static <T extends Collection | |
| getCollection | back to summary |
|---|---|
| private static <T extends Collection | |
| getStringCollection | back to summary |
|---|---|
| private static <T extends Collection | |
| 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
| |
| identifyLiterals | back to summary |
|---|---|
| public static boolean identifyLiterals(NormalizedString[] strings) Analyzes a group of NormalizedString to identify any instances whose normalized content will generate
clashes. Any clashing entries will be converted to their literal counterparts (using
| |
| identifyLiterals | back to summary |
|---|---|
| public static boolean identifyLiterals(NormalizedString[] strings, boolean lowercaseIdentifiers, boolean uppercaseIdentifiers) Analyzes a group of NormalizedString to identify any instances whose normalized content will generate
clashes. Any clashing entries will be converted to their literal counterparts (using
| |
| isLiteral | back to summary |
|---|---|
| public boolean isLiteral() | |
| length | back to summary |
|---|---|
| public int length() Implements java. Doc from java. Returns the length of this character sequence. The length is the number
of 16-bit
| |
| literalValueOf | back to summary |
|---|---|
| public static NormalizedString literalValueOf(String string) Creates a literal
| |
| normalize | back to summary |
|---|---|
| private String normalize(Object value) | |
| shouldBeLiteral | back to summary |
|---|---|
| private static boolean shouldBeLiteral(String string, boolean lowercaseIdentifiers, boolean uppercaseIdentifiers) | |
| subSequence | back to summary |
|---|---|
| public CharSequence subSequence(int start, int end) Implements java. Doc from java. Returns a
| |
| toArray | back to summary |
|---|---|
| public static NormalizedString[] toArray(Collection<String> args) Converts a collection of plain strings into an array of
| |
| toArray | back to summary |
|---|---|
| public static NormalizedString[] toArray(String... args) Converts multiple plain strings into an array of
| |
| toArray | back to summary |
|---|---|
| public static String[] toArray(NormalizedString... args) Converts multiple normalized strings into an array of
| |
| toArrayList | back to summary |
|---|---|
| public static ArrayList Converts multiple plain strings into an
| |
| toArrayList | back to summary |
|---|---|
| public static ArrayList Converts multiple plain strings into an
| |
| toArrayListOfStrings | back to summary |
|---|---|
| public static ArrayList Converts multiple normalized strings into a
| |
| toArrayListOfStrings | back to summary |
|---|---|
| public static ArrayList Converts multiple normalized strings into a
| |
| toHashSet | back to summary |
|---|---|
| public static HashSet Converts multiple plain strings into a
| |
| toHashSet | back to summary |
|---|---|
| public static HashSet Converts multiple plain strings into a
| |
| toHashSetOfStrings | back to summary |
|---|---|
| public static HashSet Converts multiple normalized strings into a
| |
| toHashSetOfStrings | back to summary |
|---|---|
| public static HashSet Converts multiple normalized strings into a
| |
| toIdentifierGroupArray | back to summary |
|---|---|
| public static NormalizedString[] toIdentifierGroupArray(NormalizedString[] strings) Analyzes a group of NormalizedString to identify any instances whose normalized content will generate
clashes. Any clashing entries will be converted to their literal counterparts (using
| |
| toIdentifierGroupArray | back to summary |
|---|---|
| public static NormalizedString[] toIdentifierGroupArray(String[] strings) Analyzes a group of String to identify any instances whose normalized content will generate
clashes. Any clashing entries will be converted to their literal counterparts (using
| |
| toLinkedHashSet | back to summary |
|---|---|
| public static LinkedHashSet Converts multiple plain strings into a
| |
| toLinkedHashSet | back to summary |
|---|---|
| public static LinkedHashSet Converts multiple plain strings into a
| |
| toLinkedHashSetOfStrings | back to summary |
|---|---|
| public static LinkedHashSet Converts multiple normalized strings into a
| |
| toLinkedHashSetOfStrings | back to summary |
|---|---|
| public static LinkedHashSet Converts multiple normalized strings into a
| |
| toLiteral | back to summary |
|---|---|
| public NormalizedString toLiteral() Returns the literal representation of this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Doc from java. Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence. | |
| toStringArray | back to summary |
|---|---|
| public static String[] toStringArray(Collection<NormalizedString> args) Converts a collection of normalized strings into an array of
| |
| toTreeSet | back to summary |
|---|---|
| public static TreeSet Converts multiple plain strings into a
| |
| toTreeSet | back to summary |
|---|---|
| public static TreeSet Converts multiple plain strings into a
| |
| toTreeSetOfStrings | back to summary |
|---|---|
| public static TreeSet Converts multiple normalized strings into a
| |
| toTreeSetOfStrings | back to summary |
|---|---|
| public static TreeSet Converts multiple normalized strings into a
| |
| toUniqueArray | back to summary |
|---|---|
| public static NormalizedString[] toUniqueArray(String... args) Converts multiple plain strings into an array of
| |
| valueOf | back to summary |
|---|---|
| public static NormalizedString valueOf(Object o) Creates a non-literal
| |
| valueOf | back to summary |
|---|---|
| public static NormalizedString valueOf(String string) Creates a non-literal
| |
| valueOf | back to summary |
|---|---|
| public static String valueOf(NormalizedString string) Converts a
| |