KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > graph > GraphChangeHandler


1 /*****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  ****************************************************************/

19
20 package org.apache.cayenne.graph;
21
22 /**
23  * Defines callback API that can be used by object graph nodes to notify of their state
24  * changes. Graph nodes can be any objects as long as each node supports a notion of a
25  * unique id within the graph and each directional arc has a unique identifier within its
26  * source node.
27  *
28  * @since 1.2
29  * @author Andrus Adamchik
30  */

31 public interface GraphChangeHandler {
32
33     /**
34      * Notifies implementing object that a node was assigned a new id.
35      */

36     void nodeIdChanged(Object JavaDoc nodeId, Object JavaDoc newId);
37
38     /**
39      * Notifies implementing object that a new node was created in the graph.
40      */

41     void nodeCreated(Object JavaDoc nodeId);
42
43     /**
44      * Notifies implementing object that a node was removed from the graph.
45      */

46     void nodeRemoved(Object JavaDoc nodeId);
47
48     /**
49      * Notifies implementing object that a node's property was modified.
50      */

51     void nodePropertyChanged(
52             Object JavaDoc nodeId,
53             String JavaDoc property,
54             Object JavaDoc oldValue,
55             Object JavaDoc newValue);
56
57     /**
58      * Notifies implementing object that a new arc was created between two nodes.
59      */

60     void arcCreated(Object JavaDoc nodeId, Object JavaDoc targetNodeId, Object JavaDoc arcId);
61
62     /**
63      * Notifies implementing object that an arc between two nodes was deleted.
64      */

65     void arcDeleted(Object JavaDoc nodeId, Object JavaDoc targetNodeId, Object JavaDoc arcId);
66 }
67
Popular Tags