Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.Sorter

java.lang.Object
  |
  +--uk.co.ist.mwt.Sorter

public class Sorter
extends java.lang.Object
implements java.util.Enumeration
A Sorter knows how to sort an array of objects which implement the Comparable interface; it should be constructed with the list, and then the elements should be read out using the normal Enumeration interface.


Constructor Summary
Sorter(Comparable[] objects)
          Initialises the class; copies the array into a private sorted version of itself.
 
Method Summary
boolean hasMoreElements()
          When enumerating the results of a sort, tells you if there are any more elements to be enumerated
java.lang.Object nextElement()
          When enumerating the results of a sort, returns the next element
int numElements()
          Returns the number of elements in the array we're dealing with
void resetEnum()
          When enumerating, reset so that the enumeration can begin from the start
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

Sorter

public Sorter(Comparable[] objects)
Initialises the class; copies the array into a private sorted version of itself.
Method Detail

resetEnum

public void resetEnum()
When enumerating, reset so that the enumeration can begin from the start

numElements

public int numElements()
Returns the number of elements in the array we're dealing with

hasMoreElements

public boolean hasMoreElements()
When enumerating the results of a sort, tells you if there are any more elements to be enumerated
Specified by:
hasMoreElements() in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
When enumerating the results of a sort, returns the next element
Specified by:
nextElement() in interface java.util.Enumeration

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD