AddressSpace library v1.0 beta

mmap
Class IntList

java.lang.Object
  |
  +--mmap.IntList
Direct Known Subclasses:
IntOrderedList

public class IntList
extends java.lang.Object

This list keeps integers in arrival order.
Elements can be extracted from the list in the same order used for insertion, simulating a FIFO fashion.
Integer.MIN_VALUE is used as a placeholder when the list is empty.

Version:
1.0 June 05 2000
Author:
Dario Maggiorini (dario@dsi.unimi.it)

Inner Class Summary
protected  class IntList.Entry
           
 
Field Summary
protected  IntList.Entry cursor
          Actual examined entry of the list.
protected  int howMany
          Number of objects in the list.
protected  IntList.Entry last
          Last entry of the list.
protected static int noNumbers
          Number returned when no elements are available.
protected  IntList.Entry queue
          First entry of the list.
 
Constructor Summary
IntList()
          Create a new empty list.
 
Method Summary
 void add(int value)
          Add an integer to the list.
 void clear()
          Clear the list.
 int get()
          Get an integer from the list.
 int getSize()
          Get the size of the list.
 java.lang.String toString()
          Convert the list in a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queue

protected IntList.Entry queue
First entry of the list.

last

protected IntList.Entry last
Last entry of the list.

cursor

protected IntList.Entry cursor
Actual examined entry of the list.

howMany

protected int howMany
Number of objects in the list.

noNumbers

protected static final int noNumbers
Number returned when no elements are available.
Constructor Detail

IntList

public IntList()
Create a new empty list.
Method Detail

add

public void add(int value)
Add an integer to the list.
Parameters:
value - the integer to add.

get

public int get()
Get an integer from the list.
Such element is removed from the list.
Returns:
the first element in list or java.lang.Integer.MIN_VALUE if the list is empty.

clear

public void clear()
Clear the list.
All list elements are dropped.

getSize

public int getSize()
Get the size of the list.
Returns:
the number of elements in the list

toString

public java.lang.String toString()
Convert the list in a string.
The string produced is in the form:
[value,value,...]
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the list

Help is irrilevant
You will be assimilated!

v1.0 beta by Dario Maggiorini