public class OrderedTableNameMap
extends java.lang.Object
getTableNames().
The map ensures that one table name can only be added once.
TODO In the future it might be discussed if a ListOrderedMap (apache-commons-collections) can/should be used.| Constructor and Description |
|---|
OrderedTableNameMap(boolean caseSensitiveTableNames)
Creates a new map which does strictly force that one table can only occur once.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String tableName,
java.lang.Object object)
Adds the given table name to the map of table names, associating
it with the given object.
|
boolean |
containsTable(java.lang.String tableName)
Checks if this map contains the given table name
|
java.lang.Object |
get(java.lang.String tableName)
Returns the object associated with the given table name
|
java.lang.String |
getLastTableName() |
java.lang.String |
getTableName(java.lang.String tableName)
Returns the table name in the correct case (for example as upper case string)
|
java.lang.String[] |
getTableNames()
Provides the ordered table names having the same order in which the table
names have been added via
add(String, Object). |
boolean |
isLastTable(java.lang.String tableName) |
java.util.Collection |
orderedValues() |
void |
setLastTable(java.lang.String tableName) |
java.lang.String |
toString() |
void |
update(java.lang.String tableName,
java.lang.Object object)
Updates the value associated with the given table name.
|
public OrderedTableNameMap(boolean caseSensitiveTableNames)
caseSensitiveTableNames - Whether or not table names should be case sensitivepublic java.lang.Object get(java.lang.String tableName)
tableName - The table name for which the associated object is retrievedpublic java.lang.String[] getTableNames()
add(String, Object).public boolean containsTable(java.lang.String tableName)
tableName - true if the map of tables contains the given table namepublic boolean isLastTable(java.lang.String tableName)
tableName - The table name to checktrue if the given tableName matches the last table that has been added to this map.public java.lang.String getLastTableName()
null if no
table has been added yet.public void setLastTable(java.lang.String tableName)
throws NoSuchTableException
NoSuchTableExceptionpublic void add(java.lang.String tableName,
java.lang.Object object)
throws AmbiguousTableNameException
tableName - The table name to be addedobject - Object to be associated with the given table name. Can be nullAmbiguousTableNameException - If the given table name already existspublic java.util.Collection orderedValues()
public void update(java.lang.String tableName,
java.lang.Object object)
tableName - The table name for which the association should be updatedobject - The new object to be associated with the given table namepublic java.lang.String getTableName(java.lang.String tableName)
tableName - The input table name to be resolvedpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2002-2018. All Rights Reserved.