org.jaudiotagger.audio.asf.data
Class LanguageList

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.LanguageList

public class LanguageList
extends Chunk

This structure represents the data of the ASF language object.
The language list is simply a listing of language codes which should comply to RFC-1766.
Consider: the index of a language is used by other entries in the ASF metadata.

Author:
Christian Laireiter

Field Summary
private  java.util.List<java.lang.String> languages
          List of language codes, complying RFC-1766
 
Fields inherited from class org.jaudiotagger.audio.asf.data.Chunk
chunkLength, guid, position
 
Constructor Summary
LanguageList()
          Creates a new instance.
LanguageList(long pos, java.math.BigInteger size)
          Creates an instance.
 
Method Summary
 void addLanguage(java.lang.String language)
          This method adds a language.
 java.lang.String getLanguage(int index)
          Returns the language code at the specified index.
 int getLanguageCount()
          Returns the amount of stored language codes.
 java.util.List<java.lang.String> getLanguages()
          Returns all language codes in list.
 java.lang.String prettyPrint(java.lang.String prefix)
          This method creates a String containing useful information prepared to be printed on STD-OUT.
 void removeLanguage(int index)
          Removes the language entry at specified index.
 
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk
getChunckEnd, getChunkEnd, getChunkLength, getGuid, getPosition, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

languages

private final java.util.List<java.lang.String> languages
List of language codes, complying RFC-1766

Constructor Detail

LanguageList

public LanguageList()
Creates a new instance.


LanguageList

public LanguageList(long pos,
                    java.math.BigInteger size)
Creates an instance.

Parameters:
pos - position within the ASF file.
size - size of the chunk
Method Detail

addLanguage

public void addLanguage(java.lang.String language)
This method adds a language.

Parameters:
language - language code

getLanguage

public java.lang.String getLanguage(int index)
Returns the language code at the specified index.

Parameters:
index - the index of the language code to get.
Returns:
the language code at given index.

getLanguageCount

public int getLanguageCount()
Returns the amount of stored language codes.

Returns:
number of stored language codes.

getLanguages

public java.util.List<java.lang.String> getLanguages()
Returns all language codes in list.

Returns:
list of language codes.

prettyPrint

public java.lang.String prettyPrint(java.lang.String prefix)
This method creates a String containing useful information prepared to be printed on STD-OUT.
This method is intended to be overwritten by inheriting classes.

Overrides:
prettyPrint in class Chunk
Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.

removeLanguage

public void removeLanguage(int index)
Removes the language entry at specified index.

Parameters:
index - index of language to remove.