| |
|
| java.lang.Object tcl.lang.TclObjectBase tcl.lang.TclObject
TclObject | final public class TclObject extends TclObjectBase (Code) | | This class extends TclObjectBase to implement the basic notion of
an object in Tcl.
|
Constructor Summary | |
public | TclObject(InternalRep rep) Creates a TclObject with the given InternalRep. | protected | TclObject(TclString rep, String s) Creates a TclObject with the given InternalRep and stringRep.
This constructor is used by the TclString class only. | protected | TclObject(int ivalue) Creates a TclObject with the given integer value.
This constructor is used by the TclInteger class only. |
Method Summary | |
public static String | getObjRecords() Return a String that describes TclObject and internal
rep type allocations and conversions. | final public void | preserve() Tcl_IncrRefCount -> preserve
Increments the refCount to indicate the caller's intent to
preserve the value of this object. | final public void | release() Tcl_DecrRefCount -> release
Decrements the refCount to indicate that the caller is no longer
interested in the value of this object. | final void | setRecycledDoubleValue(double d) Modify a "recycled" double value so that it
contains a new double value. | final void | setRecycledIntValue(int i) Modify a "recycled" int value so that it
contains a new int value. |
saveObjRecords | final static boolean saveObjRecords(Code) | | |
TclObject | public TclObject(InternalRep rep)(Code) | | Creates a TclObject with the given InternalRep. This method should be
called only by an InternalRep implementation.
Parameters: rep - the initial InternalRep for this object. |
TclObject | protected TclObject(TclString rep, String s)(Code) | | Creates a TclObject with the given InternalRep and stringRep.
This constructor is used by the TclString class only. No other place
should call this constructor.
Parameters: rep - the initial InternalRep for this object. Parameters: s - the initial string rep for this object. |
TclObject | protected TclObject(int ivalue)(Code) | | Creates a TclObject with the given integer value.
This constructor is used by the TclInteger class only. No other place
should call this constructor.
Parameters: ivalue - the integer value |
getObjRecords | public static String getObjRecords()(Code) | | Return a String that describes TclObject and internal
rep type allocations and conversions. The string is
in lines separated by newlines. The saveObjRecords
needs to be set to true and Jacl recompiled for
this method to return a useful value.
|
preserve | final public void preserve()(Code) | | Tcl_IncrRefCount -> preserve
Increments the refCount to indicate the caller's intent to
preserve the value of this object. Each preserve() call must be matched
by a corresponding release() call. This method is Jacl specific
and is intended to be easily inlined in calling code.
exception: TclRuntimeError - if the object has already been deallocated. |
release | final public void release()(Code) | | Tcl_DecrRefCount -> release
Decrements the refCount to indicate that the caller is no longer
interested in the value of this object. If the refCount reaches 0,
the object will be deallocated. This method is Jacl specific
an is intended to be easily inlined in calling code.
exception: TclRuntimeError - if the object has already been deallocated. |
setRecycledDoubleValue | final void setRecycledDoubleValue(double d)(Code) | | Modify a "recycled" double value so that it
contains a new double value. This optimized
logic is like TclDouble.set() except
that it does not invoke invalidateStringRep().
This method is only invoked from the Interp
class when the TclObject is known to
have a refCount of 1 or when the refCount
is 2 but the interp result holds the
other ref. An object with a refCount of
2 would normally raise an exception in
invalidateStringRep, but this optimized
case is worth it for this common case.
|
setRecycledIntValue | final void setRecycledIntValue(int i)(Code) | | Modify a "recycled" int value so that it
contains a new int value. This optimized
logic is like TclInteger.set() except
that it does not invoke invalidateStringRep().
This method is only invoked from the Interp
class when the TclObject is known to
have a refCount of 1 or when the refCount
is 2 but the interp result holds the
other ref. An object with a refCount of
2 would normally raise an exception in
invalidateStringRep, but this optimized
case is worth it for this common case.
|
|
|
|