com.groovemanager.sampled.nondestructive
Interface CutListElement

All Known Implementing Classes:
AbstractElement, DeleteElement, InsertElement, ReplaceElement

public interface CutListElement

A CutListElement is used to add a modification to a CutList. The main task of a CutListElement is to create a modified CutListSource out of a given CutListSource.

Author:
Manu Robledo

Method Summary
 void addModificationListener(ModificationListener listener)
          Add a ModificationListener to this CutListElement that will be notified of any changes made to this CutListElement
 CutListElement duplicate()
          Create a new CutListElement out of this one that is independent of any changes made to this one.
 java.lang.String getName()
          Get this CutListElementīs name
 CutListSource getResult(CutListSource source)
          Create a new CutListSource out of the given source including this CutListElementīs modification.
 void removeModificationListener(ModificationListener listener)
          Remove a ModificationListener from this CutListElement
 void replaceFile(java.io.File from, java.io.File to)
          Replace all references to the given source file inside this CutListElement with references to the given target file.
 boolean usesFile(java.io.File f)
          Ask this CutListElement whether it relies on the contents of the given file.
 

Method Detail

addModificationListener

void addModificationListener(ModificationListener listener)
Add a ModificationListener to this CutListElement that will be notified of any changes made to this CutListElement

Parameters:
listener - The ModificationListener to add

duplicate

CutListElement duplicate()
Create a new CutListElement out of this one that is independent of any changes made to this one.

Returns:
An independent copy of this CutListElement

getName

java.lang.String getName()
Get this CutListElementīs name

Returns:
A short String describing, what this CutListElement does (e.g. "Delete")

getResult

CutListSource getResult(CutListSource source)
Create a new CutListSource out of the given source including this CutListElementīs modification.

Parameters:
source - The CutListSource to modify
Returns:
A modified CutListSource

removeModificationListener

void removeModificationListener(ModificationListener listener)
Remove a ModificationListener from this CutListElement

Parameters:
listener - The ModificationListener to remove

replaceFile

void replaceFile(java.io.File from,
                 java.io.File to)
Replace all references to the given source file inside this CutListElement with references to the given target file. This may be because the source file is about to change and to avoid inconsistencies. If the given source file is not used by this CutListElement, the call can be ignored.

Parameters:
from - The source file to replace
to - The target file to replace with

usesFile

boolean usesFile(java.io.File f)
Ask this CutListElement whether it relies on the contents of the given file. This is needed, if a file should be overwritten and it must be checked that this doesnīt cause any inconsistencies

Parameters:
f - The file to ask for
Returns:
true, if a change to the given fileīs content would also mean a change to this element, false otherwise