home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)cachedmatr.tcl /main/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)cachedmatr.tcl /main/2 11 Jun 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- require cadmodeltp.tcl
- require cachedcell.tcl
- require cachedrow.tcl
- # End user added include file section
-
-
- Class CachedMatrix : {Matrix} {
- method destructor
- constructor
- method promoter
- method loadCachedMatrix
- method addCachedRow
- method removeCachedRow
- attribute cachedRowSet
- }
-
- method CachedMatrix::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- constructor CachedMatrix {class this name_1 name} {
- set this [Matrix::constructor $class $this $name_1 $name]
- $this cachedRowSet [List new]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method CachedMatrix::promoter {this} {
- $this cachedRowSet [List new]
- }
-
- selfPromoter Matrix {this} {
- if {[[$this file] type] == $CDM_TYPE} {
- CachedMatrix promote $this
- }
- }
-
- method CachedMatrix::loadCachedMatrix {this} {
- $this loadRowData $LT_NAME_TYPE rowDataList
-
- foreach row $rowDataList {
- set theRow [lindex $row 0]
- CachedRow promote $theRow [lindex $row 1] [lindex $row 2]
- $this addCachedRow $theRow
-
- set cells [lindex $row 3]
- foreach cell $cells {
- set theCell [lindex $cell 0]
- CachedCell promote $theCell \
- [lindex $cell 1] [lindex $cell 2]
- $theRow addCachedCell $theCell
- }
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
- method CachedMatrix::addCachedRow {this newCachedRow} {
- [$this cachedRowSet] append $newCachedRow
-
- }
-
- method CachedMatrix::removeCachedRow {this oldCachedRow} {
- [$this cachedRowSet] removeValue $oldCachedRow
- }
-
-