org.farng.mp3.filename
Class FilenameToken

java.lang.Object
  extended byorg.farng.mp3.filename.AbstractFilenameComposite
      extended byorg.farng.mp3.filename.FilenameToken

public class FilenameToken
extends AbstractFilenameComposite

This composite subclass is the leaf of the tree. It contains the actual strings found in the filename.

Version:
$Revision: 1.7 $
Author:
Eric Farng

Constructor Summary
FilenameToken()
          Creates a new FilenameToken object.
FilenameToken(FilenameToken copyObject)
          Creates a new FilenameToken object.
 
Method Summary
 java.lang.String composeFilename()
          Reconstruct the filename that is represented by this composite.
 ID3v2_4 createId3Tag()
           
 java.lang.Class getId3v2FrameBodyClass()
          Returns the ID3v2 frame body that this token represents
 java.lang.String getToken()
          Return the token that this class contains
 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 matchId3v2FrameBodyClass)
          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 setFrame(AbstractID3v2Frame frame)
           
 void setId3v2FrameBodyClass(java.lang.Class id3v2FrameBodyClass)
          Sets the ID3v2 frame body that this token represents
 void setToken(java.lang.String token)
          Sets the token that this class contains
 java.lang.String toString()
          Returns a string containing debug information about this class
 
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, wait, wait, wait
 

Constructor Detail

FilenameToken

public FilenameToken()
Creates a new FilenameToken object.


FilenameToken

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

Method Detail

setFrame

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

setId3v2FrameBodyClass

public void setId3v2FrameBodyClass(java.lang.Class id3v2FrameBodyClass)
Sets the ID3v2 frame body that this token represents

Parameters:
id3v2FrameBodyClass - the ID3v2 frame body that this token represents

getId3v2FrameBodyClass

public java.lang.Class getId3v2FrameBodyClass()
Returns the ID3v2 frame body that this token represents

Returns:
the ID3v2 frame body that this token represents

setToken

public void setToken(java.lang.String token)
Sets the token that this class contains

Parameters:
token - the token that this class contains

getToken

public java.lang.String getToken()
Return the token that this class contains

Returns:
the token that this class contains

composeFilename

public java.lang.String composeFilename()
Reconstruct the filename that is represented by this composite.

Specified by:
composeFilename in class AbstractFilenameComposite
Returns:
the filename that is represented by this composite.

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 matchId3v2FrameBodyClass)
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:
matchId3v2FrameBodyClass - 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

toString

public java.lang.String toString()
Returns a string containing debug information about this class

Returns:
a string containing debug information about this class


Copyright (c) 2004 Eric Farng