org.zkoss.util
Class DualCollection

java.lang.Object
  extended by java.util.AbstractCollection
      extended by org.zkoss.util.DualCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection

public class DualCollection
extends java.util.AbstractCollection
implements java.io.Serializable

A combination of two collections into a collection.

Since:
3.0.0
Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
DualCollection(java.util.Collection first, java.util.Collection second)
          Constructor.
 
Method Summary
static java.util.Collection combine(java.util.Collection first, java.util.Collection second)
          Returns a collection by combining two collections.
 java.util.Iterator iterator()
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

DualCollection

public DualCollection(java.util.Collection first,
                      java.util.Collection second)
Constructor. It is better to use combine(java.util.Collection, java.util.Collection) instead of this method since it checks whether any of them is null or equals.

Method Detail

combine

public static final java.util.Collection combine(java.util.Collection first,
                                                 java.util.Collection second)
Returns a collection by combining two collections. It checks whether any of them is null, or equals. And, returns the non-null one if another is null. If both null, it returns null.


size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in class java.util.AbstractCollection

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in class java.util.AbstractCollection


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo