cz.cmc.tcgui.datadef
Class AttributeTypeNumber

java.lang.Object
  extended bycz.cmc.tcgui.datadef.AttributeType
      extended bycz.cmc.tcgui.datadef.AttributeTypeNumber
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AttributeTypeFloat, AttributeTypeInt

public abstract class AttributeTypeNumber
extends AttributeType

Abstract parent implementing common properties for attribute types based on numbers.


Field Summary
protected  boolean nonzero
          The 'nonzero' flag
protected  boolean positive
          The 'positive' flag
 
Constructor Summary
AttributeTypeNumber()
          Creates new AttributeTypeNumber with "positive" and "nonzero" flags set to false.
AttributeTypeNumber(boolean positive, boolean nonzero)
          Creates new AttributeTypeNumber with "positive" and "nonzero" flags set to given values.
 
Method Summary
 boolean getNonzero()
          Checks whether this AttributeTypeNumber has 'nonzero' flag set.
 boolean getPositive()
          Checks whether this AttributeTypeNumber has 'positive' flag set.
 void setNonzero(boolean nonzero)
          Sets the 'nonzero' flag.
 void setPositive(boolean positive)
          Sets the 'positive' flag.
 String toString()
          Returns String representing this object.
 
Methods inherited from class cz.cmc.tcgui.datadef.AttributeType
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

positive

protected boolean positive
The 'positive' flag

See Also:
setPositive(boolean)

nonzero

protected boolean nonzero
The 'nonzero' flag

See Also:
setNonzero(boolean)
Constructor Detail

AttributeTypeNumber

public AttributeTypeNumber()
Creates new AttributeTypeNumber with "positive" and "nonzero" flags set to false.


AttributeTypeNumber

public AttributeTypeNumber(boolean positive,
                           boolean nonzero)
Creates new AttributeTypeNumber with "positive" and "nonzero" flags set to given values.

Parameters:
positive - boolean value to which to set the "positive" flag to
nonzero - boolean value to which to set the "nonzero" flag to
Method Detail

getPositive

public boolean getPositive()
Checks whether this AttributeTypeNumber has 'positive' flag set.

Returns:
true if this AttributeTypeNumber has 'positive' flag set, false otherwise

setPositive

public void setPositive(boolean positive)
Sets the 'positive' flag. AttributeTypeNumber has 'positive' flag set if value of corresponding Attribute must not be negative.

Parameters:
positive - New value for the 'positive' flag

getNonzero

public boolean getNonzero()
Checks whether this AttributeTypeNumber has 'nonzero' flag set.

Returns:
true if this AttributeTypeNumber has 'nonzero' flag set, false otherwise

setNonzero

public void setNonzero(boolean nonzero)
Sets the 'nonzero' flag. AttributeTypeNumber has 'nonzero' flag set if value of corresponding Attribute must not be zero.


toString

public String toString()
Returns String representing this object.

Specified by:
toString in class AttributeType
Returns:
String representation of this object