org.jaudiotagger.tag.id3.framebody
Class FrameBodyPCNT

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
          extended by org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
              extended by org.jaudiotagger.tag.id3.framebody.FrameBodyPCNT
All Implemented Interfaces:
ID3v23FrameBody, ID3v24FrameBody

public class FrameBodyPCNT
extends AbstractID3v2FrameBody
implements ID3v24FrameBody, ID3v23FrameBody

Play counter frame.

This is simply a counter of the number of times a file has been played. The value is increased by one every time the file begins to play. There may only be one "PCNT" frame in each tag. When the counter reaches all one's, one byte is inserted in front of the counter thus making the counter eight bits bigger. The counter must be at least 32-bits long to begin with.

<Header for 'Play counter', ID: "PCNT">
Counter $xx xx xx xx (xx ...)

For more details, please refer to the ID3 specifications:

Version:
$Id: FrameBodyPCNT.java,v 1.15 2009/11/12 13:25:21 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
private static int COUNTER_MINIMUM_FIELD_SIZE
           
 
Fields inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
TYPE_BODY
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
objectList
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Constructor Summary
FrameBodyPCNT()
          Creates a new FrameBodyPCNT datatype.
FrameBodyPCNT(java.nio.ByteBuffer byteBuffer, int frameSize)
          Creates a new FrameBodyPCNT datatype.
FrameBodyPCNT(FrameBodyPCNT body)
           
FrameBodyPCNT(long counter)
          Creates a new FrameBodyPCNT datatype.
 
Method Summary
 long getCounter()
           
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
 void setCounter(long counter)
          Set the play counter of this file
protected  void setupObjectList()
          Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses
 
Methods inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
createStructure, equals, getSize, read, setSize, setSize, write
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COUNTER_MINIMUM_FIELD_SIZE

private static final int COUNTER_MINIMUM_FIELD_SIZE
See Also:
Constant Field Values
Constructor Detail

FrameBodyPCNT

public FrameBodyPCNT()
Creates a new FrameBodyPCNT datatype.


FrameBodyPCNT

public FrameBodyPCNT(FrameBodyPCNT body)

FrameBodyPCNT

public FrameBodyPCNT(long counter)
Creates a new FrameBodyPCNT datatype.

Parameters:
counter -

FrameBodyPCNT

public FrameBodyPCNT(java.nio.ByteBuffer byteBuffer,
                     int frameSize)
              throws InvalidTagException
Creates a new FrameBodyPCNT datatype.

Parameters:
byteBuffer -
frameSize -
Throws:
InvalidTagException - if unable to create framebody from buffer
Method Detail

getCounter

public long getCounter()
Returns:
the play count of this file

setCounter

public void setCounter(long counter)
Set the play counter of this file

Parameters:
counter -

getIdentifier

public java.lang.String getIdentifier()
The ID3v2 frame identifier

Specified by:
getIdentifier in class AbstractID3v2FrameBody
Returns:
the ID3v2 frame identifier for this frame type

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractTagFrameBody
Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses

Specified by:
setupObjectList in class AbstractTagFrameBody