cynosurex.util
Class RecentList

java.lang.Object
  extended by cynosurex.util.RecentList
All Implemented Interfaces:
cynosurex.internal.AuthorCommon, cynosurex.internal.CommonInterface, cynosurex.internal.CompanyCommon, java.io.Serializable

public class RecentList
extends java.lang.Object
implements cynosurex.internal.CommonInterface, java.io.Serializable

This list class keeps tracks of a recent list of objects placed in the list. Old objects that over-flow from the list are no longer kept by the list.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface cynosurex.internal.CommonInterface
copyright, copyrightYears, notice, program, version
 
Fields inherited from interface cynosurex.internal.AuthorCommon
author, copyrightSymbol, noticeMsg, rights
 
Fields inherited from interface cynosurex.internal.CompanyCommon
company, email, website
 
Constructor Summary
RecentList()
           
RecentList(int value)
          Constructor that allows the specification of maximum capacity keep track before over-flowing.
 
Method Summary
 int getCapacity()
          This method returns the capacity of this list.
 java.util.Enumeration getElements()
          This method returns the list of elements being stored.
 int getSize()
          This method returns the size of this list.
 boolean isEmpty()
          Whether the list is empty.
 void putElement(java.lang.Object obj)
          This method places an object into the list.
 void setCapacity(int value)
          Changes the maximum capacity of the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecentList

public RecentList()

RecentList

public RecentList(int value)
Constructor that allows the specification of maximum capacity keep track before over-flowing.

Parameters:
value - Specify how many object to track.
Method Detail

getCapacity

public int getCapacity()
This method returns the capacity of this list.

Returns:
the capacity of this list.

getElements

public java.util.Enumeration getElements()
This method returns the list of elements being stored.

Returns:
Array of objects.

getSize

public int getSize()
This method returns the size of this list. The size is the number of objects currently being stored in this list.

Returns:
the size of this list.

isEmpty

public boolean isEmpty()
Whether the list is empty.

Returns:
true if the list is empty.

putElement

public void putElement(java.lang.Object obj)
This method places an object into the list. If the list already contains the object, it moves it to the top of the list. If the list over-flows, it removes the oldest object from the list.

Parameters:
obj - The object to add to the list.

setCapacity

public void setCapacity(int value)
Changes the maximum capacity of the list. If the value is less than 1, then the setting is not changed.

Parameters:
value - The new value to set.