org.farng.mp3.filename
Class FilenameDelimiter

java.lang.Object
  extended byorg.farng.mp3.filename.AbstractFilenameComposite
      extended byorg.farng.mp3.filename.FilenameDelimiter
Direct Known Subclasses:
FilenameEndWordDelimiter, FilenameParenthesis, FilenameStartWordDelimiter

public class FilenameDelimiter
extends AbstractFilenameComposite

This class is a composite subclass which represents a delimiter within a filename. Delimiters are usually punctuation such as " - "

Version:
$Revision: 1.5 $
Author:
Eric Farng

Constructor Summary
FilenameDelimiter()
          Creates a new FilenameDelimiter object.
FilenameDelimiter(FilenameDelimiter copyObject)
          Creates a new FilenameDelimiter object.
 
Method Summary
 java.lang.String composeFilename()
          Create the filename that this composite represents
 ID3v2_4 createId3Tag()
           
 AbstractFilenameComposite getAfterComposite()
          Returns the composite that comes after the delimiter.
 AbstractFilenameComposite getBeforeComposite()
          Returns the composite that comes before the delimiter
 java.lang.String getDelimiter()
          Returns the delimiter that splits the two halfs of this composite
 java.util.Iterator iterator()
          Returns an iterator through each FilenameToken in this composite in the correct order for the file name.
 void matchAgainstKeyword(java.lang.Class id3v2FrameBodyClass)
          Match all elements of this composite against the keywords for this class type found in TagOptionSingleton.
 void matchAgainstTag(AbstractMP3Tag matchTag)
          Match all elements of this composite against the given tag.
 void setAfterComposite(AbstractFilenameComposite afterComposite)
          Sets the composite that comes after the delimiter.
 void setBeforeComposite(AbstractFilenameComposite beforeComposite)
          Sets the composite that comes before the delimiter
 void setDelimiter(java.lang.String delimiter)
          Sets the delimiter that splits the two halves of this composite
 void setFrame(AbstractID3v2Frame frame)
           
 
Methods inherited from class org.farng.mp3.filename.AbstractFilenameComposite
getOriginalToken, setOriginalToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilenameDelimiter

public FilenameDelimiter()
Creates a new FilenameDelimiter object.


FilenameDelimiter

public FilenameDelimiter(FilenameDelimiter copyObject)
Creates a new FilenameDelimiter object.

Method Detail

setAfterComposite

public void setAfterComposite(AbstractFilenameComposite afterComposite)
Sets the composite that comes after the delimiter.

Parameters:
afterComposite - The composite that comes after the delimiter.

getAfterComposite

public AbstractFilenameComposite getAfterComposite()
Returns the composite that comes after the delimiter.

Returns:
the composite that comes after the delimiter.

setBeforeComposite

public void setBeforeComposite(AbstractFilenameComposite beforeComposite)
Sets the composite that comes before the delimiter

Parameters:
beforeComposite - the composite that comes before the delimiter

getBeforeComposite

public AbstractFilenameComposite getBeforeComposite()
Returns the composite that comes before the delimiter

Returns:
the composite that comes before the delimiter

setDelimiter

public void setDelimiter(java.lang.String delimiter)
Sets the delimiter that splits the two halves of this composite

Parameters:
delimiter - delimiter that splits the two halves of this composite

getDelimiter

public java.lang.String getDelimiter()
Returns the delimiter that splits the two halfs of this composite

Returns:
the delimiter that splits the two halfs of this composite

setFrame

public void setFrame(AbstractID3v2Frame frame)
Specified by:
setFrame in class AbstractFilenameComposite

composeFilename

public java.lang.String composeFilename()
Create the filename that this composite represents

Specified by:
composeFilename in class AbstractFilenameComposite
Returns:
the filename that this composite represents

createId3Tag

public ID3v2_4 createId3Tag()
Specified by:
createId3Tag in class AbstractFilenameComposite

iterator

public java.util.Iterator iterator()
Returns an iterator through each FilenameToken in this composite in the correct order for the file name.

Specified by:
iterator in class AbstractFilenameComposite
Returns:
an iterator through each FilenameToken in this composite

matchAgainstKeyword

public void matchAgainstKeyword(java.lang.Class id3v2FrameBodyClass)
Match all elements of this composite against the keywords for this class type found in TagOptionSingleton. If the FilenameToken matches the keyword, the token's class is set.

Specified by:
matchAgainstKeyword in class AbstractFilenameComposite
Parameters:
id3v2FrameBodyClass - Class of keywords to match against.

matchAgainstTag

public void matchAgainstTag(AbstractMP3Tag matchTag)
Match all elements of this composite against the given tag. If any element of matchTag matches any element of this tag's composite, then this tag's composite leaf node's class is set.

Specified by:
matchAgainstTag in class AbstractFilenameComposite
Parameters:
matchTag - Tag to match against


Copyright (c) 2004 Eric Farng