KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > engine > dm > TreeManagementOperation


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.framework.engine.dm;
20
21 import java.util.Map JavaDoc;
22 import java.util.HashMap JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 /**
26  * Base class for tree manipulation management commands such as Add, Replace,
27  * Delete and so on.
28  * <p>
29  * These operations affect on or mode management nodes that in this simple
30  * implementation are represented in a Map {key-value}. The key is the path
31  * in the configuration tree.
32  *
33  * @author Stefano Fornari @ Funambol
34  *
35  * @version $Id: TreeManagementOperation.java,v 1.1 2005/05/16 17:32:55 nichele Exp $
36  */

37 public abstract class TreeManagementOperation
38 extends ManagementOperation
39 implements java.io.Serializable JavaDoc {
40     
41     // ------------------------------------------------------------ Private data
42

43     private Map JavaDoc nodes;
44     
45     // ------------------------------------------------------------ constructors
46

47     protected TreeManagementOperation() {
48         nodes = new HashMap JavaDoc();
49     }
50     
51     // ---------------------------------------------------------- Public methods
52

53     /**
54      * Returns the nodes property
55      *
56      * @return the nodes property
57      */

58     public Map JavaDoc getNodes() {
59         return nodes;
60     }
61     
62     /**
63      * Set the nodes property
64      *
65      * @param newNodes the new values
66      */

67     public void setNodes(Map JavaDoc newNodes) {
68         this.nodes = new HashMap JavaDoc();
69         if (newNodes == null) {
70             return;
71         }
72         
73         nodes.putAll(newNodes);
74     }
75 }
Popular Tags