Class BootstrapHelper<TS extends TermStructure>
- java.lang.Object
-
- org.jquantlib.termstructures.BootstrapHelper<TS>
-
- All Implemented Interfaces:
- Observable, Observer, PolymorphicVisitable
- Direct Known Subclasses:
- RateHelper
public abstract class BootstrapHelper<TS extends TermStructure> extends java.lang.Object implements Observer, Observable, PolymorphicVisitable
Base helper class for bootstrappingThis class provides an abstraction for the instruments used to bootstrap a term structure.
It is advised that a bootstrap helper for an instrument contains an instance of the actual instrument class to ensure consistancy between the algorithms used during bootstrapping and later instrument pricing. This is not yet fully enforced in the available rate helpers.
-
-
Constructor Summary
Constructors Constructor and Description BootstrapHelper(double quote)BootstrapHelper(Handle<Quote> quote)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaccept(PolymorphicVisitor pv)This method is intended to extend the semantics of methodVisitable.accept(Visitor)voidaddObserver(Observer observer)Attaches a observer to the Observable.intcountObservers()Counts how many Observers were attached to this class.voiddeleteObserver(Observer observer)Detaches a previously attached observer to the observable.voiddeleteObservers()Detaches all previously attached observer to the observable.DateearliestDate()java.util.List<Observer>getObservers()Returns list of observers registered with the Observable.abstract doubleimpliedQuote()DatelatestDate()voidnotifyObservers()Notifies all attached observers about changes in the observable.voidnotifyObservers(java.lang.Object arg)Notifies all attached observers about changes in the observable.doublequoteError()booleanquoteIsValid()voidsetTermStructure(TS c)voidupdate()This method is called whenever the observed object is changed.
-
-
-
Method Detail
-
impliedQuote
public abstract double impliedQuote()
-
quoteError
public double quoteError()
-
quoteIsValid
public boolean quoteIsValid()
-
setTermStructure
public void setTermStructure(TS c)
-
earliestDate
public Date earliestDate()
-
latestDate
public Date latestDate()
-
update
public void update()
Description copied from interface:ObserverThis method is called whenever the observed object is changed.
-
addObserver
public final void addObserver(Observer observer)
Description copied from interface:ObservableAttaches a observer to the Observable. After attachment the observer gets informed about changes in the Observable.- Specified by:
addObserverin interfaceObservable- Parameters:
observer- The observer to attach to the observable
-
countObservers
public final int countObservers()
Description copied from interface:ObservableCounts how many Observers were attached to this class.- Specified by:
countObserversin interfaceObservable- Returns:
- the number of Observers
- See Also:
Observer
-
deleteObserver
public final void deleteObserver(Observer observer)
Description copied from interface:ObservableDetaches a previously attached observer to the observable. After detachment the observer does no longer receive change notifications from the observable.- Specified by:
deleteObserverin interfaceObservable- Parameters:
observer- The observer to detach from the observable
-
notifyObservers
public final void notifyObservers()
Description copied from interface:ObservableNotifies all attached observers about changes in the observable.- Specified by:
notifyObserversin interfaceObservable
-
notifyObservers
public final void notifyObservers(java.lang.Object arg)
Description copied from interface:ObservableNotifies all attached observers about changes in the observable.- Specified by:
notifyObserversin interfaceObservable- Parameters:
arg- an arbitrary Object to be passed to the Observer
-
deleteObservers
public final void deleteObservers()
Description copied from interface:ObservableDetaches all previously attached observer to the observable. After detachment observers do not longer receive change notifications from the observable.- Specified by:
deleteObserversin interfaceObservable
-
getObservers
public final java.util.List<Observer> getObservers()
Description copied from interface:ObservableReturns list of observers registered with the Observable. List returned is unmodifiable list.- Specified by:
getObserversin interfaceObservable- Returns:
- list of observers
-
accept
public void accept(PolymorphicVisitor pv)
Description copied from interface:PolymorphicVisitableThis method is intended to extend the semantics of methodVisitable.accept(Visitor)In a conventional Visitor design pattern, the
acceptmethod is called when access to visit a data structure is requested. AVisitorobject is passed as argument in case permission is granted to thatVisitorto access the data structure. Obviously,Visitors andVisitables work in pairs and the class which provides the data structure to be visited also implementsVisitablein order to properly grant access when the expectedVisitoris received.In the case of a
PolymorphicVisitable, aPolymorphicVisitoris passed instead of aVisitor. APolymorphicVisitoris in fact, a composition ofVisitors and not only a singleVisitor. APolymorphicVisitoris responsible for returning the correctVisitorresponsible for processing a certain data structure.The initial design of pairs made of <
Visitor,Visitable> is extended to a concept of a matrix made of multipleVisitors against multipleVisitables. Every class which implementsPolymorphicVisitablepasses different data structures when queryingPolymorphicVisitors.- Specified by:
acceptin interfacePolymorphicVisitable- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG