/** * \return the newStamp */ public Stamp returnTheNewStamp() { if (newStamp == null) { //if newStamp==null then newStampBuilder must be available. cache it's return value as newStamp newStamp = newStampBuilder.build(); newStampBuilder = null; } return(newStamp); }
/** creates a lazy/deferred StampBuilder which only constructs the stamp if getTheNewStamp() is actually invoked */ public void setTheNewStamp(Stamp first, Stamp second, long time) { newStamp = null; newStampBuilder = new DefaultStampBuilder(first, second, time); }