acme
Class ArrayList

java.lang.Object
  extended by acme.AbstractList
      extended by acme.ArrayList

public class ArrayList
extends AbstractList

Derivazione concreta della lista astratta, caratterizzata da una strategia implementativa basata su array


Constructor Summary
ArrayList()
          Costruisce una lista, inizialmente vuota
 
Method Summary
 void addElement(int element)
          Aggiunge un elemento in coda a questa lista
 void empty()
          Elimina tutti gli elementi di questa lista, rendendola vuota.
 int getElementAt(int index)
          Restituisce l'elemento di posizione specificata
 int getLength()
          Restituisce la lunghezza della lista
 
Methods inherited from class acme.AbstractList
getAverage, isEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayList

public ArrayList()
Costruisce una lista, inizialmente vuota

Method Detail

addElement

public void addElement(int element)
Aggiunge un elemento in coda a questa lista

Specified by:
addElement in class AbstractList
Parameters:
element - elemento da aggiungere

getElementAt

public int getElementAt(int index)
Restituisce l'elemento di posizione specificata

Specified by:
getElementAt in class AbstractList
Parameters:
index - indice dell'elemento da restituire
Returns:
elemento della lista

empty

public void empty()
Elimina tutti gli elementi di questa lista, rendendola vuota.

Specified by:
empty in class AbstractList

getLength

public int getLength()
Restituisce la lunghezza della lista

Specified by:
getLength in class AbstractList
Returns:
lunghezza della lista