|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.nist.antd.java.util.RingList
This class represents a ring list.
This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain.
NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
| Field Summary | |
private java.lang.Object |
lastSelected
The last selected Object in the list. |
private java.util.LinkedList |
list
The list that is used to simulate the ring. |
| Constructor Summary | |
RingList()
Creates a ring list out of a Vector. |
|
| Method Summary | |
void |
add(java.lang.Object obj)
Adds an object to the end of a ring. |
void |
clear()
Clears the whole ring. |
java.lang.Object |
get(java.lang.Object obj)
Returns the given element if existent and set the internal pointer to the requested object. |
java.lang.Object |
getFirst()
Returns the object, specified as first object in the ring. |
private java.lang.Object |
getLast()
Returns the object, specified as last object in the ring. |
java.lang.Object |
getNext()
Returns the next object in the ring. |
java.lang.Object |
getPrevious()
Returns the next object in the ring. |
void |
insertFirst(java.lang.Object o)
Inserts an object to the ring at the first position. |
static void |
main(java.lang.String[] argv)
|
void |
remove(java.lang.Object obj)
Removed the element out of the ring. |
java.lang.String |
toString()
Creates a representative string output of the RingList. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.util.LinkedList list
private java.lang.Object lastSelected
| Constructor Detail |
public RingList()
| Method Detail |
public java.lang.Object getFirst()
private java.lang.Object getLast()
public java.lang.Object getNext()
public java.lang.Object getPrevious()
public java.lang.Object get(java.lang.Object obj)
obj - the requested object.
public void add(java.lang.Object obj)
public void insertFirst(java.lang.Object o)
o - The element.public void remove(java.lang.Object obj)
public void clear()
public java.lang.String toString()
toString in class java.lang.Objectpublic static void main(java.lang.String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||