org.grinvin.graphs

Class DefaultAnnotation

Implemented Interfaces:
Annotation, AnnotationView
Known Direct Subclasses:
DefaultAnnotationModel

public class DefaultAnnotation
extends java.lang.Object
implements Annotation

Constructor Summary

DefaultAnnotation(GraphView peer)

Method Summary

void
copy(AnnotationView original)
Make this annotation a copy of the given view using the peer of the original.
void
copy(AnnotationView original, GraphView newPeer)
Make this annotation a copy of the given view using the given peer.
Object
getAnnotation(Edge edge)
Returns the annotation for the given Edge.
Object
getAnnotation(Vertex vertex)
Returns the annotation for the given Vertex.
GraphView
getPeer()
Returns the peer graph for this annotation.
void
setAnnotation(Edge edge, Object annotation)
Sets the annotation for the given Edge.
void
setAnnotation(Vertex vertex, Object annotation)
Sets the annotation for the given Vertex.

Constructor Details

DefaultAnnotation

public DefaultAnnotation(GraphView peer)

Method Details

copy

public void copy(AnnotationView original)
Make this annotation a copy of the given view using the peer of the original.
Specified by:
copy in interface Annotation

copy

public void copy(AnnotationView original,
                 GraphView newPeer)
Make this annotation a copy of the given view using the given peer. This peer is supposed to be a copy of the peer in the sense of method Graph.copy(GraphView).
Specified by:
copy in interface Annotation

getAnnotation

public Object getAnnotation(Edge edge)
Returns the annotation for the given Edge.
Specified by:
getAnnotation in interface AnnotationView

getAnnotation

public Object getAnnotation(Vertex vertex)
Returns the annotation for the given Vertex.
Specified by:
getAnnotation in interface AnnotationView

getPeer

public GraphView getPeer()
Returns the peer graph for this annotation.
Specified by:
getPeer in interface AnnotationView

setAnnotation

public void setAnnotation(Edge edge,
                          Object annotation)
Sets the annotation for the given Edge.
Specified by:
setAnnotation in interface Annotation

setAnnotation

public void setAnnotation(Vertex vertex,
                          Object annotation)
Sets the annotation for the given Vertex.
Specified by:
setAnnotation in interface Annotation