Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 12, 2024
1 parent 53e58ad commit 29b780d
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ public void remove() {
* <p>
* From Commons Collections 3.1, all access to the {@code value} property
* is via the methods on this class.
* </p>
*
* @param <E> the type of the node value.
*/
protected static class Node<E> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
* Methods are forwarded directly to the decorated list.
* </p>
*
* @param <E> the type of the elements in the list
* @param <E> the type of the elements in the list.
* @since 3.0
*/
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E>
implements List<E> {
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E> implements List<E> {

/** Serialization version--necessary in an abstract class? */
private static final long serialVersionUID = 4500739654952315623L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
/**
* Serializable subclass of AbstractListDecorator.
*
* @param <E> the type of the elements in the list.
* @since 3.1
*/
public abstract class AbstractSerializableListDecorator<E>
extends AbstractListDecorator<E> {
public abstract class AbstractSerializableListDecorator<E> extends AbstractListDecorator<E> {

/** Serialization version */
private static final long serialVersionUID = 2684959196747496299L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* <b>Note that this implementation is not synchronized.</b>
* </p>
*
* @param <E> the type of the elements in the list.
* @see java.util.LinkedList
* @since 1.0
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* can be used together by decorating twice.
* </p>
*
* @param <E> the type of the elements in the list.
* @see LazyList
* @since 3.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* This class is Serializable from Commons Collections 3.1.
* </p>
*
* @param <E> the type of the elements in the list.
* @see GrowthList
* @since 3.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* <b>Note that this implementation is not synchronized.</b>
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.0
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* This class is Serializable from Commons Collections 3.1.
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.0
*/
public class PredicatedList<E> extends PredicatedCollection<E> implements List<E> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* This class is Serializable from Commons Collections 3.1.
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.0
*/
public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* This class is Serializable from Commons Collections 3.1.
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.0
*/
public class TransformedList<E> extends TransformedCollection<E> implements List<E> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
* does use slightly more memory.
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.1
*/
public class TreeList<E> extends AbstractList<E> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* Attempts to modify it will result in an UnsupportedOperationException.
* </p>
*
* @param <E> the type of the elements in the list.
* @since 3.0
*/
public final class UnmodifiableList<E>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
* number of occurrences of that element in the multiset.
* </p>
*
* @param <E> the type held in the multiset
* @param <E> the type held in the multiset.
* @since 4.1
*/
public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {

/**
* Inner class EntrySetIterator.
*
* @param <E> the element type.
*/
protected static class EntrySetIterator<E> implements Iterator<Entry<E>> {

Expand Down Expand Up @@ -154,8 +156,11 @@ public void remove() {
canRemove = false;
}
}

/**
* Inner class MultiSetEntry.
*
* @param <E> the key type.
*/
protected static class MultiSetEntry<E> extends AbstractEntry<E> {

Expand Down Expand Up @@ -211,6 +216,8 @@ public int hashCode() {

/**
* Inner class UniqueSetIterator.
*
* @param <E> the element type.
*/
protected static class UniqueSetIterator<E> extends AbstractIteratorDecorator<E> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen

/**
* Inner class AbstractEntry.
*
* @param <E> the element type.
*/
protected abstract static class AbstractEntry<E> implements Entry<E> {

Expand Down Expand Up @@ -68,8 +70,11 @@ public String toString() {
return String.format("%s:%d", getElement(), getCount());
}
}

/**
* Inner class EntrySet.
*
* @param <E> the element type.
*/
protected static class EntrySet<E> extends AbstractSet<Entry<E>> {

Expand Down Expand Up @@ -180,6 +185,8 @@ public void remove() {

/**
* Inner class UniqueSet.
*
* @param <E> the element type.
*/
protected static class UniqueSet<E> extends AbstractSet<E> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
* }
* </pre>
*
* @param <T> the type of the input to the visit operations.
* @since 4.0
*/
public interface CommandVisitor<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* these type of commands always come from the first sequence.
* </p>
*
* @param <T> the type of object to apply this command.
* @see SequencesComparator
* @see EditScript
*
* @since 4.0
*/
public class DeleteCommand<T> extends EditCommand<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
* and the {@code equals} method is specialized.
* </p>
*
* @param <T> the type of object to apply this command.
* @see SequencesComparator
* @see EditScript
*
* @since 4.0
*/
public abstract class EditCommand<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
* method is specialized.
* </p>
*
* @param <T> the type of object to apply commands.
* @see SequencesComparator
* @see EditCommand
* @see CommandVisitor
* @see ReplacementsHandler
*
* @since 4.0
*/
public class EditScript<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* these type of commands always come from the second sequence.
* </p>
*
* @param <T> the type of object to apply this command.
* @see SequencesComparator
* @see EditScript
*
* @since 4.0
*/
public class InsertCommand<T> extends EditCommand<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* these type of commands always come from the first sequence.
* </p>
*
* @param <T> the type of object to apply this command.
* @see SequencesComparator
* @see EditScript
*
* @since 4.0
*/
public class KeepCommand<T> extends EditCommand<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@
* interface to process the sub-sequences.
* </p>
*
* @param <T> the type of the input to the visit operations.
* @see ReplacementsHandler
* @see EditScript
* @see SequencesComparator
*
* @since 4.0
*/
public class ReplacementsFinder<T> implements CommandVisitor<T> {

private final List<T> pendingInsertions;
private final List<T> pendingDeletions;
private int skipped;
private int skipped;

/** Handler to call when synchronized sequences are found. */
private final ReplacementsHandler<T> handler;
Expand All @@ -65,9 +65,9 @@ public class ReplacementsFinder<T> implements CommandVisitor<T> {
*/
public ReplacementsFinder(final ReplacementsHandler<T> handler) {
pendingInsertions = new ArrayList<>();
pendingDeletions = new ArrayList<>();
skipped = 0;
this.handler = handler;
pendingDeletions = new ArrayList<>();
skipped = 0;
this.handler = handler;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,27 @@
/**
* This interface is devoted to handle synchronized replacement sequences.
*
* @param <T> the type of elements in the lists.
* @see ReplacementsFinder
* @since 4.0
*/
@FunctionalInterface
public interface ReplacementsHandler<T> {

/**
* Handle two synchronized sequences.
* Handles two synchronized sequences.
* <p>
* This method is called by a {@link ReplacementsFinder ReplacementsFinder}
* instance when it has synchronized two sub-sequences of object arrays
* being compared, and at least one of the sequences is non-empty. Since the
* sequences are synchronized, the objects before the two sub-sequences are
* equals (if they exist). This property also holds for the objects after
* the two sub-sequences.
* </p>
* <p>
* The replacement is defined as replacing the {@code from}
* sub-sequence into the {@code to} sub-sequence.
* </p>
*
* @param skipped number of tokens skipped since the last call (i.e. number of
* tokens that were in both sequences), this number should be strictly positive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
* needed to transform the first sequence into the second one.
* </p>
*
* @param <T> the type of elements in the lists.
* @see EditScript
* @see EditCommand
* @see CommandVisitor
*
* @since 4.0
*/
public class SequencesComparator<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class CompositeSet<E> implements Set<E>, Serializable {

/**
* Defines callbacks for mutation operations.
*
* @param <E> the type of the elements in this instance.
*/
public interface SetMutator<E> extends Serializable {

Expand Down

0 comments on commit 29b780d

Please sign in to comment.