public void setUnit(Unit unit) { if (!canContainUnit(unit)) { throw new RuntimeException("attempting to put invalid unit in UnitBox"); } // Remove this from set of back pointers. if (this.unit != null) { this.unit.removeBoxPointingToThis(this); } // Perform link this.unit = unit; // Add this to back pointers if (this.unit != null) { this.unit.addBoxPointingToThis(this); } }
public void toString(UnitPrinter up) { up.startUnitBox(this); up.unitRef(unit, isBranchTarget()); up.endUnitBox(this); } }
public void toString(UnitPrinter up) { up.startUnitBox(this); up.unitRef(unit, isBranchTarget()); up.endUnitBox(this); } }
public void setUnit(Unit unit) { if(!canContainUnit(unit)) throw new RuntimeException("attempting to put invalid unit in UnitBox"); // Remove this from set of back pointers. if(this.unit != null) { this.unit.removeBoxPointingToThis(this); } // Perform link this.unit = unit; // Add this to back pointers if(this.unit != null) { this.unit.addBoxPointingToThis(this); } }
public void toString(UnitPrinter up) { up.startUnitBox(this); up.unitRef(unit, isBranchTarget()); up.endUnitBox(this); } }
public void setUnit(Unit unit) { if(!canContainUnit(unit)) throw new RuntimeException("attempting to put invalid unit in UnitBox"); // Remove this from set of back pointers. if(this.unit != null) { this.unit.removeBoxPointingToThis(this); } // Perform link this.unit = unit; // Add this to back pointers if(this.unit != null) { this.unit.addBoxPointingToThis(this); } }