Interface DistributedList<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addRange​(java.util.Collection<? extends T> items)
      Adds the elements of the specified collection to the end of the List.
      void copyTo​(T[] array, int arrayIndex)
      Copies the List elements to the specified array, starting at the specified index.
      T first()
      Returns the first element of the list.
      java.util.Collection<T> getRange​(int start, int count)
      Returns a list that will contain only the specified range of elements.
      boolean insertAfter​(T pivot, T value)
      Inserts the element in the list after the first occurrence of specified element.
      void insertAtHead​(T value)
      Insert the specified value at the head of the list.
      void insertAtTail​(T value)
      Insert the specified value at the tail of the list.
      boolean insertBefore​(T pivot, T value)
      Inserts the element in the list before the first occurrence of specified element.
      T last()
      Returns the last element of the list.
      void removeRange​(int index, int count)
      Removes a range of elements from the List.
      int removeRange​(java.util.Collection<?> items)
      Removes the elements of the specified collection from the List.
      void trim​(int start, int end)
      Trim an existing list so that it will contain only the specified range of elements.
      • 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

        add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
      • Methods inherited from interface com.alachisoft.ncache.client.datastructures.Lockable

        lock, unlock
    • Method Detail

      • trim

        void trim​(int start,
                  int end)
        Trim an existing list so that it will contain only the specified range of elements.
        Parameters:
        start - Starting index.
        end - Ending index.
      • copyTo

        void copyTo​(T[] array,
                    int arrayIndex)
        Copies the List elements to the specified array, starting at the specified index.
        Parameters:
        array - The destination array of the elements copied from List.
        arrayIndex - he zero-based index in array at which copying begins.
      • getRange

        java.util.Collection<T> getRange​(int start,
                                         int count)
        Returns a list that will contain only the specified range of elements.
        Parameters:
        start - Starting index.
        count - Number of items.
      • addRange

        void addRange​(java.util.Collection<? extends T> items)
        Adds the elements of the specified collection to the end of the List.
        Parameters:
        items - The collection whose elements should be added to the end of the List.
      • removeRange

        void removeRange​(int index,
                         int count)
        Removes a range of elements from the List.
        Parameters:
        index - The zero-based starting index of the range of elements to remove.
        count - The number of elements to remove.
      • removeRange

        int removeRange​(java.util.Collection<?> items)
        Removes the elements of the specified collection from the List.
        Parameters:
        items - The collection whose elements should be removed from the List.
        Returns:
        The number of removed elements.
      • insertAfter

        boolean insertAfter​(T pivot,
                            T value)
        Inserts the element in the list after the first occurrence of specified element.
        Parameters:
        pivot - Element after which value will be inserted.
        value - Element to insert in the list.
        Returns:
        False if the value pivot was not found; else true.
      • insertBefore

        boolean insertBefore​(T pivot,
                             T value)
        Inserts the element in the list before the first occurrence of specified element.
        Parameters:
        pivot - Element before which value will be inserted.
        value - Element to insert in the list.
        Returns:
        False if the value pivot was not found; else true.
      • first

        T first()
        Returns the first element of the list.
        Returns:
        The first element in the list.
      • last

        T last()
        Returns the last element of the list.
        Returns:
        The last element in the list.
      • insertAtHead

        void insertAtHead​(T value)
        Insert the specified value at the head of the list.
        Parameters:
        value - Element to insert in the list.
      • insertAtTail

        void insertAtTail​(T value)
        Insert the specified value at the tail of the list.
        Parameters:
        value - Element to insert in the list.