Mp3dings 
20100427

net.sourceforge.mp3dings.utils
Class FilenamePatterns

java.lang.Object
  extended by net.sourceforge.mp3dings.utils.FilenamePatterns

public class FilenamePatterns
extends Object

A set of patterns that can be used to retrieve information from an mp3 filename.

Author:
ringler

Field Summary
static String DEFAULT_PATTERN
          The default pattern for Artist (\1) and Title (\3)*
static String DEFAULT_TRACK_PATTERN
          The default pattern for Track (\1) *
 
Constructor Summary
FilenamePatterns()
          Constructs*
 
Method Summary
 Object[] apply(String[] filenames, Field field)
          Description of the Method
 Object apply(String filename, Field field)
          Description of the Method
 void clear()
          Description of the Method
 String getCgString(Field field)
          Gets the cgString attribute of the FilenamePatterns object
 Field[] getFields()
          Gets the fields attribute of the FilenamePatterns object
 String getPattern(Field field)
          Gets the pattern attribute of the FilenamePatterns object
static FilenamePatterns load(Preferences p)
          Recreates previously saved FilenamePatterns from the specified preferences node.
static FilenamePatterns mp3dingsDefault()
          Description of the Method
 void putPattern(Field field, Pattern p, String cgs)
          Description of the Method
 void putPattern(Field field, String p, String cgs)
          Description of the Method
 void save(Preferences p)
          Saves these FilenamePatterns to a Preferences node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PATTERN

public static final String DEFAULT_PATTERN
The default pattern for Artist (\1) and Title (\3)*

See Also:
Constant Field Values

DEFAULT_TRACK_PATTERN

public static final String DEFAULT_TRACK_PATTERN
The default pattern for Track (\1) *

See Also:
Constant Field Values
Constructor Detail

FilenamePatterns

public FilenamePatterns()
Constructs*

Method Detail

putPattern

public void putPattern(Field field,
                       Pattern p,
                       String cgs)
Description of the Method

Parameters:
field - Description of the Parameter
p - Description of the Parameter
cgs - Description of the Parameter

putPattern

public void putPattern(Field field,
                       String p,
                       String cgs)
Description of the Method

Parameters:
field - Description of the Parameter
p - Description of the Parameter
cgs - Description of the Parameter

getFields

public Field[] getFields()
Gets the fields attribute of the FilenamePatterns object

Returns:
The fields value

getPattern

public String getPattern(Field field)
Gets the pattern attribute of the FilenamePatterns object

Parameters:
field - Description of the Parameter
Returns:
The pattern value

getCgString

public String getCgString(Field field)
Gets the cgString attribute of the FilenamePatterns object

Parameters:
field - Description of the Parameter
Returns:
The cgString value

clear

public void clear()
Description of the Method


apply

public Object[] apply(String[] filenames,
                      Field field)
Description of the Method

Parameters:
filenames - Description of the Parameter
field - Description of the Parameter
Returns:
Description of the Return Value

apply

public Object apply(String filename,
                    Field field)
Description of the Method

Parameters:
filename - Description of the Parameter
field - Description of the Parameter
Returns:
Description of the Return Value

load

public static FilenamePatterns load(Preferences p)
Recreates previously saved FilenamePatterns from the specified preferences node. This method must ensure that loading the patterns from the node will restore the exact same set of filename patterns that has been saved to it with save(java.util.prefs.Preferences).

Parameters:
p - Description of the Parameter
Returns:
A previously saved FilenamePatterns object if the preferences node contains such an object or a default set of filename patterns otherwise.
See Also:
save(java.util.prefs.Preferences)

mp3dingsDefault

public static FilenamePatterns mp3dingsDefault()
Description of the Method

Returns:
Description of the Return Value

save

public void save(Preferences p)
Saves these FilenamePatterns to a Preferences node. This method must ensure that re-loading the patterns from the node will restore the exact same set of filename patterns.

Parameters:
p - Description of the Parameter
See Also:
load(java.util.prefs.Preferences)

Mp3dings 
20100427