edu.buffalo.fs7.mathlib
Class GateProperty

java.lang.Object
  |
  +--edu.buffalo.fs7.mathlib.MathObject
        |
        +--edu.buffalo.fs7.mathlib.Argument
              |
              +--edu.buffalo.fs7.mathlib.GateProperty
All Implemented Interfaces:
java.lang.Cloneable

public class GateProperty
extends Argument

Class representing properties of a gate object, like repetitions, parameters for error behavior of gates, parameters for decoherence simulation. The idea is to provide optional additional information for the processing of gates. This class is used to encode gate specific information of circuits into files and their reconstruction.

Properties are added with the command 'gateproperty("gatename", a=123)' and the property object can be handled within the MathObject structure (e.g. save like a variable). The gateproperty object will be called "gatename_property".

See Also:
Gate

Field Summary
protected  java.util.Hashtable properties
           
 
Fields inherited from class edu.buffalo.fs7.mathlib.MathObject
mathlib
 
Constructor Summary
GateProperty(MathObject o)
          clone constructor
GateProperty(java.lang.String gate)
          creates a new property object
 
Method Summary
 void addProperty(java.lang.String property, Argument value)
          adds a property to the property object.
 java.lang.Object clone()
          clones the GateProperty object
 boolean equals(MathObject o)
          equality predicate
 java.lang.String getGate()
          returns the gate to which this property object belongs.
 Argument getProperty(java.lang.String property)
          returns the complex value of a property specified by the string.
 java.util.Enumeration getPropertyKeys()
          returns the name of all properties as an enumeration
 Argument removeProperty(java.lang.String property)
          removes a property of the property object.
 void setGate(java.lang.String gate)
          sets the gate to which this property object belongs
 java.lang.String toParseableString()
          returns a parsable sequence of commands representing this property object
 java.lang.String toString()
          returns the contained properties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

properties

protected java.util.Hashtable properties
Constructor Detail

GateProperty

public GateProperty(java.lang.String gate)
creates a new property object

GateProperty

public GateProperty(MathObject o)
clone constructor
Method Detail

clone

public java.lang.Object clone()
clones the GateProperty object
Overrides:
clone in class MathObject

addProperty

public void addProperty(java.lang.String property,
                        Argument value)
adds a property to the property object. If the property is already assigned, the old value is overwritten.
Parameters:
property - the name of the property
value - the complex value of the property

removeProperty

public Argument removeProperty(java.lang.String property)
removes a property of the property object. If the property is existing, the property is returned otherwise null.

getProperty

public Argument getProperty(java.lang.String property)
returns the complex value of a property specified by the string. If the property is not available, null is returned.
Returns:
value of property or null

equals

public boolean equals(MathObject o)
equality predicate
Overrides:
equals in class Argument

toString

public java.lang.String toString()
returns the contained properties
Overrides:
toString in class MathObject
Following copied from class: edu.buffalo.fs7.mathlib.MathObject
See Also:
MathObject.toParseableString()

toParseableString

public java.lang.String toParseableString()
returns a parsable sequence of commands representing this property object
Overrides:
toParseableString in class MathObject
Following copied from class: edu.buffalo.fs7.mathlib.MathObject
See Also:
MathObject.toString()

setGate

public void setGate(java.lang.String gate)
sets the gate to which this property object belongs

getGate

public java.lang.String getGate()
returns the gate to which this property object belongs.

getPropertyKeys

public java.util.Enumeration getPropertyKeys()
returns the name of all properties as an enumeration