org.blinkenlights.jid3.v2
Class ETCOID3V2Frame

java.lang.Object
  extended byorg.blinkenlights.jid3.v2.ID3V2Frame
      extended byorg.blinkenlights.jid3.v2.ETCOID3V2Frame
All Implemented Interfaces:
ID3Subject, ID3Visitable

public class ETCOID3V2Frame
extends ID3V2Frame


Nested Class Summary
static class ETCOID3V2Frame.Event
          Event.
static class ETCOID3V2Frame.EventType
          Event types.
static class ETCOID3V2Frame.TimestampFormat
          Timestamp format.
 
Constructor Summary
ETCOID3V2Frame(ETCOID3V2Frame.TimestampFormat oTimestampFormat)
          Constructor.
ETCOID3V2Frame(java.io.InputStream oIS)
           
 
Method Summary
 void accept(ID3Visitor oID3Visitor)
          Accept a visitor.
 void addEvent(ETCOID3V2Frame.Event oEvent)
          Add an event to the list.
 boolean equals(java.lang.Object oOther)
           
 ETCOID3V2Frame.Event getEvent(int iTimestamp)
          Get the event which has been set for a given time.
 ETCOID3V2Frame.Event[] getEvents()
          Get all events which have been set.
protected  byte[] getFrameId()
          Get the four bytes which uniquely specify of which type this frame is.
 ETCOID3V2Frame.TimestampFormat getTimestampFormat()
          Get the set timestamp format.
 ETCOID3V2Frame.Event removeEvent(ETCOID3V2Frame.Event oEvent)
          Remove the event set for a specific time.
 java.lang.String toString()
          Represent the contents of this frame as a string.
protected  void writeBody(ID3DataOutputStream oIDOS)
          Write the body of the frame to an ID3 data output stream.
 
Methods inherited from class org.blinkenlights.jid3.v2.ID3V2Frame
addID3Observer, getEncryptionMethod, isEncrypted, notifyID3Observers, removeID3Observer, setCompressionFlag, setEncryption, setFileAlterPreservationFlag, setGroupingIdentityFlag, setReadOnlyFlag, setTagAlterPreservationFlag, write, writeHeader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ETCOID3V2Frame

public ETCOID3V2Frame(ETCOID3V2Frame.TimestampFormat oTimestampFormat)
               throws ID3Exception
Constructor.

Parameters:
oTimestampFormat - the format for timestamps, whether by millisecond or frame count
Throws:
ID3Exception - if oTimestampFormat object is null

ETCOID3V2Frame

public ETCOID3V2Frame(java.io.InputStream oIS)
               throws ID3Exception
Method Detail

accept

public void accept(ID3Visitor oID3Visitor)
Description copied from interface: ID3Visitable
Accept a visitor.

Parameters:
oID3Visitor - a visitor of this object

getTimestampFormat

public ETCOID3V2Frame.TimestampFormat getTimestampFormat()
Get the set timestamp format.

Returns:
the currently set timestamp format

addEvent

public void addEvent(ETCOID3V2Frame.Event oEvent)
Add an event to the list. Note, only one event per exact time can be defined. An event set at a time for which another event already is set will overwrite the existing one.

Parameters:
oEvent - the event being set

getEvent

public ETCOID3V2Frame.Event getEvent(int iTimestamp)
                              throws ID3Exception
Get the event which has been set for a given time.

Returns:
the event set for the given time, or null if no event has been set for that time
Throws:
ID3Exception - if the timestamp specified is negative

getEvents

public ETCOID3V2Frame.Event[] getEvents()
Get all events which have been set. Events are returned in sorted order by timestamp.

Returns:
an array of Events which have been set

removeEvent

public ETCOID3V2Frame.Event removeEvent(ETCOID3V2Frame.Event oEvent)
Remove the event set for a specific time.

Returns:
the event which was previously set for the given time, or null if no even was set for that time

getFrameId

protected byte[] getFrameId()
Description copied from class: ID3V2Frame
Get the four bytes which uniquely specify of which type this frame is.

Specified by:
getFrameId in class ID3V2Frame

toString

public java.lang.String toString()
Description copied from class: ID3V2Frame
Represent the contents of this frame as a string. For debugging purposes.

Specified by:
toString in class ID3V2Frame
Returns:
a string representing this frame

writeBody

protected void writeBody(ID3DataOutputStream oIDOS)
                  throws java.io.IOException
Description copied from class: ID3V2Frame
Write the body of the frame to an ID3 data output stream.

Specified by:
writeBody in class ID3V2Frame
Parameters:
oIDOS - the output stream to write to
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object oOther)