de.cau.cs.kieler.core.kivi
Class UndoEffect

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractEffect
      extended by de.cau.cs.kieler.core.kivi.UndoEffect
All Implemented Interfaces:
IEffect

public class UndoEffect
extends AbstractEffect

Takes another effect and performs undo when executed.

Rating red

Constructor Summary
UndoEffect(IEffect e)
          Create a new undo effect.
 
Method Summary
 void execute()
          Execute the effect.
 IEffect getEffect()
          Get the effect that is supposed to be undone.
 boolean isMergeable()
          Determines whether this effect can be merged with previously scheduled effects.
 IEffect merge(IEffect otherEffect)
          Merge this effect with another effect.
 String toString()
          
 
Methods inherited from class de.cau.cs.kieler.core.kivi.AbstractEffect
schedule, scheduleUndo, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoEffect

public UndoEffect(IEffect e)
Create a new undo effect.

Parameters:
e - the effect to be undone
Method Detail

execute

public void execute()
Execute the effect.


isMergeable

public boolean isMergeable()
Determines whether this effect can be merged with previously scheduled effects.

Specified by:
isMergeable in interface IEffect
Overrides:
isMergeable in class AbstractEffect
Returns:
true if it can be merged, false if no search through the effect queue is necessary

merge

public IEffect merge(IEffect otherEffect)
Merge this effect with another effect. Will return null if the effects can not be merged.

Specified by:
merge in interface IEffect
Overrides:
merge in class AbstractEffect
Parameters:
otherEffect - the effect to merge with
Returns:
the newly merged effect, or null if no merge was possible.

getEffect

public IEffect getEffect()
Get the effect that is supposed to be undone.

Returns:
the effect

toString

public String toString()

Overrides:
toString in class AbstractEffect