Example 2

Consider a composite object representing a time-line. A filter operation is used to select the part of the time-line (and the events it contains) that lies within a specified interval of time. The interval is specified by a predicate t1 < time < t2 that selects all events with a time (the location along the time-line) within the endpoints of the interval. Note that time is the location component of the time-line composite object.