~ubuntu-branches/ubuntu/utopic/libjaudiotagger-java/utopic

« back to all changes in this revision

Viewing changes to src/org/jaudiotagger/audio/asf/data/EncodingChunk.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath, Damien Raude-Morvan, Varun Hiremath
  • Date: 2009-04-01 19:17:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401191756-bygniim270guy7o1
Tags: 1.0.9-1
[ Damien Raude-Morvan ]
* New upstream release
* debian/watch: Use java.net repository (which contains new releases!)
* debian/control:
  - Build-Depends on default-jdk-builddep
  - Bump Standards-Version to 3.8.1 (no changes needed)
  - Change section to "java"
* debian/rules: use default-java as JAVA_HOME
* debina/orig-tar.{sh|excludes}: strip audio and others binary files from ZIP
* debian/build.xml:
  - compile with "nowarn" to keep build log readable
  - exclude LogFormatter from build (use com.sun classes)
* debian/ant.properties: new source directory is "src" in orig.tar.gz
* Add myself as Uploaders

[ Varun Hiremath ]
* Accept changes made by Damien Raude-Morvan (Closes: #522130)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Entagged Audio Tag library
 
3
 * Copyright (c) 2004-2005 Christian Laireiter <liree@web.de>
 
4
 * 
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2.1 of the License, or (at your option) any later version.
 
9
 *  
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details.
 
14
 * 
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 */
 
19
package org.jaudiotagger.audio.asf.data;
 
20
 
 
21
import java.math.BigInteger;
 
22
import java.util.ArrayList;
 
23
import java.util.Collection;
 
24
import java.util.Iterator;
 
25
 
 
26
import org.jaudiotagger.audio.asf.util.Utils;
 
27
 
 
28
/**
 
29
 * This class was intended to store the data of a chunk which contained the
 
30
 * encoding parameters in textual form. <br>
 
31
 * Since the needed parameters were found in other chunks the implementation of
 
32
 * this class was paused. <br>
 
33
 * TODO complete analysis.
 
34
 *
 
35
 * @author Christian Laireiter
 
36
 */
 
37
public class EncodingChunk extends Chunk
 
38
{
 
39
 
 
40
    /**
 
41
     * The read strings.
 
42
     */
 
43
    private final ArrayList<String> strings;
 
44
 
 
45
    /**
 
46
     * Creates an instance.
 
47
     *
 
48
     * @param chunkLen Length of current chunk.
 
49
     */
 
50
    public EncodingChunk(BigInteger chunkLen)
 
51
    {
 
52
        super(GUID.GUID_ENCODING, chunkLen);
 
53
        this.strings = new ArrayList<String>();
 
54
    }
 
55
 
 
56
    /**
 
57
     * This method appends a String.
 
58
     *
 
59
     * @param toAdd String to add.
 
60
     */
 
61
    public void addString(String toAdd)
 
62
    {
 
63
        strings.add(toAdd);
 
64
    }
 
65
 
 
66
    /**
 
67
     * This method returns a collection of all {@linkplain String Strings} which were added
 
68
     * due {@link #addString(String)}.
 
69
     *
 
70
     * @return Inserted Strings.
 
71
     */
 
72
    public Collection<String> getStrings()
 
73
    {
 
74
        return new ArrayList<String>(strings);
 
75
    }
 
76
 
 
77
    /**
 
78
     * {@inheritDoc}
 
79
     */
 
80
    public String prettyPrint(final String prefix)
 
81
    {
 
82
        StringBuffer result = new StringBuffer(super.prettyPrint(prefix));
 
83
        Iterator<String> iterator = this.strings.iterator();
 
84
        while (iterator.hasNext())
 
85
        {
 
86
            result.append(prefix + "  | : " + iterator.next() + Utils.LINE_SEPARATOR);
 
87
        }
 
88
        return result.toString();
 
89
    }
 
90
}
 
 
b'\\ No newline at end of file'