Class Pipeline<T>

  • All Implemented Interfaces:
    IPipeline<T>

    public class Pipeline<T>
    extends java.lang.Object
    implements IPipeline<T>
    Pipeline Enables concurrent access to a queue.
    Author:
    Modest von Korff Mar 27, 2012 MvK: Start implementation Oct 9 2012 MvK: bug fix, added reset()
    • Constructor Detail

      • Pipeline

        public Pipeline()
      • Pipeline

        public Pipeline​(java.util.List<T> li)
        The 'all data in' flag is set true.
        Parameters:
        li -
    • Method Detail

      • reset

        public void reset()
        Sets all to 0 and allDataIn to false..
      • setAllDataIn

        public void setAllDataIn​(boolean allDataIn)
        has to be set true or wereAllDataFetched() will never become true.
        Specified by:
        setAllDataIn in interface IPipeline<T>
      • setAllDataIn

        public void setAllDataIn()
      • addData

        public void addData​(T t)
      • addData

        public void addData​(java.util.List<T> li)
      • pollData

        public T pollData()
        Returns:
        null if nothing is in the queue.
      • sizePipe

        public int sizePipe()
      • isEmpty

        public boolean isEmpty()
      • getAdded

        public long getAdded()
      • getPolled

        public long getPolled()
      • pollAllWithWait

        public java.util.List<T> pollAllWithWait()
        all data in flag has to be set.
        Returns:
        all data
      • pollAll

        public java.util.List<T> pollAll()
      • wereAllDataFetched

        public boolean wereAllDataFetched()
        Returns true if all data in was set and the queue is empty.
        Specified by:
        wereAllDataFetched in interface IPipeline<T>
        Returns:
      • clear

        public void clear()