You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/05/16 16:58:43 UTC
cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections SortedBag.java SequencedHashMap.java StaticBucketMap.java ReferenceMap.java UnboundedFifoBuffer.java TreeBag.java ProxyMap.java SynchronizedPriorityQueue.java PriorityQueue.java
scolebourne 2003/05/16 07:58:43
Modified: collections/src/java/org/apache/commons/collections
SortedBag.java SequencedHashMap.java
StaticBucketMap.java ReferenceMap.java
UnboundedFifoBuffer.java TreeBag.java ProxyMap.java
SynchronizedPriorityQueue.java PriorityQueue.java
Log:
Update licence and javadoc
Revision Changes Path
1.5 +32 -27 jakarta-commons/collections/src/java/org/apache/commons/collections/SortedBag.java
Index: SortedBag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SortedBag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SortedBag.java 12 Jun 2002 03:59:15 -0000 1.4
+++ SortedBag.java 16 May 2003 14:58:42 -0000 1.5
@@ -1,13 +1,10 @@
/*
* $Header$
- * $Revision$
- * $Date$
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* 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"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -58,7 +55,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.commons.collections;
import java.util.Comparator;
@@ -67,24 +63,33 @@
* A type of {@link Bag} that maintains order among its unique
* representative members.
*
- * @since 2.0
+ * @since Commons Collections 2.0
+ * @version $Revision$ $Date$
+ *
* @author Chuck Burdick
- **/
+ */
public interface SortedBag extends Bag {
- /**
- * Returns the comparator associated with this sorted set, or null
- * if it uses its elements' natural ordering.
- **/
- public Comparator comparator();
-
- /**
- * Returns the first (lowest) member.
- **/
- public Object first();
-
- /**
- * Returns the last (highest) member.
- **/
- public Object last();
+ /**
+ * Returns the comparator associated with this sorted set, or null
+ * if it uses its elements' natural ordering.
+ *
+ * @return the comparator in use, or null if natural ordering
+ */
+ public Comparator comparator();
+
+ /**
+ * Returns the first (lowest) member.
+ *
+ * @return the first element in the sorted bag
+ */
+ public Object first();
+
+ /**
+ * Returns the last (highest) member.
+ *
+ * @return the last element in the sorted bag
+ */
+ public Object last();
+
}
1.17 +14 -14 jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java
Index: SequencedHashMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SequencedHashMap.java 19 Feb 2003 20:14:25 -0000 1.16
+++ SequencedHashMap.java 16 May 2003 14:58:42 -0000 1.17
@@ -1,13 +1,10 @@
/*
* $Header$
- * $Revision$
- * $Date$
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* 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"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -76,21 +73,24 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+
/**
* A map of objects whose mapping entries are sequenced based on the order in
- * which they were added. This data structure has fast <I>O(1)</I> search
+ * which they were added. This data structure has fast <i>O(1)</i> search
* time, deletion time, and insertion time.
*
- * <P>Although this map is sequenced, it cannot implement {@link
+ * <p>Although this map is sequenced, it cannot implement {@link
* java.util.List} because of incompatible interface definitions. The remove
* methods in List and Map have different return values (see: {@link
* java.util.List#remove(Object)} and {@link java.util.Map#remove(Object)}).
*
- * <P>This class is not thread safe. When a thread safe implementation is
+ * <p>This class is not thread safe. When a thread safe implementation is
* required, use {@link Collections#synchronizedMap(Map)} as it is documented,
* or use explicit synchronization controls.
*
- * @since 2.0
+ * @since Commons Collections 2.0
+ * @version $Revision$ $Date$
+ *
* @author <a href="mailto:mas@apache.org">Michael A. Smith</A>
* @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
@@ -987,7 +987,7 @@
* value of a list. This occurs because changing the key, changes when the
* mapping is added to the map and thus where it appears in the list.
*
- * <P>An alternative to this method is to use {@link #keySet()}
+ * <p>An alternative to this method is to use {@link #keySet()}
*
* @see #keySet()
* @return The ordered list of keys.
1.9 +25 -25 jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java
Index: StaticBucketMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StaticBucketMap.java 19 Feb 2003 20:14:25 -0000 1.8
+++ StaticBucketMap.java 16 May 2003 14:58:42 -0000 1.9
@@ -4,7 +4,7 @@
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@
* number of entries exceeds the number of buckets or if the hashcodes of the
* objects are not uniformly distributed, these operations have a worst case
* scenario that is proportional to the number of elements in the map
- * (<I>O(n)</I>).<P>
+ * (<i>O(n)</i>).<p>
*
* Each bucket in the hash table has its own monitor, so two threads can
* safely operate on the map at the same time, often without incurring any
@@ -87,38 +87,38 @@
* that this map implementation behaves in ways you may find disconcerting.
* Bulk operations, such as {@link #putAll(Map) putAll} or the
* {@link Collection#retainAll(Collection) retainAll} operation in collection
- * views, are <I>not</I> atomic. If two threads are simultaneously
+ * views, are <i>not</i> atomic. If two threads are simultaneously
* executing
*
- * <Pre>
+ * <pre>
* staticBucketMapInstance.putAll(map);
- * </Pre>
+ * </pre>
*
* and
*
- * <Pre>
+ * <pre>
* staticBucketMapInstance.entrySet().removeAll(map.entrySet());
- * </Pre>
+ * </pre>
*
* then the results are generally random. Those two statement could cancel
- * each other out, leaving <Code>staticBucketMapInstance</Code> essentially
- * unchanged, or they could leave some random subset of <Code>map</Code> in
- * <Code>staticBucketMapInstance</Code>.<P>
+ * each other out, leaving <code>staticBucketMapInstance</code> essentially
+ * unchanged, or they could leave some random subset of <code>map</code> in
+ * <code>staticBucketMapInstance</code>.<p>
*
* Also, much like an encyclopedia, the results of {@link #size()} and
- * {@link #isEmpty()} are out-of-date as soon as they are produced.<P>
+ * {@link #isEmpty()} are out-of-date as soon as they are produced.<p>
*
- * The iterators returned by the collection views of this class are <I>not</I>
- * fail-fast. They will <I>never</I> raise a
+ * The iterators returned by the collection views of this class are <i>not</i>
+ * fail-fast. They will <i>never</i> raise a
* {@link java.util.ConcurrentModificationException}. Keys and values
* added to the map after the iterator is created do not necessarily appear
* during iteration. Similarly, the iterator does not necessarily fail to
- * return keys and values that were removed after the iterator was created.<P>
+ * return keys and values that were removed after the iterator was created.<p>
*
* Finally, unlike {@link java.util.HashMap}-style implementations, this
- * class <I>never</I> rehashes the map. The number of buckets is fixed
+ * class <i>never</i> rehashes the map. The number of buckets is fixed
* at construction time and never altered. Performance may degrade if
- * you do not allocate enough buckets upfront.<P>
+ * you do not allocate enough buckets upfront.<p>
*
* The {@link #atomic(Runnable)} method is provided to allow atomic iterations
* and bulk operations; however, overuse of {@link #atomic(Runnable) atomic}
@@ -127,7 +127,7 @@
*
* Use this class if you do not require reliable bulk operations and
* iterations, or if you can make your own guarantees about how bulk
- * operations will affect the map.<P>
+ * operations will affect the map.<p>
*
* @since Commons Collections 2.1
* @version $Revision$ $Date$
@@ -138,8 +138,8 @@
* @author Paul Jack
* @author Leo Sutic
*/
-public final class StaticBucketMap implements Map
-{
+public final class StaticBucketMap implements Map {
+
private static final int DEFAULT_BUCKETS = 255;
private Node[] m_buckets;
private Lock[] m_locks;
@@ -698,17 +698,17 @@
* given {@link Runnable} executes. This method can be used, for
* instance, to execute a bulk operation atomicly:
*
- * <Pre>
+ * <pre>
* staticBucketMapInstance.atomic(new Runnable() {
* public void run() {
* staticBucketMapInstance.putAll(map);
* }
* });
- * </Pre>
+ * </pre>
*
* It can also be used if you need a reliable iterator:
*
- * <Pre>
+ * <pre>
* staticBucketMapInstance.atomic(new Runnable() {
* public void run() {
* Iterator iterator = staticBucketMapInstance.iterator();
@@ -717,7 +717,7 @@
* }
* }
* });
- * </Pre>
+ * </pre>
*
* <B>Implementation note:</B> This method requires a lot of time
* and a ton of stack space. Essentially a recursive algorithm is used
1.12 +22 -22 jakarta-commons/collections/src/java/org/apache/commons/collections/ReferenceMap.java
Index: ReferenceMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/ReferenceMap.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ReferenceMap.java 7 May 2003 09:18:57 -0000 1.11
+++ ReferenceMap.java 16 May 2003 14:58:42 -0000 1.12
@@ -4,7 +4,7 @@
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -78,40 +78,40 @@
/**
* Hashtable-based {@link Map} implementation that allows
- * mappings to be removed by the garbage collector.<P>
+ * mappings to be removed by the garbage collector.<p>
*
- * When you construct a <Code>ReferenceMap</Code>, you can
+ * When you construct a <code>ReferenceMap</code>, you can
* specify what kind of references are used to store the
* map's keys and values. If non-hard references are
* used, then the garbage collector can remove mappings
* if a key or value becomes unreachable, or if the
* JVM's memory is running low. For information on how
* the different reference types behave, see
- * {@link Reference}.<P>
+ * {@link Reference}.<p>
*
* Different types of references can be specified for keys
* and values. The keys can be configured to be weak but
* the values hard, in which case this class will behave
- * like a <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/WeakHashMap.html">
- * <Code>WeakHashMap</Code></A>. However, you
+ * like a <a href="http://java.sun.com/j2se/1.4/docs/api/java/util/WeakHashMap.html">
+ * <code>WeakHashMap</code></a>. However, you
* can also specify hard keys and weak values, or any other
* combination. The default constructor uses hard keys
- * and soft values, providing a memory-sensitive cache.<P>
+ * and soft values, providing a memory-sensitive cache.<p>
*
* The algorithms used are basically the same as those
* in {@link java.util.HashMap}. In particular, you
* can specify a load factor and capacity to suit your
* needs. All optional {@link Map} operations are
- * supported.<P>
+ * supported.<p>
*
* However, this {@link Map} implementation does <I>not</I>
* allow null elements. Attempting to add a null key or
* or a null value to the map will raise a
- * <Code>NullPointerException</Code>.<P>
+ * <code>NullPointerException</code>.<p>
*
* As usual, this implementation is not synchronized. You
* can use {@link java.util.Collections#synchronizedMap} to
- * provide synchronized access to a <Code>ReferenceMap</Code>.
+ * provide synchronized access to a <code>ReferenceMap</code>.
*
* @see java.lang.ref.Reference
*
@@ -235,7 +235,7 @@
/**
- * Constructs a new <Code>ReferenceMap</Code> that will
+ * Constructs a new <code>ReferenceMap</code> that will
* use hard references to keys and soft references to values.
*/
public ReferenceMap() {
@@ -243,7 +243,7 @@
}
/**
- * Constructs a new <Code>ReferenceMap</Code> that will
+ * Constructs a new <code>ReferenceMap</code> that will
* use the specified types of references.
*
* @param keyType the type of reference to use for keys;
@@ -259,7 +259,7 @@
}
/**
- * Constructs a new <Code>ReferenceMap</Code> that will
+ * Constructs a new <code>ReferenceMap</code> that will
* use the specified types of references.
*
* @param keyType the type of reference to use for keys;
@@ -272,7 +272,7 @@
}
/**
- * Constructs a new <Code>ReferenceMap</Code> with the
+ * Constructs a new <code>ReferenceMap</code> with the
* specified reference types, load factor and initial
* capacity.
*
@@ -296,7 +296,7 @@
}
/**
- * Constructs a new <Code>ReferenceMap</Code> with the
+ * Constructs a new <code>ReferenceMap</code> with the
* specified reference types, load factor and initial
* capacity.
*
@@ -523,9 +523,9 @@
/**
- * Returns <Code>true</Code> if this map is empty.
+ * Returns <code>true</code> if this map is empty.
*
- * @return <Code>true</Code> if this map is empty
+ * @return <code>true</code> if this map is empty
*/
public boolean isEmpty() {
purge();
@@ -534,7 +534,7 @@
/**
- * Returns <Code>true</Code> if this map contains the given key.
+ * Returns <code>true</code> if this map contains the given key.
*
* @return true if the given key is in this map
*/
@@ -549,7 +549,7 @@
/**
* Returns the value associated with the given key, if any.
*
- * @return the value associated with the given key, or <Code>null</Code>
+ * @return the value associated with the given key, or <code>null</code>
* if the key maps to no value
*/
public Object get(Object key) {
@@ -561,7 +561,7 @@
/**
- * Associates the given key with the given value.<P>
+ * Associates the given key with the given value.<p>
* Neither the key nor the value may be null.
*
* @param key the key of the mapping
1.6 +11 -13 jakarta-commons/collections/src/java/org/apache/commons/collections/UnboundedFifoBuffer.java
Index: UnboundedFifoBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/UnboundedFifoBuffer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UnboundedFifoBuffer.java 13 Oct 2002 12:59:04 -0000 1.5
+++ UnboundedFifoBuffer.java 16 May 2003 14:58:42 -0000 1.6
@@ -1,13 +1,10 @@
/*
* $Header$
- * $Revision$
- * $Date$
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* 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"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -60,10 +57,10 @@
*/
package org.apache.commons.collections;
-
import java.util.AbstractCollection;
import java.util.Iterator;
import java.util.NoSuchElementException;
+
/**
* UnboundedFifoBuffer is a <strong>very</strong> efficient buffer implementation.
* According to performance testing, it exhibits a constant access time, but it
@@ -84,16 +81,18 @@
* </pre>
* <p>
* This buffer prevents null objects from being added.
+ *
+ * @since Commons Collections 2.1
+ * @version $Revision$ $Date$
*
* @author Avalon
* @author <a href="fede@apache.org">Federico Barbieri</a>
* @author <a href="bloritsch@apache.org">Berin Loritsch</a>
* @author Paul Jack
* @author Stephen Colebourne
- * @since 2.1
- * @version $Id$
*/
public final class UnboundedFifoBuffer extends AbstractCollection implements Buffer {
+
protected Object[] m_buffer;
protected int m_head;
protected int m_tail;
@@ -314,4 +313,3 @@
}
}
-
1.8 +47 -48 jakarta-commons/collections/src/java/org/apache/commons/collections/TreeBag.java
Index: TreeBag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/TreeBag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TreeBag.java 13 Jan 2003 23:54:38 -0000 1.7
+++ TreeBag.java 16 May 2003 14:58:42 -0000 1.8
@@ -1,9 +1,10 @@
/*
* $Header$
* ====================================================================
+ *
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,7 +55,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.commons.collections;
import java.util.Collection;
@@ -69,50 +69,49 @@
*
* @since Commons Collections 2.0
* @version $Revision$ $Date$
+ *
* @author Chuck Burdick
- **/
-public class TreeBag extends DefaultMapBag implements SortedBag, Bag {
+ */
+public class TreeBag extends DefaultMapBag implements SortedBag {
- /**
- * Constructs an empty <Code>TreeBag</Code>.
- */
- public TreeBag() {
- super(new TreeMap());
- }
-
- /**
- * Constructs an empty {@link Bag} that maintains order on its unique
- * representative members according to the given {@link Comparator}.
- **/
- public TreeBag(Comparator c) {
- super(new TreeMap(c));
- }
-
- /**
- * Constructs a {@link Bag} containing all the members of the given
- * collection.
- * @see #addAll
- **/
- public TreeBag(Collection c) {
- this();
- addAll(c);
- }
-
- public Object first() {
- return ((SortedMap)getMap()).firstKey();
- }
-
- public Object last() {
- return ((SortedMap)getMap()).lastKey();
- }
-
- public Comparator comparator() {
- return ((SortedMap)getMap()).comparator();
- }
+ /**
+ * Constructs an empty <code>TreeBag</code>.
+ */
+ public TreeBag() {
+ super(new TreeMap());
+ }
+
+ /**
+ * Constructs an empty {@link Bag} that maintains order on its unique
+ * representative members according to the given {@link Comparator}.
+ *
+ * @param comparator the comparator to use
+ */
+ public TreeBag(Comparator comparator) {
+ super(new TreeMap(comparator));
+ }
+
+ /**
+ * Constructs a {@link Bag} containing all the members of the given
+ * collection.
+ *
+ * @param coll the collection to copy into the bag
+ */
+ public TreeBag(Collection coll) {
+ this();
+ addAll(coll);
+ }
+
+ public Object first() {
+ return ((SortedMap) getMap()).firstKey();
+ }
+
+ public Object last() {
+ return ((SortedMap) getMap()).lastKey();
+ }
+
+ public Comparator comparator() {
+ return ((SortedMap) getMap()).comparator();
+ }
+
}
-
-
-
-
-
-
1.8 +7 -7 jakarta-commons/collections/src/java/org/apache/commons/collections/ProxyMap.java
Index: ProxyMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/ProxyMap.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ProxyMap.java 10 May 2003 17:07:28 -0000 1.7
+++ ProxyMap.java 16 May 2003 14:58:42 -0000 1.8
@@ -4,7 +4,7 @@
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -20,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
@@ -33,7 +33,7 @@
*
* 5. Products derived from this software may not be called "Apache"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1.6 +27 -37 jakarta-commons/collections/src/java/org/apache/commons/collections/SynchronizedPriorityQueue.java
Index: SynchronizedPriorityQueue.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SynchronizedPriorityQueue.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SynchronizedPriorityQueue.java 15 Aug 2002 20:04:31 -0000 1.5
+++ SynchronizedPriorityQueue.java 16 May 2003 14:58:42 -0000 1.6
@@ -1,13 +1,10 @@
/*
* $Header$
- * $Revision$
- * $Date$
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* 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"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -67,34 +64,31 @@
* Provides synchronized wrapper methods for all the methods
* defined in the PriorityQueue interface.
*
- * @since 1.0
+ * @since Commons Collections 1.0
+ * @version $Revision$ $Date$
+ *
* @author <a href="mailto:ram.chidambaram@telus.com">Ram Chidambaram</a>
*/
-public final class SynchronizedPriorityQueue
- implements PriorityQueue
-{
+public final class SynchronizedPriorityQueue implements PriorityQueue {
/**
- * The underlying priority queue.
+ * The underlying priority queue.
*/
- protected final PriorityQueue m_priorityQueue;
-
+ protected final PriorityQueue m_priorityQueue;
/**
- * Constructs a new synchronized priority queue.
+ * Constructs a new synchronized priority queue.
*
- * @param priorityQueue the priority queue to synchronize
+ * @param priorityQueue the priority queue to synchronize
*/
- public SynchronizedPriorityQueue( final PriorityQueue priorityQueue )
- {
+ public SynchronizedPriorityQueue(final PriorityQueue priorityQueue) {
m_priorityQueue = priorityQueue;
}
/**
* Clear all elements from queue.
*/
- public synchronized void clear()
- {
+ public synchronized void clear() {
m_priorityQueue.clear();
}
@@ -103,8 +97,7 @@
*
* @return true if queue is empty else false.
*/
- public synchronized boolean isEmpty()
- {
+ public synchronized boolean isEmpty() {
return m_priorityQueue.isEmpty();
}
@@ -113,19 +106,17 @@
*
* @param element the element to be inserted
*/
- public synchronized void insert( final Object element )
- {
- m_priorityQueue.insert( element );
+ public synchronized void insert(final Object element) {
+ m_priorityQueue.insert(element);
}
/**
* Return element on top of heap but don't remove it.
*
* @return the element at top of heap
- * @exception NoSuchElementException if isEmpty() == true
+ * @throws NoSuchElementException if isEmpty() == true
*/
- public synchronized Object peek() throws NoSuchElementException
- {
+ public synchronized Object peek() throws NoSuchElementException {
return m_priorityQueue.peek();
}
@@ -133,20 +124,19 @@
* Return element on top of heap and remove it.
*
* @return the element at top of heap
- * @exception NoSuchElementException if isEmpty() == true
+ * @throws NoSuchElementException if isEmpty() == true
*/
- public synchronized Object pop() throws NoSuchElementException
- {
+ public synchronized Object pop() throws NoSuchElementException {
return m_priorityQueue.pop();
}
/**
- * Returns a string representation of the underlying queue.
+ * Returns a string representation of the underlying queue.
*
- * @return a string representation of the underlying queue
+ * @return a string representation of the underlying queue
*/
- public synchronized String toString()
- {
+ public synchronized String toString() {
return m_priorityQueue.toString();
}
+
}
1.6 +16 -17 jakarta-commons/collections/src/java/org/apache/commons/collections/PriorityQueue.java
Index: PriorityQueue.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/PriorityQueue.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PriorityQueue.java 12 Jun 2002 03:59:15 -0000 1.5
+++ PriorityQueue.java 16 May 2003 14:58:42 -0000 1.6
@@ -1,13 +1,10 @@
/*
* $Header$
- * $Revision$
- * $Date$
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +20,11 @@
* distribution.
*
* 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
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* 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"
* 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
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -66,11 +63,13 @@
* Interface for priority queues.
* This interface does not dictate whether it is min or max heap.
*
- * @since 1.0
+ * @since Commons Collections 1.0
+ * @version $Revision$ $Date$
+ *
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
*/
-public interface PriorityQueue
-{
+public interface PriorityQueue {
+
/**
* Clear all elements from queue.
*/
@@ -88,17 +87,17 @@
*
* @param element the element to be inserted
*
- * @exception ClassCastException if the specified <code>element</code>'s
+ * @throws ClassCastException if the specified <code>element</code>'s
* type prevents it from being compared to other items in the queue to
* determine its relative priority.
*/
- void insert( Object element );
+ void insert(Object element);
/**
* Return element on top of heap but don't remove it.
*
* @return the element at top of heap
- * @exception NoSuchElementException if <code>isEmpty() == true</code>
+ * @throws NoSuchElementException if <code>isEmpty() == true</code>
*/
Object peek() throws NoSuchElementException;
@@ -106,8 +105,8 @@
* Return element on top of heap and remove it.
*
* @return the element at top of heap
- * @exception NoSuchElementException if <code>isEmpty() == true</code>
+ * @throws NoSuchElementException if <code>isEmpty() == true</code>
*/
Object pop() throws NoSuchElementException;
+
}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org