| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ObservableGraph |
|
| 1.0;1 |
| 1 | /* | |
| 2 | ||
| 3 | dsh-observable-graph Observable decorators for graph interfaces. | |
| 4 | Copyright (c) 2008-2013 held jointly by the individual authors. | |
| 5 | ||
| 6 | This library is free software; you can redistribute it and/or modify it | |
| 7 | under the terms of the GNU Lesser General Public License as published | |
| 8 | by the Free Software Foundation; either version 3 of the License, or (at | |
| 9 | your option) any later version. | |
| 10 | ||
| 11 | This library is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or | |
| 13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
| 14 | License for more details. | |
| 15 | ||
| 16 | You should have received a copy of the GNU Lesser General Public License | |
| 17 | along with this library; if not, write to the Free Software Foundation, | |
| 18 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
| 19 | ||
| 20 | > http://www.fsf.org/licensing/licenses/lgpl.html | |
| 21 | > http://www.opensource.org/licenses/lgpl-license.php | |
| 22 | ||
| 23 | */ | |
| 24 | package org.dishevelled.observable.graph; | |
| 25 | ||
| 26 | import org.dishevelled.graph.Graph; | |
| 27 | ||
| 28 | // introduces a circular package dependency, not sure how to break this | |
| 29 | import org.dishevelled.observable.graph.event.GraphChangeListener; | |
| 30 | import org.dishevelled.observable.graph.event.VetoableGraphChangeListener; | |
| 31 | ||
| 32 | /** | |
| 33 | * Observable extension to the <code>Graph</code> interface. | |
| 34 | * | |
| 35 | * @param <N> node value type | |
| 36 | * @param <E> edge value type | |
| 37 | * @author Michael Heuer | |
| 38 | * @version $Revision$ $Date$ | |
| 39 | */ | |
| 40 | public interface ObservableGraph<N, E> | |
| 41 | extends Graph<N, E> | |
| 42 | { | |
| 43 | ||
| 44 | /** | |
| 45 | * Add the specified graph change listener. | |
| 46 | * | |
| 47 | * @param l graph change listener to add | |
| 48 | */ | |
| 49 | void addGraphChangeListener(GraphChangeListener<N, E> l); | |
| 50 | ||
| 51 | /** | |
| 52 | * Remove the specified graph change listener. | |
| 53 | * | |
| 54 | * @param l graph change listener to remove | |
| 55 | */ | |
| 56 | void removeGraphChangeListener(GraphChangeListener<N, E> l); | |
| 57 | ||
| 58 | /** | |
| 59 | * Add the specified vetoable graph change listener. | |
| 60 | * | |
| 61 | * @param l vetoable graph change listener to add | |
| 62 | */ | |
| 63 | void addVetoableGraphChangeListener(VetoableGraphChangeListener<N, E> l); | |
| 64 | ||
| 65 | /** | |
| 66 | * Remove the specified vetoable graph change listener. | |
| 67 | * | |
| 68 | * @param l vetoable graph change listener to remove | |
| 69 | */ | |
| 70 | void removeVetoableGraphChangeListener(VetoableGraphChangeListener<N, E> l); | |
| 71 | ||
| 72 | /** | |
| 73 | * Return an array of all <code>GraphChangeListener</code>s, or | |
| 74 | * an empty array if none are registered. | |
| 75 | * | |
| 76 | * @return an array of all <code>GraphChangeListener</code>s, or | |
| 77 | * an empty array if none are registered | |
| 78 | */ | |
| 79 | GraphChangeListener<N, E>[] getGraphChangeListeners(); | |
| 80 | ||
| 81 | /** | |
| 82 | * Return the number of <code>GraphChangeListener</code>s registered | |
| 83 | * to this observable graph. | |
| 84 | * | |
| 85 | * @return the number of <code>GraphChangeListener</code>s registered | |
| 86 | * to this observable graph | |
| 87 | */ | |
| 88 | int getGraphChangeListenerCount(); | |
| 89 | ||
| 90 | /** | |
| 91 | * Return an array of all <code>VetoableGraphChangeListener</code>s, | |
| 92 | * or an empty array if none are registered. | |
| 93 | * | |
| 94 | * @return an array of all <code>VetoableGraphChangeListener</code>s, | |
| 95 | * or an empty array if none are registered | |
| 96 | */ | |
| 97 | VetoableGraphChangeListener<N, E>[] getVetoableGraphChangeListeners(); | |
| 98 | ||
| 99 | /** | |
| 100 | * Return the number of <code>VetoableGraphChangeListener</code>s | |
| 101 | * registered to this observable graph. | |
| 102 | * | |
| 103 | * @return the number of <code>VetoableGraphChangeListener</code>s | |
| 104 | * registered to this observable graph | |
| 105 | */ | |
| 106 | int getVetoableGraphChangeListenerCount(); | |
| 107 | } |