::xotcl
Class Relations

Heritage:
::xotcl::Object
Class Relations
superclass ::xotcl::Object,

Variables
NameDefault ValueClassComment
 
Methods
NameComment
add {obj prop value {pos 0}}  
delete {obj prop value}  
get {obj prop}  
set {obj prop value}   Same as the Tcl set method, but in the object scope
unknown {m args}  
   
Methods from ::xotcl::Object
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
 
Instproc Detail

add

Description:
 
Arguments:
Code:
  ::xotcl::Relations instproc add {obj prop value {pos 0}}  {
   
$obj $prop [linsert [$obj info $prop -guards] $pos $value]
}

delete

Description:
 
Arguments:
Code:
  ::xotcl::Relations instproc delete {obj prop value}  {
   
set old [$obj info $prop]
set p [lsearch -glob $old $value]
if {$p>-1} {$obj $prop [lreplace $old $p $p]} else {
error "$value is not a $prop of $obj (valid are: $old)"}
}

get

Description:
 
Arguments:
Code:
  ::xotcl::Relations instproc get {obj prop}  {
   $obj info $prop
}

set

Description:
 Same as the Tcl set method, but in the object scope.
Arguments:
Overrides:
set in ::xotcl::Object
Code:
  ::xotcl::Relations instproc set {obj prop value}  {
   ::xotcl::setrelation $obj $prop $value
}

unknown

Description:
 
Arguments:
Code:
  ::xotcl::Relations instproc unknown {m args}  {
   
puts "method '$m' unknown for [self]"
puts "   valid commands are: {[lsort [my info procs]]}"
}