truls.becken@gmail.com
)A generic history class which can contain arbitary entries located in the past or the future.
Copyright: (C) 2008 Truls Becken
- Declared in:
- ETHistory.h
- Conforms to:
- ETCollection
@group Collection Additions
ETHistory keeps a history of objects of some kind. After going back in time, it can go forward again towards the most recent object. Adding an object while at a historic point will discard the forward history.
It is also possible to give ETHistory an NSEnumerator to use as a lazy source for the forward history. This way, a collection of objects can be added as a "future", replacing the current forward history.
ETHistory supports ETCollection protocol, but not
ETCollectionMutation which means
-[NSObject isMutableCollection] returns
NO
and an history won't be considered
as a mutable represented object by EtoileUI.
Go forward, and return the new current object or
nil
if already at the end.
Return an object at a position relative to the
current object. Return nil
if the
index refers to a point before the beginning or
after the end of time.
Go back, and return the new current object or
nil
if already at the start.
Set an enumerator to use as the forward history, discarding everything after the current object.
Set the maximum number of objects to remember. When more objects than this are added, the oldest ones are forgotten.
The default is to remember an unlimited number of objects (max size = 0).
Note that max size only limits the number of objects before -currentObject . Setting a future and peeking into it may force the history to temporarily hold more objects.