1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.archive.util.anvl;
24
25 import java.io.UnsupportedEncodingException;
26 import java.util.ArrayList;
27 import java.util.Collection;
28 import java.util.Iterator;
29
30 import org.archive.io.UTF8Bytes;
31
32 /***
33 * List of {@link ANVLRecord}s.
34 * @author stack
35 * @version $Date: 2006-08-05 01:15:47 +0000 (Sat, 05 Aug 2006) $ $Version$
36 */
37 public class ANVLRecords extends ArrayList<ANVLRecord> implements UTF8Bytes {
38 private static final long serialVersionUID = 5361551920550106113L;
39
40 public ANVLRecords() {
41 super();
42 }
43
44 public ANVLRecords(int initialCapacity) {
45 super(initialCapacity);
46 }
47
48 public ANVLRecords(Collection<ANVLRecord> c) {
49 super(c);
50 }
51
52 public byte[] getUTF8Bytes() throws UnsupportedEncodingException {
53 return toString().getBytes(UTF8);
54 }
55
56 @Override
57 public String toString() {
58 StringBuilder sb = new StringBuilder();
59 for (final Iterator i = iterator(); i.hasNext();) {
60 sb.append(i.next().toString());
61 }
62 return super.toString();
63 }
64 }