*/\r
public class Wire\r
{\r
+ public final String name;\r
private BitVector values;\r
public final int travelTime;\r
private List<ReadEnd> attached = new ArrayList<>();\r
Timeline timeline;\r
\r
public Wire(Timeline timeline, int length, int travelTime)\r
+ {\r
+ this(timeline, length, travelTime, null);\r
+ }\r
+\r
+ public Wire(Timeline timeline, int length, int travelTime, String name)\r
{\r
if (length < 1)\r
throw new IllegalArgumentException(\r
String.format("Tried to create an array of wires with length %d, but a length of less than 1 makes no sense.", length));\r
+ this.name = name;\r
this.timeline = timeline;\r
this.length = length;\r
this.travelTime = travelTime;\r
@Override\r
public String toString()\r
{\r
- return String.format("wire 0x%08x value: %s inputs: %s", hashCode(), values, inputs);\r
+ String name = this.name == null ? String.format("0x%08x", hashCode()) : this.name;\r
+ return String.format("wire %s value: %s inputs: %s", name, values, inputs);\r
}\r
\r
public static ReadEnd[] extractEnds(Wire[] w)\r