Update licence
Update since and version tags git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60aa1d0752
commit
9340ca5e76
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/CollatingIterator.java,v 1.4 2002/12/13 11:03:42 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/CollatingIterator.java,v 1.5 2003/01/15 21:45:23 scolebourne Exp $
|
||||||
* $Revision: 1.4 $
|
|
||||||
* $Date: 2002/12/13 11:03:42 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -68,6 +65,7 @@ import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an ordered iteration over the elements contained in
|
* Provides an ordered iteration over the elements contained in
|
||||||
* a collection of ordered {@link Iterator}s. In other words,
|
* a collection of ordered {@link Iterator}s. In other words,
|
||||||
|
@ -75,10 +73,11 @@ import java.util.BitSet;
|
||||||
* my {@link #next} method will return the lesser of
|
* my {@link #next} method will return the lesser of
|
||||||
* <code>A.next()</code> and <code>B.next()</code>.
|
* <code>A.next()</code> and <code>B.next()</code>.
|
||||||
*
|
*
|
||||||
* @since 2.1
|
* @since Commons Collections 2.1
|
||||||
|
* @version $Revision: 1.5 $ $Date: 2003/01/15 21:45:23 $
|
||||||
|
*
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
|
* @author Stephen Colebourne
|
||||||
* @version $Revision: 1.4 $ $Date: 2002/12/13 11:03:42 $
|
|
||||||
*/
|
*/
|
||||||
public class CollatingIterator implements Iterator {
|
public class CollatingIterator implements Iterator {
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java,v 1.2 2003/01/15 21:45:23 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -64,13 +61,16 @@ import java.util.Collection;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/** Adapter to make {@link Enumeration Enumeration} instances appear
|
/**
|
||||||
* to be {@link Iterator Iterator} instances.
|
* Adapter to make {@link Enumeration Enumeration} instances appear
|
||||||
*
|
* to be {@link Iterator Iterator} instances.
|
||||||
* @since 1.0
|
*
|
||||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
* @since Commons Collections 1.0
|
||||||
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:45:23 $
|
||||||
*/
|
*
|
||||||
|
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||||
|
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
|
||||||
|
*/
|
||||||
public class EnumerationIterator implements Iterator {
|
public class EnumerationIterator implements Iterator {
|
||||||
|
|
||||||
private Collection collection;
|
private Collection collection;
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/FilterIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/FilterIterator.java,v 1.2 2003/01/15 21:45:23 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -64,18 +61,19 @@ import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import org.apache.commons.collections.Predicate;
|
import org.apache.commons.collections.Predicate;
|
||||||
|
|
||||||
|
/**
|
||||||
/** A Proxy {@link Iterator Iterator} which takes a {@link Predicate Predicate} instance to filter
|
* A Proxy {@link Iterator Iterator} which takes a {@link Predicate Predicate} instance to filter
|
||||||
* out objects from an underlying {@link Iterator Iterator} instance.
|
* out objects from an underlying {@link Iterator Iterator} instance.
|
||||||
* Only objects for which the
|
* Only objects for which the
|
||||||
* specified <code>Predicate</code> evaluates to <code>true</code> are
|
* specified <code>Predicate</code> evaluates to <code>true</code> are
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* @since 1.0
|
* @since Commons Collections 1.0
|
||||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:45:23 $
|
||||||
* @author Jan Sorensen
|
*
|
||||||
*/
|
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||||
|
* @author Jan Sorensen
|
||||||
|
*/
|
||||||
public class FilterIterator extends ProxyIterator {
|
public class FilterIterator extends ProxyIterator {
|
||||||
|
|
||||||
/** Holds value of property predicate. */
|
/** Holds value of property predicate. */
|
||||||
|
@ -88,31 +86,32 @@ public class FilterIterator extends ProxyIterator {
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterIterator</Code> that will not function
|
* Constructs a new <Code>FilterIterator</Code> that will not function
|
||||||
* until {@link #setIterator(Iterator) setIterator} is invoked.
|
* until {@link #setIterator(Iterator) setIterator} is invoked.
|
||||||
*/
|
*/
|
||||||
public FilterIterator() {
|
public FilterIterator() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterIterator</Code> that will not function
|
* Constructs a new <Code>FilterIterator</Code> that will not function
|
||||||
* until {@link #setPredicate(Predicate) setPredicate} is invoked.
|
* until {@link #setPredicate(Predicate) setPredicate} is invoked.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
*/
|
*/
|
||||||
public FilterIterator( Iterator iterator ) {
|
public FilterIterator(Iterator iterator) {
|
||||||
super( iterator );
|
super(iterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterIterator</Code> that will use the
|
* Constructs a new <Code>FilterIterator</Code> that will use the
|
||||||
* given iterator and predicate.
|
* given iterator and predicate.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
* @param predicate the predicate to use
|
* @param predicate the predicate to use
|
||||||
*/
|
*/
|
||||||
public FilterIterator( Iterator iterator, Predicate predicate ) {
|
public FilterIterator(Iterator iterator, Predicate predicate) {
|
||||||
super( iterator );
|
super(iterator);
|
||||||
this.predicate = predicate;
|
this.predicate = predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/FilterListIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/FilterListIterator.java,v 1.2 2003/01/15 21:45:23 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -65,17 +62,18 @@ import java.util.NoSuchElementException;
|
||||||
import org.apache.commons.collections.Predicate;
|
import org.apache.commons.collections.Predicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A proxy {@link ListIterator ListIterator} which
|
* A proxy {@link ListIterator ListIterator} which
|
||||||
* takes a {@link Predicate Predicate} instance to filter
|
* takes a {@link Predicate Predicate} instance to filter
|
||||||
* out objects from an underlying <code>ListIterator</code>
|
* out objects from an underlying <code>ListIterator</code>
|
||||||
* instance. Only objects for which the specified
|
* instance. Only objects for which the specified
|
||||||
* <code>Predicate</code> evaluates to <code>true</code> are
|
* <code>Predicate</code> evaluates to <code>true</code> are
|
||||||
* returned by the iterator.
|
* returned by the iterator.
|
||||||
*
|
*
|
||||||
* @since 2.0
|
* @since Commons Collections 2.0
|
||||||
* @version $Revision: 1.1 $ $Date: 2002/08/15 23:13:51 $
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:45:23 $
|
||||||
* @author Rodney Waldhoff
|
*
|
||||||
*/
|
* @author Rodney Waldhoff
|
||||||
|
*/
|
||||||
public class FilterListIterator extends ProxyListIterator {
|
public class FilterListIterator extends ProxyListIterator {
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -88,23 +86,24 @@ public class FilterListIterator extends ProxyListIterator {
|
||||||
* and {@link #setPredicate(Predicate) setPredicate} are invoked.
|
* and {@link #setPredicate(Predicate) setPredicate} are invoked.
|
||||||
*/
|
*/
|
||||||
public FilterListIterator() {
|
public FilterListIterator() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterListIterator</Code> that will not
|
* Constructs a new <Code>FilterListIterator</Code> that will not
|
||||||
* function until {@link #setPredicate(Predicate) setPredicate} is invoked.
|
* function until {@link #setPredicate(Predicate) setPredicate} is invoked.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
*/
|
*/
|
||||||
public FilterListIterator(ListIterator iterator ) {
|
public FilterListIterator(ListIterator iterator ) {
|
||||||
super(iterator);
|
super(iterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterListIterator</Code>.
|
* Constructs a new <Code>FilterListIterator</Code>.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
* @param predicate the predicate to use
|
* @param predicate the predicate to use
|
||||||
*/
|
*/
|
||||||
public FilterListIterator(ListIterator iterator, Predicate predicate) {
|
public FilterListIterator(ListIterator iterator, Predicate predicate) {
|
||||||
super(iterator);
|
super(iterator);
|
||||||
|
@ -112,14 +111,15 @@ public class FilterListIterator extends ProxyListIterator {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>FilterListIterator</Code> that will not
|
* Constructs a new <Code>FilterListIterator</Code> that will not
|
||||||
* function until
|
* function until
|
||||||
* {@link ProxyListIterator#setListIterator(ListIterator) setListIterator}
|
* {@link ProxyListIterator#setListIterator(ListIterator) setListIterator}
|
||||||
* is invoked.
|
* is invoked.
|
||||||
*
|
*
|
||||||
* @param predicate the predicate to use.
|
* @param predicate the predicate to use.
|
||||||
*/
|
*/
|
||||||
public FilterListIterator(Predicate predicate) {
|
public FilterListIterator(Predicate predicate) {
|
||||||
|
super();
|
||||||
this.predicate = predicate;
|
this.predicate = predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/IteratorChain.java,v 1.3 2002/10/31 21:55:23 rwaldhoff Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/IteratorChain.java,v 1.4 2003/01/15 21:46:55 scolebourne Exp $
|
||||||
* $Revision: 1.3 $
|
|
||||||
* $Date: 2002/10/31 21:55:23 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -85,10 +82,11 @@ import java.util.NoSuchElementException;
|
||||||
* UnsupportedOperationException. Subclasses should <i>take care</i>
|
* UnsupportedOperationException. Subclasses should <i>take care</i>
|
||||||
* to not alter the underlying List of Iterators.</p>
|
* to not alter the underlying List of Iterators.</p>
|
||||||
*
|
*
|
||||||
* @since 2.1
|
* @since Commons Collections 2.1
|
||||||
|
* @version $Revision: 1.4 $ $Date: 2003/01/15 21:46:55 $
|
||||||
|
*
|
||||||
* @author Morgan Delagrange
|
* @author Morgan Delagrange
|
||||||
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
|
* @author Stephen Colebourne
|
||||||
* @version $Id: IteratorChain.java,v 1.3 2002/10/31 21:55:23 rwaldhoff Exp $
|
|
||||||
*/
|
*/
|
||||||
public class IteratorChain implements Iterator {
|
public class IteratorChain implements Iterator {
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/IteratorEnumeration.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/IteratorEnumeration.java,v 1.2 2003/01/15 21:46:55 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -63,31 +60,35 @@ package org.apache.commons.collections.iterators;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/** Adapter to make an {@link Iterator Iterator} instance appear to be an {@link Enumeration Enumeration} instances
|
/**
|
||||||
*
|
* Adapter to make an {@link Iterator Iterator} instance appear to be an {@link Enumeration Enumeration} instances
|
||||||
* @since 1.0
|
*
|
||||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
* @since Commons Collections 1.0
|
||||||
*/
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:46:55 $
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||||
|
*/
|
||||||
public class IteratorEnumeration implements Enumeration {
|
public class IteratorEnumeration implements Enumeration {
|
||||||
|
|
||||||
private Iterator iterator;
|
private Iterator iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>IteratorEnumeration</Code> that will not
|
* Constructs a new <Code>IteratorEnumeration</Code> that will not
|
||||||
* function until {@link #setIterator(Iterator) setIterator} is
|
* function until {@link #setIterator(Iterator) setIterator} is
|
||||||
* invoked.
|
* invoked.
|
||||||
*/
|
*/
|
||||||
public IteratorEnumeration() {
|
public IteratorEnumeration() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>IteratorEnumeration</Code> that will use
|
* Constructs a new <Code>IteratorEnumeration</Code> that will use
|
||||||
* the given iterator.
|
* the given iterator.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
*/
|
*/
|
||||||
public IteratorEnumeration( Iterator iterator ) {
|
public IteratorEnumeration( Iterator iterator ) {
|
||||||
|
super();
|
||||||
this.iterator = iterator;
|
this.iterator = iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ListIteratorWrapper.java,v 1.2 2002/08/17 11:33:09 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ListIteratorWrapper.java,v 1.3 2003/01/15 21:46:55 scolebourne Exp $
|
||||||
* $Revision: 1.2 $
|
|
||||||
* $Date: 2002/08/17 11:33:09 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -64,15 +61,17 @@ import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* As the wrapped Iterator is traversed, ListIteratorWrapper
|
* As the wrapped Iterator is traversed, ListIteratorWrapper
|
||||||
* builds a LinkedList of its values, permitting all required
|
* builds a LinkedList of its values, permitting all required
|
||||||
* operations of ListIterator.
|
* operations of ListIterator.
|
||||||
*
|
*
|
||||||
* @since 2.1
|
* @since Commons Collections 2.1
|
||||||
|
* @version $Revision: 1.3 $ $Date: 2003/01/15 21:46:55 $
|
||||||
|
*
|
||||||
* @author Morgan Delagrange
|
* @author Morgan Delagrange
|
||||||
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
|
* @author Stephen Colebourne
|
||||||
* @version $Id: ListIteratorWrapper.java,v 1.2 2002/08/17 11:33:09 scolebourne Exp $
|
|
||||||
*/
|
*/
|
||||||
public class ListIteratorWrapper implements ListIterator {
|
public class ListIteratorWrapper implements ListIterator {
|
||||||
|
|
||||||
|
@ -100,6 +99,7 @@ public class ListIteratorWrapper implements ListIterator {
|
||||||
* @throws NullPointerException if the iterator is null
|
* @throws NullPointerException if the iterator is null
|
||||||
*/
|
*/
|
||||||
public ListIteratorWrapper(Iterator iterator) {
|
public ListIteratorWrapper(Iterator iterator) {
|
||||||
|
super();
|
||||||
if (iterator == null) {
|
if (iterator == null) {
|
||||||
throw new NullPointerException("Iterator must not be null");
|
throw new NullPointerException("Iterator must not be null");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ProxyIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ProxyIterator.java,v 1.2 2003/01/15 21:49:14 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -62,34 +59,39 @@ package org.apache.commons.collections.iterators;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/** A Proxy {@link Iterator Iterator} which delegates its methods to a proxy instance.
|
/**
|
||||||
*
|
* A Proxy {@link Iterator Iterator} which delegates its methods to a proxy instance.
|
||||||
* @since 1.0
|
*
|
||||||
* @see ProxyListIterator
|
* @see ProxyListIterator
|
||||||
* @version $Revision: 1.1 $ $Date: 2002/08/15 23:13:51 $
|
* @since Commons Collections 1.0
|
||||||
*
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:49:14 $
|
||||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
*
|
||||||
*/
|
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||||
|
*/
|
||||||
public class ProxyIterator implements Iterator {
|
public class ProxyIterator implements Iterator {
|
||||||
|
|
||||||
/** Holds value of property iterator. */
|
/** Holds value of property iterator. */
|
||||||
private Iterator iterator;
|
private Iterator iterator;
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>ProxyIterator</Code> that will not function
|
* Constructs a new <Code>ProxyIterator</Code> that will not function
|
||||||
* until {@link #setIterator(Iterator)} is called.
|
* until {@link #setIterator(Iterator)} is called.
|
||||||
*/
|
*/
|
||||||
public ProxyIterator() {
|
public ProxyIterator() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>ProxyIterator</Code> that will use the
|
* Constructs a new <Code>ProxyIterator</Code> that will use the
|
||||||
* given iterator.
|
* given iterator.
|
||||||
*
|
*
|
||||||
* @param iterator the underyling iterator
|
* @param iterator the underyling iterator
|
||||||
*/
|
*/
|
||||||
public ProxyIterator( Iterator iterator ) {
|
public ProxyIterator(Iterator iterator) {
|
||||||
|
super();
|
||||||
this.iterator = iterator;
|
this.iterator = iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ProxyListIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ProxyListIterator.java,v 1.2 2003/01/15 21:49:14 scolebourne Exp $
|
||||||
* $Revision: 1.1 $
|
|
||||||
* $Date: 2002/08/15 23:13:51 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -66,31 +63,37 @@ import java.util.ListIterator;
|
||||||
* A proxy {@link ListIterator ListIterator} which delegates its
|
* A proxy {@link ListIterator ListIterator} which delegates its
|
||||||
* methods to a proxy instance.
|
* methods to a proxy instance.
|
||||||
*
|
*
|
||||||
* @since 2.0
|
|
||||||
* @see ProxyIterator
|
* @see ProxyIterator
|
||||||
* @version $Revision: 1.1 $ $Date: 2002/08/15 23:13:51 $
|
* @since Commons Collections 2.0
|
||||||
|
* @version $Revision: 1.2 $ $Date: 2003/01/15 21:49:14 $
|
||||||
|
*
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
*/
|
*/
|
||||||
public class ProxyListIterator implements ListIterator {
|
public class ProxyListIterator implements ListIterator {
|
||||||
|
|
||||||
// Constructor
|
/** Holds value of property "iterator". */
|
||||||
|
private ListIterator iterator;
|
||||||
|
|
||||||
|
// Constructors
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>ProxyListIterator</Code> that will not
|
* Constructs a new <Code>ProxyListIterator</Code> that will not
|
||||||
* function until {@link #setListIterator(ListIterator) setListIterator}
|
* function until {@link #setListIterator(ListIterator) setListIterator}
|
||||||
* is invoked.
|
* is invoked.
|
||||||
*/
|
*/
|
||||||
public ProxyListIterator() {
|
public ProxyListIterator() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>ProxyListIterator</Code> that will use the
|
* Constructs a new <Code>ProxyListIterator</Code> that will use the
|
||||||
* given list iterator.
|
* given list iterator.
|
||||||
*
|
*
|
||||||
* @param iterator the list iterator to use
|
* @param iterator the list iterator to use
|
||||||
*/
|
*/
|
||||||
public ProxyListIterator(ListIterator iterator) {
|
public ProxyListIterator(ListIterator iterator) {
|
||||||
|
super();
|
||||||
this.iterator = iterator;
|
this.iterator = iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,11 +200,5 @@ public class ProxyListIterator implements ListIterator {
|
||||||
this.iterator = iterator;
|
this.iterator = iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attributes
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Holds value of property "iterator". */
|
|
||||||
private ListIterator iterator;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/TransformIterator.java,v 1.2 2002/10/12 22:15:21 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/TransformIterator.java,v 1.3 2003/01/15 21:49:14 scolebourne Exp $
|
||||||
* $Revision: 1.2 $
|
|
||||||
* $Date: 2002/10/12 22:15:21 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -63,13 +60,16 @@ package org.apache.commons.collections.iterators;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import org.apache.commons.collections.Transformer;
|
import org.apache.commons.collections.Transformer;
|
||||||
|
|
||||||
/** A Proxy {@link Iterator Iterator} which uses a {@link Transformer Transformer} instance to
|
/**
|
||||||
* transform the contents of the {@link Iterator Iterator} into some other form
|
* A Proxy {@link Iterator Iterator} which uses a {@link Transformer Transformer}
|
||||||
*
|
* instance to transform the contents of the {@link Iterator Iterator} into
|
||||||
* @since 1.0
|
* some other form.
|
||||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
*
|
||||||
*/
|
* @since Commons Collections 1.0
|
||||||
|
* @version $Revision: 1.3 $ $Date: 2003/01/15 21:49:14 $
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||||
|
*/
|
||||||
public class TransformIterator extends ProxyIterator {
|
public class TransformIterator extends ProxyIterator {
|
||||||
|
|
||||||
/** Holds value of property transformer. */
|
/** Holds value of property transformer. */
|
||||||
|
@ -77,33 +77,34 @@ public class TransformIterator extends ProxyIterator {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>TransformIterator</Code> that will not function
|
* Constructs a new <Code>TransformIterator</Code> that will not function
|
||||||
* until the {@link #setIterator(Iterator) setIterator} method is
|
* until the {@link #setIterator(Iterator) setIterator} method is
|
||||||
* invoked.
|
* invoked.
|
||||||
*/
|
*/
|
||||||
public TransformIterator() {
|
public TransformIterator() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>TransformIterator</Code> that won't transform
|
* Constructs a new <Code>TransformIterator</Code> that won't transform
|
||||||
* elements from the given iterator.
|
* elements from the given iterator.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
*/
|
*/
|
||||||
public TransformIterator( Iterator iterator ) {
|
public TransformIterator(Iterator iterator) {
|
||||||
super( iterator );
|
super(iterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <Code>TransformIterator</Code> that will use the
|
* Constructs a new <Code>TransformIterator</Code> that will use the
|
||||||
* given iterator and transformer. If the given transformer is null,
|
* given iterator and transformer. If the given transformer is null,
|
||||||
* then objects will not be transformed.
|
* then objects will not be transformed.
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
* @param transformer the transformer to use
|
* @param transformer the transformer to use
|
||||||
*/
|
*/
|
||||||
public TransformIterator( Iterator iterator, Transformer transformer ) {
|
public TransformIterator(Iterator iterator, Transformer transformer) {
|
||||||
super( iterator );
|
super(iterator);
|
||||||
this.transformer = transformer;
|
this.transformer = transformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,13 +116,18 @@ public class TransformIterator extends ProxyIterator {
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
/** Getter for property transformer.
|
/**
|
||||||
|
* Getter for property transformer.
|
||||||
|
*
|
||||||
* @return Value of property transformer.
|
* @return Value of property transformer.
|
||||||
*/
|
*/
|
||||||
public Transformer getTransformer() {
|
public Transformer getTransformer() {
|
||||||
return transformer;
|
return transformer;
|
||||||
}
|
}
|
||||||
/** Setter for property transformer.
|
|
||||||
|
/**
|
||||||
|
* Setter for property transformer.
|
||||||
|
*
|
||||||
* @param transformer New value of property transformer.
|
* @param transformer New value of property transformer.
|
||||||
*/
|
*/
|
||||||
public void setTransformer(Transformer transformer) {
|
public void setTransformer(Transformer transformer) {
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/UniqueFilterIterator.java,v 1.2 2002/10/12 22:15:21 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/UniqueFilterIterator.java,v 1.3 2003/01/15 21:49:14 scolebourne Exp $
|
||||||
* $Revision: 1.2 $
|
|
||||||
* $Date: 2002/10/12 22:15:21 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -23,11 +20,11 @@
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
* 3. The end-user documentation included with the redistribution, if
|
||||||
* any, must include the following acknowlegement:
|
* any, must include the following acknowledgment:
|
||||||
* "This product includes software developed by the
|
* "This product includes software developed by the
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
* Apache Software Foundation (http://www.apache.org/)."
|
||||||
* Alternately, this acknowlegement may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowlegements normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
* Foundation" must not be used to endorse or promote products derived
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* nor may "Apache" appear in their names without prior written
|
||||||
* permission of the Apache Group.
|
* permission of the Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -64,15 +61,16 @@ import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import org.apache.commons.collections.Predicate;
|
import org.apache.commons.collections.Predicate;
|
||||||
|
|
||||||
/** A FilterIterator which only returns "unique" Objects. Internally,
|
/**
|
||||||
* the Iterator maintains a Set of objects it has already encountered,
|
* A FilterIterator which only returns "unique" Objects. Internally,
|
||||||
* and duplicate Objects are skipped.
|
* the Iterator maintains a Set of objects it has already encountered,
|
||||||
*
|
* and duplicate Objects are skipped.
|
||||||
* @author Morgan Delagrange
|
*
|
||||||
* @version $Id: UniqueFilterIterator.java,v 1.2 2002/10/12 22:15:21 scolebourne Exp $
|
* @since Commons Collections 2.1
|
||||||
* @since 2.1
|
* @version $Revision: 1.3 $ $Date: 2003/01/15 21:49:14 $
|
||||||
*/
|
*
|
||||||
|
* @author Morgan Delagrange
|
||||||
|
*/
|
||||||
public class UniqueFilterIterator extends FilterIterator {
|
public class UniqueFilterIterator extends FilterIterator {
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
@ -86,14 +84,15 @@ public class UniqueFilterIterator extends FilterIterator {
|
||||||
super( iterator, new UniquePredicate() );
|
super( iterator, new UniquePredicate() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private Predicate needed to implement the unique behaviour.
|
||||||
|
*/
|
||||||
private static class UniquePredicate implements Predicate {
|
private static class UniquePredicate implements Predicate {
|
||||||
|
|
||||||
HashSet set = new HashSet();
|
HashSet set = new HashSet();
|
||||||
|
|
||||||
public boolean evaluate(Object object) {
|
public boolean evaluate(Object object) {
|
||||||
return set.add(object);
|
return set.add(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue