Class BmLongList


  • public class BmLongList
    extends Object
    List of long values.
    • Constructor Summary

      Constructors 
      Constructor Description
      BmLongList()
      Constructs an empty list with a default capacity.
      BmLongList​(int initialCapacity)
      Constructs an empty list with the specifiec initial capacity.
      BmLongList​(BmLongList sourceList)
      Constructs a new list containing all the values from the specified source list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, long element)
      Added the specified element at the specified index.
      void add​(long element)
      Adds the specified element to the end of the list.
      void clear()
      Clears the list.
      boolean contains​(long element)
      Checks if the list contains the specified element.
      boolean equals​(Object obj)  
      long get​(int index)
      Gets the element at the specified position in this list.
      int hashCode()  
      int indexOf​(long element)
      Gets the index of the specified element.
      boolean isEmpty()
      Checks if the list is empty.
      IBmLongIterator iterator()  
      int lastIndexOf​(long element)
      Gets the last index of the specified element.
      long remove​(int index)
      Removes the element at the specified index.
      long set​(int index, long element)
      Replaces the element at the specified position in this list with the specified element.
      int size()
      Gets the number of elements in this list.
    • Constructor Detail

      • BmLongList

        public BmLongList()
        Constructs an empty list with a default capacity.
      • BmLongList

        public BmLongList​(int initialCapacity)
        Constructs an empty list with the specifiec initial capacity.
        Parameters:
        initialCapacity - The initial capacity.
      • BmLongList

        public BmLongList​(BmLongList sourceList)
        Constructs a new list containing all the values from the specified source list.
        Parameters:
        sourceList - The source list. May not be null.
    • Method Detail

      • add

        public void add​(long element)
        Adds the specified element to the end of the list.
        Parameters:
        element - The element to add.
      • add

        public void add​(int index,
                        long element)
        Added the specified element at the specified index.
        Parameters:
        index - The index.
        element - The element to add.
      • set

        public long set​(int index,
                        long element)
        Replaces the element at the specified position in this list with the specified element.
        Parameters:
        index - The index of the element to replace.
        element - The element to store at the specified position.
        Returns:
        The element previously at the specified position.
      • remove

        public long remove​(int index)
        Removes the element at the specified index.
        Parameters:
        index - The index.
        Returns:
        the previous element at the specified index.
      • get

        public long get​(int index)
        Gets the element at the specified position in this list.
        Parameters:
        index - The index of the element to get.
        Returns:
        the element at the specified position in this list.
      • size

        public int size()
        Gets the number of elements in this list.
        Returns:
        the number of elements in this list
      • isEmpty

        public boolean isEmpty()
        Checks if the list is empty.
        Returns:
        true if empty, false otherwise.
      • indexOf

        public int indexOf​(long element)
        Gets the index of the specified element.
        Parameters:
        element - The element.
        Returns:
        the index or -1 if the element not found.
      • lastIndexOf

        public int lastIndexOf​(long element)
        Gets the last index of the specified element.
        Parameters:
        element - The element.
        Returns:
        the index or -1 if the element not found.
      • contains

        public boolean contains​(long element)
        Checks if the list contains the specified element.
        Parameters:
        element - The element.
        Returns:
        true if the list contains the element, false otherwise.
      • clear

        public void clear()
        Clears the list.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object