1 /***
2 * The contents of this file are subject to the Mozilla Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/MPL/
6 *
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
11 *
12 * The Original Code is pow2toolkit library.
13 *
14 * The Initial Owner of the Original Code is
15 * Paul Monday
16 *
17 * Portions created by Power Of Two S.R.L. are
18 * Copyright (C) Power Of Two S.R.L.
19 * All Rights Reserved.
20 *
21 * Contributor(s):
22 */
23
24
25 package com.pow2.resources;
26
27
28 /***
29 * PropertyContainer Interface
30 *
31 * @author Paul Monday
32 * @created 23 aprile 2002
33 */
34 public interface PropertyContainer
35 {
36 /***
37 * Add a property associated with a token name.
38 * <br>
39 * If the token already exists, the value will be replaced.
40 * If the token does not exist, it will be added with the value.
41 *
42 * @param value is an object that cannot be null
43 * @param token is a key that can be used to retrieve the value
44 */
45 public void addProperty(Object value, String token);
46
47
48 /***
49 * Retrieve a value by a particular token.
50 *
51 * @param token is a key that can be used to retrieve the value
52 * @return String is the value associated with the token. It
53 * will not be null
54 */
55 public String getProperty(String token);
56
57
58 /***
59 * Retrieve a value by a particular token.
60 *
61 * @param token is a key that can be used to retrieve the value
62 * @return Object is the value associated with the token. It
63 * will not be null
64 */
65 public Object getObject(String token);
66
67
68 /***
69 * Retrieve all property keys currently in use.
70 *
71 * @return String[] is an array of all valid token names
72 */
73 public String[] getPropertyKeys();
74
75
76 /***
77 * Remove a value associated with a particular token.
78 *
79 * @param token is a key associated with a value that was added
80 */
81 public void removeProperty(String token);
82 }