Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/j-w-yun/jaylist

Circular, dynamic, blocking deque
https://github.com/j-w-yun/jaylist

Last synced: about 7 hours ago
JSON representation

Circular, dynamic, blocking deque

Awesome Lists containing this project

README

        

# JayList



Blocking Deque.


Author : Jaewan Yun ([email protected])


OUT-OF-DATE readme : Additional features added. Refer to 1.2.0 change


![alt tag](https://github.com/jaewany/JayList/blob/master/pics/Untitled13.png)

Incomplete demo.


Class JayList<T>





  • java.lang.Object



    • JayList<T>








  • All Implemented Interfaces:

    MyDeque<T>






    public class JayList<T>
    
    extends java.lang.Object
    implements MyDeque<T>









    • Constructor Summary

      Constructors 

      Constructor and Description

      JayList() 

      JayList(int capacity) 

      JayList(T[] input) 





    • Method Summary

      All Methods Instance Methods Concrete Methods 

      Modifier and Type
      Method and Description

      T
      addFirst(T entry) 

      T
      addFirst(T entry,
      constant.Keyword keyword)

      Bottleneck synchronized with this.

      T
      addLast(T entry) 

      T
      addLast(T entry,
      constant.Keyword keyword)

      Bottleneck synchronized with this.

      void
      clear() 

      protected void
      finalize() 

      T
      getFirst() 

      T
      getFirst(constant.Keyword keyword)

      Bottleneck synchronized with this.

      T
      getLast() 

      T
      getLast(constant.Keyword keyword)

      Bottleneck synchronized with this.

      boolean
      isEmpty()

      Client method needs to ensure synchronization with this.

      T
      removeFirst() 

      T
      removeFirst(constant.Keyword keyword)

      Bottleneck synchronized with this.

      T
      removeLast() 

      T
      removeLast(constant.Keyword keyword)

      Bottleneck synchronized with this.

      boolean
      setArray(T[] input) 

      void
      showState(constant.Keyword keyword) 

      int
      size() 

      void
      sort()

      Client ensures object types are comparable.

      T[]
      toArray() 

      java.lang.String
      toString() 




      • Methods inherited from class java.lang.Object


        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait












    • Constructor Detail





      • JayList


        public JayList()


        Since:

        1.0.0







      • JayList


        public JayList(int capacity)


        Parameters:


        capacity - The desired capacity of the underlying data structure.

        Throws:


        java.lang.IllegalArgumentException - when the size of the accepted value exceeds a predetermined maximum capacity.


        java.lang.IllegalArgumentException - when the size of the accepted value is less than one.

        Since:

        1.0.0







      • JayList


        public JayList(T[] input)


        Parameters:


        input - An array used as a template.

        Since:

        1.0.0








    • Method Detail





      • addFirst


        public T addFirst(T entry)


        Specified by:


        addFirst in interface MyDeque<T>

        Parameters:


        entry - An entry to be added.

        Throws:


        java.lang.IllegalStateException - when this has not been properly initialized or when entry cannot be added due to a predetermined maximum capacity.

        Since:

        1.0.0







      • addFirst


        public T addFirst(T entry,
        
        constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        entry - An entry to be added.


        keyword - Used for development.

        Throws:


        java.lang.IllegalStateException - when this has not been properly initialized or when entry cannot be added due to a predetermined maximum capacity.


        java.lang.IllegalArgumentException - when entry is null.

        Since:

        1.0.0







      • addLast


        public T addLast(T entry)


        Specified by:


        addLast in interface MyDeque<T>

        Parameters:


        entry - An entry to be added.

        Throws:


        java.lang.IllegalStateException - when this has not been properly initialized or when entry cannot be added due to a predetermined maximum capacity.

        Since:

        1.0.0







      • addLast


        public T addLast(T entry,
        
        constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        entry - An entry to be added.


        keyword - Used for development.

        Throws:


        java.lang.IllegalStateException - when this has not been properly initialized or when entry cannot be added due to a predetermined maximum capacity.


        java.lang.IllegalArgumentException - when entry is null.

        Since:

        1.0.0







      • removeLast


        public T removeLast()


        Specified by:


        removeLast in interface MyDeque<T>

        Returns:

        the element that was removed.

        Throws:


        java.lang.IllegalArgumentException - if data structure is empty.

        Since:

        1.0.0







      • removeLast


        public T removeLast(constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        keyword - Used for development.

        Returns:

        the element that was removed.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if removed value is null.

        Since:

        1.0.0







      • removeFirst


        public T removeFirst()


        Specified by:


        removeFirst in interface MyDeque<T>

        Returns:

        the element that was popped.

        Throws:


        java.lang.IllegalArgumentException - if data structure is empty.

        Since:

        1.0.0







      • removeFirst


        public T removeFirst(constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        keyword - Used for development.

        Returns:

        the element that was popped.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if popped value is null.

        Since:

        1.0.0







      • getLast


        public T getLast()


        Specified by:


        getLast in interface MyDeque<T>

        Returns:

        the element that is next in queue.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if next value is null.

        Since:

        1.0.0







      • getLast


        public T getLast(constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        keyword - Used for development.

        Returns:

        the element that is next in queue.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if next value is null.

        Since:

        1.0.0







      • getFirst


        public T getFirst()


        Specified by:


        getFirst in interface MyDeque<T>

        Returns:

        the element that is next in stack.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if next value is null.

        Since:

        1.0.0







      • getFirst


        public T getFirst(constant.Keyword keyword)

        Bottleneck synchronized with this.


        Parameters:


        keyword - Used for development.

        Returns:

        the element that is next in stack.

        Throws:


        java.util.NoSuchElementException - if data structure is empty.


        java.lang.NullPointerException - if next value is null.

        Since:

        1.0.0







      • clear


        public void clear()


        Since:

        1.0.0







      • setArray


        public boolean setArray(T[] input)






      • toArray


        public T[] toArray()


        Returns:

        A copy of this array.

        Throws:


        java.lang.IllegalStateException - when this has not been properly initialized.


        java.lang.NullPointerException - when jayList is null.

        Since:

        1.0.0







      • sort


        public void sort()

        Client ensures object types are comparable.


        Throws:


        java.lang.UnsupportedOperationException - if object types are not comparable.

        Since:

        1.0.0







      • size


        public int size()


        Returns:

        size The number of elements contained within this data structure.

        Since:

        1.0.0







      • isEmpty


        public boolean isEmpty()

        Client method needs to ensure synchronization with this.


        Returns:

        true if no elements exist in this data structure.

        Since:

        1.0.0







      • finalize


        protected void finalize()


        Overrides:


        finalize in class java.lang.Object

        Since:

        1.0.0







      • toString


        public java.lang.String toString()


        Overrides:


        toString in class java.lang.Object

        Since:

        1.0.0







      • showState


        public void showState(constant.Keyword keyword)


        Parameters:


        keyword - Keyword that the method body portion execution is dependent on

        Since:

        1.0.0