Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## serp.util
Class OrderedSet

    java.lang.Object
      |
      +--serp.util.OrderedSet

All Implemented Interfaces:
  Collection, Set

Deprecated. Use the Jakarta project's Commons Collections module.

public class OrderedSet
extends Object
implements Set

Ordered set data structure that uses a `HashMap` to optimize accessing random elements in the list. All methods are designed with performance in mind, and all operate in constant time, provided that the hashing function distributes objects among buckets in an optimal manner.

Additionally, this data structure ensures that there is one and only one entry for a given value in the list. So, it has some resemblance to a `Set`.

Note that this data structure is not sorted -- it is merely ordered. The ordering is defined by the order in which elements are put into the set.

Inner Class Summary
`class` | `OrderedSet.OrderedSetIterator` Deprecated.

Field Summary
`protected HashMap` | `elementMap` Deprecated. A map of objects to `Entry` objects in the underlying linked list.
`protected SimpleLinkedList` | `list` Deprecated. The linked list that this set uses to maintain ordering.

Constructor Summary
`OrderedSet()` Deprecated. Create an ordered set using the default constructor for the `HashMap` used for random element access.
`OrderedSet(int initialCapacity)` Deprecated. Create an ordered set using the specified initial capacity for the `HashMap` used for random element access.
`OrderedSet(int initialCapacity, float loadFactor)` Deprecated. Create an ordered set using the specified initial capacity and load factor for the `HashMap` used for random element access.

Method Summary
`boolean` | `add(Object o)` Deprecated. Adds `o` to the end of this ordered set.
`boolean` | `addAll(Collection c)` Deprecated.
`void` | `append(Object o)` Deprecated. Appends `o` to the end of this ordered set, or moves it to the end if it already exists in the set.
`void` | `clear()` Deprecated.
`boolean` | `contains(Object o)` Deprecated.
`boolean` | `containsAll(Collection c)` Deprecated.
`boolean` | `equals(Object ob)` Deprecated.
`Object` | `first()` Deprecated.
`SimpleLinkedList.Entry` | `getEntry(Object o)` Deprecated.
`int` | `hashCode()` Deprecated.
`boolean` | `isEmpty()` Deprecated.
`Iterator` | `iterator()` Deprecated.
`Object` | `last()` Deprecated.
`void` | `prepend(Object o)` Deprecated. Prepends `o` to the end of this ordered set, or moves it to the beginning if it already exists in the set.
`boolean` | `remove(Object o)` Deprecated.
`boolean` | `removeAll(Collection c)` Deprecated.
`Object` | `removeFirst()` Deprecated.
`Object` | `removeLast()` Deprecated.
`boolean` | `retainAll(Collection c)` Deprecated.
`int` | `size()` Deprecated.
`Object[]` | `toArray()` Deprecated.
`Object[]` | `toArray(Object[] a)` Deprecated.

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

Field Detail

### elementMap

    protected HashMap elementMap

  Deprecated.
  A map of objects to `Entry` objects in the underlying linked list. Provides speedy access to random objects in the list.

### list

    protected SimpleLinkedList list

  Deprecated.
  The linked list that this set uses to maintain ordering.

Constructor Detail

### OrderedSet

    public OrderedSet()

  Deprecated.
  Create an ordered set using the default constructor for the `HashMap` used for random element access.

### OrderedSet

    public OrderedSet(int initialCapacity)

  Deprecated.
  Create an ordered set using the specified initial capacity for the `HashMap` used for random element access.

### OrderedSet

    public OrderedSet(int initialCapacity,
                      float loadFactor)

  Deprecated.
  Create an ordered set using the specified initial capacity and load factor for the `HashMap` used for random element access.

Method Detail

### prepend

    public void prepend(Object o)

  Deprecated.
  Prepends `o` to the end of this ordered set, or moves it to the beginning if it already exists in the set.

### append

    public void append(Object o)

  Deprecated.
  Appends `o` to the end of this ordered set, or moves it to the end if it already exists in the set.

### removeFirst

    public Object removeFirst()

  Deprecated.

### removeLast

    public Object removeLast()

  Deprecated.

### getEntry

    public SimpleLinkedList.Entry getEntry(Object o)

  Deprecated.

### first

    public Object first()

  Deprecated.

### last

    public Object last()

  Deprecated.

### size

    public int size()

  Deprecated.
  Specified by:
    `size` in interface `Set`

### isEmpty

    public boolean isEmpty()

  Deprecated.
  Specified by:
    `isEmpty` in interface `Set`

### contains

    public boolean contains(Object o)

  Deprecated.
  Specified by:
    `contains` in interface `Set`

### iterator

    public Iterator iterator()

  Deprecated.
  Specified by:
    `iterator` in interface `Set`

### toArray

    public Object[] toArray()

  Deprecated.
  Specified by:
    `toArray` in interface `Set`

### toArray

    public Object[] toArray(Object[] a)

  Deprecated.
  Specified by:
    `toArray` in interface `Set`

### add

    public boolean add(Object o)

  Deprecated.
  Adds `o` to the end of this ordered set. If `o` is already in this set, does nothing. This differs from the behavior of `append(java.lang.Object)`.
  Specified by:
    `add` in interface `Set`

### remove

    public boolean remove(Object o)

  Deprecated.
  Specified by:
    `remove` in interface `Set`

### containsAll

    public boolean containsAll(Collection c)

  Deprecated.
  Specified by:
    `containsAll` in interface `Set`

### addAll

    public boolean addAll(Collection c)

  Deprecated.
  Specified by:
    `addAll` in interface `Set`

### retainAll

    public boolean retainAll(Collection c)

  Deprecated.
  Specified by:
    `retainAll` in interface `Set`

### removeAll

    public boolean removeAll(Collection c)

  Deprecated.
  Specified by:
    `removeAll` in interface `Set`

### clear

    public void clear()

  Deprecated.
  Specified by:
    `clear` in interface `Set`

### equals

    public boolean equals(Object ob)

  Deprecated.
  Specified by:
    `equals` in interface `Set`
  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Deprecated.
  Specified by:
    `hashCode` in interface `Set`
  Overrides:
    `hashCode` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.