From 245744c4a0bb8faac3b11d7be1770a5462cffd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Mon, 18 Mar 2019 19:50:20 +0100 Subject: [PATCH] Add toString() for Graph. --- src/main/org/insa/graph/Graph.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/org/insa/graph/Graph.java b/src/main/org/insa/graph/Graph.java index 5461df8..a7d1323 100644 --- a/src/main/org/insa/graph/Graph.java +++ b/src/main/org/insa/graph/Graph.java @@ -115,4 +115,10 @@ public final class Graph implements Iterable { return new Graph("R/" + mapId, mapName, trNodes, graphStatistics); } + @Override + public String toString() { + return String.format("%s[id=%s, name=%s, #nodes=%d]", getClass().getCanonicalName(), + getMapId(), getMapName(), size()); + } + }