mauda.operation
Class SimpleOperation

java.lang.Object
  extended by mauda.operation.SimpleOperation
All Implemented Interfaces:
java.util.Comparator
Direct Known Subclasses:
Operation, SubOperation

public class SimpleOperation
extends java.lang.Object
implements java.util.Comparator

The super-class of Operation and SubOperation

Author:
Markus Krebs

Field Summary
static int NULL
          Value for non-filled parameters, like it is in DELETE-MIN the case.
 
Constructor Summary
SimpleOperation(java.lang.String o, int p1, int p2)
          Creates a SimpleOperation
 
Method Summary
 java.lang.Object clone()
           
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 boolean equals(java.lang.Object o)
           
 void execute(java.lang.Object o)
          Executes an operation on the data-structure.
 java.lang.String getID()
          Gets the ID
 int getParameter1()
          Gets the 1st parameter
 int getParameter2()
          Gets the 2nd parameter
 void load(java.lang.String opString)
          Loads this operation from a string-representation
 java.lang.String out()
          Creates a string-representation of this operation, that can be used in GUIs.
 java.lang.String save()
          Creates a string-representation of this operation for saving- purposes.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final int NULL
Value for non-filled parameters, like it is in DELETE-MIN the case.

See Also:
Constant Field Values
Constructor Detail

SimpleOperation

public SimpleOperation(java.lang.String o,
                       int p1,
                       int p2)
Creates a SimpleOperation

Parameters:
o - ID
p1 - 1st parameter
p2 - 2st parameter
Method Detail

getID

public java.lang.String getID()
Gets the ID

Returns:
ID

getParameter1

public int getParameter1()
Gets the 1st parameter

Returns:
1st parameter

getParameter2

public int getParameter2()
Gets the 2nd parameter

Returns:
2nd parameter

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

execute

public void execute(java.lang.Object o)
Executes an operation on the data-structure.

Parameters:
o - data-structure

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

out

public java.lang.String out()
Creates a string-representation of this operation, that can be used in GUIs. E.g.: In feedback-messages

Returns:
string-representation

save

public java.lang.String save()
Creates a string-representation of this operation for saving- purposes.

Returns:
string-representation

load

public void load(java.lang.String opString)
Loads this operation from a string-representation

Parameters:
opString - string-representation