Javadoc
This commit is contained in:
parent
53e58ad41b
commit
29b780d9e4
|
@ -404,6 +404,9 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
|
||||||
* <p>
|
* <p>
|
||||||
* From Commons Collections 3.1, all access to the {@code value} property
|
* From Commons Collections 3.1, all access to the {@code value} property
|
||||||
* is via the methods on this class.
|
* is via the methods on this class.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param <E> the type of the node value.
|
||||||
*/
|
*/
|
||||||
protected static class Node<E> {
|
protected static class Node<E> {
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,10 @@ import org.apache.commons.collections4.collection.AbstractCollectionDecorator;
|
||||||
* Methods are forwarded directly to the decorated list.
|
* Methods are forwarded directly to the decorated list.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param <E> the type of the elements in the list
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E>
|
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E> implements List<E> {
|
||||||
implements List<E> {
|
|
||||||
|
|
||||||
/** Serialization version--necessary in an abstract class? */
|
/** Serialization version--necessary in an abstract class? */
|
||||||
private static final long serialVersionUID = 4500739654952315623L;
|
private static final long serialVersionUID = 4500739654952315623L;
|
||||||
|
|
|
@ -25,10 +25,10 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* Serializable subclass of AbstractListDecorator.
|
* Serializable subclass of AbstractListDecorator.
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSerializableListDecorator<E>
|
public abstract class AbstractSerializableListDecorator<E> extends AbstractListDecorator<E> {
|
||||||
extends AbstractListDecorator<E> {
|
|
||||||
|
|
||||||
/** Serialization version */
|
/** Serialization version */
|
||||||
private static final long serialVersionUID = 2684959196747496299L;
|
private static final long serialVersionUID = 2684959196747496299L;
|
||||||
|
|
|
@ -55,6 +55,7 @@ import java.util.ListIterator;
|
||||||
* <b>Note that this implementation is not synchronized.</b>
|
* <b>Note that this implementation is not synchronized.</b>
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @see java.util.LinkedList
|
* @see java.util.LinkedList
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
|
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
|
||||||
|
|
|
@ -54,6 +54,7 @@ import java.util.List;
|
||||||
* can be used together by decorating twice.
|
* can be used together by decorating twice.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @see LazyList
|
* @see LazyList
|
||||||
* @since 3.2
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -61,6 +61,7 @@ import org.apache.commons.collections4.Transformer;
|
||||||
* This class is Serializable from Commons Collections 3.1.
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @see GrowthList
|
* @see GrowthList
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,6 +39,7 @@ import java.util.Collection;
|
||||||
* <b>Note that this implementation is not synchronized.</b>
|
* <b>Note that this implementation is not synchronized.</b>
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
|
* @deprecated parent {@link AbstractLinkedList} is source incompatible with List methods added in Java 21
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,6 +45,7 @@ import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator;
|
||||||
* This class is Serializable from Commons Collections 3.1.
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public class PredicatedList<E> extends PredicatedCollection<E> implements List<E> {
|
public class PredicatedList<E> extends PredicatedCollection<E> implements List<E> {
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||||
* This class is Serializable from Commons Collections 3.1.
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
||||||
|
|
|
@ -36,6 +36,7 @@ import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator;
|
||||||
* This class is Serializable from Commons Collections 3.1.
|
* This class is Serializable from Commons Collections 3.1.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public class TransformedList<E> extends TransformedCollection<E> implements List<E> {
|
public class TransformedList<E> extends TransformedCollection<E> implements List<E> {
|
||||||
|
|
|
@ -59,6 +59,7 @@ import org.apache.commons.collections4.OrderedIterator;
|
||||||
* does use slightly more memory.
|
* does use slightly more memory.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
*/
|
*/
|
||||||
public class TreeList<E> extends AbstractList<E> {
|
public class TreeList<E> extends AbstractList<E> {
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.apache.commons.collections4.iterators.UnmodifiableListIterator;
|
||||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <E> the type of the elements in the list.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public final class UnmodifiableList<E>
|
public final class UnmodifiableList<E>
|
||||||
|
|
|
@ -36,13 +36,15 @@ import org.apache.commons.collections4.iterators.AbstractIteratorDecorator;
|
||||||
* number of occurrences of that element in the multiset.
|
* number of occurrences of that element in the multiset.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param <E> the type held in the multiset
|
* @param <E> the type held in the multiset.
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
|
public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class EntrySetIterator.
|
* Inner class EntrySetIterator.
|
||||||
|
*
|
||||||
|
* @param <E> the element type.
|
||||||
*/
|
*/
|
||||||
protected static class EntrySetIterator<E> implements Iterator<Entry<E>> {
|
protected static class EntrySetIterator<E> implements Iterator<Entry<E>> {
|
||||||
|
|
||||||
|
@ -154,8 +156,11 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
|
||||||
canRemove = false;
|
canRemove = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class MultiSetEntry.
|
* Inner class MultiSetEntry.
|
||||||
|
*
|
||||||
|
* @param <E> the key type.
|
||||||
*/
|
*/
|
||||||
protected static class MultiSetEntry<E> extends AbstractEntry<E> {
|
protected static class MultiSetEntry<E> extends AbstractEntry<E> {
|
||||||
|
|
||||||
|
@ -211,6 +216,8 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class UniqueSetIterator.
|
* Inner class UniqueSetIterator.
|
||||||
|
*
|
||||||
|
* @param <E> the element type.
|
||||||
*/
|
*/
|
||||||
protected static class UniqueSetIterator<E> extends AbstractIteratorDecorator<E> {
|
protected static class UniqueSetIterator<E> extends AbstractIteratorDecorator<E> {
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class AbstractEntry.
|
* Inner class AbstractEntry.
|
||||||
|
*
|
||||||
|
* @param <E> the element type.
|
||||||
*/
|
*/
|
||||||
protected abstract static class AbstractEntry<E> implements Entry<E> {
|
protected abstract static class AbstractEntry<E> implements Entry<E> {
|
||||||
|
|
||||||
|
@ -68,8 +70,11 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
|
||||||
return String.format("%s:%d", getElement(), getCount());
|
return String.format("%s:%d", getElement(), getCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class EntrySet.
|
* Inner class EntrySet.
|
||||||
|
*
|
||||||
|
* @param <E> the element type.
|
||||||
*/
|
*/
|
||||||
protected static class EntrySet<E> extends AbstractSet<Entry<E>> {
|
protected static class EntrySet<E> extends AbstractSet<Entry<E>> {
|
||||||
|
|
||||||
|
@ -180,6 +185,8 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class UniqueSet.
|
* Inner class UniqueSet.
|
||||||
|
*
|
||||||
|
* @param <E> the element type.
|
||||||
*/
|
*/
|
||||||
protected static class UniqueSet<E> extends AbstractSet<E> {
|
protected static class UniqueSet<E> extends AbstractSet<E> {
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ package org.apache.commons.collections4.sequence;
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of the input to the visit operations.
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public interface CommandVisitor<T> {
|
public interface CommandVisitor<T> {
|
||||||
|
|
|
@ -26,9 +26,9 @@ package org.apache.commons.collections4.sequence;
|
||||||
* these type of commands always come from the first sequence.
|
* these type of commands always come from the first sequence.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of object to apply this command.
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class DeleteCommand<T> extends EditCommand<T> {
|
public class DeleteCommand<T> extends EditCommand<T> {
|
||||||
|
|
|
@ -41,9 +41,9 @@ package org.apache.commons.collections4.sequence;
|
||||||
* and the {@code equals} method is specialized.
|
* and the {@code equals} method is specialized.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of object to apply this command.
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public abstract class EditCommand<T> {
|
public abstract class EditCommand<T> {
|
||||||
|
|
|
@ -37,11 +37,11 @@ import java.util.List;
|
||||||
* method is specialized.
|
* method is specialized.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of object to apply commands.
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
* @see EditCommand
|
* @see EditCommand
|
||||||
* @see CommandVisitor
|
* @see CommandVisitor
|
||||||
* @see ReplacementsHandler
|
* @see ReplacementsHandler
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class EditScript<T> {
|
public class EditScript<T> {
|
||||||
|
|
|
@ -26,9 +26,9 @@ package org.apache.commons.collections4.sequence;
|
||||||
* these type of commands always come from the second sequence.
|
* these type of commands always come from the second sequence.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of object to apply this command.
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class InsertCommand<T> extends EditCommand<T> {
|
public class InsertCommand<T> extends EditCommand<T> {
|
||||||
|
|
|
@ -26,9 +26,9 @@ package org.apache.commons.collections4.sequence;
|
||||||
* these type of commands always come from the first sequence.
|
* these type of commands always come from the first sequence.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of object to apply this command.
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class KeepCommand<T> extends EditCommand<T> {
|
public class KeepCommand<T> extends EditCommand<T> {
|
||||||
|
|
|
@ -43,17 +43,17 @@ import java.util.List;
|
||||||
* interface to process the sub-sequences.
|
* interface to process the sub-sequences.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of the input to the visit operations.
|
||||||
* @see ReplacementsHandler
|
* @see ReplacementsHandler
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
* @see SequencesComparator
|
* @see SequencesComparator
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class ReplacementsFinder<T> implements CommandVisitor<T> {
|
public class ReplacementsFinder<T> implements CommandVisitor<T> {
|
||||||
|
|
||||||
private final List<T> pendingInsertions;
|
private final List<T> pendingInsertions;
|
||||||
private final List<T> pendingDeletions;
|
private final List<T> pendingDeletions;
|
||||||
private int skipped;
|
private int skipped;
|
||||||
|
|
||||||
/** Handler to call when synchronized sequences are found. */
|
/** Handler to call when synchronized sequences are found. */
|
||||||
private final ReplacementsHandler<T> handler;
|
private final ReplacementsHandler<T> handler;
|
||||||
|
@ -65,9 +65,9 @@ public class ReplacementsFinder<T> implements CommandVisitor<T> {
|
||||||
*/
|
*/
|
||||||
public ReplacementsFinder(final ReplacementsHandler<T> handler) {
|
public ReplacementsFinder(final ReplacementsHandler<T> handler) {
|
||||||
pendingInsertions = new ArrayList<>();
|
pendingInsertions = new ArrayList<>();
|
||||||
pendingDeletions = new ArrayList<>();
|
pendingDeletions = new ArrayList<>();
|
||||||
skipped = 0;
|
skipped = 0;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* This interface is devoted to handle synchronized replacement sequences.
|
* This interface is devoted to handle synchronized replacement sequences.
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of elements in the lists.
|
||||||
* @see ReplacementsFinder
|
* @see ReplacementsFinder
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +29,7 @@ import java.util.List;
|
||||||
public interface ReplacementsHandler<T> {
|
public interface ReplacementsHandler<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle two synchronized sequences.
|
* Handles two synchronized sequences.
|
||||||
* <p>
|
* <p>
|
||||||
* This method is called by a {@link ReplacementsFinder ReplacementsFinder}
|
* This method is called by a {@link ReplacementsFinder ReplacementsFinder}
|
||||||
* instance when it has synchronized two sub-sequences of object arrays
|
* instance when it has synchronized two sub-sequences of object arrays
|
||||||
|
@ -36,9 +37,11 @@ public interface ReplacementsHandler<T> {
|
||||||
* sequences are synchronized, the objects before the two sub-sequences are
|
* sequences are synchronized, the objects before the two sub-sequences are
|
||||||
* equals (if they exist). This property also holds for the objects after
|
* equals (if they exist). This property also holds for the objects after
|
||||||
* the two sub-sequences.
|
* the two sub-sequences.
|
||||||
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* The replacement is defined as replacing the {@code from}
|
* The replacement is defined as replacing the {@code from}
|
||||||
* sub-sequence into the {@code to} sub-sequence.
|
* sub-sequence into the {@code to} sub-sequence.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param skipped number of tokens skipped since the last call (i.e. number of
|
* @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
|
* tokens that were in both sequences), this number should be strictly positive
|
||||||
|
|
|
@ -52,10 +52,10 @@ import org.apache.commons.collections4.functors.DefaultEquator;
|
||||||
* needed to transform the first sequence into the second one.
|
* needed to transform the first sequence into the second one.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
* @param <T> the type of elements in the lists.
|
||||||
* @see EditScript
|
* @see EditScript
|
||||||
* @see EditCommand
|
* @see EditCommand
|
||||||
* @see CommandVisitor
|
* @see CommandVisitor
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class SequencesComparator<T> {
|
public class SequencesComparator<T> {
|
||||||
|
|
|
@ -54,6 +54,8 @@ public class CompositeSet<E> implements Set<E>, Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines callbacks for mutation operations.
|
* Defines callbacks for mutation operations.
|
||||||
|
*
|
||||||
|
* @param <E> the type of the elements in this instance.
|
||||||
*/
|
*/
|
||||||
public interface SetMutator<E> extends Serializable {
|
public interface SetMutator<E> extends Serializable {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue