rails.game
Class StockSpaceType

java.lang.Object
  extended by rails.game.StockSpaceType
All Implemented Interfaces:
StockSpaceTypeI

public class StockSpaceType
extends java.lang.Object
implements StockSpaceTypeI

Objects of this class represent a type of square on the StockMarket with special properties,usually represented by a non-white square colour. The default type is "white", which has no special properties.


Field Summary
protected  java.awt.Color colour
           
protected  java.lang.String colourString
           
protected  java.lang.String name
           
protected  boolean noBuyLimit
           
protected  boolean noCertLimit
           
protected  boolean noHoldLimit
           
static java.lang.String WHITE
           
 
Fields inherited from interface rails.game.StockSpaceTypeI
COLOUR_TAG, ELEMENT_ID, NAME_TAG, NO_BUY_LIMIT_TAG, NO_CERT_LIMIT_TAG, NO_HOLD_LIMIT_TAG
 
Constructor Summary
StockSpaceType(java.lang.String name)
           
StockSpaceType(java.lang.String name, java.lang.String colour)
           
 
Method Summary
 java.awt.Color getColour()
           
 java.lang.String getName()
           
 boolean isNoBuyLimit()
           
 boolean isNoCertLimit()
           
 boolean isNoHoldLimit()
           
 void setNoBuyLimit(boolean b)
           
 void setNoCertLimit(boolean b)
           
 void setNoHoldLimit(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

colourString

protected java.lang.String colourString

colour

protected java.awt.Color colour

noCertLimit

protected boolean noCertLimit

noHoldLimit

protected boolean noHoldLimit

noBuyLimit

protected boolean noBuyLimit

WHITE

public static final java.lang.String WHITE
See Also:
Constant Field Values
Constructor Detail

StockSpaceType

public StockSpaceType(java.lang.String name)
               throws ConfigurationException
Throws:
ConfigurationException

StockSpaceType

public StockSpaceType(java.lang.String name,
                      java.lang.String colour)
               throws ConfigurationException
Throws:
ConfigurationException
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface StockSpaceTypeI
Returns:
The square type's name.

getColour

public java.awt.Color getColour()
Specified by:
getColour in interface StockSpaceTypeI
Returns:
The square type's colour.

isNoBuyLimit

public boolean isNoBuyLimit()
Specified by:
isNoBuyLimit in interface StockSpaceTypeI
Returns:
TRUE if the square type has no buy limit ("brown area")

isNoCertLimit

public boolean isNoCertLimit()
Specified by:
isNoCertLimit in interface StockSpaceTypeI
Returns:
TRUE if the square type has no certificate limit ("yellow area")

isNoHoldLimit

public boolean isNoHoldLimit()
Specified by:
isNoHoldLimit in interface StockSpaceTypeI
Returns:
TRUE if the square type has no hold limit ("orange area")

setNoBuyLimit

public void setNoBuyLimit(boolean b)
Specified by:
setNoBuyLimit in interface StockSpaceTypeI
Parameters:
b - TRUE if the square type has no buy limit ("brown area")

setNoCertLimit

public void setNoCertLimit(boolean b)
Specified by:
setNoCertLimit in interface StockSpaceTypeI
Parameters:
b - TRUE if the square type has no certificate limit ("yellow area")

setNoHoldLimit

public void setNoHoldLimit(boolean b)
Specified by:
setNoHoldLimit in interface StockSpaceTypeI
Parameters:
b - TRUE if the square type has no hold limit ("orange area")