From 8e16456b2e7ffd2a070a216cdefd597af2435a19 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 4 Dec 2024 22:12:22 +0800 Subject: [PATCH] update comments --- .../java/forge/util/collect/FCollection.java | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/forge-core/src/main/java/forge/util/collect/FCollection.java b/forge-core/src/main/java/forge/util/collect/FCollection.java index 0bf30058cc0..14430057881 100644 --- a/forge-core/src/main/java/forge/util/collect/FCollection.java +++ b/forge-core/src/main/java/forge/util/collect/FCollection.java @@ -59,8 +59,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Create an {@link FCollection} containing a single element. * - * @param e - * the single element the new collection contains. + * @param e the single element the new collection contains. */ public FCollection(final T e) { add(e); @@ -70,8 +69,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Create an {@link FCollection} from an array. The order of the elements in * the array is preserved in the new collection. * - * @param c - * an array, whose elements will be in the collection upon its + * @param c an array, whose elements will be in the collection upon its * creation. */ public FCollection(final T[] c) { @@ -82,8 +80,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Create an {@link FCollection} from an {@link Iterable}. The order of the * elements in the iterable is preserved in the new collection. * - * @param i - * an iterable, whose elements will be in the collection upon its + * @param i an iterable, whose elements will be in the collection upon its * creation. */ public FCollection(final Iterable i) { @@ -93,8 +90,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Create an {@link FCollection} from an {@link FCollectionReader}. * - * @param reader - * a reader used to populate collection + * @param reader a reader used to populate collection */ public FCollection(final FCollectionReader reader) { reader.readAll(this); @@ -104,8 +100,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Check whether an {@link Iterable} contains any iterable, silently * returning {@code false} when {@code null} is passed as an argument. * - * @param iterable - * a card collection. + * @param iterable a card collection. */ public static boolean hasElements(final Iterable iterable) { return iterable != null && !Iterables.isEmpty(iterable); @@ -115,10 +110,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Check whether a {@link Collection} contains a particular element, silently * returning {@code false} when {@code null} is passed as the first argument. * - * @param collection - * a collection. - * @param element - * a possible element of the collection. + * @param collection a collection. + * @param element a possible element of the collection. */ public static boolean hasElement(final Collection collection, final T element) { return collection != null && collection.contains(element); @@ -163,9 +156,6 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Get the first object in this {@link FCollection}. - * - * @throws NoSuchElementException - * if the collection is empty. */ @Override public T getFirst() { @@ -177,9 +167,6 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Get the last object in this {@link FCollection}. - * - * @throws NoSuchElementException - * if the collection is empty. */ @Override public T getLast() { @@ -212,8 +199,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Check whether this collection contains a particular object. * - * @param o - * an object. + * @param o an object. */ @Override public boolean contains(final Object o) { @@ -250,8 +236,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Add an element to this collection, if it isn't already present. * - * @param e - * the object to add. + * @param e the object to add. + * * @return whether the collection changed as a result of this method call. */ @Override @@ -268,8 +254,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Remove an element from this collection. * - * @param o - * the object to remove. + * @param o the object to remove. + * * @return whether the collection changed as a result of this method call. */ @Override @@ -312,8 +298,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Add all the elements in the specified {@link Iterator} to this * collection, in the order in which they appear. * - * @param i - * an iterator. + * @param i an iterator. + * * @return whether this collection changed as a result of this method call. * @see #addAll(Collection) */ @@ -331,8 +317,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, * Add all the elements in the specified array to this collection, * respecting the ordering. * - * @param c - * an array. + * @param c an array. + * * @return whether this collection changed as a result of this method call. */ public boolean addAll(final T[] c) { @@ -378,8 +364,8 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Remove all objects appearing in an {@link Iterable}. * - * @param c - * an iterable. + * @param c an iterable. + * * @return whether this collection changed as a result of this method call. */ public boolean removeAll(final Iterable c) { @@ -443,10 +429,10 @@ public class FCollection implements List, /*Set,*/ FCollectionView, /** * Helper method to insert an element at a particular index. * - * @param index - * the index to insert the element at. - * @param element - * the element to insert. + * @param index the index to insert the element at. + * + * @param element the element to insert. + * * @return whether this collection changed as a result of this method call. */ private boolean insert(int index, final T element) { @@ -553,7 +539,7 @@ public class FCollection implements List, /*Set,*/ FCollectionView, */ @Override public Iterable threadSafeIterable() { - //create a new linked list for iterating to make it thread safe and avoid concurrent modification exceptions + //create a new list for iterating to make it thread safe and avoid concurrent modification exceptions return Iterables.unmodifiableIterable(new ArrayList<>(list)); }