1 package org.simantics.district.network.ui.breakdown;
3 import java.util.ArrayList;
6 import org.simantics.databoard.util.Bean;
7 import org.simantics.db.Resource;
10 * @author Tuukka Lehtonen
15 public static class NetworkDiagrams extends Bean {
16 public List<NetworkDiagram> diagrams = new ArrayList<>();
19 public int hashCode() {
21 int result = super.hashCode();
22 result = prime * result + ((diagrams == null) ? 0 : diagrams.hashCode());
27 public boolean equals(Object obj) {
30 if (!super.equals(obj))
32 if (getClass() != obj.getClass())
34 NetworkDiagrams other = (NetworkDiagrams) obj;
35 if (diagrams == null) {
36 if (other.diagrams != null)
38 } else if (!diagrams.equals(other.diagrams))
44 public static class NetworkDiagram extends Bean {
47 public Resource diagram;
49 public NetworkDiagram(String name, Resource diagram) {
51 this.diagram = diagram;
55 public int hashCode() {
57 int result = super.hashCode();
58 result = prime * result + ((diagram == null) ? 0 : diagram.hashCode());
59 result = prime * result + ((name == null) ? 0 : name.hashCode());
64 public boolean equals(Object obj) {
67 if (!super.equals(obj))
69 if (getClass() != obj.getClass())
71 NetworkDiagram other = (NetworkDiagram) obj;
72 if (diagram == null) {
73 if (other.diagram != null)
75 } else if (!diagram.equals(other.diagram))
78 if (other.name != null)
80 } else if (!name.equals(other.name))
86 public static class Subgraph {
87 public NetworkDiagram parent;
89 public List<Resource> vertices;
90 public List<Resource> edges;
92 public Subgraph(NetworkDiagram parent, int index, List<Resource> vertices, List<Resource> edges) {
95 this.vertices = vertices;
100 public int hashCode() {
101 final int prime = 31;
103 result = prime * result + ((edges == null) ? 0 : edges.hashCode());
104 result = prime * result + index;
105 result = prime * result + ((parent == null) ? 0 : parent.hashCode());
106 result = prime * result + ((vertices == null) ? 0 : vertices.hashCode());
111 public boolean equals(Object obj) {
116 if (getClass() != obj.getClass())
118 Subgraph other = (Subgraph) obj;
120 if (other.edges != null)
122 } else if (!edges.equals(other.edges))
124 if (index != other.index)
126 if (parent == null) {
127 if (other.parent != null)
129 } else if (!parent.equals(other.parent))
131 if (vertices == null) {
132 if (other.vertices != null)
134 } else if (!vertices.equals(other.vertices))