|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.musicontroller.gui.edit.TrackList
public class TrackList
Helper class to construct a track listing of track index numbers satisfying some condition. For example, the tracks on which some artist plays guitar. Tracks can be "added" using the add() method. Adding a track increases the track counter. The track counter can be queried using getTrackCount(). The same track index number may be added more than once. Each addition will increase the track counter, but the track list will contain each added track index number exactly once.
Constructor Summary | |
---|---|
TrackList()
Default constructor. |
Method Summary | |
---|---|
void |
add(int trackno)
Adds a track to the listing, increasing the track counter. |
boolean |
contains(int trackno)
Tests if the track number is contained in the Tracklist. |
boolean |
containsAllSongs()
Returns true if the number of added songs is greater or equal than the highestIndexNo. |
static TrackList |
createInstance(Playlist playlist)
Factory method creates a tracklist containing all tracks in the playlist. |
static TrackList |
createInstance(java.lang.String tracks)
Factory method for constructing TrackLists from strings representing track numbers separated by commas. |
boolean |
equals(java.lang.Object other)
Two TrackLists are equal if they contain the same tracks. |
int |
getHighestIndexNr()
Getter for the highest track number. |
int |
getTrackCount()
Getter for the track counter. |
java.lang.String |
getTrackListing()
Returns a string containing the numerically sorted track numbers of the added tracks separated by commas. |
int |
hashCode()
|
void |
setHighestIndexNr(int highestTrackNo)
Sets the index number of the last song in the tracklist. |
void |
setTracks(java.lang.String tracks)
Adds all tracks in the tracks String to the list of tracks indexes. |
java.lang.String |
toString()
Returns a short human readable representation of the track list. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TrackList()
Method Detail |
---|
public int getTrackCount()
public void add(int trackno)
trackno
- The track index number.public java.lang.String getTrackListing()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static TrackList createInstance(java.lang.String tracks)
tracks
- The string representing the track numbers.
public static TrackList createInstance(Playlist playlist)
playlist
- The playlist. If the playlist is null, the result is an empty tracklist.
public boolean contains(int trackno)
trackno
- The track number to test.
public void setHighestIndexNr(int highestTrackNo)
highestTrackNo
- the index of the last song in the tracklistpublic int getHighestIndexNr()
public boolean containsAllSongs()
public void setTracks(java.lang.String tracks)
tracks
- A String containing the tracks to add.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |