Holger's Java API

## com.antelmann.cddb
Class Track

    java.lang.Object
      com.antelmann.cddb.Track

All Implemented Interfaces:
  Serializable, Comparable<Track>

    public class Track

extends Object
implements Serializable, Comparable<Track>

Track objects represent the leaf elements of Composition objects defined as a specific track on a particular music CD.

A Track object may be contained by several Composition objects, while the association is maintained soley from the Composition object. Contributions added to a track may 'override' an equal contribution that is already associated with this track through its membership in a composition.

Any operation on the embedded Set objects must be synchronized externally.

Author:
  Holger Antelmann
See Also:
  `Composition`, `Contribution`, `CDID`, Serialized Form

Constructor Summary
`Track(CDID cd, int trackNo, String title, String description)`

Method Summary
`boolean` `add(Contribution con)` adds a contribution specific to this single track
`int` `compareTo(Track t)`
`boolean` `contains(Contribution con)`
`boolean` `equals(Object obj)` a track is equal if cd and trackNo are equal
`Set<Contribution>` `getAllContributions()` generates an unmodifiable view of all associated contributions (including contributions from parent Compositions).
`CDID` `getCD()`
`Set<Composition>` `getCompositions()` provides an unmodifiable view of the Composition objects that this track is associated with
`String` `getDescription()`
`int` `getLength()` returns the length in seconds
`String` `getRecordingType()` examples are DDD, AAD, and the alike.
`String` `getTitle()`
`Set<Contribution>` `getTrackContributions()` provides an unmodifiable view of contributions that were directly added to this track
`int` `getTrackNo()`
`int` `hashCode()`
`boolean` `remove(Contribution con)`
`void` `setDescription(String description)`
`void` `setRecordingType(String type)` examples are DDD, AAD, and the alike.
`void` `setTitle(String title)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Track

    public Track(CDID cd,
                 int trackNo,
                 String title,
                 String description)

Method Detail

### getCD

    public CDID getCD()

### getTrackNo

    public int getTrackNo()

### getRecordingType

    public String getRecordingType()

  examples are DDD, AAD, and the alike. May be null if unknown.

### setRecordingType

    public void setRecordingType(String type)

  examples are DDD, AAD, and the alike. May be null if unknown.

### getLength

    public int getLength()

  returns the length in seconds

  See Also:
    `CDID.getTrackLength(int)`

### getTitle

    public String getTitle()

### setTitle

    public void setTitle(String title)

### getDescription

    public String getDescription()

### setDescription

    public void setDescription(String description)

### contains

    public boolean contains(Contribution con)

### add

    public boolean add(Contribution con)

  adds a contribution specific to this single track

### remove

    public boolean remove(Contribution con)

### getTrackContributions

    public Set<Contribution> getTrackContributions()

  provides an unmodifiable view of contributions that were directly added to this track

  Returns:
    Set of Contribution objects

### getAllContributions

    public Set<Contribution> getAllContributions()

  generates an unmodifiable view of all associated contributions (including contributions from parent Compositions).

  Returns:
    Set of Contribution objects
  See Also:
    `getCompositions()`

### getCompositions

    public Set<Composition> getCompositions()

  provides an unmodifiable view of the Composition objects that this track is associated with

  See Also:
    `Composition.add(Track)`, `Composition.remove(Track)`

### compareTo

    public int compareTo(Track t)

  Specified by:
    `compareTo` in interface `Comparable<Track>`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### equals

    public boolean equals(Object obj)

  a track is equal if cd and trackNo are equal

  Overrides:
    `equals` in class `Object`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads