TYPE - Elements typepublic class Ring<TYPE>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
Ring.Element<ELEMENT>
Element of the ring
|
| Modifier and Type | Field and Description |
|---|---|
private Ring.Element<TYPE> |
current
Current element of the ring
|
| Constructor and Description |
|---|
Ring()
Create a new empty Ring
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(TYPE element)
Add element to ring
|
TYPE |
get()
Current element or
null if ring is empty |
boolean |
isEmpty()
Indicates if ring is empty
|
void |
next()
Pass to next element
|
void |
previous()
Pass to previous element
|
void |
remove()
Remove current element of the ring
|
java.lang.String |
toString()
Ring string representation
Parent documentation: |
private Ring.Element<TYPE> current
public void add(TYPE element)
element - Element to addpublic TYPE get()
null if ring is emptynull if ring is emptypublic boolean isEmpty()
true if ring is emptypublic void next()
public void previous()
public void remove()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()