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

## com.solarmetric.kodo.runtime.objectprovider
Class MergedResultList

    java.lang.Object
      |
      +--java.util.AbstractCollection
            |
            +--java.util.AbstractList
                  |
                  +--java.util.AbstractSequentialList
                        |
                        +--com.solarmetric.kodo.runtime.objectprovider.MergedResultList

All Implemented Interfaces:
  Collection, List, ResultList, Serializable

public class MergedResultList
extends AbstractSequentialList
implements ResultList, Serializable

A MergedResultList is a wrapper for multiple instances of a `ResultList` that may be returned. Support exists for maintaining ordering of the internally held results, provided that each of the individual results are themselves ordered and a `Comparator` is provided.

See Also:
  Serialized Form

Inner Class Summary
`protected class` | `MergedResultList.MergedIterator` This iterator provides access to the internally held lists with no support for manual ordering
`protected class` | `MergedResultList.OrderedMergedIterator` This iterator provides support for maintaining result list ordering if a `Comparator` exists for the owning `MergedResultList.MergedIterator`.

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`MergedResultList()` Constructor: create an empty MergedResultList.
`MergedResultList(Collection collection)` Constructor: create a MergedResultList with the contents of the specified `Collection`.
`MergedResultList(ResultList[] lists, Comparator order)` Constructor: create a new `MergedResultList` from the specified array of `ResultList` objects.

Method Summary
`void` | `checkClosed()` Invoke `ResultList.checkClosed()` on all the internally held `ResultList`s
`void` | `close()` Invoke `ResultList.close()` on all the internally held `ResultList`s
`boolean` | `equals(Object other)`
`Object` | `get(int index)` Maintain a cache for random access.
`int` | `getInstantiatedCount()` Sum the results of `ResultList.getInstantiatedCount()` on all the internally held `ResultList`s
`int` | `hashCode()` `hashCode` is calculated as the sum of all the `hashCode`s of the internally held lists.
`boolean` | `isClosed()` Returns true if any of the internally held lists are closed.
`ListIterator` | `listIterator(int idx)` Returns a new `MergedResultList.MergedIterator` for this `ResultList` that will deal with any ordering necessary.
`int` | `size()` Size calculation will just sum up the the sized of embedded ResultLists.
`Object` | `writeReplace()` Convert this object to a `LinkedList` for serialization

Methods inherited from class java.util.AbstractSequentialList
`add, addAll, iterator, remove, set`

Methods inherited from class java.util.AbstractList
`add, clear, indexOf, lastIndexOf, listIterator, removeRange, subList`

Methods inherited from class java.util.AbstractCollection
`addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString`

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

Methods inherited from interface java.util.List
`add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray`

Constructor Detail

### MergedResultList

    public MergedResultList(ResultList[] lists,
                            Comparator order)

  Constructor: create a new `MergedResultList` from the specified array of `ResultList` objects. If a `Comparator` is not null, then ordering will be done in-memory. This requires that each element of the lists array already be ordered according to the rules in the specified `Comparator`. Elements of the lists that are null or of size zero will be excluded.

### MergedResultList

    public MergedResultList()

  Constructor: create an empty MergedResultList. This method only exists because it is suggested by the Collections specification.

### MergedResultList

    public MergedResultList(Collection collection)

  Constructor: create a MergedResultList with the contents of the specified `Collection`. This method only exists because it is suggested by the Collections specification.

Method Detail

### get

    public Object get(int index)

  Maintain a cache for random access.
  Specified by:
    `get` in interface `List`
  Overrides:
    `get` in class `AbstractSequentialList`

### close

    public void close()

  Invoke `ResultList.close()` on all the internally held `ResultList`s
  Specified by:
    `close` in interface `ResultList`

### isClosed

    public boolean isClosed()

  Returns true if any of the internally held lists are closed.
  Specified by:
    `isClosed` in interface `ResultList`

### checkClosed

    public void checkClosed()

  Invoke `ResultList.checkClosed()` on all the internally held `ResultList`s
  Specified by:
    `checkClosed` in interface `ResultList`

### getInstantiatedCount

    public int getInstantiatedCount()

  Sum the results of `ResultList.getInstantiatedCount()` on all the internally held `ResultList`s
  Specified by:
    `getInstantiatedCount` in interface `ResultList`

### writeReplace

    public Object writeReplace()
                        throws ObjectStreamException

  Convert this object to a `LinkedList` for serialization

### hashCode

    public int hashCode()

  `hashCode` is calculated as the sum of all the `hashCode`s of the internally held lists.
  Specified by:
    `hashCode` in interface `List`
  Overrides:
    `hashCode` in class `AbstractList`

### equals

    public boolean equals(Object other)

  Specified by:
    `equals` in interface `List`
  Overrides:
    `equals` in class `AbstractList`

### size

    public final int size()

  Size calculation will just sum up the the sized of embedded ResultLists. This is to retain any potential support for lazy materialization.
  Specified by:
    `size` in interface `List`
  Overrides:
    `size` in class `AbstractCollection`

### listIterator

    public ListIterator listIterator(int idx)

  Returns a new `MergedResultList.MergedIterator` for this `ResultList` that will deal with any ordering necessary. Ordered lists will return an instance of `MergedResultList.OrderedMergedIterator`.
  Specified by:
    `listIterator` in interface `List`
  Overrides:
    `listIterator` in class `AbstractSequentialList`

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.