|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.util.UniqueNameGenerator
public final class UniqueNameGenerator
Helper class to create a set of unique names. Unique names are created
by appending a suffix (#<index>) to duplicate names. The name set
is initially created either based on a DataTableSpec (names derived
from column headers) or based on a Set of strings.
This class is probably mostly used to append a set of new columns to
an existing DataTableSpec.
| Constructor Summary | |
|---|---|
UniqueNameGenerator(DataTableSpec spec)
Create name generator, with names reserved from column names. |
|
UniqueNameGenerator(Set<String> names)
Create new name generator with reserved names from argument set. |
|
| Method Summary | |
|---|---|
DataColumnSpec |
newColumn(String suggested,
DataType type)
Call newCreator(String, DataType) and returns the spec created
from it. |
DataColumnSpecCreator |
newCreator(String suggested,
DataType type)
Convenience method to create a new column spec creator with a unique name, see newName(String) for a description on how names are
made unique. |
String |
newName(String suggested)
Create new unique name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UniqueNameGenerator(DataTableSpec spec)
spec - The spec whose name are the initially set of names.public UniqueNameGenerator(Set<String> names)
names - Reserved names, must not be null.| Method Detail |
|---|
public String newName(String suggested)
suggested - The name as suggested
NullPointerException - If the argument is null.
public DataColumnSpecCreator newCreator(String suggested,
DataType type)
newName(String) for a description on how names are
made unique.
suggested - The base nametype - The target column type.
public DataColumnSpec newColumn(String suggested,
DataType type)
newCreator(String, DataType) and returns the spec created
from it.
suggested - The base nametype - The column type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||