public class OrderedTwoWayTable
extends java.lang.Object
Constructor and Description |
---|
OrderedTwoWayTable() |
Modifier and Type | Method and Description |
---|---|
protected int |
findIndex(java.util.Vector data,
java.lang.Object target)
Get the index of the target in the table.
|
java.lang.Object |
getKeyAt(int index)
Get the key at the given index.
|
int |
getKeyIndex(java.lang.Object key)
Get the position of the key within the table.
|
int |
getSize()
Get the number of pairs in the table.
|
java.lang.Object |
getValueAt(int index)
Get the value at the given index.
|
int |
getValueIndex(java.lang.Object value)
Get the position of a value within the table.
|
void |
put(java.lang.Object key,
java.lang.Object value)
Put an object in the table.
|
void |
remove(int index)
Remove the object at a specified index.
|
public void put(java.lang.Object key, java.lang.Object value)
key
- the key for this objectvalue
- the object to be stored in the tablepublic int getKeyIndex(java.lang.Object key)
key
- the key whose position is requiredpublic int getValueIndex(java.lang.Object value)
value
- the value whose position is requiredpublic java.lang.Object getValueAt(int index)
index
- the index of the required valuepublic java.lang.Object getKeyAt(int index)
index
- the index of the given keypublic int getSize()
public void remove(int index)
index
- the index of the entry to be removed.protected int findIndex(java.util.Vector data, java.lang.Object target)
data
- the vector in which to searchtarget
- the object to search forCopyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.