cz.cmc.tcgui.datadef
Class TCQdisc

java.lang.Object
  extended bycz.cmc.tcgui.datadef.TCEntry
      extended bycz.cmc.tcgui.datadef.TCObject
          extended bycz.cmc.tcgui.datadef.TCQdisc
All Implemented Interfaces:
Cloneable

public class TCQdisc
extends TCObject

Class representing Qdisc and its specific properties, including alowed sub TCClasses.


Field Summary
static Exporter DEFAULT_EXPORTER
          Default QDisc exporter
static Generator DEFAULT_GENERATOR
          Default QDisc generator
 
Fields inherited from class cz.cmc.tcgui.datadef.TCObject
attributeEntry, DEFAULT_CHECKER, editor, exporter, generator, checker
 
Fields inherited from class cz.cmc.tcgui.datadef.TCEntry
description, id, label, name
 
Constructor Summary
TCQdisc(String id, String name, String label)
          Creates new TCQdisct with given id, name and label
 
Method Summary
 void addClass(TCClass newClass)
          Adds TCClass to the list of allowed subclasses of this Qdisc.
 TCClass getClass(int pos)
          Returns one TCClass from list of all alowed subclasses.
 Vector getClasses()
          Returns Vector containing all TCClasses which are allowed to be a subclass of this Qdisc.
 boolean isClassless()
          Returns true if this Qdisc is classless, false if classfull.
 void removeClass(TCClass oldClass)
          Removes TCClass from the list of allowed subclasses of this Qdisc.
 
Methods inherited from class cz.cmc.tcgui.datadef.TCObject
getAttributeEntry, getEditor, getExporter, getGenerator, getChecker, setAttributeEntry, setEditor, setExporter, setGenerator, setChecker
 
Methods inherited from class cz.cmc.tcgui.datadef.TCEntry
clone, getDescription, getID, getLabel, getName, setDescription, setID, setLabel, setName, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_GENERATOR

public static final Generator DEFAULT_GENERATOR
Default QDisc generator


DEFAULT_EXPORTER

public static final Exporter DEFAULT_EXPORTER
Default QDisc exporter

Constructor Detail

TCQdisc

public TCQdisc(String id,
               String name,
               String label)
Creates new TCQdisct with given id, name and label

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

isClassless

public boolean isClassless()
Returns true if this Qdisc is classless, false if classfull.

Returns:
true if this Qdisc is classless, false if classfull

addClass

public void addClass(TCClass newClass)
Adds TCClass to the list of allowed subclasses of this Qdisc. If it is first class added, then it changes state of this Qdisc from classless to classfull.

Parameters:
newClass - instance of TCClass which should be added to allowed subclasses

removeClass

public void removeClass(TCClass oldClass)
Removes TCClass from the list of allowed subclasses of this Qdisc. If it is last class removed, then it changes state of this Qdisc from classfull to classless.

Parameters:
oldClass - instance of TCClass which should be removed from allowed subclasses

getClasses

public Vector getClasses()
Returns Vector containing all TCClasses which are allowed to be a subclass of this Qdisc. For classless Qdiscs the Vector will be empty.

Returns:
Vector containing all TCClasses which are allowed to be a subclass of this Qdisc

getClass

public TCClass getClass(int pos)
                 throws ArrayIndexOutOfBoundsException
Returns one TCClass from list of all alowed subclasses. It is selected by position 'pos' in the list.

Parameters:
pos - position of the class to return
Returns:
instance of TCClass at selected position
Throws:
ArrayIndexOutOfBoundsException - if pos is negative or not less then the number of subclasses in the list