Class CursorableSubList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List

    class CursorableSubList
    extends CursorableLinkedList
    implements java.util.List
    Deprecated.
    Use new version in list subpackage, which has been rewritten and now returns the cursor from the listIterator method. Will be removed in v4.0
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void add​(int index, java.lang.Object element)
      Deprecated.
      Inserts the specified element at the specified position in this list.
      boolean add​(java.lang.Object o)
      Deprecated.
      Appends the specified element to the end of this list.
      boolean addAll​(int index, java.util.Collection c)
      Deprecated.
      Inserts all of the elements in the specified collection into this list at the specified position.
      boolean addAll​(java.util.Collection c)
      Deprecated.
      Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
      boolean addFirst​(java.lang.Object o)
      Deprecated.
      Inserts the specified element at the beginning of this list.
      boolean addLast​(java.lang.Object o)
      Deprecated.
      Inserts the specified element at the end of this list.
      protected void checkForComod()
      Deprecated.
      Test to see if my underlying list has been modified by some other process.
      void clear()
      Deprecated.
      Removes all of the elements from this list.
      boolean contains​(java.lang.Object o)
      Deprecated.
      Returns true if this list contains the specified element.
      boolean containsAll​(java.util.Collection c)
      Deprecated.
      Returns true if this list contains all of the elements of the specified collection.
      boolean equals​(java.lang.Object o)
      Deprecated.
      Compares the specified object with this list for equality.
      java.lang.Object get​(int index)
      Deprecated.
      Returns the element at the specified position in this list.
      java.lang.Object getFirst()
      Deprecated.
      Returns the element at the beginning of this list.
      java.lang.Object getLast()
      Deprecated.
      Returns the element at the end of this list.
      int hashCode()
      Deprecated.
      Returns the hash code value for this list.
      int indexOf​(java.lang.Object o)
      Deprecated.
      Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
      protected CursorableLinkedList.Listable insertListable​(CursorableLinkedList.Listable before, CursorableLinkedList.Listable after, java.lang.Object value)
      Deprecated.
      Inserts a new value into my list, after the specified before element, and before the specified after element
      boolean isEmpty()
      Deprecated.
      Returns true if this list contains no elements.
      java.util.Iterator iterator()
      Deprecated.
      Returns a fail-fast iterator.
      int lastIndexOf​(java.lang.Object o)
      Deprecated.
      Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
      java.util.ListIterator listIterator()
      Deprecated.
      Returns a fail-fast ListIterator.
      java.util.ListIterator listIterator​(int index)
      Deprecated.
      Returns a fail-fast ListIterator.
      java.lang.Object remove​(int index)
      Deprecated.
      Removes the element at the specified position in this list (optional operation).
      boolean remove​(java.lang.Object o)
      Deprecated.
      Removes the first occurrence in this list of the specified element.
      boolean removeAll​(java.util.Collection c)
      Deprecated.
      Removes from this list all the elements that are contained in the specified collection.
      java.lang.Object removeFirst()
      Deprecated.
      Removes the first element of this list, if any.
      java.lang.Object removeLast()
      Deprecated.
      Removes the last element of this list, if any.
      protected void removeListable​(CursorableLinkedList.Listable elt)
      Deprecated.
      Removes the given CursorableLinkedList.Listable from my list.
      boolean retainAll​(java.util.Collection c)
      Deprecated.
      Retains only the elements in this list that are contained in the specified collection.
      java.lang.Object set​(int index, java.lang.Object element)
      Deprecated.
      Replaces the element at the specified position in this list with the specified element.
      int size()
      Deprecated.
      Returns the number of elements in this list.
      java.util.List subList​(int fromIndex, int toIndex)
      Deprecated.
      Returns a fail-fast sublist.
      java.lang.Object[] toArray()
      Deprecated.
      Returns an array containing all of the elements in this list in proper sequence.
      java.lang.Object[] toArray​(java.lang.Object[] a)
      Deprecated.
      Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        replaceAll, sort, spliterator
    • Constructor Detail

      • CursorableSubList

        CursorableSubList​(CursorableLinkedList list,
                          int from,
                          int to)
        Deprecated.
    • Method Detail

      • clear

        public void clear()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Removes all of the elements from this list. This list will be empty after this call returns (unless it throws an exception).
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.List
        Overrides:
        clear in class CursorableLinkedList
      • iterator

        public java.util.Iterator iterator()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns a fail-fast iterator.
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.List
        Overrides:
        iterator in class CursorableLinkedList
        See Also:
        List.iterator()
      • size

        public int size()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns the number of elements in this list.
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Overrides:
        size in class CursorableLinkedList
        Returns:
        the number of elements in this list.
      • isEmpty

        public boolean isEmpty()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns true if this list contains no elements.
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.List
        Overrides:
        isEmpty in class CursorableLinkedList
        Returns:
        true if this list contains no elements.
      • toArray

        public java.lang.Object[] toArray()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns an array containing all of the elements in this list in proper sequence. Obeys the general contract of the Collection.toArray() method.
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class CursorableLinkedList
        Returns:
        an array containing all of the elements in this list in proper sequence.
      • toArray

        public java.lang.Object[] toArray​(java.lang.Object[] a)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array. Obeys the general contract of the Collection.toArray() method.
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class CursorableLinkedList
        Parameters:
        a - the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
        Returns:
        an array containing the elements of this list.
      • contains

        public boolean contains​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
        Overrides:
        contains in class CursorableLinkedList
        Parameters:
        o - element whose presence in this list is to be tested.
        Returns:
        true if this list contains the specified element.
      • remove

        public boolean remove​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Removes the first occurrence in this list of the specified element. If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists).
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class CursorableLinkedList
        Parameters:
        o - element to be removed from this list, if present.
        Returns:
        true if this list contained the specified element.
      • addAll

        public boolean addAll​(java.util.Collection c)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
        Specified by:
        addAll in interface java.util.Collection
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class CursorableLinkedList
        Parameters:
        c - collection whose elements are to be added to this list.
        Returns:
        true if this list changed as a result of the call.
      • add

        public boolean add​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Appends the specified element to the end of this list.
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class CursorableLinkedList
        Parameters:
        o - element to be appended to this list.
        Returns:
        true
      • addFirst

        public boolean addFirst​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Inserts the specified element at the beginning of this list. (Equivalent to add(0,o)).
        Overrides:
        addFirst in class CursorableLinkedList
        Parameters:
        o - element to be prepended to this list.
        Returns:
        true
      • removeAll

        public boolean removeAll​(java.util.Collection c)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Removes from this list all the elements that are contained in the specified collection.
        Specified by:
        removeAll in interface java.util.Collection
        Specified by:
        removeAll in interface java.util.List
        Overrides:
        removeAll in class CursorableLinkedList
        Parameters:
        c - collection that defines which elements will be removed from this list.
        Returns:
        true if this list changed as a result of the call.
      • containsAll

        public boolean containsAll​(java.util.Collection c)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns true if this list contains all of the elements of the specified collection.
        Specified by:
        containsAll in interface java.util.Collection
        Specified by:
        containsAll in interface java.util.List
        Overrides:
        containsAll in class CursorableLinkedList
        Parameters:
        c - collection to be checked for containment in this list.
        Returns:
        true if this list contains all of the elements of the specified collection.
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection c)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Inserts all of the elements in the specified collection into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class CursorableLinkedList
        Parameters:
        index - index at which to insert first element from the specified collection.
        c - elements to be inserted into this list.
        Returns:
        true if this list changed as a result of the call.
      • hashCode

        public int hashCode()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
          hashCode = 1;
          Iterator i = list.iterator();
          while (i.hasNext()) {
              Object obj = i.next();
              hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
          }
         
        This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object.hashCode.
        Specified by:
        hashCode in interface java.util.Collection
        Specified by:
        hashCode in interface java.util.List
        Overrides:
        hashCode in class CursorableLinkedList
        Returns:
        the hash code value for this list.
        See Also:
        Object.hashCode(), Object.equals(Object), CursorableLinkedList.equals(Object)
      • retainAll

        public boolean retainAll​(java.util.Collection c)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all the elements that are not contained in the specified collection.
        Specified by:
        retainAll in interface java.util.Collection
        Specified by:
        retainAll in interface java.util.List
        Overrides:
        retainAll in class CursorableLinkedList
        Parameters:
        c - collection that defines which elements this set will retain.
        Returns:
        true if this list changed as a result of the call.
      • set

        public java.lang.Object set​(int index,
                                    java.lang.Object element)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Replaces the element at the specified position in this list with the specified element.
        Specified by:
        set in interface java.util.List
        Overrides:
        set in class CursorableLinkedList
        Parameters:
        index - index of element to replace.
        element - element to be stored at the specified position.
        Returns:
        the element previously at the specified position.
      • equals

        public boolean equals​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)).) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.
        Specified by:
        equals in interface java.util.Collection
        Specified by:
        equals in interface java.util.List
        Overrides:
        equals in class CursorableLinkedList
        Parameters:
        o - the object to be compared for equality with this list.
        Returns:
        true if the specified object is equal to this list.
      • get

        public java.lang.Object get​(int index)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns the element at the specified position in this list.
        Specified by:
        get in interface java.util.List
        Overrides:
        get in class CursorableLinkedList
        Parameters:
        index - index of element to return.
        Returns:
        the element at the specified position in this list.
      • add

        public void add​(int index,
                        java.lang.Object element)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class CursorableLinkedList
        Parameters:
        index - index at which the specified element is to be inserted.
        element - element to be inserted.
      • listIterator

        public java.util.ListIterator listIterator​(int index)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns a fail-fast ListIterator.
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class CursorableLinkedList
        See Also:
        List.listIterator(int)
      • remove

        public java.lang.Object remove​(int index)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class CursorableLinkedList
        Parameters:
        index - the index of the element to removed.
        Returns:
        the element previously at the specified position.
      • indexOf

        public int indexOf​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
        Specified by:
        indexOf in interface java.util.List
        Overrides:
        indexOf in class CursorableLinkedList
        Parameters:
        o - element to search for.
        Returns:
        the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
        Specified by:
        lastIndexOf in interface java.util.List
        Overrides:
        lastIndexOf in class CursorableLinkedList
        Parameters:
        o - element to search for.
        Returns:
        the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
      • listIterator

        public java.util.ListIterator listIterator()
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns a fail-fast ListIterator.
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class CursorableLinkedList
        See Also:
        List.listIterator()
      • subList

        public java.util.List subList​(int fromIndex,
                                      int toIndex)
        Deprecated.
        Description copied from class: CursorableLinkedList
        Returns a fail-fast sublist.
        Specified by:
        subList in interface java.util.List
        Overrides:
        subList in class CursorableLinkedList
        See Also:
        List.subList(int,int)
      • checkForComod

        protected void checkForComod()
                              throws java.util.ConcurrentModificationException
        Deprecated.
        Test to see if my underlying list has been modified by some other process. If it has, throws a ConcurrentModificationException, otherwise quietly returns.
        Throws:
        java.util.ConcurrentModificationException