cz.cmc.tcgui.datadef
Class AttributeEntry

java.lang.Object
  extended bycz.cmc.tcgui.datadef.TCEntry
      extended bycz.cmc.tcgui.datadef.AttributeEntry
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Attribute, AttributeGroup

public abstract class AttributeEntry
extends TCEntry

Abstract parent for AttributeGroup and Attribute, implements their common functionality. AttributeEntry is identified by it's position in the data definition hierarchy. It has also an id parameter, but it serves only for generators, checkers and exporters (not for unique identification).


Field Summary
protected  boolean generated
          The 'generated' flag
protected  boolean interpreted
          The 'interpreted' flag
protected  int maxInstances
          Maximum number of required instances of this AttributeEntry to be used.
protected  int minInstances
          Minimum number of required instances of this AttributeEntry to be used.
protected  AttributeGroup parent
          Reference to the parent AttributeGroup
protected  int position
          AttributeEntry position within the attribute group
static int UNLIMITED_INSTANCES
          Constant to be used with attribute instance count specification.
protected  boolean virtual
          The 'virtual' flag
 
Fields inherited from class cz.cmc.tcgui.datadef.TCEntry
description, id, label, name
 
Constructor Summary
AttributeEntry()
          Creates a new AttributeEntry
AttributeEntry(String id, String name, String label)
          Creates a new AttributeEntry with given id, name and label
 
Method Summary
 Object clone()
          Clones this AttributeEntry
 boolean getGenerated()
          Checks whether this AttributeEntry is generated.
 boolean getInterpreted()
          Checks whether this AttributeEntry is interpreted.
 int getMaxInstances()
           
 int getMinInstances()
           
 AttributeGroup getParent()
          Returns parent of this AttributeEntry.
 int getPosition()
          Gets the position within parent AttributeGroup
 boolean getVirtual()
          Checks whether this AttributeEntry is virtual.
 void setGenerated(boolean generated)
          Sets the generated flag.
 void setInterpreted(boolean interpreted)
          Sets the interpreted flag.
 void setMaxInstances(int maxInstances)
          Sets the maximal number of instances
 void setMinInstances(int minInstances)
          Sets the minimal number of instances
 void setParent(AttributeGroup parent)
          Sets parent of this AttributeEntry
protected  void setPosition(int position)
          Sets the position within AttributeGroup.
 void setVirtual(boolean virtual)
          Sets the virtual flag.
 String toString()
          Creates and returns string representation of this TCEntry.
 
Methods inherited from class cz.cmc.tcgui.datadef.TCEntry
getDescription, getID, getLabel, getName, setDescription, setID, setLabel, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNLIMITED_INSTANCES

public static final int UNLIMITED_INSTANCES
Constant to be used with attribute instance count specification.

See Also:
Constant Field Values

parent

protected AttributeGroup parent
Reference to the parent AttributeGroup


position

protected int position
AttributeEntry position within the attribute group


generated

protected boolean generated
The 'generated' flag

See Also:
setGenerated(boolean)

virtual

protected boolean virtual
The 'virtual' flag

See Also:
setVirtual(boolean)

interpreted

protected boolean interpreted
The 'interpreted' flag

See Also:
setInterpreted(boolean)

minInstances

protected int minInstances
Minimum number of required instances of this AttributeEntry to be used. Zero means nonmandatory attribute. This is NOT applied if this attribute entry does not match the used attribute set. Thus do not set this to zero only for the reason of alternate syntax. This is one by default.


maxInstances

protected int maxInstances
Maximum number of required instances of this AttributeEntry to be used. This is one by default.

See Also:
minInstances
Constructor Detail

AttributeEntry

public AttributeEntry()
Creates a new AttributeEntry


AttributeEntry

public AttributeEntry(String id,
                      String name,
                      String label)
Creates a new AttributeEntry with given id, name and label

Parameters:
id - id of the AttributeEntry
name - name of the AttributeEntry
label - human-readable label of the AttributeEntry
Method Detail

getParent

public AttributeGroup getParent()
Returns parent of this AttributeEntry.

Returns:
parent of this AttributeEntry
See Also:
parent

setParent

public void setParent(AttributeGroup parent)
Sets parent of this AttributeEntry

Parameters:
parent - parent to be set
See Also:
parent

getPosition

public int getPosition()
Gets the position within parent AttributeGroup

See Also:
position

setPosition

protected void setPosition(int position)
Sets the position within AttributeGroup. Note that the positions within a AttributeGroup should NOT be the same.

See Also:
position

getGenerated

public boolean getGenerated()
Checks whether this AttributeEntry is generated.

Returns:
true if this AttributeEntry is generated, false otherwise

setGenerated

public void setGenerated(boolean generated)
Sets the generated flag. AttributeEntry is generated if its value is programatically computed from other attributes values.

Parameters:
generated - New value for the generated flag

getVirtual

public boolean getVirtual()
Checks whether this AttributeEntry is virtual.

Returns:
true if this AttributeEntry is virtual, false otherwise

setVirtual

public void setVirtual(boolean virtual)
Sets the virtual flag. AttributeEntry is virtual if it has no direct counterpart in the iproute2 world.

Parameters:
virtual - New value for the virtual flag

getInterpreted

public boolean getInterpreted()
Checks whether this AttributeEntry is interpreted.

Returns:
true if this AttributeEntry is interpreted, false otherwise

setInterpreted

public void setInterpreted(boolean interpreted)
Sets the interpreted flag. AttributeEntry is interpreted if some other AttributeEntry is programatically computed from this AttributeEntry.

Parameters:
interpreted - New value for the interpreted flag

getMinInstances

public int getMinInstances()
Returns:
minimal number of instances
See Also:
minInstances

setMinInstances

public void setMinInstances(int minInstances)
Sets the minimal number of instances

Parameters:
minInstances - new minimal number of instances

getMaxInstances

public int getMaxInstances()
Returns:
maximal number of instances
See Also:
maxInstances

setMaxInstances

public void setMaxInstances(int maxInstances)
Sets the maximal number of instances

Parameters:
maxInstances - new maximal number of instances

clone

public Object clone()
Clones this AttributeEntry

Overrides:
clone in class TCEntry
Returns:
cloned AttributeEntry

toString

public String toString()
Description copied from class: TCEntry
Creates and returns string representation of this TCEntry.

Overrides:
toString in class TCEntry
Returns:
String representing this object