Class ActiveList

java.lang.Object
  |
  +--ActiveList
Direct Known Subclasses:
MenuItemList, TrackCanvasList, TrackList

public class ActiveList
extends java.lang.Object


Constructor Summary
ActiveList()
          Initializes the list and the active index.
ActiveList(java.lang.Object obj)
          Initializes the list with the specified object, setting it as the active object.
 
Method Summary
 void addActiveObject(java.lang.Object obj)
          Adds the object to the list and selects it as the active object
 void addObject(java.lang.Object obj)
           
 boolean containsObjectName(java.lang.String name)
          Return true if an object with the specified name appears in the list.
 int getActiveIndex()
          Returns the index of the active object
 java.lang.Object getActiveObject()
          Returns the active object.
 java.lang.String getActiveObjectName()
          Gets the name of the active object by calling its toString() method.
 java.lang.Object getObjectAt(int i)
          Returns the object at position i from the list.
 java.lang.String getObjectName(int i)
          Returns the name of the object at position i of the list.
 int getSize()
          Returns the number of elements in the ActiveList.
 java.lang.Object nextObject()
          Returns the next object in the current list, wrapping around in the overflow case.
 java.lang.Object previousObject()
          Returns the previous object in the current list, wrapping around in the underflow case.
 void printObjects()
          Prints out the names of all the objects and indicates which one is active.
 void removeActiveObject()
          Remove the active object from the list.
 java.lang.Object setActiveObject(int i)
          Sets the object at index i to be the active object.
 java.lang.Object setActiveObjectByName(java.lang.String name)
          Sets the object identified by name to be the active object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveList

public ActiveList()
Initializes the list and the active index.

ActiveList

public ActiveList(java.lang.Object obj)
Initializes the list with the specified object, setting it as the active object.
Parameters:
obj - the object to add to the list
Method Detail

getSize

public int getSize()
Returns the number of elements in the ActiveList.

getActiveObject

public java.lang.Object getActiveObject()
                                 throws java.lang.NoSuchFieldException
Returns the active object.
Throws:
java.lang.NoSuchFieldException - if the list does not contain any objects

getActiveIndex

public int getActiveIndex()
Returns the index of the active object

setActiveObject

public java.lang.Object setActiveObject(int i)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Sets the object at index i to be the active object.
Parameters:
i - the index of the object
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is out of range

containsObjectName

public boolean containsObjectName(java.lang.String name)
Return true if an object with the specified name appears in the list.
Parameters:
name - the name of the object

setActiveObjectByName

public java.lang.Object setActiveObjectByName(java.lang.String name)
                                       throws java.lang.NoSuchFieldException
Sets the object identified by name to be the active object.
Parameters:
name - the object name
Throws:
java.lang.NoSuchFieldException - if no object exists identified by name

removeActiveObject

public void removeActiveObject()
                        throws java.lang.NoSuchFieldException
Remove the active object from the list.
Throws:
java.lang.NoSuchFieldException - if there is no active object.

getActiveObjectName

public java.lang.String getActiveObjectName()
                                     throws java.lang.NoSuchFieldException
Gets the name of the active object by calling its toString() method.
Throws:
java.lang.NoSuchFieldException - if there is no active object.

addActiveObject

public void addActiveObject(java.lang.Object obj)
Adds the object to the list and selects it as the active object
Parameters:
obj - the object to add
Throws:
throws - a NullPointerException if the object is null.

addObject

public void addObject(java.lang.Object obj)
               throws java.lang.NullPointerException

getObjectAt

public java.lang.Object getObjectAt(int i)
Returns the object at position i from the list.
Parameters:
i - the object index

getObjectName

public java.lang.String getObjectName(int i)
Returns the name of the object at position i of the list.
Parameters:
i - the index of the object

nextObject

public java.lang.Object nextObject()
                            throws java.lang.NoSuchFieldException
Returns the next object in the current list, wrapping around in the overflow case.
Throws:
java.lang.NoSuchFieldException - if there is no active object

previousObject

public java.lang.Object previousObject()
                                throws java.lang.NoSuchFieldException
Returns the previous object in the current list, wrapping around in the underflow case.
Throws:
java.lang.NoSuchFieldException - if

printObjects

public void printObjects()
Prints out the names of all the objects and indicates which one is active.