|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.buffalo.fs7.qsymbol2.GateContainer
class wrapping a Mathlib Gate object. This class provides the ability of grouping gates together and hierarchical arrange them. It uses the addtional information provided by optional GateProperty objects to provide multiple iterations of gates and gate groups, gates with errors and as well handles the simulatin of decoherence.
Gates are grouped with the help of their name qualifier. For example the gates group1.gate0 and group1.gate1 would belong to the same group. Since this class is responsible for holding groups of gates it implements the Steppable interface with which it administers the sequential operation of gates.
Steppable,
Gate| Field Summary | |
protected java.util.Vector |
childs
holds child containers |
protected int |
currentIteration
holds the current iteration of the gate container |
protected java.lang.String |
description
description of the gate container |
protected java.lang.String |
gateName
holds the name of the gate in case this container is a leaf |
protected java.lang.String |
name
name of the gate container |
protected GateContainer |
parent
parent container |
protected int |
stepChild
holds the child which "has" the current step |
protected boolean |
stepFocus
holds the step focus. |
| Constructor Summary | |
GateContainer(GateContainer parent,
java.lang.String name,
java.lang.String gateName)
constructs a gate container |
|
| Method Summary | |
void |
addChildContainer(GateContainer child)
adds a given gate container as a child to this gate container. |
GateContainer |
addContainerIfPossible(GateContainer nextContainer)
this is a special method to add a single container column to an existing container and merge matching groups. |
void |
adjustGateContainer(java.lang.String oldTopLevel)
adjusts the child container if the top level container was renamed. |
void |
complete()
sets the step handling of the gate container to a completed state |
boolean |
containsGateContainer(java.lang.String name)
determines whether a gate container qualified by the given string parameter is a child of this gatecontainer. |
GateContainer |
getChildContainer(int i)
returns a specified child container. null if index out of range. |
int |
getChildCount()
returns the number of direct childs |
java.util.Enumeration |
getChilds()
returns the direct childs in an Enumeration object. |
java.util.Enumeration |
getChildsOnLevel(int level)
returns childs on a specified level in an Enumeration object. |
int |
getContainerDepth()
returns the depth of this container |
int |
getContainerLevel()
returns the container level |
double |
getCurrentDecayProbability()
|
double |
getCurrentDecoherenceRate()
|
Matrix |
getCurrentErrorMatrix()
returns the error modifier (2x2 matrix) for the current gate or null if none is specified |
Gate |
getCurrentGate()
returns the gate which corresponds to the current step. |
int |
getCurrentIteration()
returns the current iteration of this gate container. |
java.lang.String |
getDescription()
returns the description of this gate container as displayed by the tooltip |
int |
getDimension()
returns the dimension of the first gate contained by this container |
java.lang.String |
getFullName()
returns the full name of the gate container |
Gate |
getGate()
returns gate if container is leaf container otherwise null |
int |
getLeafCount()
determines the number of leaves parented by this container and its child containers |
java.util.Enumeration |
getLeaves()
returns an enumeration of the leaves parented by this container and its childs. |
int |
getMaxIteration()
returns the maximum number of iterations for this gate container. |
GateContainer |
getParent()
returns the parent of the gate container |
GateProperty |
getPropertyObject()
returns the property object |
int |
getStep()
returns the current step within this gate container |
protected int |
getStepChild()
returns the step child index |
int |
getStepCount()
returns the number of steps contained in this gatecontainer. |
java.lang.String |
getTopLevelName()
returns the top level name of the gate container. |
boolean |
hasStepFocus()
returns wheter the gate container has the step focus |
void |
insertChildContainer(GateContainer child,
int pos)
inserts a given gate container to a certain position of the child containers. |
boolean |
isLeafContainer()
determines whether container is a leaf container and therefore holds a gate |
boolean |
isStep()
returns true if the current gate container holds the current step |
protected void |
levelDown(java.lang.String newTopLevel)
brings a child container one level down. |
protected void |
levelUp(java.lang.String oldTopLevel)
brings a child container one level up. |
void |
removeChildContainer(GateContainer child)
removes a child container specified by child. |
void |
removeLeafGateContainer(java.lang.String name)
removes a leaf container specified by name |
void |
reset()
resets the step handling of the gate container |
void |
setCurrentIteration(int currentIteration)
sets the value of the current iteration |
void |
setGate(java.lang.String gateName)
sets the gate hold by this gatecontainer. only applicable to leaf containers. |
void |
setParent(GateContainer parent)
sets the parent of the gate container |
void |
setPropertyObject(GateProperty gateProperty)
registers the given gateProperty object as the property object of this gate containers. |
void |
setStepFocus(boolean stepFocus)
sets the step focus to this gate container. |
void |
setTopLevelName(java.lang.String name)
sets the top level name of the gate container. |
boolean |
stepBackward()
decreases the step by one. |
boolean |
stepForward()
increases the step by one. |
java.lang.String |
toString()
returns the most important information of the gate containe as a string. |
java.util.Enumeration |
ungroup()
ungroups a parent container into its child components. |
void |
updateDescription()
updates gate container description |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Vector childs
protected java.lang.String gateName
protected int stepChild
protected int currentIteration
protected boolean stepFocus
protected java.lang.String name
protected java.lang.String description
protected GateContainer parent
| Constructor Detail |
public GateContainer(GateContainer parent,
java.lang.String name,
java.lang.String gateName)
parent - the parent gate container or nulllevel - the level of the gate containername - the full name of the gate containergateName - the name of the gate| Method Detail |
public boolean containsGateContainer(java.lang.String name)
name - name of variable for gatecontainerpublic void addChildContainer(GateContainer child)
public void insertChildContainer(GateContainer child,
int pos)
public void removeChildContainer(GateContainer child)
child - the child container to be removedpublic int getChildCount()
public GateContainer getChildContainer(int i)
number - of child starting with 0public java.util.Enumeration getChilds()
public java.util.Enumeration getChildsOnLevel(int level)
level - child levelpublic void removeLeafGateContainer(java.lang.String name)
public java.util.Enumeration getLeaves()
public int getLeafCount()
public java.util.Enumeration ungroup()
protected void levelUp(java.lang.String oldTopLevel)
oldTopLevel - the old top level name of the gate containerprotected void levelDown(java.lang.String newTopLevel)
oldTopLevel - the old top level name of the gate containerpublic GateContainer addContainerIfPossible(GateContainer nextContainer)
public GateContainer getParent()
public void setParent(GateContainer parent)
public void adjustGateContainer(java.lang.String oldTopLevel)
public int getContainerLevel()
public int getContainerDepth()
public java.lang.String toString()
toString in class java.lang.Objectpublic GateProperty getPropertyObject()
public void setPropertyObject(GateProperty gateProperty)
public boolean isLeafContainer()
public int getDimension()
public java.lang.String getTopLevelName()
public void setTopLevelName(java.lang.String name)
public java.lang.String getFullName()
public int getCurrentIteration()
public void setCurrentIteration(int currentIteration)
public int getMaxIteration()
public Gate getGate()
public void setGate(java.lang.String gateName)
public Gate getCurrentGate()
public Matrix getCurrentErrorMatrix()
public double getCurrentDecoherenceRate()
public double getCurrentDecayProbability()
public java.lang.String getDescription()
public void updateDescription()
public void setStepFocus(boolean stepFocus)
public boolean hasStepFocus()
public int getStepCount()
getStepCount in interface Steppableprotected int getStepChild()
public boolean stepForward()
stepForward in interface Steppablepublic boolean stepBackward()
stepBackward in interface Steppablepublic int getStep()
getStep in interface Steppablepublic boolean isStep()
public void reset()
reset in interface Steppablepublic void complete()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||