Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/j-w-yun/jaylist
- Owner: j-w-yun
- Created: 2016-05-01T06:44:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-07T09:09:26.000Z (over 8 years ago)
- Last Synced: 2024-03-01T05:07:39.445Z (9 months ago)
- Language: Java
- Homepage:
- Size: 105 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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>
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
T
addFirst(T entry,
constant.Keyword keyword)Bottleneck synchronized with this.
T
addLast(T entry,
constant.Keyword keyword)Bottleneck synchronized with this.
void
clear()
protected void
finalize()
T
getFirst(constant.Keyword keyword)
Bottleneck synchronized with this.
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.
void
showState(constant.Keyword keyword)
int
size()
void
sort()
Client ensures object types are comparable.
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 interfaceMyDeque<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 interfaceMyDeque<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 interfaceMyDeque<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 interfaceMyDeque<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 interfaceMyDeque<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 interfaceMyDeque<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 classjava.lang.Object
- Since:
- 1.0.0
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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