mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-17 07:26:39 +00:00
Make decorator classes serializable, bug 18815
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131766 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e96040f146
commit
e00f903d7e
BIN
data/test/FixedSizeList.emptyCollection.version3.1.obj
Normal file
BIN
data/test/FixedSizeList.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/FixedSizeList.fullCollection.version3.1.obj
Normal file
BIN
data/test/FixedSizeList.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/ListOrderedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/ListOrderedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/ListOrderedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/ListOrderedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/MapBackedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/MapBackedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/MapBackedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/MapBackedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedBag.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedBag.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedBag.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedBag.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedBuffer.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedBuffer.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedBuffer.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedBuffer.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedCollection.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedCollection.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedCollection.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedCollection.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedList.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedList.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedList.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedList.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSortedBag.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSortedBag.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSortedBag.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSortedBag.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSortedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSortedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/PredicatedSortedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/PredicatedSortedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/SetUniqueList.emptyCollection.version3.1.obj
Normal file
BIN
data/test/SetUniqueList.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/SetUniqueList.fullCollection.version3.1.obj
Normal file
BIN
data/test/SetUniqueList.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/SynchronizedBuffer.emptyCollection.version3.1.obj
Normal file
BIN
data/test/SynchronizedBuffer.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/SynchronizedBuffer.fullCollection.version3.1.obj
Normal file
BIN
data/test/SynchronizedBuffer.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedBag.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedBag.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedBag.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedBag.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedCollection.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedCollection.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedCollection.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedCollection.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedList.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedList.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedList.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedList.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSortedBag.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSortedBag.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSortedBag.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSortedBag.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSortedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSortedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/TransformedSortedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/TransformedSortedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableBuffer.emptyCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableBuffer.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableBuffer.fullCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableBuffer.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableCollection.emptyCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableCollection.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableCollection.fullCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableCollection.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableList.emptyCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableList.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableList.fullCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableList.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableSortedSet.emptyCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableSortedSet.emptyCollection.version3.1.obj
Normal file
Binary file not shown.
BIN
data/test/UnmodifiableSortedSet.fullCollection.version3.1.obj
Normal file
BIN
data/test/UnmodifiableSortedSet.fullCollection.version3.1.obj
Normal file
Binary file not shown.
@ -26,13 +26,21 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||||||
* Methods are forwarded directly to the decorated bag.
|
* Methods are forwarded directly to the decorated bag.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:53:02 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractBagDecorator
|
public abstract class AbstractBagDecorator
|
||||||
extends AbstractCollectionDecorator implements Bag {
|
extends AbstractCollectionDecorator implements Bag {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractBagDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -25,13 +25,21 @@ import org.apache.commons.collections.SortedBag;
|
|||||||
* Methods are forwarded directly to the decorated bag.
|
* Methods are forwarded directly to the decorated bag.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:53:02 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSortedBagDecorator
|
public abstract class AbstractSortedBagDecorator
|
||||||
extends AbstractBagDecorator implements SortedBag {
|
extends AbstractBagDecorator implements SortedBag {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractSortedBagDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -31,9 +31,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the bag.
|
* One usage would be to ensure that no null entries are added to the bag.
|
||||||
* <pre>Bag bag = PredicatedBag.decorate(new HashBag(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>Bag bag = PredicatedBag.decorate(new HashBag(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/05/21 21:38:40 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.SortedBag;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the bag.
|
* One usage would be to ensure that no null entries are added to the bag.
|
||||||
* <pre>SortedBag bag = PredicatedSortedBag.decorate(new TreeBag(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>SortedBag bag = PredicatedSortedBag.decorate(new TreeBag(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/05/21 21:38:40 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -29,9 +29,11 @@ import org.apache.commons.collections.set.TransformedSet;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:27:04 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.Transformer;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:27:04 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.collections.bag;
|
package org.apache.commons.collections.bag;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -26,14 +30,19 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>Bag</code> to ensure it can't be altered.
|
* Decorates another <code>Bag</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.7 $ $Date: 2004/05/15 12:27:04 $
|
* @version $Revision: 1.8 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableBag
|
public final class UnmodifiableBag
|
||||||
extends AbstractBagDecorator implements Unmodifiable {
|
extends AbstractBagDecorator implements Unmodifiable, Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = -1873799975157099624L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable bag.
|
* Factory method to create an unmodifiable bag.
|
||||||
@ -62,6 +71,30 @@ public final class UnmodifiableBag
|
|||||||
super(bag);
|
super(bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the collection out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the collection in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public Iterator iterator() {
|
public Iterator iterator() {
|
||||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.collections.bag;
|
package org.apache.commons.collections.bag;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -26,14 +30,19 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>SortedBag</code> to ensure it can't be altered.
|
* Decorates another <code>SortedBag</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.8 $ $Date: 2004/05/15 12:27:04 $
|
* @version $Revision: 1.9 $ $Date: 2004/06/02 21:56:19 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableSortedBag
|
public final class UnmodifiableSortedBag
|
||||||
extends AbstractSortedBagDecorator implements Unmodifiable {
|
extends AbstractSortedBagDecorator implements Unmodifiable, Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = -3190437252665717841L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable bag.
|
* Factory method to create an unmodifiable bag.
|
||||||
@ -62,6 +71,30 @@ public final class UnmodifiableSortedBag
|
|||||||
super(bag);
|
super(bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the collection out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the collection in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public Iterator iterator() {
|
public Iterator iterator() {
|
||||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||||
|
@ -24,12 +24,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||||||
* Methods are forwarded directly to the decorated buffer.
|
* Methods are forwarded directly to the decorated buffer.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:02 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractBufferDecorator extends AbstractCollectionDecorator implements Buffer {
|
public abstract class AbstractBufferDecorator extends AbstractCollectionDecorator implements Buffer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractBufferDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -29,9 +29,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the buffer.
|
* One usage would be to ensure that no null entries are added to the buffer.
|
||||||
* <pre>Buffer buffer = PredicatedBuffer.decorate(new UnboundedFifoBuffer(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>Buffer buffer = PredicatedBuffer.decorate(new UnboundedFifoBuffer(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/05/21 21:38:48 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:57:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -26,9 +26,11 @@ import org.apache.commons.collections.collection.TransformedCollection;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:57:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.collections.buffer;
|
package org.apache.commons.collections.buffer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
@ -24,13 +28,20 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>Buffer</code> to ensure it can't be altered.
|
* Decorates another <code>Buffer</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/05/15 12:33:23 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:57:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableBuffer extends AbstractBufferDecorator implements Unmodifiable {
|
public final class UnmodifiableBuffer
|
||||||
|
extends AbstractBufferDecorator
|
||||||
|
implements Unmodifiable, Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = 1832948656215393357L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable buffer.
|
* Factory method to create an unmodifiable buffer.
|
||||||
@ -59,6 +70,30 @@ public final class UnmodifiableBuffer extends AbstractBufferDecorator implements
|
|||||||
super(buffer);
|
super(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the collection out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the collection in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public Iterator iterator() {
|
public Iterator iterator() {
|
||||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Iterator;
|
|||||||
* to write an unmodifiable implementation it might provide a loophole.
|
* to write an unmodifiable implementation it might provide a loophole.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:53 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
@ -42,7 +42,15 @@ import java.util.Iterator;
|
|||||||
public abstract class AbstractCollectionDecorator implements Collection {
|
public abstract class AbstractCollectionDecorator implements Collection {
|
||||||
|
|
||||||
/** The collection being decorated */
|
/** The collection being decorated */
|
||||||
protected final Collection collection;
|
protected Collection collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractCollectionDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.commons.collections.collection;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializable subclass of AbstractCollectionDecorator.
|
||||||
|
*
|
||||||
|
* @author Stephen Colebourne
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
public abstract class AbstractSerializableCollectionDecorator
|
||||||
|
extends AbstractCollectionDecorator
|
||||||
|
implements Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = 6249888059822088500L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
protected AbstractSerializableCollectionDecorator(Collection coll) {
|
||||||
|
super(coll);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the collection out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the collection in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -30,14 +30,16 @@ import org.apache.commons.collections.Predicate;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the collection.
|
* One usage would be to ensure that no null entries are added to the collection.
|
||||||
* <pre>Collection coll = PredicatedCollection.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>Collection coll = PredicatedCollection.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/05/21 21:38:40 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:58:06 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
*/
|
*/
|
||||||
public class PredicatedCollection extends AbstractCollectionDecorator {
|
public class PredicatedCollection extends AbstractSerializableCollectionDecorator {
|
||||||
|
|
||||||
/** The predicate to use */
|
/** The predicate to use */
|
||||||
protected final Predicate predicate;
|
protected final Predicate predicate;
|
||||||
|
@ -29,13 +29,15 @@ import org.apache.commons.collections.Transformer;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:39:13 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:58:06 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TransformedCollection extends AbstractCollectionDecorator {
|
public class TransformedCollection extends AbstractSerializableCollectionDecorator {
|
||||||
|
|
||||||
/** The transformer to use */
|
/** The transformer to use */
|
||||||
protected final Transformer transformer;
|
protected final Transformer transformer;
|
||||||
|
@ -30,13 +30,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
* longer accessible.
|
* longer accessible.
|
||||||
* The factory on this class will attempt to retrieve the bounded nature by
|
* The factory on this class will attempt to retrieve the bounded nature by
|
||||||
* examining the package scope variables.
|
* examining the package scope variables.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.8 $ $Date: 2004/05/15 12:39:13 $
|
* @version $Revision: 1.9 $ $Date: 2004/06/02 21:58:06 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableBoundedCollection extends AbstractCollectionDecorator implements BoundedCollection {
|
public final class UnmodifiableBoundedCollection
|
||||||
|
extends AbstractSerializableCollectionDecorator
|
||||||
|
implements BoundedCollection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable bounded collection.
|
* Factory method to create an unmodifiable bounded collection.
|
||||||
|
@ -23,13 +23,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>Collection</code> to ensure it can't be altered.
|
* Decorates another <code>Collection</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/05/15 12:39:13 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:58:06 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableCollection extends AbstractCollectionDecorator implements Unmodifiable {
|
public final class UnmodifiableCollection
|
||||||
|
extends AbstractSerializableCollectionDecorator
|
||||||
|
implements Unmodifiable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable collection.
|
* Factory method to create an unmodifiable collection.
|
||||||
|
@ -27,12 +27,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||||||
* Methods are forwarded directly to the decorated list.
|
* Methods are forwarded directly to the decorated list.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:02 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractListDecorator extends AbstractCollectionDecorator implements List {
|
public abstract class AbstractListDecorator extends AbstractCollectionDecorator implements List {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractListDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.commons.collections.list;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializable subclass of AbstractListDecorator.
|
||||||
|
*
|
||||||
|
* @author Stephen Colebourne
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
public abstract class AbstractSerializableListDecorator
|
||||||
|
extends AbstractListDecorator
|
||||||
|
implements Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = 2684959196747496299L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
protected AbstractSerializableListDecorator(List list) {
|
||||||
|
super(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the list out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the list in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -29,14 +29,18 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
* <p>
|
* <p>
|
||||||
* The add, remove, clear and retain operations are unsupported.
|
* The add, remove, clear and retain operations are unsupported.
|
||||||
* The set method is allowed (as it doesn't change the list size).
|
* The set method is allowed (as it doesn't change the list size).
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
*/
|
*/
|
||||||
public class FixedSizeList extends AbstractListDecorator implements BoundedCollection {
|
public class FixedSizeList
|
||||||
|
extends AbstractSerializableListDecorator
|
||||||
|
implements BoundedCollection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create a fixed size list.
|
* Factory method to create a fixed size list.
|
||||||
|
@ -45,15 +45,17 @@ import org.apache.commons.collections.Factory;
|
|||||||
* a new <code>Date</code> instance. Furthermore, that <code>Date</code>
|
* a new <code>Date</code> instance. Furthermore, that <code>Date</code>
|
||||||
* instance is the fourth element in the list. The first, second,
|
* instance is the fourth element in the list. The first, second,
|
||||||
* and third element are all set to <code>null</code>.
|
* and third element are all set to <code>null</code>.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Arron Bates
|
* @author Arron Bates
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
*/
|
*/
|
||||||
public class LazyList extends AbstractListDecorator {
|
public class LazyList extends AbstractSerializableListDecorator {
|
||||||
|
|
||||||
/** The factory to use to lazily instantiate the objects */
|
/** The factory to use to lazily instantiate the objects */
|
||||||
protected final Factory factory;
|
protected final Factory factory;
|
||||||
|
@ -34,9 +34,11 @@ import org.apache.commons.collections.iterators.AbstractListIteratorDecorator;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the list.
|
* One usage would be to ensure that no null entries are added to the list.
|
||||||
* <pre>List list = PredicatedList.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>List list = PredicatedList.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:40 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -39,14 +39,16 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||||||
* The {@link org.apache.commons.collections.set.ListOrderedSet ListOrderedSet}
|
* The {@link org.apache.commons.collections.set.ListOrderedSet ListOrderedSet}
|
||||||
* class provides an alternative approach, by wrapping an existing Set and
|
* class provides an alternative approach, by wrapping an existing Set and
|
||||||
* retaining insertion order in the iterator.
|
* retaining insertion order in the iterator.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Matthew Hawthorne
|
* @author Matthew Hawthorne
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class SetUniqueList extends AbstractListDecorator {
|
public class SetUniqueList extends AbstractSerializableListDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal Set to maintain uniqueness.
|
* Internal Set to maintain uniqueness.
|
||||||
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.iterators.AbstractListIteratorDecorator;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -26,13 +26,17 @@ import org.apache.commons.collections.iterators.UnmodifiableListIterator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>List</code> to ensure it can't be altered.
|
* Decorates another <code>List</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:12:26 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:59:49 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableList extends AbstractListDecorator implements Unmodifiable {
|
public final class UnmodifiableList
|
||||||
|
extends AbstractSerializableListDecorator
|
||||||
|
implements Unmodifiable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable list.
|
* Factory method to create an unmodifiable list.
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.commons.collections.set;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializable subclass of AbstractSetDecorator.
|
||||||
|
*
|
||||||
|
* @author Stephen Colebourne
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
public abstract class AbstractSerializableSetDecorator
|
||||||
|
extends AbstractSetDecorator
|
||||||
|
implements Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = 1229469966212206107L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
protected AbstractSerializableSetDecorator(Set set) {
|
||||||
|
super(set);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the set out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the set in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -25,12 +25,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||||||
* Methods are forwarded directly to the decorated set.
|
* Methods are forwarded directly to the decorated set.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSetDecorator extends AbstractCollectionDecorator implements Set {
|
public abstract class AbstractSetDecorator extends AbstractCollectionDecorator implements Set {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractSetDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -25,12 +25,20 @@ import java.util.SortedSet;
|
|||||||
* Methods are forwarded directly to the decorated set.
|
* Methods are forwarded directly to the decorated set.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSortedSetDecorator extends AbstractSetDecorator implements SortedSet {
|
public abstract class AbstractSortedSetDecorator extends AbstractSetDecorator implements SortedSet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor only used in deserialization, do not use otherwise.
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
*/
|
||||||
|
protected AbstractSortedSetDecorator() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
|
@ -40,14 +40,16 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
|||||||
* <p>
|
* <p>
|
||||||
* This class cannot implement the <code>List</code> interface directly as
|
* This class cannot implement the <code>List</code> interface directly as
|
||||||
* various interface methods (notably equals/hashCode) are incompatable with a set.
|
* various interface methods (notably equals/hashCode) are incompatable with a set.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Henning P. Schmiedehausen
|
* @author Henning P. Schmiedehausen
|
||||||
*/
|
*/
|
||||||
public class ListOrderedSet extends AbstractSetDecorator implements Set {
|
public class ListOrderedSet extends AbstractSerializableSetDecorator implements Set {
|
||||||
|
|
||||||
/** Internal list to hold the sequence of objects */
|
/** Internal list to hold the sequence of objects */
|
||||||
protected final List setOrder;
|
protected final List setOrder;
|
||||||
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the set.
|
* One usage would be to ensure that no null entries are added to the set.
|
||||||
* <pre>Set set = PredicatedSet.decorate(new HashSet(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>Set set = PredicatedSet.decorate(new HashSet(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:42 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.Predicate;
|
|||||||
* <p>
|
* <p>
|
||||||
* One usage would be to ensure that no null entries are added to the set.
|
* One usage would be to ensure that no null entries are added to the set.
|
||||||
* <pre>SortedSet set = PredicatedSortedSet.decorate(new TreeSet(), NotNullPredicate.INSTANCE);</pre>
|
* <pre>SortedSet set = PredicatedSortedSet.decorate(new TreeSet(), NotNullPredicate.INSTANCE);</pre>
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:42 $
|
* @version $Revision: 1.5 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.collection.TransformedCollection;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.Transformer;
|
|||||||
* Thus objects must be removed or searched for using their transformed form.
|
* Thus objects must be removed or searched for using their transformed form.
|
||||||
* For example, if the transformation converts Strings to Integers, you must
|
* For example, if the transformation converts Strings to Integers, you must
|
||||||
* use the Integer form to remove objects.
|
* use the Integer form to remove objects.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
@ -24,13 +24,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>Set</code> to ensure it can't be altered.
|
* Decorates another <code>Set</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableSet extends AbstractSetDecorator implements Unmodifiable {
|
public final class UnmodifiableSet
|
||||||
|
extends AbstractSerializableSetDecorator
|
||||||
|
implements Unmodifiable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable set.
|
* Factory method to create an unmodifiable set.
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.collections.set;
|
package org.apache.commons.collections.set;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
@ -24,13 +28,20 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorates another <code>SortedSet</code> to ensure it can't be altered.
|
* Decorates another <code>SortedSet</code> to ensure it can't be altered.
|
||||||
|
* <p>
|
||||||
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:14:27 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:02:34 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator implements Unmodifiable {
|
public final class UnmodifiableSortedSet
|
||||||
|
extends AbstractSortedSetDecorator
|
||||||
|
implements Unmodifiable, Serializable {
|
||||||
|
|
||||||
|
/** Serialization version */
|
||||||
|
private static final long serialVersionUID = -725356885467962424L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method to create an unmodifiable set.
|
* Factory method to create an unmodifiable set.
|
||||||
@ -45,6 +56,30 @@ public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator impl
|
|||||||
return new UnmodifiableSortedSet(set);
|
return new UnmodifiableSortedSet(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Write the collection out using a custom routine.
|
||||||
|
*
|
||||||
|
* @param out the output stream
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
|
out.defaultWriteObject();
|
||||||
|
out.writeObject(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the collection in using a custom routine.
|
||||||
|
*
|
||||||
|
* @param in the input stream
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
*/
|
||||||
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
|
in.defaultReadObject();
|
||||||
|
collection = (Collection) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
|
@ -15,18 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.collections;
|
package org.apache.commons.collections;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.commons.collections.buffer.PredicatedBuffer;
|
import org.apache.commons.collections.buffer.PredicatedBuffer;
|
||||||
import org.apache.commons.collections.collection.AbstractTestCollection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for BufferUtils.
|
* Tests for BufferUtils.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.12 $ $Date: 2004/02/18 01:20:35 $
|
* @version $Revision: 1.13 $ $Date: 2004/06/02 22:12:14 $
|
||||||
*
|
*
|
||||||
* @author Unknown
|
* @author Unknown
|
||||||
*/
|
*/
|
||||||
@ -67,38 +63,4 @@ public class TestBufferUtils extends BulkTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BulkTest bulkTestUnmodifiableBuffer() {
|
|
||||||
return new AbstractTestCollection("") {
|
|
||||||
public boolean isAddSupported() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRemoveSupported() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection makeCollection() {
|
|
||||||
return BufferUtils.unmodifiableBuffer(new ArrayStack());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection makeFullCollection() {
|
|
||||||
ArrayStack a = new ArrayStack();
|
|
||||||
a.addAll(Arrays.asList(getFullElements()));
|
|
||||||
return BufferUtils.unmodifiableBuffer(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Collection makeConfirmedCollection() {
|
|
||||||
return new ArrayStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Collection makeConfirmedFullCollection() {
|
|
||||||
ArrayStack a = new ArrayStack();
|
|
||||||
a.addAll(Arrays.asList(getFullElements()));
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -22,13 +22,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
|
||||||
import org.apache.commons.collections.list.PredicatedList;
|
import org.apache.commons.collections.list.PredicatedList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for ListUtils.
|
* Tests for ListUtils.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.18 $ $Date: 2004/02/18 01:20:35 $
|
* @version $Revision: 1.19 $ $Date: 2004/06/02 22:12:14 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Neil O'Toole
|
* @author Neil O'Toole
|
||||||
@ -73,34 +72,6 @@ public class TestListUtils extends BulkTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulkTest bulkTestTypedList() {
|
|
||||||
return new TestTypedCollection("") {
|
|
||||||
|
|
||||||
public Collection typedCollection() {
|
|
||||||
Class type = getType();
|
|
||||||
return ListUtils.typedList(new ArrayList(), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BulkTest bulkTestAll() {
|
|
||||||
return new AbstractTestList("") {
|
|
||||||
public List makeEmptyList() {
|
|
||||||
return (List)typedCollection();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getFullElements() {
|
|
||||||
return getFullNonNullStringElements();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getOtherElements() {
|
|
||||||
return getOtherNonNullStringElements();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void testLazyList() {
|
public void testLazyList() {
|
||||||
List list = ListUtils.lazyList(new ArrayList(), new Factory() {
|
List list = ListUtils.lazyList(new ArrayList(), new Factory() {
|
||||||
|
|
||||||
|
@ -22,13 +22,12 @@ import java.util.Set;
|
|||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.commons.collections.set.AbstractTestSet;
|
|
||||||
import org.apache.commons.collections.set.PredicatedSet;
|
import org.apache.commons.collections.set.PredicatedSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for SetUtils.
|
* Tests for SetUtils.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.15 $ $Date: 2004/02/18 01:20:35 $
|
* @version $Revision: 1.16 $ $Date: 2004/06/02 22:12:14 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Neil O'Toole
|
* @author Neil O'Toole
|
||||||
@ -70,33 +69,6 @@ public class TestSetUtils extends BulkTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BulkTest bulkTestTypedSet() {
|
|
||||||
return new TestTypedCollection("") {
|
|
||||||
|
|
||||||
public Collection typedCollection() {
|
|
||||||
Class type = getType();
|
|
||||||
return SetUtils.typedSet(new HashSet(), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BulkTest bulkTestAll() {
|
|
||||||
return new AbstractTestSet("") {
|
|
||||||
public Set makeEmptySet() {
|
|
||||||
return (Set)typedCollection();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getFullElements() {
|
|
||||||
return getFullNonNullStringElements();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getOtherElements() {
|
|
||||||
return getOtherNonNullStringElements();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testEquals() {
|
public void testEquals() {
|
||||||
Collection data = Arrays.asList( new String[] { "a", "b", "c" });
|
Collection data = Arrays.asList( new String[] { "a", "b", "c" });
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -123,4 +123,21 @@ public class TestPredicatedBag extends AbstractTestBag {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// Bag bag = makeBag();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedBag.emptyCollection.version3.1.obj");
|
||||||
|
// bag = makeBag();
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("C");
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedBag.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import org.apache.commons.collections.SortedBag;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.7 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -103,4 +103,21 @@ public class TestPredicatedSortedBag extends AbstractTestSortedBag {
|
|||||||
Comparator c = bag.comparator();
|
Comparator c = bag.comparator();
|
||||||
assertTrue("natural order, so comparator should be null", c == null);
|
assertTrue("natural order, so comparator should be null", c == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// Bag bag = makeBag();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedSortedBag.emptyCollection.version3.1.obj");
|
||||||
|
// bag = makeBag();
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("C");
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedSortedBag.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -64,4 +64,21 @@ public class TestTransformedBag extends AbstractTestBag {
|
|||||||
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// Bag bag = makeBag();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedBag.emptyCollection.version3.1.obj");
|
||||||
|
// bag = makeBag();
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("C");
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedBag.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -62,4 +62,21 @@ public class TestTransformedSortedBag extends AbstractTestSortedBag {
|
|||||||
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// Bag bag = makeBag();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedSortedBag.emptyCollection.version3.1.obj");
|
||||||
|
// bag = makeBag();
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("A");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("B");
|
||||||
|
// bag.add("C");
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedSortedBag.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import org.apache.commons.collections.Bag;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -115,4 +115,9 @@ public class TestTypedBag extends AbstractTestBag {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean skipSerializedCanonicalTests() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import org.apache.commons.collections.SortedBag;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.7 $ $Date: 2004/02/18 01:20:39 $
|
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:05:03 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -93,4 +93,9 @@ public class TestTypedSortedBag extends AbstractTestSortedBag {
|
|||||||
Comparator c = bag.comparator();
|
Comparator c = bag.comparator();
|
||||||
assertTrue("natural order, so comparator should be null", c == null);
|
assertTrue("natural order, so comparator should be null", c == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean skipSerializedCanonicalTests() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import junit.framework.TestSuite;
|
|||||||
* Entry point for tests.
|
* Entry point for tests.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:37 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:54 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -49,7 +49,9 @@ public class TestAll extends TestCase {
|
|||||||
|
|
||||||
suite.addTest(TestBlockingBuffer.suite());
|
suite.addTest(TestBlockingBuffer.suite());
|
||||||
suite.addTest(TestPredicatedBuffer.suite());
|
suite.addTest(TestPredicatedBuffer.suite());
|
||||||
|
suite.addTest(TestSynchronizedBuffer.suite());
|
||||||
suite.addTest(TestTransformedBuffer.suite());
|
suite.addTest(TestTransformedBuffer.suite());
|
||||||
|
suite.addTest(TestUnmodifiableBuffer.suite());
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.collection.TestPredicatedCollection;
|
|||||||
* {@link PredicatedBuffer} implementation.
|
* {@link PredicatedBuffer} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:20:37 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:05:54 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -101,4 +101,16 @@ public class TestPredicatedBuffer extends TestPredicatedCollection {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedBuffer.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedBuffer.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.commons.collections.buffer;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.ArrayStack;
|
||||||
|
import org.apache.commons.collections.Buffer;
|
||||||
|
import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension of {@link AbstractTestCollection} for exercising the
|
||||||
|
* {@link SynchronizedBuffer} implementation.
|
||||||
|
*
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
* @version $Revision: 1.1 $ $Date: 2004/06/02 22:05:54 $
|
||||||
|
*
|
||||||
|
* @author Phil Steitz
|
||||||
|
* @author Stephen Colebourne
|
||||||
|
*/
|
||||||
|
public class TestSynchronizedBuffer extends AbstractTestCollection {
|
||||||
|
|
||||||
|
public TestSynchronizedBuffer(String testName) {
|
||||||
|
super(testName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new TestSuite(TestSynchronizedBuffer.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
String[] testCaseName = { TestSynchronizedBuffer.class.getName()};
|
||||||
|
junit.textui.TestRunner.main(testCaseName);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
public Collection makeCollection() {
|
||||||
|
return SynchronizedBuffer.decorate(new UnboundedFifoBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeFullCollection() {
|
||||||
|
Buffer buffer = new UnboundedFifoBuffer();
|
||||||
|
buffer.addAll(Arrays.asList(getFullElements()));
|
||||||
|
return SynchronizedBuffer.decorate(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeConfirmedCollection() {
|
||||||
|
ArrayStack list = new ArrayStack();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeConfirmedFullCollection() {
|
||||||
|
ArrayStack list = new ArrayStack();
|
||||||
|
list.addAll(Arrays.asList(getFullElements()));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNullSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedBuffer.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedBuffer.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2004 The Apache Software Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.commons.collections.buffer;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.ArrayStack;
|
||||||
|
import org.apache.commons.collections.Buffer;
|
||||||
|
import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension of {@link AbstractTestCollection} for exercising the
|
||||||
|
* {@link UnmodifiableBuffer} implementation.
|
||||||
|
*
|
||||||
|
* @since Commons Collections 3.1
|
||||||
|
* @version $Revision: 1.1 $ $Date: 2004/06/02 22:05:54 $
|
||||||
|
*
|
||||||
|
* @author Phil Steitz
|
||||||
|
* @author Stephen Colebourne
|
||||||
|
*/
|
||||||
|
public class TestUnmodifiableBuffer extends AbstractTestCollection {
|
||||||
|
|
||||||
|
public TestUnmodifiableBuffer(String testName) {
|
||||||
|
super(testName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new TestSuite(TestUnmodifiableBuffer.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
String[] testCaseName = { TestUnmodifiableBuffer.class.getName()};
|
||||||
|
junit.textui.TestRunner.main(testCaseName);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
public Collection makeCollection() {
|
||||||
|
return UnmodifiableBuffer.decorate(new UnboundedFifoBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeFullCollection() {
|
||||||
|
Buffer buffer = new UnboundedFifoBuffer();
|
||||||
|
buffer.addAll(Arrays.asList(getFullElements()));
|
||||||
|
return UnmodifiableBuffer.decorate(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeConfirmedCollection() {
|
||||||
|
ArrayStack list = new ArrayStack();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection makeConfirmedFullCollection() {
|
||||||
|
ArrayStack list = new ArrayStack();
|
||||||
|
list.addAll(Arrays.asList(getFullElements()));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAddSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRemoveSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNullSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testBufferRemove() {
|
||||||
|
resetEmpty();
|
||||||
|
Buffer buffer = (Buffer) collection;
|
||||||
|
try {
|
||||||
|
buffer.remove();
|
||||||
|
fail();
|
||||||
|
} catch (UnsupportedOperationException ex) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableBuffer.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableBuffer.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||||||
* {@link PredicatedCollection} implementation.
|
* {@link PredicatedCollection} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:20:40 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:06:33 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
@ -50,7 +50,7 @@ public class TestPredicatedCollection extends AbstractTestCollection {
|
|||||||
junit.textui.TestRunner.main(testCaseName);
|
junit.textui.TestRunner.main(testCaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
protected Predicate truePredicate = PredicateUtils.truePredicate();
|
protected Predicate truePredicate = PredicateUtils.truePredicate();
|
||||||
|
|
||||||
@ -131,4 +131,15 @@ public class TestPredicatedCollection extends AbstractTestCollection {
|
|||||||
!c.contains("four"));
|
!c.contains("four"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedCollection.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedCollection.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.TransformerUtils;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2004/04/10 22:22:57 $
|
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:06:33 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -104,4 +104,15 @@ public class TestTransformedCollection extends AbstractTestCollection {
|
|||||||
assertEquals(true, coll.remove(new Integer((String) els[0])));
|
assertEquals(true, coll.remove(new Integer((String) els[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/TransformedCollection.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/TransformedCollection.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import junit.framework.TestSuite;
|
|||||||
* {@link UnmodifiableCollection} implementation.
|
* {@link UnmodifiableCollection} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:20:40 $
|
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:06:33 $
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
@ -78,4 +78,15 @@ public class TestUnmodifiableCollection extends AbstractTestCollection {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableCollection.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableCollection.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import junit.framework.TestSuite;
|
|||||||
* Entry point for tests.
|
* Entry point for tests.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.7 $ $Date: 2004/06/01 23:08:04 $
|
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:07:53 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -50,7 +50,7 @@ public class TestAll extends TestCase {
|
|||||||
suite.addTest(TestSetUniqueList.suite());
|
suite.addTest(TestSetUniqueList.suite());
|
||||||
suite.addTest(TestSynchronizedList.suite());
|
suite.addTest(TestSynchronizedList.suite());
|
||||||
suite.addTest(TestTransformedList.suite());
|
suite.addTest(TestTransformedList.suite());
|
||||||
// suite.addTest(TestTypedList.suite());
|
suite.addTest(TestTypedList.suite());
|
||||||
suite.addTest(TestUnmodifiableList.suite());
|
suite.addTest(TestUnmodifiableList.suite());
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
|
@ -27,7 +27,7 @@ import junit.framework.TestSuite;
|
|||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:20:34 $
|
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:07:53 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
@ -64,4 +64,15 @@ public class TestFixedSizeList extends AbstractTestList {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompatibilityVersion() {
|
||||||
|
return "3.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void testCreate() throws Exception {
|
||||||
|
// resetEmpty();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/FixedSizeList.emptyCollection.version3.1.obj");
|
||||||
|
// resetFull();
|
||||||
|
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/FixedSizeList.fullCollection.version3.1.obj");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user