org.dishevelled.observable.graph.event
Class GraphChangeEvent<N,E>

java.lang.Object
  extended by java.util.EventObject
      extended by org.dishevelled.observable.graph.event.GraphChangeEvent<N,E>
Type Parameters:
N - node value type
E - edge value type
All Implemented Interfaces:
Serializable

public class GraphChangeEvent<N,E>
extends EventObject

An event object representing a change made to an observable graph.

Version:
$Revision$ $Date$
Author:
Michael Heuer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphChangeEvent(ObservableGraph<N,E> source)
          Create a new graph change event with the specified observable graph as the event source.
GraphChangeEvent(ObservableGraph<N,E> source, Edge<N,E> edge)
          Create a new graph change event with the specified observable graph as the event source and the specified newly created or removed edge.
GraphChangeEvent(ObservableGraph<N,E> source, Node<N,E> node)
          Create a new graph change event with the specified observable graph as the event source and the specified newly created or removed node.
 
Method Summary
 Edge<N,E> getEdge()
          Return the newly created or removed edge for this graph change event, if any.
 Node<N,E> getNode()
          Return the newly created or removed node for this graph change event, if any.
 ObservableGraph<N,E> getObservableGraph()
          Return the source of this graph change event as an ObservableGraph.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphChangeEvent

public GraphChangeEvent(ObservableGraph<N,E> source)
Create a new graph change event with the specified observable graph as the event source.

Parameters:
source - source of the event, must not be null

GraphChangeEvent

public GraphChangeEvent(ObservableGraph<N,E> source,
                        Node<N,E> node)
Create a new graph change event with the specified observable graph as the event source and the specified newly created or removed node.

Parameters:
source - source of the event, must not be null
node - newly created or removed node, if any

GraphChangeEvent

public GraphChangeEvent(ObservableGraph<N,E> source,
                        Edge<N,E> edge)
Create a new graph change event with the specified observable graph as the event source and the specified newly created or removed edge.

Parameters:
source - source of the event, must not be null
edge - newly created or removed edge, if any
Method Detail

getObservableGraph

public final ObservableGraph<N,E> getObservableGraph()
Return the source of this graph change event as an ObservableGraph.

Returns:
the source of this graph change event as an ObservableGraph

getNode

public final Node<N,E> getNode()
Return the newly created or removed node for this graph change event, if any.

Returns:
the newly created or removed node for this graph change event, if any

getEdge

public final Edge<N,E> getEdge()
Return the newly created or removed edge for this graph change event, if any.

Returns:
the newly created or removed edge for this graph change event, if any


Copyright (c) 2008-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).