home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
mergeobjec.tcl
< prev
next >
Wrap
Text File
|
1997-08-28
|
2KB
|
82 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)mergeobjec.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)mergeobjec.tcl /main/titanic/2 28 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class MergeObject : {Object} {
constructor
method destructor
method parent
method childSet
method addChild
method removeChild
attribute _parent
attribute fromRepObj
attribute baseRepObj
attribute toRepObj
attribute _childSet
}
constructor MergeObject {class this name fromRepObj toRepObj} {
set this [Object::constructor $class $this $name]
$this fromRepObj $fromRepObj
$this toRepObj $toRepObj
$this _childSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method MergeObject::destructor {this} {
set ref [$this _parent]
if {$ref != ""} {
[$ref _childSet] removeValue $this
}
foreach ref [[$this _childSet] contents] {
$ref _parent ""
}
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
method MergeObject::parent {this args} {
if {$args == ""} {
return [$this _parent]
}
set ref [$this _parent]
if {$ref != ""} {
[$ref _childSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _childSet] append $this
}
$this _parent $obj
}
method MergeObject::childSet {this} {
return [$this _childSet]
}
method MergeObject::addChild {this newChild} {
[$this _childSet] append $newChild
$newChild _parent $this
}
method MergeObject::removeChild {this oldChild} {
$oldChild _parent ""
[$this _childSet] removeValue $oldChild
}