public class Artist extends Object implements Comparable<Artist>
Modifier and Type | Field and Description |
---|---|
(package private) Vector<Album> |
albums |
static Comparator<Artist> |
ArtistComparator
A Comparator that can be used to sort Artist vectors.
|
static Comparator<Artist> |
ArtistComparatorIgnoreCase
A case in-sensitive Comparator that can be used to sort Artist vectors.
|
private String |
artistDir_ |
private File |
artistDirFile_ |
private MusicbrainzArtist |
mb_ |
private String |
name_ |
private int |
numAlbums_ |
private int |
numSongs_ |
private char[] |
refKEY_
The 3 digit HEX char/byte Reference KEY for this Artist .
|
static String |
SYSTEM_FILE_SEPERATOR
A holder for this clients System File Separator.
|
static String |
SYSTEM_LINE_SEPERATOR
A holder for this clients System line termination separator.
|
static boolean |
useMusicBrainz_
Flag to control if this class should use Musibrainz lookups to augment the information about this Artist.
|
Constructor and Description |
---|
Artist(String artistFileDirPath)
Constructor for Artist.
|
Artist(String artistFileDirPath,
boolean useMusicbrainz)
Constructor for Artist.
|
Artist(String artistFileDirPath,
boolean useMusicbrainz,
int refKey)
Constructor for Artist.
|
Modifier and Type | Method and Description |
---|---|
String[] |
albumNames()
albumNames with spaces in names .
|
String[] |
albumNames(boolean removeSpaces)
Each album in an array.
|
String |
artistName()
The actual fully expanded, cleaned of underscores and explicits / usable Artists name.
|
String |
artistName(boolean removeSpaces)
The actual cleaned of underscores and explicits / usable Artists name.
|
int |
compareTo(Artist other)
implements Comparator.
|
int |
compareToIgnoreCase(Artist other)
Comparator for ignore case sort.
|
Vector<Album> |
getAlbums() |
Vector<Album> |
getAlbums(boolean sortByYear) |
String |
getArtistDir()
Get Method for class field 'artistDir_'.
|
String |
getMusicBrainzID()
Get Method for class field 'mb_.id'.
|
int |
getNumberOfAlbums()
Gets you a cheeseBurger.
|
int |
getNumberOfSongs() |
int |
getNumberOfSongs(boolean useCache)
counts and returns the number of songs in ALL albums.
|
String |
getRefKeyString() |
String |
listAlbums()
Each album listed One Per line of the returned String (with spaces in the filename).
|
String |
listAlbums(boolean removeSpaces)
Each album listed One Per line of the returned String.
|
void |
markLovedSongs(Vector<String> lovedTrackNames) |
String |
name()
ArtistName with spaces in name .
|
String |
name(boolean removeSpaces) |
void |
readAlbums()
Reads all the album subDirs of this Artist into the class var albums.
|
String |
toJsonString(int songIndex)
lists all songs in all albums in a JSON string.
|
String |
toMetaJson()
Cobbles together the meta-data information about this Artist Directory in a JSON string.
|
JsonObject |
toMetaJsonObject()
Cobbles together the meta-data information about this Artist Directory in a JSON Object.
|
void |
writeMetaJsonFile() |
public static final String SYSTEM_FILE_SEPERATOR
public static final String SYSTEM_LINE_SEPERATOR
private File artistDirFile_
private String artistDir_
private int numAlbums_
private int numSongs_
private MusicbrainzArtist mb_
public static boolean useMusicBrainz_
private char[] refKEY_
public static Comparator<Artist> ArtistComparator
public static Comparator<Artist> ArtistComparatorIgnoreCase
public Artist(String artistFileDirPath) throws Exception
Exception
- if the artist file dire does not exist of can't read as a dir.public Artist(String artistFileDirPath, boolean useMusicbrainz) throws Exception
Exception
- if the artist file dir does not exist of can't read as a dir.public Artist(String artistFileDirPath, boolean useMusicbrainz, int refKey) throws Exception
refKey
- is the unique key value indicating the subDirNumber in the dir - MUST be less than 4096 because it is represented by a 3 char HEX string.Exception
- if the artist file dir does not exist of can't read as a dir.public void readAlbums()
public String[] albumNames()
public String[] albumNames(boolean removeSpaces)
removeSpaces
- is a boolean flag to remove any spaces from the albumName using CamelCase.public int getNumberOfAlbums()
public int getNumberOfSongs()
public int getNumberOfSongs(boolean useCache)
public void markLovedSongs(Vector<String> lovedTrackNames)
public String listAlbums()
public String listAlbums(boolean removeSpaces)
removeSpaces
- is a boolean flag to remove any spaces from the albumName using CamelCase.public String artistName()
public String artistName(boolean removeSpaces)
public String getMusicBrainzID()
public String getArtistDir()
public String getRefKeyString()
public String toMetaJson()
public JsonObject toMetaJsonObject()
public String toJsonString(int songIndex)
public void writeMetaJsonFile()
public int compareToIgnoreCase(Artist other)
public int compareTo(Artist other)
compareTo
in interface Comparable<Artist>
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses