Class CustomLevelOrder

java.lang.Object
  |
  +--CustomLevelOrder

public class CustomLevelOrder
extends java.lang.Object

CustomLevelOrder is a user defined order of the custom created levels.


Constructor Summary
CustomLevelOrder()
          Constructor - initializes the CustomLevelOrder attributes
 
Method Summary
 void addLevel(java.lang.String level)
          This function allows the user to add custom level(s) to level list.
 java.lang.String getCurrentLevel()
          Returns the name of the current level in the list
 java.lang.String[] getLevelList()
          Returns a String array of the level names in the current customLevelOrder list
 java.lang.String getNextLevel()
          Returns the name of the next level in the list
 java.lang.String getPrevLevel()
          Returns the name of the previous level in the list
 void insertLevel(int location, java.lang.String level)
          This function allows the user to add custom level(s) to level list.
 boolean isEmpty()
          Returns true if the customLevelOrder Vector is empty and false if not
 void removeLevel(int location)
          This function allows the user to remove custom level(s) from level list.
 void setCurrentLevel(java.lang.String levelName)
          sets the currentLevel to the index of the passed String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLevelOrder

public CustomLevelOrder()
Constructor - initializes the CustomLevelOrder attributes
Method Detail

insertLevel

public void insertLevel(int location,
                        java.lang.String level)
This function allows the user to add custom level(s) to level list.
Parameters:
location - The slot number where the added level will be saved
level - The name of the level being added
Precondition:The slot number desired is empty
Postcondition:The added level will be saved in the desired slot with the desired name

addLevel

public void addLevel(java.lang.String level)
This function allows the user to add custom level(s) to level list.
Parameters:
level - The name of the level being added
Precondition:None
Postcondition:The added level will be saved at the end of the customLevelOrder vector with the desired name

removeLevel

public void removeLevel(int location)
This function allows the user to remove custom level(s) from level list.
Parameters:
location - the location of the level to be removed from the list
Precondition:There is a level in the customLevelOrder Vector matching the level string
Postcondition:The desired level to be will be removed from the customLevelOrder Vector

setCurrentLevel

public void setCurrentLevel(java.lang.String levelName)
sets the currentLevel to the index of the passed String
Parameters:
levelName - the level name of the new current level
Precondition:a level with the name contained by levelName exists.
Postcondition:currentLevel is set to the index of the element levelName

getCurrentLevel

public java.lang.String getCurrentLevel()
Returns the name of the current level in the list
Returns:
Returns the level name of the current level

getLevelList

public java.lang.String[] getLevelList()
Returns a String array of the level names in the current customLevelOrder list
Returns:
Returns the level names of all the levels in the list

getNextLevel

public java.lang.String getNextLevel()
Returns the name of the next level in the list
Returns:
Returns the level name of the next level or null if there are no more levels

getPrevLevel

public java.lang.String getPrevLevel()
Returns the name of the previous level in the list
Returns:
Returns the level name of the previous level or null if the current level is the first level

isEmpty

public boolean isEmpty()
Returns true if the customLevelOrder Vector is empty and false if not
Returns:
Returns true if the customLevelOrder Vector is empty; otherwise it returns false.