edu.buffalo.fs7.mathlib
Class UnaryOp

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

public class UnaryOp
extends Operator

Class representing an unary operator. Implemented are +,-,'(transpose), " (complex conjugate).

See Also:
Tokenizer, BinaryOp, Parse

Fields inherited from class edu.buffalo.fs7.mathlib.MathObject
mathlib
 
Constructor Summary
UnaryOp(char c)
          creates a unary operator of the given type
 
Method Summary
 MathObject apply(Complex c1)
          applies the unary operator to a complex number
 MathObject apply(Gate g1)
          applies the unary operator to a gate object
 MathObject apply(MathObject o1)
          dispatch method.
 MathObject apply(Matrix m1)
          applies the unary operator to a matrix object
 MathObject apply(Vect v1)
          applies the unary operator to a vect object
 boolean leadingUnaryOp()
          returns whether the unary operator this object represents is a leading unary operator, i.e.
 java.lang.String toString()
          returns string representation of the operator
 
Methods inherited from class edu.buffalo.fs7.mathlib.MathObject
clone, toParseableString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnaryOp

public UnaryOp(char c)
creates a unary operator of the given type
Method Detail

apply

public MathObject apply(MathObject o1)
dispatch method. Since at compile time the bindings are not known, the Parse class needs to have this generic method.
See Also:
BinaryOp.apply(MathObject, MathObject)

apply

public MathObject apply(Complex c1)
applies the unary operator to a complex number

apply

public MathObject apply(Vect v1)
applies the unary operator to a vect object

apply

public MathObject apply(Matrix m1)
applies the unary operator to a matrix object

apply

public MathObject apply(Gate g1)
applies the unary operator to a gate object

leadingUnaryOp

public boolean leadingUnaryOp()
returns whether the unary operator this object represents is a leading unary operator, i.e. +,-

toString

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