(class)
public abstract RecordView
{inherits
RecordSet}
A RecordSet which provides a sorted, filtered view of the data contained by another RecordSet.
Description
RecordViews observe their source
RecordSet in order to maintain their state and fire any necessary events at themselves.
NOTE: It is important to be aware that a
RecordView is primarily just a means for efficiently accessing data contained in the underlying source
RecordSet. No separate copy of the data is made. It particular, it is critical to note that the methods
RecordView.commit,
RecordView.revert,
RecordView.load,
RecordView.load-state and
RecordView.pending-update? are simply delegated to the
source. Therefore, all records which have been modified in the underlying source will be affected by these methods, whether or not they currently appear in the view.
| default: | Create an instance of this class. |
accessor public final inline RecordView.for-loop-count:
int
accessor public abstract RecordView.include-deleted-records?:
bool setter public abstract RecordView.include-deleted-records?:
bool
accessor public RecordView.pending-update?:
bool
| sort: | The sort currently applied to this RecordView. |
accessor public abstract RecordView.sort:#
RecordSort setter public abstract RecordView.sort:#
RecordSort
accessor public abstract RecordView.source:
RecordSet
| commit: | Commit the data in the RecordView's source. |
| public | {RecordView.commit}:void |
| find: | Search the RecordView for a record. |
| public | {RecordView.find filter:RecordFilter,search-direction:SearchDirection = SearchDirection.forward,starting-index:int = {if search-direction == SearchDirection.forward then
0
else
self.size - 1
} }:int |
| get: | Returns the Record at the specified index. |
| public abstract | {RecordView.get index:int}:Record |
| get-index: | Return the index for a record in this view. |
| public | {RecordView.get-index record:Record}:int |
| load: | Load or reload the RecordView's source data. |
| public | {RecordView.load}:void |
| public | {RecordView.note-record-set-event-at-source}:void |
| revert: | Revert the data in the RecordView's source. |
| public | {RecordView.revert}:void |
Methods inherited from RecordSet:
append, delete-all, ensure-attached, ensure-modifiable, handle-event, member?, new-record, on-record-set-event, register-view, select, select-one, to-Iterator, unregister-view
(factory)
Create an instance of this class.
Description
...: zero or more
EventHandlers to be applied to this object.
(accessor)
(accessor)
accessor public final inline RecordView.for-loop-count:
int Supports iteration using for loops.
Programming Notes
Not intended for direct use.
Description
A getter that the Curl compiler uses when it encounters a container for loop that iterates over self.
(accessor)
accessor public abstract RecordView.include-deleted-records?:
bool setter public abstract RecordView.include-deleted-records?:
bool Should records marked for deletion be included in this view?
Description
This property applies to records in the state RecordState.deleted.
(accessor)
Load state of the RecordView's source.
Description
Overriding
Not typically overridden.
(accessor)
accessor public RecordView.pending-update?:
bool Has data changed in the RecordView's source?
Description
Overriding
Not typically overridden.
(accessor)
accessor public abstract RecordView.sort:#
RecordSort setter public abstract RecordView.sort:#
RecordSort The sort currently applied to this RecordView.
(accessor)
accessor public abstract RecordView.source:
RecordSet
(method)
| public | {RecordView.commit}:void |
Commit the data in the RecordView's source.
Description
Overriding
Not typically overridden.
(method)
| public | {RecordView.find filter:RecordFilter,search-direction:SearchDirection = SearchDirection.forward,starting-index:int = {if search-direction == SearchDirection.forward then
0
else
self.size - 1
} }:int |
Search the RecordView for a record.
filter:
RecordFilter describing the record being searched for.
starting-index: an
int that indicates the index of the record from which you want to start searching. By default this method searches from the first record or the last record, depending on
search-direction. The range of valid values for
starting-index is different for
SearchDirection.forward (
0 <= valid-starting-index <= self.size) and
SearchDirection.backward (
-1 <= valid-starting-index <= self.size - 1). This method throws a
KeyNotFoundException if
starting-index is outside this range.
Returns
An int containing the index of the first matching record. If there is no matching record, this method returns -1.
Overriding
The default implementation of this method provides a simple linear time search. Subclasses that can provide more efficient implementations should do so.
(method)
| public abstract | {RecordView.get index:int}:Record |
Returns the Record at the specified index.
(method)
| public | {RecordView.get-index record:Record}:int |
Return the index for a record in this view.
record:
Record being searched for.
Description
If record is not currently present in this collection, -1 will be returned.
Overriding
The default implementation of this method does a linear scan through the collection. Subclasses are encouraged to override this method with a more efficient implementation, if possible.
(method)
| public | {RecordView.load}:void |
Load or reload the RecordView's source data.
Description
Overriding
Not typically overridden.
(method)
| public | {RecordView.note-record-set-event-at-source}:void |
Inform this object that a RecordSetEvent was fired on its source.
Programming Notes
Not for application use. Used by implementations of RecordSet.
Overriding
Override this method to react to changes to the source recordset. Implementations should be sure to invoke the super implementation.
(method)
| public | {RecordView.revert}:void |
Revert the data in the RecordView's source.
Description
Overriding
Not typically overridden.