RecordView (class)
public abstract RecordView {inherits RecordSet}
Import from: CURL.GUI.STANDARD. Defined in package CURL.DATA-ACCESS.BASE.
Direct Known Subclasses: DefaultRecordView, DirectRecordView

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.

Constructors
default:Create an instance of this class.
factory public {RecordView.default
source:RecordSet,
modifiable?:bool = true,
sort:#RecordSort = null,
filter:#RecordFilter = null,
include-deleted-records?:bool = false,
...:EventHandler
}:RecordView

Properties
filter:The RecordFilter currently applied to this RecordView.
accessor public abstract RecordView.filter:#RecordFilter
setter public abstract RecordView.filter:#RecordFilter
for-loop-count:Supports iteration using for loops.
accessor public final inline RecordView.for-loop-count:int
include-deleted-records?:Should records marked for deletion be included in this view?
accessor public abstract RecordView.include-deleted-records?:bool
setter public abstract RecordView.include-deleted-records?:bool
load-state:Load state of the RecordView's source.
accessor public RecordView.load-state:RecordSetLoadState
pending-update?:Has data changed in the RecordView's source?
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
source:RecordSet on which this view is based.
accessor public abstract RecordView.source:RecordSet
Properties inherited from RecordSet: batch-events?, fields, modifiable?, registered-views, size
Properties inherited from EventTarget: event-handlers

Methods
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
note-record-set-event-at-source:Inform this object that a RecordSetEvent was fired on its source.
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
Methods inherited from EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
Methods inherited from BasicEventTarget: enqueue-event
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize



Constructor Details
default (factory)
public {RecordView.default
source:RecordSet,
modifiable?:bool = true,
sort:#RecordSort = null,
filter:#RecordFilter = null,
include-deleted-records?:bool = false,
...:EventHandler
}:RecordView

Create an instance of this class.

Description

This factory creates a DefaultRecordView.
source: see source.
modifiable?: see modifiable?.
sort: see sort.
filter: see filter.
include-deleted-records?: see include-deleted-records?.
...: zero or more EventHandlers to be applied to this object.



Property Details
filter (accessor)
accessor public abstract RecordView.filter:#RecordFilter
setter public abstract RecordView.filter:#RecordFilter

The RecordFilter currently applied to this RecordView.



for-loop-count (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.


include-deleted-records? (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.


load-state (accessor)
accessor public RecordView.load-state:RecordSetLoadState

Load state of the RecordView's source.

Description

See the class documentation for RecordView and RecordSet.load-state for more information.

Overriding

Not typically overridden.


pending-update? (accessor)
accessor public RecordView.pending-update?:bool

Has data changed in the RecordView's source?

Description

See the class documentation for RecordView and RecordSet.pending-update? for more information.

Overriding

Not typically overridden.


sort (accessor)
accessor public abstract RecordView.sort:#RecordSort
setter public abstract RecordView.sort:#RecordSort

The sort currently applied to this RecordView.



source (accessor)
accessor public abstract RecordView.source:RecordSet

RecordSet on which this view is based.






Method Details
commit (method)
public {RecordView.commit}:void

Commit the data in the RecordView's source.

Description

See the class documentation for RecordView and RecordSet.commit for more information.

Overriding

Not typically overridden.


find (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.
search-direction: the SearchDirection to search in.
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.


get (method)
public abstract {RecordView.get index:int}:Record

Returns the Record at the specified index.

index: index of record to be returned. A DataException will be thrown if index is not between 0 and RecordSet.size - 1.


get-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.


load (method)
public {RecordView.load}:void

Load or reload the RecordView's source data.

Description

See the class documentation for RecordView and RecordSet.load for more information.

Overriding

Not typically overridden.


note-record-set-event-at-source (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.


revert (method)
public {RecordView.revert}:void

Revert the data in the RecordView's source.

Description

See the class documentation for RecordView and RecordSet.revert for more information.

Overriding

Not typically overridden.