org.jquantlib.indexes
Class Index
- java.lang.Object
-
- org.jquantlib.indexes.Index
-
- All Implemented Interfaces:
- Observable
- Direct Known Subclasses:
- InflationIndex, InterestRateIndex
public abstract class Index extends java.lang.Object implements Observable
Purely virtual base class for indexes
-
-
Constructor Summary
Constructors Constructor and Description Index()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddFixing(Date date, double value)Stores the historical fixing at the given datevoidaddFixing(Date date, double value, boolean forceOverwrite)Stores the historical fixing at the given datevoidaddFixings(java.util.Iterator<Date> dates, java.util.Iterator<java.lang.Double> values, boolean forceOverwrite)Stores historical fixings at the given datesvoidaddObserver(Observer observer)Attaches a observer to the Observable.voidclearFixings()Clear the fixings stored for the indexintcountObservers()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.doublefixing(Date fixingDate)abstract doublefixing(Date fixingDate, boolean forecastTodaysFixing)abstract CalendarfixingCalendar()java.util.List<Observer>getObservers()Returns list of observers registered with the Observable.abstract booleanisValidFixingDate(Date fixingDate)abstract java.lang.Stringname()voidnotifyObservers()Notifies all attached observers about changes in the observable.voidnotifyObservers(java.lang.Object arg)Notifies all attached observers about changes in the observable.TimeSeries<java.lang.Double>timeSeries()
-
-
-
Method Detail
-
name
public abstract java.lang.String name()
- Returns:
- name of the Index
-
fixingCalendar
public abstract Calendar fixingCalendar()
- Returns:
- the calendar defining valid fixing dates
-
isValidFixingDate
public abstract boolean isValidFixingDate(Date fixingDate)
- Returns:
- TRUE if the fixing date is a valid one
-
fixing
public abstract double fixing(Date fixingDate, boolean forecastTodaysFixing)
- Returns:
- the fixing at the given date. The date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
-
timeSeries
public TimeSeries<java.lang.Double> timeSeries()
- Returns:
- the fixing TimeSeries
-
addFixing
public void addFixing(Date date, double value)
Stores the historical fixing at the given dateThe date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
-
addFixing
public void addFixing(Date date, double value, boolean forceOverwrite)
Stores the historical fixing at the given dateThe date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
-
addFixings
public final void addFixings(java.util.Iterator<Date> dates, java.util.Iterator<java.lang.Double> values, boolean forceOverwrite)
Stores historical fixings at the given datesThe dates passed as arguments must be the actual calendar dates of the fixings; no settlement days must be used.
-
clearFixings
public final void clearFixings()
Clear the fixings stored for the index
-
fixing
public double fixing(Date fixingDate)
-
addObserver
public 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 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 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 void notifyObservers()
Description copied from interface:ObservableNotifies all attached observers about changes in the observable.- Specified by:
notifyObserversin interfaceObservable
-
notifyObservers
public 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 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 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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG