SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.rop
Class MergedResultList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.AbstractSequentialList
                    |
                    +--com.solarmetric.rd.rop.MergedResultList
All Implemented Interfaces:
java.util.Collection, java.util.List, ResultList, java.io.Serializable

public class MergedResultList
extends java.util.AbstractSequentialList
implements ResultList

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

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MergedResultList()
          Constructor: create an empty MergedResultList.
MergedResultList(java.util.Collection collection)
          Constructor: create a MergedResultList with the contents of the specified Collection.
MergedResultList(com.solarmetric.rd.rop.ResultList[] lists, java.util.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 ResultLists
 void close()
          Invoke ResultList.close() on all the internally held ResultLists
 boolean equals(java.lang.Object other)
           
 java.lang.Object get(int index)
          Maintain a cache for random access.
 int getInstantiatedCount()
          Sum the results of ResultList.getInstantiatedCount() on all the internally held ResultLists
 int hashCode()
          hashCode is calculated as the sum of all the hashCodes of the internally held lists.
 boolean isClosed()
          Returns true if any of the internally held lists are closed.
 java.util.ListIterator listIterator(int idx)
          Returns a new ResultListIterator for this ResultList that will deal with any ordering necessary.
 int size()
          Size calculation will just sum up the the sized of embedded ResultLists.
 java.lang.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(com.solarmetric.rd.rop.ResultList[] lists,
                        java.util.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(java.util.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 java.lang.Object get(int index)
Maintain a cache for random access.

Specified by:
get in interface java.util.List
Overrides:
get in class java.util.AbstractSequentialList

close

public void close()
Invoke ResultList.close() on all the internally held ResultLists

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 ResultLists

Specified by:
checkClosed in interface ResultList

getInstantiatedCount

public int getInstantiatedCount()
Sum the results of ResultList.getInstantiatedCount() on all the internally held ResultLists

Specified by:
getInstantiatedCount in interface ResultList

writeReplace

public java.lang.Object writeReplace()
                              throws java.io.ObjectStreamException
Convert this object to a LinkedList for serialization

java.io.ObjectStreamException

hashCode

public int hashCode()
hashCode is calculated as the sum of all the hashCodes of the internally held lists.

Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.util.AbstractList

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.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 java.util.List
Specified by:
size in class java.util.AbstractCollection

listIterator

public java.util.ListIterator listIterator(int idx)
Returns a new ResultListIterator for this ResultList that will deal with any ordering necessary.

Specified by:
listIterator in interface java.util.List
Specified by:
listIterator in class java.util.AbstractSequentialList

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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