Browse Source

Add toString() for Graph.

Mikaël Capelle 5 years ago
parent
commit
245744c4a0
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/main/org/insa/graph/Graph.java

+ 6
- 0
src/main/org/insa/graph/Graph.java View File

@@ -115,4 +115,10 @@ public final class Graph implements Iterable<Node> {
115 115
         return new Graph("R/" + mapId, mapName, trNodes, graphStatistics);
116 116
     }
117 117
 
118
+    @Override
119
+    public String toString() {
120
+        return String.format("%s[id=%s, name=%s, #nodes=%d]", getClass().getCanonicalName(),
121
+                getMapId(), getMapName(), size());
122
+    }
123
+
118 124
 }

Loading…
Cancel
Save