com.groovemanager.sampled.nondestructive
Class AbstractElement

java.lang.Object
  extended by com.groovemanager.sampled.nondestructive.AbstractElement
All Implemented Interfaces:
CutListElement
Direct Known Subclasses:
DeleteElement, InsertElement, ReplaceElement

public abstract class AbstractElement
extends java.lang.Object
implements CutListElement

Abstract subclass for implementation of CutListElements

Author:
Manu Robledo

Field Summary
private  java.util.ArrayList listeners
          List of ModificationListeners registered with this CutListElement
private  java.lang.String name
          Name of this CutListElement
 
Constructor Summary
AbstractElement(java.lang.String name)
          Construct a new CutListElement with the given name
 
Method Summary
 void addModificationListener(ModificationListener listener)
          Add a ModificationListener to this CutListElement that will be notified of any changes made to this CutListElement
 java.lang.String getName()
          Get this CutListElementīs name
protected  void notifyListeners()
          Notify all registered ModificationListeners about a change that occured to this element
 void removeModificationListener(ModificationListener listener)
          Remove a ModificationListener from this CutListElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.groovemanager.sampled.nondestructive.CutListElement
duplicate, getResult, replaceFile, usesFile
 

Field Detail

listeners

private java.util.ArrayList listeners
List of ModificationListeners registered with this CutListElement


name

private final java.lang.String name
Name of this CutListElement

Constructor Detail

AbstractElement

public AbstractElement(java.lang.String name)
Construct a new CutListElement with the given name

Parameters:
name - The name of the element
Method Detail

addModificationListener

public void addModificationListener(ModificationListener listener)
Description copied from interface: CutListElement
Add a ModificationListener to this CutListElement that will be notified of any changes made to this CutListElement

Specified by:
addModificationListener in interface CutListElement
Parameters:
listener - The ModificationListener to add
See Also:
CutListElement.addModificationListener(com.groovemanager.sampled.nondestructive.ModificationListener)

getName

public java.lang.String getName()
Description copied from interface: CutListElement
Get this CutListElementīs name

Specified by:
getName in interface CutListElement
Returns:
A short String describing, what this CutListElement does (e.g. "Delete")
See Also:
CutListElement.getName()

notifyListeners

protected void notifyListeners()
Notify all registered ModificationListeners about a change that occured to this element


removeModificationListener

public void removeModificationListener(ModificationListener listener)
Description copied from interface: CutListElement
Remove a ModificationListener from this CutListElement

Specified by:
removeModificationListener in interface CutListElement
Parameters:
listener - The ModificationListener to remove
See Also:
CutListElement.removeModificationListener(com.groovemanager.sampled.nondestructive.ModificationListener)