cz.cmc.tcgui.datadef
Class AttributeTypeSet

java.lang.Object
  extended bycz.cmc.tcgui.datadef.AttributeType
      extended bycz.cmc.tcgui.datadef.AttributeTypeSet
All Implemented Interfaces:
Cloneable

public class AttributeTypeSet
extends AttributeType

AttributeTypeSet is used to mark attributes which store set of elements.


Constructor Summary
AttributeTypeSet()
          Creates new AttributeTypeSet with min and max cardinality set to 1.
AttributeTypeSet(int minCardinality, int maxCardinality)
          Creates new AttributeTypeSet with min and max cardinality set to given values.
 
Method Summary
 boolean addSetElement(String newSetElement)
          Adds new String element to list(set) of allowed set elements.
 Object clone()
          Clones this AttributeTypeSet
 boolean containsElement(String element)
          Tests whether element is already present in the set definition domain.
 int getMaxCardinality()
          Returns value of maximal cardinality of this AttributeTypeSet.
 int getMinCardinality()
          Returns value of minimal cardinality of this AttributeTypeSet.
 boolean removeSetElement(String setElement)
          Removes String element from list(set) of allowed set elements.
 String[] setElements()
          Returns array of Strings, containing allowed set elements.
 String toString()
          Returns String representing this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeTypeSet

public AttributeTypeSet()
Creates new AttributeTypeSet with min and max cardinality set to 1. It should be thought of as "enum" type.


AttributeTypeSet

public AttributeTypeSet(int minCardinality,
                        int maxCardinality)
Creates new AttributeTypeSet with min and max cardinality set to given values.

Parameters:
minCardinality - limit for minimal cardinality
maxCardinality - limit for maximal cardinality
Method Detail

getMinCardinality

public int getMinCardinality()
Returns value of minimal cardinality of this AttributeTypeSet.

Returns:
minimal cardinality

getMaxCardinality

public int getMaxCardinality()
Returns value of maximal cardinality of this AttributeTypeSet.

Returns:
maximal cardinality

addSetElement

public boolean addSetElement(String newSetElement)
Adds new String element to list(set) of allowed set elements. (adds new String to domain of this set)

Parameters:
newSetElement - String representing new element of set domain
Returns:
true if element added, false otherwise

removeSetElement

public boolean removeSetElement(String setElement)
Removes String element from list(set) of allowed set elements. (removes String from domain of this set)

Parameters:
setElement - String representing element of set domain
Returns:
true if element removed, false otherwise

setElements

public String[] setElements()
Returns array of Strings, containing allowed set elements. (returns set definition domain)

Returns:
set definition domain as array of Strings

containsElement

public boolean containsElement(String element)
Tests whether element is already present in the set definition domain.

Parameters:
element - String representing the element to be tested
Returns:
true if element is already present, false otherwise

clone

public Object clone()
Clones this AttributeTypeSet

Overrides:
clone in class AttributeType
Returns:
cloned AttributeTypeSet

toString

public String toString()
Returns String representing this object.

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