KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > plankton > data > StateMap


1 /*
2  * Copyright (C) 2003 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: StateMap.java,v 1.3 2004/02/01 05:16:28 christianc Exp $
19  */

20 package org.enhydra.barracuda.plankton.data;
21
22 import java.io.*;
23 import java.util.*;
24
25 /**
26  * <p>This interface defines the methods needed to implement
27  * state in an object. By this we mean that an object is
28  * capable of carrying state information along with it--you
29  * can put properties into the state and then get them back
30  * out.
31  *
32  * <p>Key entities that implement StateMap:
33  * <ul>
34  * <li>BaseEvent</li>
35  * <li>EventContext</li>
36  * <li>FormMap</li>
37  * </ul>
38  */

39 public interface StateMap {
40
41     /**
42      * set a property in this StateMap
43      *
44      * @param key the key object
45      * @param val the value object
46      */

47     public void putState(Object JavaDoc key, Object JavaDoc val);
48
49     /**
50      * get a property in this StateMap
51      *
52      * @param key the key object
53      * @return the value for the given key
54      */

55     public Object JavaDoc getState(Object JavaDoc key);
56
57     /**
58      * remove a property in this StateMap
59      *
60      * @param key the key object
61      * @return the object which was removed
62      */

63     public Object JavaDoc removeState(Object JavaDoc key);
64
65     /**
66      * get a list of the keys for this StateMap
67      *
68      * @return a list the keys for this StateMap
69      */

70     public List getStateKeys();
71
72     /**
73      * get a copy of the underlying Map that holds
74      * the state values
75      *
76      * @return a copy of the underlying state Map
77      */

78     public Map getStateValues();
79
80     //csc_052803_2 - added
81
/**
82      * clear all state information
83      */

84     public void clearState();
85 }
86
Popular Tags