Class Vector4List

  • All Implemented Interfaces:
    java.lang.Iterable<Vector4>, java.util.Collection<Vector4>, java.util.List<Vector4>

    public class Vector4List
    extends java.util.AbstractList<Vector4>
    implements java.util.List<Vector4>
    Performance optimized list for accessing Vector4
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      Modifier and Type Method Description
      boolean add​(double x, double y, double z)
      Adds a new vector to the Vector4List.
      void add​(int index, Vector4 item)  
      boolean add​(Vector3 item)
      Adds an item to the Vector4List.
      boolean add​(Vector4 item)
      Adds an item to the Vector4List.
      void addRange​(Vector4List vectors)
      Add a range of vectors into current list
      void addRange​(java.util.List<Vector4> vectors)
      Add a range of vectors into current list
      void clear()
      Removes all items from the Vector4List.
      Vector4List clone()
      Clone the current list
      boolean contains​(java.lang.Object item)
      Determines whether the Vector4List contains a specific value.
      void copyTo​(Vector4[] array, int arrayIndex)
      Copies the elements of the Vector4List to an array, starting at a particular array index.
      Vector4 get​(int index)
      Gets the element at the specified index.
      int indexOf​(java.lang.Object item)
      Determines the index of a specific item in the Vector4List.
      boolean isReadOnly()
      Gets a value indicating whether the Vector4List is read-only.
      java.util.Iterator<Vector4> iterator()  
      Vector4 remove​(int index)  
      boolean remove​(java.lang.Object item)
      Removes the first occurrence of a specific object from the Vector4List.
      Vector4 set​(int index, Vector4 value)
      Sets the element at the specified index.
      void setCount​(int value)
      Gets the number of elements contained in the Vector4List.
      int size()
      Gets the number of elements contained in the Vector4List.
      Vector4[] toNativeArray()  
      • Methods inherited from class java.util.AbstractList

        addAll, equals, hashCode, lastIndexOf, listIterator, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

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

        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

        addAll, addAll, containsAll, equals, hashCode, isEmpty, lastIndexOf, listIterator, listIterator, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
    • Constructor Detail

      • Vector4List

        public Vector4List()
        Construct a new Vector4List
      • Vector4List

        public Vector4List​(int capacity)
        Construct a new Vector4List with specified capacity
      • Vector4List

        public Vector4List​(java.util.List<Vector4> vectors)
        Construct a new Vector4List with default elements
    • Method Detail

      • indexOf

        public int indexOf​(java.lang.Object item)
        Determines the index of a specific item in the Vector4List.
        Specified by:
        indexOf in interface java.util.List<Vector4>
        Overrides:
        indexOf in class java.util.AbstractList<Vector4>
        Parameters:
        item - The object to locate in the Vector4List.
        Returns:
        The index of item if found in the list; otherwise, -1.
      • get

        public Vector4 get​(int index)
        Gets the element at the specified index.
        Specified by:
        get in interface java.util.List<Vector4>
        Specified by:
        get in class java.util.AbstractList<Vector4>
        Parameters:
        index - The zero-based index of the element to get or set.
        Returns:
        The element at the specified index.
      • set

        public Vector4 set​(int index,
                           Vector4 value)
        Sets the element at the specified index.
        Specified by:
        set in interface java.util.List<Vector4>
        Overrides:
        set in class java.util.AbstractList<Vector4>
        Parameters:
        index - The zero-based index of the element to get or set.
        value - New value
      • addRange

        public void addRange​(java.util.List<Vector4> vectors)
        Add a range of vectors into current list
        Parameters:
        vectors -
      • addRange

        public void addRange​(Vector4List vectors)
        Add a range of vectors into current list
        Parameters:
        vectors -
      • add

        public boolean add​(Vector4 item)
        Adds an item to the Vector4List.
        Specified by:
        add in interface java.util.Collection<Vector4>
        Specified by:
        add in interface java.util.List<Vector4>
        Overrides:
        add in class java.util.AbstractList<Vector4>
        Parameters:
        item - The object to add to the Vector4List.
      • add

        public boolean add​(double x,
                           double y,
                           double z)
        Adds a new vector to the Vector4List.
        Parameters:
        x - the x component of the vector
        y - the y component of the vector
        z - the z component of the vector
      • clear

        public void clear()
        Removes all items from the Vector4List.
        Specified by:
        clear in interface java.util.Collection<Vector4>
        Specified by:
        clear in interface java.util.List<Vector4>
        Overrides:
        clear in class java.util.AbstractList<Vector4>
      • contains

        public boolean contains​(java.lang.Object item)
        Determines whether the Vector4List contains a specific value.
        Specified by:
        contains in interface java.util.Collection<Vector4>
        Specified by:
        contains in interface java.util.List<Vector4>
        Overrides:
        contains in class java.util.AbstractCollection<Vector4>
        Parameters:
        item - The object to locate in the Vector4List.
        Returns:
        true if item is found in the Vector4List; otherwise, false.
      • copyTo

        public void copyTo​(Vector4[] array,
                           int arrayIndex)
        Copies the elements of the Vector4List to an array, starting at a particular array index.
        Parameters:
        array - The one-dimensional array that is the destination of the elements copied from Vector4List. The array must have zero-based indexing.
        arrayIndex - The zero-based index in array at which copying begins.
      • remove

        public boolean remove​(java.lang.Object item)
        Removes the first occurrence of a specific object from the Vector4List.
        Specified by:
        remove in interface java.util.Collection<Vector4>
        Specified by:
        remove in interface java.util.List<Vector4>
        Overrides:
        remove in class java.util.AbstractCollection<Vector4>
        Returns:
        true if item was successfully removed from the Vector4List; otherwise, false. This method also returns false if item is not found in the original Vector4List.
      • setCount

        public void setCount​(int value)
        Gets the number of elements contained in the Vector4List.
        Parameters:
        value - New value
      • isReadOnly

        public boolean isReadOnly()
        Gets a value indicating whether the Vector4List is read-only.
        Returns:
        true if the Vector4List is read-only; otherwise, false.
      • clone

        public Vector4List clone()
        Clone the current list
        Overrides:
        clone in class java.lang.Object
      • add

        public void add​(int index,
                        Vector4 item)
        Specified by:
        add in interface java.util.List<Vector4>
        Overrides:
        add in class java.util.AbstractList<Vector4>
      • remove

        public Vector4 remove​(int index)
        Specified by:
        remove in interface java.util.List<Vector4>
        Overrides:
        remove in class java.util.AbstractList<Vector4>
      • toNativeArray

        public Vector4[] toNativeArray()
      • size

        public int size()
        Gets the number of elements contained in the Vector4List.
        Specified by:
        size in interface java.util.Collection<Vector4>
        Specified by:
        size in interface java.util.List<Vector4>
        Specified by:
        size in class java.util.AbstractCollection<Vector4>
        Returns:
        The number of elements contained in the Vector4List.
      • iterator

        public java.util.Iterator<Vector4> iterator()
        Specified by:
        iterator in interface java.util.Collection<Vector4>
        Specified by:
        iterator in interface java.lang.Iterable<Vector4>
        Specified by:
        iterator in interface java.util.List<Vector4>
        Overrides:
        iterator in class java.util.AbstractList<Vector4>