net.sf.adatagenerator.api
Interface ModifiablePair<R>

Type Parameters:
R - the type of pair being modified
All Superinterfaces:
com.choicemaker.shared.api.CMPair<R>, Iterable<R>
All Known Subinterfaces:
SynthesizedPair<R>
All Known Implementing Classes:
DefaultModifiablePair, DefaultSynthesizedPair

public interface ModifiablePair<R>
extends com.choicemaker.shared.api.CMPair<R>

A template for the client in a visitor pattern. This class allows one to define a chain of processing operations on a pair:

 DefaultPair p = new DefaultPair(person1,person2);
 ModfiablePair mp = new ModifiableGeneratedPair0(p);
 List>> processors = ;
 for (PairModifier> processor : processors) {
   mp = mp.acceptModification(processor);
 }
 


Method Summary
 ModifiablePair<R> acceptModification(PairModifier<R,ModifiablePair<R>> modifier)
          Accepts modification by the specified pair modifier.
 PairModifier.ModificationResult getCurrentStatus()
          Returns the result of the last modification to this instance.
 void setCurrentStatus(PairModifier.ModificationResult currentStatus)
          Sets the result of the last modification to this instance.
 
Methods inherited from interface com.choicemaker.shared.api.CMPair
getLeft, getRight, iterator, setLeft, setRight
 

Method Detail

getCurrentStatus

PairModifier.ModificationResult getCurrentStatus()
Returns the result of the last modification to this instance.


setCurrentStatus

void setCurrentStatus(PairModifier.ModificationResult currentStatus)
Sets the result of the last modification to this instance.


acceptModification

ModifiablePair<R> acceptModification(PairModifier<R,ModifiablePair<R>> modifier)
                                     throws ModificationException
Accepts modification by the specified pair modifier.

Returns:
a modified version (or copy) of this instance.
Throws:
ModificationException


Copyright © 2011-2012. All Rights Reserved.