|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
net.sf.jmp3renamer.DataManager
public class DataManager
This class holds the data used for renaming and tagging. The data is stored in DataSet objects which are stored in a vector. If you want to change the data, you have to do it via the DataManager. After changing any of the DataSets you have to notify all "interested" components by calling the method notifyObservers() (Observer/Observable pattern).
Nested Class Summary | |
---|---|
private class |
DataManager.Container
|
Field Summary | |
---|---|
static int |
CAPITALIZED
|
private Vector |
datasets
|
private static int |
id
|
private static DataManager |
instance
|
private Logger |
logger
|
static int |
LOWERCASE
|
static int |
UPPERCASE
|
Constructor Summary | |
---|---|
private |
DataManager()
|
Method Summary | |
---|---|
private String |
addLeadingZeros(String track,
int count)
|
void |
addObserver(Observer o)
If you have a component which should be notified about changes, you have to add your component via this method. |
void |
addRow(DataSet row)
|
private String |
capitalize(String string)
|
Vector |
getDatasets()
Returns the current DataSets. |
static DataManager |
getInstance()
|
static int |
getNextID()
|
void |
moveRow(int row,
int to)
This method moves a dataset to another row in the table. |
void |
notifyObservers()
If you have changed any of the DataSets, you have to notify all observers, so that they can show/work with the new data. |
void |
removeRow(int row)
|
void |
replaceBy(String r,
String b)
Replaces all substrings, which equal r, with b in all tag fields |
void |
setDatasets(Vector datasets)
Replaces the current datasets, with the new ones in the given vector. |
void |
setLeadingZeros(int count)
|
void |
setWordCase(int wordCase)
Changes the case of all words in the tag fields to UPPERCASE, lowercase or Capitalized |
void |
trySort()
This method tries to assign datasets to files, so that the user does not have to use the "up"- and "down"-buttons. |
Methods inherited from class java.util.Observable |
---|
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int id
private Logger logger
private Vector datasets
private static DataManager instance
public static final int CAPITALIZED
public static final int UPPERCASE
public static final int LOWERCASE
Constructor Detail |
---|
private DataManager()
Method Detail |
---|
public static DataManager getInstance()
public void addObserver(Observer o)
addObserver
in class Observable
public void notifyObservers()
notifyObservers
in class Observable
public Vector getDatasets()
public void setDatasets(Vector datasets)
datasets
- the new datasets in a vectorpublic void trySort()
public void moveRow(int row, int to)
row
- The row which should be movedto
- The row to which "row" should be movedpublic static int getNextID()
public void removeRow(int row)
public void addRow(DataSet row)
public void setLeadingZeros(int count)
private String addLeadingZeros(String track, int count)
public void replaceBy(String r, String b)
r
- b
- public void setWordCase(int wordCase)
wordCase
- private String capitalize(String string)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |