Jadex 0.941

jadex.examples.blackjack
Class GameState

java.lang.Object
  extended byjadex.examples.blackjack.GameState
All Implemented Interfaces:
BeanInfo

public class GameState
extends Object
implements BeanInfo

Java class for concept GameState of blackjack_beans ontology.


Field Summary
 PropertyChangeSupport pcs
          The helper object for bean events.
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
GameState()
          Default Constructor.
GameState(Player dealer, Player[] players)
          Default Constructor.
 
Method Summary
 void addPlayer(Player player)
          Add a player to this GameState.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 BeanInfo[] getAdditionalBeanInfo()
          Get additional bean info.
 BeanDescriptor getBeanDescriptor()
          Get the bean descriptor.
 Player getDealer()
          Get the dealer of this GameState.
 int getDefaultEventIndex()
          Get the default event index.
 int getDefaultPropertyIndex()
          Get the default property index.
 EventSetDescriptor[] getEventSetDescriptors()
          Get the event set descriptors.
 Image getIcon(int iconKind)
          Get the icon.
 MethodDescriptor[] getMethodDescriptors()
          Get the method descriptors.
 Player getPlayer(int idx)
          Get an players of this GameState.
 Player getPlayer(String name)
          Get a player per name.
 Player[] getPlayers()
          Get the players of this GameState.
 PropertyDescriptor[] getPropertyDescriptors()
          Get the property descriptors.
 Image loadImage(String resourceName)
          Load the image.
 boolean removePlayer(Player player)
          Remove a player from this GameState.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void setDealer(Player dealer)
          Set the dealer of this GameState.
 void setPlayer(int idx, Player player)
          Set a player to this GameState.
 void setPlayers(Player[] players)
          Set the players of this GameState.
 String toString()
          Get a string representation of this GameState.
 void updateDealer(Player dealer)
          Update the dealer of this GameState.
 void updateOrAddPlayer(Player player)
          Add a player to this GameState.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pcs

public PropertyChangeSupport pcs
The helper object for bean events.

Constructor Detail

GameState

public GameState()
Default Constructor.
Create a new GameState.


GameState

public GameState(Player dealer,
                 Player[] players)
Default Constructor.
Create a new GameState.

Method Detail

getDealer

public Player getDealer()
Get the dealer of this GameState.

Returns:
dealer

setDealer

public void setDealer(Player dealer)
Set the dealer of this GameState.

Parameters:
dealer - the value to be set

updateDealer

public void updateDealer(Player dealer)
Update the dealer of this GameState.

Parameters:
dealer - the value to be set

getPlayers

public Player[] getPlayers()
Get the players of this GameState.

Returns:
players

setPlayers

public void setPlayers(Player[] players)
Set the players of this GameState.

Parameters:
players - the value to be set

getPlayer

public Player getPlayer(int idx)
Get an players of this GameState.

Parameters:
idx - The index.
Returns:
players

setPlayer

public void setPlayer(int idx,
                      Player player)
Set a player to this GameState.

Parameters:
idx - The index.
player - a value to be added

addPlayer

public void addPlayer(Player player)
Add a player to this GameState.

Parameters:
player - a value to be removed

removePlayer

public boolean removePlayer(Player player)
Remove a player from this GameState.

Parameters:
player - a value to be removed
Returns:
True when the players have changed.

updateOrAddPlayer

public void updateOrAddPlayer(Player player)
Add a player to this GameState.

Parameters:
player - a value to be removed

getPlayer

public Player getPlayer(String name)
Get a player per name.

Parameters:
name - The name.
Returns:
The player.

getBeanDescriptor

public BeanDescriptor getBeanDescriptor()
Get the bean descriptor.

Specified by:
getBeanDescriptor in interface BeanInfo
Returns:
The bean descriptor.

getPropertyDescriptors

public PropertyDescriptor[] getPropertyDescriptors()
Get the property descriptors.

Specified by:
getPropertyDescriptors in interface BeanInfo
Returns:
The property descriptors.

getDefaultPropertyIndex

public int getDefaultPropertyIndex()
Get the default property index.

Specified by:
getDefaultPropertyIndex in interface BeanInfo
Returns:
The property index.

getEventSetDescriptors

public EventSetDescriptor[] getEventSetDescriptors()
Get the event set descriptors.

Specified by:
getEventSetDescriptors in interface BeanInfo
Returns:
The event set descriptors.

getDefaultEventIndex

public int getDefaultEventIndex()
Get the default event index.

Specified by:
getDefaultEventIndex in interface BeanInfo
Returns:
The default event index.

getMethodDescriptors

public MethodDescriptor[] getMethodDescriptors()
Get the method descriptors.

Specified by:
getMethodDescriptors in interface BeanInfo
Returns:
The method descriptors.

getAdditionalBeanInfo

public BeanInfo[] getAdditionalBeanInfo()
Get additional bean info.

Specified by:
getAdditionalBeanInfo in interface BeanInfo
Returns:
Get additional bean info.

getIcon

public Image getIcon(int iconKind)
Get the icon.

Specified by:
getIcon in interface BeanInfo
Returns:
The icon.

loadImage

public Image loadImage(String resourceName)
Load the image.

Returns:
The image.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - The PropertyChangeListener to be added.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - The PropertyChangeListener to be removed.

toString

public String toString()
Get a string representation of this GameState.

Returns:
The string representation.

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.