Documentation of 'org.ddogleg.struct.FastQueue' Java class
FastQueue
org.ddogleg.struct

Class FastQueue<T>

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      T[] data 
      int size 
      java.lang.Class<T> type 
    • Constructor Summary

      Constructors 
      Constructor and Description
      FastQueue(java.lang.Class<T> type, boolean declareInstances) 
      FastQueue(int initialMaxSize, java.lang.Class<T> type, boolean declareInstances) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(T object) 
      void addAll(FastQueue<T> list) 
      boolean contains(java.lang.Object o) 
      java.util.List<T> copyIntoList(java.util.List<T> ret) 
      T get(int index)
      Returns the element at the specified index.
      T[] getData() 
      int getMaxSize() 
      int getSize() 
      T getTail() 
      T getTail(int index)
      Returns an element in the list relative to the tail
      java.lang.Class<T> getType() 
      T grow()
      Returns a new element of data.
      void growArray(int length)
      Increases the size of the internal array without changing the shape's size.
      boolean isDeclareInstances() 
      void remove(int index)
      Removes an element from the queue by shifting elements in the array down one and placing the removed element at the old end of the list.
      T removeTail()
      Shrinks the size of the array by one and returns the element stored at the former last element.
      void reset() 
      void resize(int length)
      Changes the size to the specified length.
      void reverse()
      Reverse the item order in this queue.
      void setData(T[] data) 
      void setDeclareInstances(boolean declareInstances) 
      void setSize(int size) 
      void setType(java.lang.Class<T> type) 
      int size() 
      java.util.List<T> toList()
      Returns a wrapper around FastQueue that allows it to act as a read only list.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        public T[] data
      • size

        public int size
      • type

        public java.lang.Class<T> type
    • Constructor Detail

      • FastQueue

        public FastQueue(int initialMaxSize,
                         java.lang.Class<T> type,
                         boolean declareInstances)
      • FastQueue

        public FastQueue(java.lang.Class<T> type,
                         boolean declareInstances)
    • Method Detail

      • toList

        public java.util.List<T> toList()
        Returns a wrapper around FastQueue that allows it to act as a read only list. There is little overhead in using this interface. NOTE: The same instead of a list is returned each time. Be careful when writing concurrent code and create a copy.
        Returns:
        List wrapper.
      • removeTail

        public T removeTail()
        Shrinks the size of the array by one and returns the element stored at the former last element.
        Returns:
        The last element in the list that was removed.
      • getTail

        public T getTail()
      • getTail

        public T getTail(int index)
        Returns an element in the list relative to the tail
        Parameters:
        index - index relative to tail. 0 == the tail. size-1 = first element
        Returns:
        element
      • reset

        public void reset()
      • getMaxSize

        public int getMaxSize()
      • size

        public int size()
      • reverse

        public void reverse()
        Reverse the item order in this queue.
      • get

        public T get(int index)
        Returns the element at the specified index. Bounds checking is performed.
        Parameters:
        index - Index of the element being retrieved
        Returns:
        The retrieved element
      • grow

        public T grow()
        Returns a new element of data. If there are new data elements available then array will automatically grow.
        Returns:
        A new instance.
      • remove

        public void remove(int index)
        Removes an element from the queue by shifting elements in the array down one and placing the removed element at the old end of the list.
        Parameters:
        index - Index of the element being removed
      • add

        public void add(T object)
      • growArray

        public void growArray(int length)
        Increases the size of the internal array without changing the shape's size. If the array is already larger than the specified length then nothing is done. Elements previously stored in the array are copied over is a new internal array is declared.
        Parameters:
        length - Requested size of internal array.
      • resize

        public void resize(int length)
        Changes the size to the specified length. Equivalent to calling growArray(int) and this.size = N.
        Parameters:
        length - The new size of the queue
      • contains

        public boolean contains(java.lang.Object o)
      • copyIntoList

        public java.util.List<T> copyIntoList(java.util.List<T> ret)
      • getData

        public T[] getData()
      • setData

        public void setData(T[] data)
      • getSize

        public int getSize()
      • setSize

        public void setSize(int size)
      • isDeclareInstances

        public boolean isDeclareInstances()
      • setDeclareInstances

        public void setDeclareInstances(boolean declareInstances)
      • getType

        public java.lang.Class<T> getType()
      • setType

        public void setType(java.lang.Class<T> type)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.