01: // ArrayAttribute.java
02: // $Id: ArrayAttribute.java,v 1.3 2000/08/16 21:37:50 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.tools.resources;
06:
07: /**
08: * @version $Revision: 1.3 $
09: * @author Benoît Mahé (bmahe@w3.org)
10: */
11: abstract public class ArrayAttribute extends Attribute {
12:
13: /**
14: * Unpickle an attribute array from a string array.
15: * @param array the String array
16: * @return a Object array
17: */
18: public abstract Object unpickle(String array[]);
19:
20: /**
21: * Pickle an attribute array into a String array.
22: * @param array the attribute array
23: * @return a String array
24: */
25: public abstract String[] pickle(Object array);
26:
27: public String stringify(Object value) {
28: String array[] = pickle(value);
29: String string = "";
30: for (int i = 0; i < array.length; i++) {
31: if (i != 0)
32: string += " | " + array[i];
33: else
34: string = array[i];
35: }
36: return string;
37: }
38:
39: public ArrayAttribute(String name, Object def, int flags) {
40: super (name, def, flags);
41: }
42:
43: public ArrayAttribute() {
44: super();
45: }
46:
47: }
|