org.apache.pivot.wtk
Class TableView.SortDictionary

java.lang.Object
  extended by org.apache.pivot.wtk.TableView.SortDictionary
All Implemented Interfaces:
Iterable<String>, Dictionary<String,SortDirection>
Enclosing class:
TableView

public final class TableView.SortDictionary
extends Object
implements Dictionary<String,SortDirection>, Iterable<String>

Sort dictionary implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Dictionary
Dictionary.Pair<K,V>
 
Constructor Summary
TableView.SortDictionary()
           
 
Method Summary
 boolean containsKey(String columnName)
          Tests the existence of a key in the dictionary.
 Dictionary.Pair<String,SortDirection> get(int index)
           
 SortDirection get(String columnName)
          Retrieves the value for the given key.
 int getLength()
           
 boolean isEmpty()
           
 Iterator<String> iterator()
           
 SortDirection put(String columnName, SortDirection sortDirection)
          Sets the value of the given key, creating a new entry or replacing the existing value.
 SortDirection remove(String columnName)
          Removes a key/value pair from the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableView.SortDictionary

public TableView.SortDictionary()
Method Detail

get

public SortDirection get(String columnName)
Description copied from interface: Dictionary
Retrieves the value for the given key.

Specified by:
get in interface Dictionary<String,SortDirection>
Parameters:
columnName - The key whose value is to be returned.
Returns:
The value corresponding to key, or null if the key does not exist. Will also return null if the key refers to a null value. Use containsKey() to distinguish between these two cases.

put

public SortDirection put(String columnName,
                         SortDirection sortDirection)
Description copied from interface: Dictionary
Sets the value of the given key, creating a new entry or replacing the existing value.

Specified by:
put in interface Dictionary<String,SortDirection>
Parameters:
columnName - The key whose value is to be set.
sortDirection - The value to be associated with the given key.
Returns:
The value previously associated with the key.

remove

public SortDirection remove(String columnName)
Description copied from interface: Dictionary
Removes a key/value pair from the map.

Specified by:
remove in interface Dictionary<String,SortDirection>
Parameters:
columnName - The key whose mapping is to be removed.
Returns:
The value that was removed.

containsKey

public boolean containsKey(String columnName)
Description copied from interface: Dictionary
Tests the existence of a key in the dictionary.

Specified by:
containsKey in interface Dictionary<String,SortDirection>
Parameters:
columnName - The key whose presence in the dictionary is to be tested.
Returns:
true if the key exists in the dictionary; false, otherwise.

isEmpty

public boolean isEmpty()

get

public Dictionary.Pair<String,SortDirection> get(int index)

getLength

public int getLength()

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>