Projekt

Obecné

Profil

Stáhnout (1.28 KB) Statistiky
| Větev: | Tag: | Revize:
1
package jdeserialize;
2
import java.util.*;
3

    
4
/**
5
 * <p>Typed collection used for storing the values of a serialized array.  </p>
6
 *
7
 * <p>Primitive types are stored using their corresponding objects; for instance, an int is
8
 * stored as an Integer.  To determine whether or not this is an array of ints or of
9
 * Integer instances, check the name in the arrayobj's class description.</p>
10
 */
11
public class arraycoll extends ArrayList<Object> {
12
    public static final long serialVersionUID = 2277356908919248L;
13

    
14
    private fieldtype ftype;
15

    
16
    /**
17
     * Constructor.
18
     * @param ft field type of the array
19
     */
20
    public arraycoll(fieldtype ft) {
21
        super();
22
        this.ftype = ft;
23
    }
24

    
25
    /**
26
     * Gets the field type of the array.
27
     *
28
     * @return the field type of the array
29
     */
30
    public fieldtype getFieldType() {
31
        return ftype;
32
    }
33
    public String toString() {
34
        StringBuffer sb = new StringBuffer();
35
        sb.append("[arraycoll sz ").append(this.size());
36
        boolean first = true;
37
        for(Object o: this) {
38
            if(first) {
39
                first = false;
40
                sb.append(' ');
41
            } else {
42
                sb.append(", ");
43
            }
44
            sb.append(o.toString());
45
        }
46
        return sb.toString();
47
    }
48
}
(5-5/20)