Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.utils.common
Class UniqueIdTable

    java.lang.Object
      oracle.ifs.utils.common.UniqueIdTable

    public class UniqueIdTable

extends java.lang.Object

UniqueIdTable maintains a mapping of unique identification numbers to Object references. The size of a UniqueIdTable is the maximum number of items that can be stored and associated with a unique id number.

Modified:
  lsaenz 07/25/2001 Fixed release off by 1 bug and added DEBUG., lsaenz 07/24/2001 Fixed "size - 1" and "put forever" bugs., lsaenz 07/23/2001 Created.

Constructor Summary
`UniqueIdTable(int size)` Creates a new UniqueIdTable given a size, which will be the maximum number of objects that can be stored and associated with unique id numbers.

Method Summary
`void` | `clear()` Clears this UniqueIdTable.
`java.lang.Object` | `get(int id)` Returns the object that is associated with the given id, or null if there is no such object.
`boolean` | `isFull()` Returns true if no more objects can be stored in this UniqueIdTable and associated with a unique id number.
`int` | `put(java.lang.Object object)` Stores an object in this UniqueIdTable, giving the object a unique id number.
`java.lang.Object` | `remove(int id)` Removes the object that is associated with the given id from this UniqueIdTable.
`java.util.Enumeration` | `uniqueIds()` Returns an Enumeration of the unique id numbers that map to objects in this UniqueIdTable.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### UniqueIdTable

    public UniqueIdTable(int size)

  Creates a new UniqueIdTable given a size, which will be the maximum number of objects that can be stored and associated with unique id numbers.

  Parameters:
    `size` - the size of the new UniqueIdTable.

Method Detail

### clear

    public void clear()

  Description copied from class: `UniqueIdTable`
  Clears this UniqueIdTable. All reserved id numbers are freed and do not map to objects any longer.

### put

    public int put(java.lang.Object object)
            throws TooManyItemsException

  Description copied from class: `UniqueIdTable`
  Stores an object in this UniqueIdTable, giving the object a unique id number.

  Returns:
    a unique id number to refer to the stored object.
  Throws:
    `TooManyItemsException` - if this UniqueIdTable is full.

### get

    public java.lang.Object get(int id)

  Description copied from class: `UniqueIdTable`
  Returns the object that is associated with the given id, or null if there is no such object.

  Parameters:
    `id` - an id number.

### uniqueIds

    public java.util.Enumeration uniqueIds()

  Description copied from class: `UniqueIdTable`
  Returns an Enumeration of the unique id numbers that map to objects in this UniqueIdTable.

  Returns:
    an Enumeration of Integer objects.

### remove

    public java.lang.Object remove(int id)

  Description copied from class: `UniqueIdTable`
  Removes the object that is associated with the given id from this UniqueIdTable. Does nothing if there is no such object.

  Returns:
    the object that was associated with the given id, or null if there was no such object.

### isFull

    public boolean isFull()

  Description copied from class: `UniqueIdTable`
  Returns true if no more objects can be stored in this UniqueIdTable and associated with a unique id number.

  Returns:
    true if this UniqueIdTable is full.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD