Class Group

java.lang.Object
  |
  +--Group

public class Group
extends java.lang.Object

Group is really an iterator class. It gets created every time you need to iterate through the list of Player objects, which is really kept in Course. However, Group represents this list upon instantiation and is good for one run through of the Players involved. Bugs: none known

See Also:
also

Constructor Summary
Group(java.util.Vector players)
          the constructor takes in a Vector of Player objects over which to iterate.
 
Method Summary
 boolean morePlayersLeft()
          a boolen test to check if there are any more Players over which to iterate.
 Player nextPlayer()
          nextPlayer() is called to acces the next Player in the Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group(java.util.Vector players)
the constructor takes in a Vector of Player objects over which to iterate. Also know as a dictionary.

Method Detail

nextPlayer

public Player nextPlayer()
nextPlayer() is called to acces the next Player in the Group. be careful that you don't get a NullPointerException when you attempt to use this return value.

Returns:
the next Player object

morePlayersLeft

public boolean morePlayersLeft()
a boolen test to check if there are any more Players over which to iterate. This method could be useful in avoiding NullPointerExceptions.

Returns:
true when there are more players in the group