Package rasj.odmg

Class RasList

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.List, DCollection, DList

    public class RasList
    extends RasCollection
    implements DList
    This class implements the ODMG DList interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      RasList()
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, java.lang.Object element)
      Inserts the specified element at the specified position in this list.
      boolean add​(java.lang.Object o)
      Appends the specified element to the end of this List.
      boolean addAll​(int index, java.util.Collection c)
      Inserts all of the elements in the specified collection into this list at the specified position.
      DList concat​(DList otherList)
      Creates a new DList object that contains the contents of this DList object concatenated with the contents of the otherList object.
      java.lang.Object get​(int index)
      Returns the element at the specified position in this list.
      int indexOf​(java.lang.Object o)
      Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
      java.util.Iterator iterator()
      Returns an iterator over the elements in this list in proper sequence.
      int lastIndexOf​(java.lang.Object o)
      Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
      java.util.ListIterator listIterator()
      Returns a list iterator of the elements in this list (in proper sequence).
      java.util.ListIterator listIterator​(int index)
      Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
      java.lang.Object remove​(int index)
      Removes the element at the specified position in this list.
      java.lang.Object set​(int index, java.lang.Object element)
      Replaces the element at the specified position in this list with the specified element.
      int size()
      Returns the number of elements in this List.
      java.util.List subList​(int fromIndex, int toIndex)
      Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.
      • Methods inherited from class java.util.AbstractCollection

        addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, 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

        addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Constructor Detail

      • RasList

        public RasList()
        constructor
    • Method Detail

      • concat

        public DList concat​(DList otherList)
        Creates a new DList object that contains the contents of this DList object concatenated with the contents of the otherList object.
        Specified by:
        concat in interface DList
        Parameters:
        otherList - The list whose elements are placed at the end of the list returned by this method.
        Returns:
        A new DList that is the concatenation of this list and the list referenced by otherList.
      • subList

        public java.util.List subList​(int fromIndex,
                                      int toIndex)
        Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.
        Specified by:
        subList in interface java.util.List
      • listIterator

        public java.util.ListIterator listIterator()
        Returns a list iterator of the elements in this list (in proper sequence).
        Specified by:
        listIterator in interface java.util.List
      • iterator

        public java.util.Iterator iterator()
        Returns an iterator over the elements in this list in proper sequence.
        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 RasCollection
      • listIterator

        public java.util.ListIterator listIterator​(int index)
        Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
        Specified by:
        listIterator in interface java.util.List
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
        Specified by:
        lastIndexOf in interface java.util.List
      • indexOf

        public int indexOf​(java.lang.Object o)
        Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
        Specified by:
        indexOf in interface java.util.List
      • remove

        public java.lang.Object remove​(int index)
        Removes the element at the specified position in this list.
        Specified by:
        remove in interface java.util.List
      • add

        public boolean add​(java.lang.Object o)
        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 java.util.AbstractCollection
      • add

        public void add​(int index,
                        java.lang.Object element)
        Inserts the specified element at the specified position in this list.
        Specified by:
        add in interface java.util.List
      • set

        public java.lang.Object set​(int index,
                                    java.lang.Object element)
        Replaces the element at the specified position in this list with the specified element.
        Specified by:
        set in interface java.util.List
      • get

        public java.lang.Object get​(int index)
        Returns the element at the specified position in this list.
        Specified by:
        get in interface java.util.List
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection c)
        Inserts all of the elements in the specified collection into this list at the specified position.
        Specified by:
        addAll in interface java.util.List
      • size

        public int size()
        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 RasCollection