public abstract class JoinFixAction
extends java.lang.Object
JoinStarTable
Modifier and Type | Field and Description |
---|---|
static JoinFixAction |
NO_ACTION
Action which causes names to be left alone.
|
Modifier | Constructor and Description |
---|---|
protected |
JoinFixAction(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
ensureUnique(java.lang.String name,
java.util.Collection<java.lang.String> others,
boolean caseSensitive)
Utility method which repeatedly doctors a name until it fails to
match any of the others in a given collection.
|
abstract java.lang.String |
getFixedName(java.lang.String origName,
java.util.Collection<java.lang.String> otherNames)
Returns a, possibly modified, name for a column in the context of
existing column names.
|
static boolean |
isDuplicate(java.lang.String name,
java.util.Collection<java.lang.String> others,
boolean caseSensitive)
Utility method to determine whether a given name is a duplicate of
any in a given collection of other names.
|
static JoinFixAction |
makeNumericDeduplicationAction(java.lang.String delimiter,
boolean caseSensitive)
Returns an action which will deduplicate names by appending a
numeric value to them.
|
static JoinFixAction |
makeRenameAllAction(java.lang.String appendage)
Returns an action for renaming all column names with default options.
|
static JoinFixAction |
makeRenameAllAction(java.lang.String appendage,
boolean caseSensitive,
boolean ensureUnique)
Returns an action for renaming all columns with additional options.
|
static JoinFixAction |
makeRenameDuplicatesAction(java.lang.String appendage)
Returns an action for renaming duplicated column names with
default options.
|
static JoinFixAction |
makeRenameDuplicatesAction(java.lang.String appendage,
boolean caseSensitive,
boolean ensureUnique)
Returns an action for renaming duplicated column names with
additional options.
|
java.lang.String |
toString()
Returns this action's name.
|
public static final JoinFixAction NO_ACTION
protected JoinFixAction(java.lang.String name)
name
- label for this actionpublic abstract java.lang.String getFixedName(java.lang.String origName, java.util.Collection<java.lang.String> otherNames)
origName
- input nameotherNames
- list of names which may be duplicates of
origName
origName
public java.lang.String toString()
toString
in class java.lang.Object
public static boolean isDuplicate(java.lang.String name, java.util.Collection<java.lang.String> others, boolean caseSensitive)
name
- name to testothers
- potential duplicates of name
caseSensitive
- true iff matching is to be done in a
case-sensitive fashionname
matches any of the entries in
others
public static java.lang.String ensureUnique(java.lang.String name, java.util.Collection<java.lang.String> others, boolean caseSensitive)
name
- input nameothers
- list of names that must not matchcaseSensitive
- whether matching others is case sensitivename
but not matching
others
public static JoinFixAction makeRenameDuplicatesAction(java.lang.String appendage)
appendage
- string to append to duplicate columnspublic static JoinFixAction makeRenameDuplicatesAction(java.lang.String appendage, boolean caseSensitive, boolean ensureUnique)
appendage
- string to append to duplicate columnscaseSensitive
- whether duplicate location should be case
sensitiveensureUnique
- if true, every effort will be made to ensure
that the output name matches none of the others;
if false, the output name may still match
(but differently from the input one)public static JoinFixAction makeRenameAllAction(java.lang.String appendage)
appendage
- string to append to columnspublic static JoinFixAction makeRenameAllAction(java.lang.String appendage, boolean caseSensitive, boolean ensureUnique)
appendage
- string to append to columnscaseSensitive
- whether duplicate location should be case
sensitive (only relevant if
ensureUnique
is true)ensureUnique
- if true, every effort will be made to ensure
that the output name matches none of the others;public static JoinFixAction makeNumericDeduplicationAction(java.lang.String delimiter, boolean caseSensitive)
delimiter
- string used to separate main part of name from
numeric partcaseSensitive
- whether duplicate location is case sensitive