/** * A pair of objects (a,b) is equal to another pair (c,d) if and only if a, * b, c and d are all the same type and the condition (a.equals(c) & * b.equals(d)) is true. */ @Override public boolean equals(Object other) { if (other instanceof OrderedPair) { OrderedPair<?> op = (OrderedPair<?>) other; return (a.equals(op.getA()) && b.equals(op.getB())); } else { return false; } }
/** * A pair of objects (a,b) is equal to another pair (c,d) if and only if a, * b, c and d are all the same type and the condition (a.equals(c) & * b.equals(d)) is true. */ @Override public boolean equals(Object other) { if (other instanceof OrderedPair) { OrderedPair<?> op = (OrderedPair<?>) other; return (a.equals(op.getA()) && b.equals(op.getB())); } else { return false; } }
/** * A pair of objects (a,b) is equal to another pair (c,d) if and only if a, * b, c and d are all the same type and the condition (a.equals(c) & * b.equals(d)) is true. */ @Override public boolean equals(Object other) { if (other instanceof OrderedPair) { OrderedPair<?> op = (OrderedPair<?>) other; return (a.equals(op.getA()) && b.equals(op.getB())); } else { return false; } }
public final void undo() { if (!applied) { throw new RuntimeException( "Attempt to undo edit that was never applied"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); synchronized (processors) { undoEditAction(pia, pib); applied = false; } }
public final void undo() { if (!applied) { throw new RuntimeException( "Attempt to undo edit that was never applied"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); synchronized (processors) { undoEditAction(pia, pib); applied = false; } }
public final void undo() { if (!applied) { throw new RuntimeException( "Attempt to undo edit that was never applied"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); synchronized (processors) { undoEditAction(pia, pib); applied = false; } }
public final OrderedPair<Processor> doEdit() throws EditException { if (applied) { throw new EditException("Edit has already been applied!"); } if (processors.getA() instanceof ProcessorImpl == false || processors.getB() instanceof ProcessorImpl == false) { throw new EditException( "Edit cannot be applied to a Processor which isn't an instance of ProcessorImpl"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); try { synchronized (processors) { doEditAction(pia, pib); applied = true; return this.processors; } } catch (EditException ee) { applied = false; throw ee; } }
public final OrderedPair<Processor> doEdit() throws EditException { if (applied) { throw new EditException("Edit has already been applied!"); } if (processors.getA() instanceof ProcessorImpl == false || processors.getB() instanceof ProcessorImpl == false) { throw new EditException( "Edit cannot be applied to a Processor which isn't an instance of ProcessorImpl"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); try { synchronized (processors) { doEditAction(pia, pib); applied = true; return this.processors; } } catch (EditException ee) { applied = false; throw ee; } }
public final OrderedPair<Processor> doEdit() throws EditException { if (applied) { throw new EditException("Edit has already been applied!"); } if (processors.getA() instanceof ProcessorImpl == false || processors.getB() instanceof ProcessorImpl == false) { throw new EditException( "Edit cannot be applied to a Processor which isn't an instance of ProcessorImpl"); } ProcessorImpl pia = (ProcessorImpl) processors.getA(); ProcessorImpl pib = (ProcessorImpl) processors.getB(); try { synchronized (processors) { doEditAction(pia, pib); applied = true; return this.processors; } } catch (EditException ee) { applied = false; throw ee; } }