| |
|
| java.lang.Object tcl.lang.TclObjectBase
All known Subclasses: tcl.lang.TclObject,
TclObjectBase | abstract class TclObjectBase (Code) | | This class implements the basic notion of an "object" in Tcl. The
fundamental representation of an object is its string value. However,
an object can also have an internal representation, which is a "cached"
reprsentation of this object in another form. The type of the internal
rep of Tcl objects can mutate. This class provides the storage of the
string rep and the internal rep, as well as the facilities for mutating
the internal rep. The Jacl or TclBlend specific implementation of
TclObject will extend this abstract base class.
|
DEALLOCATED | final protected static RuntimeException DEALLOCATED(Code) | | Raise a TclRuntimeError in the case where a
TclObject was already disposed of because the last
ref was released.
|
refCount | protected int refCount(Code) | | |
saveObjRecords | final static boolean saveObjRecords(Code) | | |
validate | final static boolean validate(Code) | | |
TclObjectBase | protected TclObjectBase(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. |
TclObjectBase | protected TclObjectBase(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 code should call this constructor.
Parameters: rep - the initial InternalRep for this object. Parameters: s - the initial string rep for this object. |
TclObjectBase | protected TclObjectBase(int ivalue)(Code) | | Creates a TclObject with the given integer value.
This constructor is used by the TclInteger class only.
No other code should call this constructor.
Parameters: ivalue - the integer value |
disposeObject | final protected void disposeObject()(Code) | | Dispose of the TclObject when the refCount reaches 0.
exception: TclRuntimeError - if the object has already been deallocated. |
disposedError | final protected void disposedError()(Code) | | |
duplicate | final public TclObject duplicate()(Code) | | Tcl_DuplicateObj -> duplicate
Duplicate a TclObject, this method provides the preferred
means to deal with modification of a shared TclObject.
It should be invoked in conjunction with isShared instead
of using the deprecated takeExclusive method.
Example:
if (tobj.isShared()) {
tobj = tobj.duplicate();
}
TclString.append(tobj, "hello");
an TclObject with a refCount of 0. |
getInternalRep | final public InternalRep getInternalRep()(Code) | | Returns the handle to the current internal rep. This method should be
called only by an InternalRep implementation.
the handle to the current internal rep. |
getObjRecords | 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.
|
getRefCount | final int getRefCount()(Code) | | Returns the refCount of this object.
refCount. |
hasNoStringRep | final boolean hasNoStringRep()(Code) | | |
invalidateStringRep | final public void invalidateStringRep() throws TclRuntimeError(Code) | | Sets the string representation of the object to null. Next
time when toString() is called, getInternalRep().toString() will
be called. This method should be called ONLY when an InternalRep
is about to modify the value of a TclObject.
exception: TclRuntimeError - if object is not exclusively owned. |
isDoubleType | final public boolean isDoubleType()(Code) | | |
isIntType | final public boolean isIntType()(Code) | | |
isListType | final boolean isListType()(Code) | | |
isShared | final public boolean isShared()(Code) | | Returns true if the TclObject is shared, false otherwise.
|
isStringType | final boolean isStringType()(Code) | | |
setInternalRep | public void setInternalRep(InternalRep rep)(Code) | | Change the internal rep of the object. The old internal rep
will be deallocated as a result. This method should be
called only by an InternalRep implementation.
Parameters: rep - the new internal rep. |
toString | final public String toString()(Code) | | Returns the string representation of the object.
the string representation of the object. |
|
|
|