git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131717 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-05-15 12:13:03 +00:00
parent bad1d79b7a
commit 7cad661cf1
5 changed files with 50 additions and 5 deletions

View File

@ -36,7 +36,7 @@ import org.apache.commons.collections.keyvalue.AbstractMapEntryDecorator;
* @see DualHashBidiMap
* @see DualTreeBidiMap
* @since Commons Collections 3.0
* @version $Id: AbstractDualBidiMap.java,v 1.11 2004/04/01 22:18:12 scolebourne Exp $
* @version $Id: AbstractDualBidiMap.java,v 1.12 2004/05/15 12:13:03 scolebourne Exp $
*
* @author Matthew Hawthorne
* @author Stephen Colebourne
@ -401,6 +401,11 @@ public abstract class AbstractDualBidiMap implements BidiMap {
/** Whether remove is allowed at present */
protected boolean canRemove = false;
/**
* Constructor.
* @param iterator the iterator to decorate
* @param parent the parent map
*/
protected KeySetIterator(Iterator iterator, AbstractDualBidiMap parent) {
super(iterator);
this.parent = parent;
@ -469,6 +474,11 @@ public abstract class AbstractDualBidiMap implements BidiMap {
/** Whether remove is allowed at present */
protected boolean canRemove = false;
/**
* Constructor.
* @param iterator the iterator to decorate
* @param parent the parent map
*/
protected ValuesIterator(Iterator iterator, AbstractDualBidiMap parent) {
super(iterator);
this.parent = parent;
@ -540,6 +550,11 @@ public abstract class AbstractDualBidiMap implements BidiMap {
/** Whether remove is allowed at present */
protected boolean canRemove = false;
/**
* Constructor.
* @param iterator the iterator to decorate
* @param parent the parent map
*/
protected EntrySetIterator(Iterator iterator, AbstractDualBidiMap parent) {
super(iterator);
this.parent = parent;
@ -572,6 +587,11 @@ public abstract class AbstractDualBidiMap implements BidiMap {
/** The parent map */
protected final AbstractDualBidiMap parent;
/**
* Constructor.
* @param entry the entry to decorate
* @param parent the parent map
*/
protected MapEntry(Map.Entry entry, AbstractDualBidiMap parent) {
super(entry);
this.parent = parent;
@ -603,6 +623,10 @@ public abstract class AbstractDualBidiMap implements BidiMap {
/** Whether remove is allowed at present */
protected boolean canRemove = false;
/**
* Constructor.
* @param parent the parent map
*/
protected BidiMapIterator(AbstractDualBidiMap parent) {
super();
this.parent = parent;

View File

@ -46,7 +46,7 @@ import org.apache.commons.collections.map.AbstractSortedMapDecorator;
* not store each object twice, which can save on memory use.
*
* @since Commons Collections 3.0
* @version $Id: DualTreeBidiMap.java,v 1.12 2004/02/18 00:57:39 scolebourne Exp $
* @version $Id: DualTreeBidiMap.java,v 1.13 2004/05/15 12:13:03 scolebourne Exp $
*
* @author Matthew Hawthorne
* @author Stephen Colebourne
@ -172,6 +172,8 @@ public class DualTreeBidiMap
* <p>
* This implementation copies the elements to an ArrayList in order to
* provide the forward/backward behaviour.
*
* @return a new ordered map iterator
*/
public OrderedMapIterator orderedMapIterator() {
return new BidiOrderedMapIterator(this);
@ -206,8 +208,14 @@ public class DualTreeBidiMap
* Internal sorted map view.
*/
protected static class ViewMap extends AbstractSortedMapDecorator {
/** The parent bidi map. */
final DualTreeBidiMap bidi;
/**
* Constructor.
* @param bidi the parent bidi map
* @param sm the subMap sorted map
*/
protected ViewMap(DualTreeBidiMap bidi, SortedMap sm) {
// the implementation is not great here...
// use the maps[0] as the filtered map, but maps[1] as the full map
@ -255,6 +263,10 @@ public class DualTreeBidiMap
/** The last returned entry */
private Map.Entry last = null;
/**
* Constructor.
* @param parent the parent map
*/
protected BidiOrderedMapIterator(AbstractDualBidiMap parent) {
super();
this.parent = parent;

View File

@ -31,7 +31,7 @@ import org.apache.commons.collections.set.UnmodifiableSet;
* Decorates another <code>BidiMap</code> to ensure it can't be altered.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:57:39 $
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:13:03 $
*
* @author Stephen Colebourne
*/
@ -43,8 +43,11 @@ public final class UnmodifiableBidiMap
/**
* Factory method to create an unmodifiable map.
* <p>
* If the map passed in is already unmodifiable, it is returned.
*
* @param map the map to decorate, must not be null
* @return an unmodifiable BidiMap
* @throws IllegalArgumentException if map is null
*/
public static BidiMap decorate(BidiMap map) {

View File

@ -33,7 +33,7 @@ import org.apache.commons.collections.set.UnmodifiableSet;
* Decorates another <code>OrderedBidiMap</code> to ensure it can't be altered.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:57:39 $
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:13:03 $
*
* @author Stephen Colebourne
*/
@ -45,8 +45,11 @@ public final class UnmodifiableOrderedBidiMap
/**
* Factory method to create an unmodifiable map.
* <p>
* If the map passed in is already unmodifiable, it is returned.
*
* @param map the map to decorate, must not be null
* @return an unmodifiable OrderedBidiMap
* @throws IllegalArgumentException if map is null
*/
public static OrderedBidiMap decorate(OrderedBidiMap map) {

View File

@ -36,7 +36,7 @@ import org.apache.commons.collections.set.UnmodifiableSet;
* Decorates another <code>SortedBidiMap</code> to ensure it can't be altered.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:57:39 $
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:13:03 $
*
* @author Stephen Colebourne
*/
@ -48,8 +48,11 @@ public final class UnmodifiableSortedBidiMap
/**
* Factory method to create an unmodifiable map.
* <p>
* If the map passed in is already unmodifiable, it is returned.
*
* @param map the map to decorate, must not be null
* @return an unmodifiable SortedBidiMap
* @throws IllegalArgumentException if map is null
*/
public static SortedBidiMap decorate(SortedBidiMap map) {