KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > archive > util > anvl > ANVLRecords


1 /* $Id: ANVLRecords.java,v 1.2 2006/08/05 01:15:47 stack-sf Exp $
2  *
3  * Created Aug 2, 2006
4  *
5  * Copyright (C) 2006 Internet Archive.
6  *
7  * This file is part of the Heritrix web crawler (crawler.archive.org).
8  *
9  * Heritrix is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * any later version.
13  *
14  * Heritrix is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser Public License
20  * along with Heritrix; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23 package org.archive.util.anvl;
24
25 import java.io.UnsupportedEncodingException JavaDoc;
26 import java.util.ArrayList JavaDoc;
27 import java.util.Collection JavaDoc;
28 import java.util.Iterator JavaDoc;
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 $ $Version$
36  */

37 public class ANVLRecords extends ArrayList JavaDoc<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 JavaDoc<ANVLRecord> c) {
49         super(c);
50     }
51
52     public byte[] getUTF8Bytes() throws UnsupportedEncodingException JavaDoc {
53         return toString().getBytes(UTF8);
54     }
55     
56     @Override JavaDoc
57     public String JavaDoc toString() {
58         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
59         for (final Iterator JavaDoc i = iterator(); i.hasNext();) {
60             sb.append(i.next().toString());
61         }
62         return super.toString();
63     }
64 }
Popular Tags