1
2
3
4
5
6
7
8 package net.kwfgrid.gworkflowdl.structure;
9
10
11
12 /***
13 * User: hans
14 * Date: 05.10.2005
15 * Time: 12:18:06
16 */
17 public interface GenericProperties {
18
19 /***
20 *
21 * @param key
22 * @param value
23 * @return old value or (if not present) null
24 */
25 String put(String key, String value);
26
27 /***
28 *
29 * @param key
30 * @return value or (if not present) null
31 */
32 String remove(String key);
33
34 /***
35 *
36 * @param key
37 * @return value or null
38 */
39 String get(String key);
40
41 /***
42 *
43 * @return number of key value pairs in properties
44 */
45 int size();
46
47 /***
48 *
49 * @param i index
50 * @return return i'th key value pair
51 */
52 Property getProperty(int i);
53
54 /***
55 * set i'th key value pair
56 * @param i index
57 * @param prop
58 * @exception IndexOutOfBoundsException If i < 0 or i >= size().
59 @exception IllegalArgumentException If the key of <code>prop</code> already exists in this set of properties.
60 @exception NullPointerException If the key of <code>prop</code> is <code>null</code>.
61 */
62 void setProperty(int i, Property prop) throws IndexOutOfBoundsException, IllegalArgumentException, NullPointerException;
63
64 /***
65 *
66 * @return array of key value pairs in right order
67 */
68 Property[] getProperties();
69
70 /***
71 * set key value pairs in right order
72 * @param props
73 * @exception IllegalArgumentException If there is a double key in the array of properties.
74 * @exception NullPointerException If the key of a property is <code>null</code>.
75 */
76 void setProperties(Property[] props) throws IllegalArgumentException, NullPointerException;
77
78 /***
79 *
80 * @return array of keys in right order
81 */
82 String[] keys();
83
84 GenericProperties deepCopy();
85
86 /***
87 Remove the property at index i.
88 */
89 void removeProperty(int i);
90
91 /***
92 Add a property.
93 This method will always append the specified property at the end of the list of properties.
94 @exception IllegalArgumentException If the key of <code>p</code> already exists in this set of properties.
95 @exception NullPointerException If the key of <code>prop</code> is <code>null</code>.
96 */
97 void addProperty(Property p) throws IllegalArgumentException, NullPointerException;
98 }