Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NodeNumbering |
|
| 1.0;1 |
1 | /* | |
2 | This file is part of Combean. | |
3 | ||
4 | Combean 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 | Combean 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 Combean; if not, write to the Free Software | |
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | /* | |
19 | * Created on 10.02.2005 | |
20 | * | |
21 | */ | |
22 | package net.sourceforge.combean.interfaces.graph.containers; | |
23 | ||
24 | import net.sourceforge.combean.interfaces.graph.Graph; | |
25 | import net.sourceforge.combean.interfaces.graph.Node; | |
26 | ||
27 | /** | |
28 | * A data structure which maps nodes to integers. | |
29 | * | |
30 | * @author schickin | |
31 | * | |
32 | */ | |
33 | public interface NodeNumbering { | |
34 | ||
35 | /** | |
36 | * Has to be invoked before the data structure can be used. | |
37 | * The data structure may only be used with nodes belonging to the given | |
38 | * graph. | |
39 | * After init() the content of the NodeNumbering is still undefined. | |
40 | * Use fill if you want to define it. | |
41 | * | |
42 | * @param g the graph for which the NodeNumbering shall be defined. | |
43 | */ | |
44 | void init(Graph g); | |
45 | ||
46 | /** | |
47 | * Set the node number of all nodes to a given value. | |
48 | * | |
49 | * @param num the value which shall be set. | |
50 | */ | |
51 | void fill(int num); | |
52 | ||
53 | /** | |
54 | * Set the number of a single node. | |
55 | * | |
56 | * @param v the node | |
57 | * @param num the number to be set | |
58 | */ | |
59 | void setNumber(Node v, int num); | |
60 | ||
61 | /** | |
62 | * Get the number of a single node. | |
63 | * | |
64 | * @param v | |
65 | * @return the number of v | |
66 | */ | |
67 | int getNumber(Node v); | |
68 | ||
69 | } |