public final class IdentityLineSet extends AbstractSet<String>
Fields: style listing, de-duplicated so that two DIFFERENT objects
are never folded into one line.
The listings folded rendered lines case-insensitively. For a case-sensitive name that
deletes output: BigQuery Sales.amount and SALES.amount are columns of two
different tables, yet only one line was printed and nothing said a column had gone.
This set changes exactly one thing: lines that differ only by case AND whose stated
identities differ are kept apart. Byte-identical lines still fold. Everything else folds as it always did — lines still compare case-insensitively,
and a line added without an identity (a star entry, an orphan's missed. line, a
constraint column) still folds with any line of the same text, because nothing proves it
stands for a separate object. So the set can only ever print MORE lines than before, never
fewer.
| Constructor and Description |
|---|
IdentityLineSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String line)
Add a line with no stated identity; it folds with any line of the same text.
|
boolean |
add(String line,
Object identity)
Add a line for a stated object.
|
void |
clear() |
boolean |
contains(Object o) |
static Object |
fieldIdentity(EDbVendor vendor,
String tableLexical,
String tableFallback,
String columnLexical)
Identity of a
table.column line, from the SQL spellings and the vendor's rules. |
Iterator<String> |
iterator() |
int |
size() |
equals, hashCode, removeAlladdAll, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringaddAll, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic IdentityLineSet()
public boolean add(String line)
add in interface Collection<String>add in interface Set<String>add in class AbstractCollection<String>public boolean add(String line, Object identity)
identity - what the line stands for, from fieldIdentity(gudusoft.gsqlparser.EDbVendor, java.lang.String, java.lang.String, java.lang.String); null when unknownpublic boolean contains(Object o)
contains in interface Collection<String>contains in interface Set<String>contains in class AbstractCollection<String>public int size()
size in interface Collection<String>size in interface Set<String>size in class AbstractCollection<String>public void clear()
clear in interface Collection<String>clear in interface Set<String>clear in class AbstractCollection<String>public static Object fieldIdentity(EDbVendor vendor, String tableLexical, String tableFallback, String columnLexical)
table.column line, from the SQL spellings and the vendor's rules.
The two parts are keyed under their own object types because a vendor can treat them
differently: BigQuery compares table names case-sensitively and column names not.tableLexical - the table name as written in SQL (may be qualified); null or empty
when the line's prefix is not a named tabletableFallback - text standing for the prefix when there is no table namecolumnLexical - the column name as written in SQLadd(String, Object), or null when none can be stated