Fix javadoc and formatting in bag package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1366801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
922da12f3f
commit
d3ebd16c42
|
@ -488,7 +488,7 @@ public abstract class AbstractMapBag<E> implements Bag<E> {
|
||||||
/**
|
/**
|
||||||
* Write the map out using a custom routine.
|
* Write the map out using a custom routine.
|
||||||
* @param out the output stream
|
* @param out the output stream
|
||||||
* @throws IOException
|
* @throws IOException any of the usual I/O related exceptions
|
||||||
*/
|
*/
|
||||||
protected void doWriteObject(ObjectOutputStream out) throws IOException {
|
protected void doWriteObject(ObjectOutputStream out) throws IOException {
|
||||||
out.writeInt(map.size());
|
out.writeInt(map.size());
|
||||||
|
@ -503,12 +503,12 @@ public abstract class AbstractMapBag<E> implements Bag<E> {
|
||||||
* Read the map in using a custom routine.
|
* Read the map in using a custom routine.
|
||||||
* @param map the map to use
|
* @param map the map to use
|
||||||
* @param in the input stream
|
* @param in the input stream
|
||||||
* @throws IOException
|
* @throws IOException any of the usual I/O related exceptions
|
||||||
* @throws ClassNotFoundException
|
* @throws ClassNotFoundException if the stream contains an object which class can not be loaded
|
||||||
* @throws ClassCastException if the stream does not contain the correct objects
|
* @throws ClassCastException if the stream does not contain the correct objects
|
||||||
*/
|
*/
|
||||||
protected void doReadObject(Map<E, MutableInteger> map, ObjectInputStream in) throws IOException,
|
protected void doReadObject(Map<E, MutableInteger> map, ObjectInputStream in)
|
||||||
ClassNotFoundException {
|
throws IOException, ClassNotFoundException {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
int entrySize = in.readInt();
|
int entrySize = in.readInt();
|
||||||
for (int i = 0; i < entrySize; i++) {
|
for (int i = 0; i < entrySize; i++) {
|
||||||
|
|
|
@ -38,8 +38,7 @@ import org.apache.commons.collections.Bag;
|
||||||
* @since 3.0 (previously in main package v2.0)
|
* @since 3.0 (previously in main package v2.0)
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class HashBag<E>
|
public class HashBag<E> extends AbstractMapBag<E> implements Bag<E>, Serializable {
|
||||||
extends AbstractMapBag<E> implements Bag<E>, Serializable {
|
|
||||||
|
|
||||||
/** Serial version lock */
|
/** Serial version lock */
|
||||||
private static final long serialVersionUID = -6561115435802554013L;
|
private static final long serialVersionUID = -6561115435802554013L;
|
||||||
|
|
|
@ -38,8 +38,7 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class PredicatedBag<E>
|
public class PredicatedBag<E> extends PredicatedCollection<E> implements Bag<E> {
|
||||||
extends PredicatedCollection<E> implements Bag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = -2575833140344736876L;
|
private static final long serialVersionUID = -2575833140344736876L;
|
||||||
|
|
|
@ -37,8 +37,7 @@ import org.apache.commons.collections.SortedBag;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class PredicatedSortedBag<E>
|
public class PredicatedSortedBag<E> extends PredicatedBag<E> implements SortedBag<E> {
|
||||||
extends PredicatedBag<E> implements SortedBag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = 3448581314086406616L;
|
private static final long serialVersionUID = 3448581314086406616L;
|
||||||
|
|
|
@ -34,8 +34,7 @@ import org.apache.commons.collections.set.SynchronizedSet;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class SynchronizedBag<E>
|
public class SynchronizedBag<E> extends SynchronizedCollection<E> implements Bag<E> {
|
||||||
extends SynchronizedCollection<E> implements Bag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = 8084674570753837109L;
|
private static final long serialVersionUID = 8084674570753837109L;
|
||||||
|
|
|
@ -33,8 +33,7 @@ import org.apache.commons.collections.SortedBag;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class SynchronizedSortedBag<E>
|
public class SynchronizedSortedBag<E> extends SynchronizedBag<E> implements SortedBag<E> {
|
||||||
extends SynchronizedBag<E> implements SortedBag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = 722374056718497858L;
|
private static final long serialVersionUID = 722374056718497858L;
|
||||||
|
|
|
@ -36,8 +36,7 @@ import org.apache.commons.collections.set.TransformedSet;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class TransformedBag<E>
|
public class TransformedBag<E> extends TransformedCollection<E> implements Bag<E> {
|
||||||
extends TransformedCollection<E> implements Bag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = 5421170911299074185L;
|
private static final long serialVersionUID = 5421170911299074185L;
|
||||||
|
|
|
@ -34,8 +34,7 @@ import org.apache.commons.collections.Transformer;
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class TransformedSortedBag<E>
|
public class TransformedSortedBag<E> extends TransformedBag<E> implements SortedBag<E> {
|
||||||
extends TransformedBag<E> implements SortedBag<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = -251737742649401930L;
|
private static final long serialVersionUID = -251737742649401930L;
|
||||||
|
|
|
@ -77,7 +77,12 @@ public class TreeBag<E> extends AbstractMapBag<E> implements SortedBag<E>, Seria
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// TODO: Generics - should this be E<? extends Comparable> or some such?
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* @throws IllegalArgumentException if the object to be added does not implement
|
||||||
|
* {@link Comparable} and the {@link TreeBag} is using natural ordering
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean add(E object) {
|
public boolean add(E object) {
|
||||||
if(comparator() == null && !(object instanceof Comparable)) {
|
if(comparator() == null && !(object instanceof Comparable)) {
|
||||||
|
|
Loading…
Reference in New Issue