|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.TclObject
public final class TclObject
This class extends TclObjectBase to implement the basic notion of an object in Tcl.
Field Summary | |
---|---|
protected static String |
DEALLOCATED_MSG
|
protected InternalRep |
internalRep
|
long |
ivalue
The ivalue field is used for a TclObject that contains an integer value. |
protected int |
refCount
|
protected String |
stringRep
|
Constructor Summary | |
---|---|
|
TclObject(InternalRep rep)
Creates a TclObject with the given InternalRep. |
protected |
TclObject(long ivalue)
Creates a TclObject with the given integer value. |
protected |
TclObject(TclString rep,
String s)
Creates a TclObject with the given InternalRep and stringRep. |
Method Summary | |
---|---|
protected void |
disposedError()
Raise a TclRuntimeError in the case where a TclObject was already disposed of because the last ref was released. |
protected void |
disposeObject()
Dispose of the TclObject when the refCount reaches 0. |
TclObject |
duplicate()
Tcl_DuplicateObj -> duplicate Duplicate a TclObject, this method provides the preferred means to deal with modification of a shared TclObject. |
boolean |
equals(Object o)
|
InternalRep |
getInternalRep()
Returns the handle to the current internal rep. |
static String |
getObjRecords()
Return a String that describes TclObject and internal rep type allocations and conversions. |
int |
getRefCount()
Returns the refCount of this object. |
int |
hashCode()
|
boolean |
hasNoStringRep()
|
void |
invalidateStringRep()
Sets the string representation of the object to null. |
boolean |
isByteArrayType()
|
boolean |
isDoubleType()
|
boolean |
isIntType()
|
boolean |
isListType()
|
boolean |
isShared()
Returns true if the TclObject is shared, false otherwise. |
boolean |
isStringType()
|
boolean |
isWideIntType()
|
void |
preserve()
Tcl_IncrRefCount -> preserve Increments the refCount to indicate the caller's intent to preserve the value of this object. |
void |
release()
Tcl_DecrRefCount -> release Decrements the refCount to indicate that the caller is no longer interested in the value of this object. |
void |
setInternalRep(InternalRep rep)
Change the internal rep of the object. |
TclObject |
takeExclusive()
Deprecated. The takeExclusive method has been deprecated in favor of the new duplicate() method. The takeExclusive method would modify the ref count of the original object and return an object with a ref count of 1 instead of 0. These two behaviors lead to lots of useless duplication of objects that could be modified directly. This method exists only for backwards compatibility and will be removed at some point. |
String |
toString()
Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected InternalRep internalRep
protected int refCount
protected String stringRep
protected static final String DEALLOCATED_MSG
public long ivalue
Constructor Detail |
---|
public TclObject(InternalRep rep)
rep
- the initial InternalRep for this object.protected TclObject(TclString rep, String s)
rep
- the initial InternalRep for this object.s
- the initial string rep for this object.protected TclObject(long ivalue)
ivalue
- the integer valueMethod Detail |
---|
public final void preserve()
TclRuntimeError
- if the object has already been deallocated.public final void release()
TclRuntimeError
- if the object has already been deallocated.public static String getObjRecords()
public boolean equals(Object o)
public int hashCode()
public final boolean isIntType()
public final boolean isStringType()
public final boolean isDoubleType()
public final boolean isWideIntType()
public final boolean isListType()
public final boolean isByteArrayType()
public final InternalRep getInternalRep()
public void setInternalRep(InternalRep rep)
rep
- the new internal rep.public final String toString()
toString
in class Object
public final void invalidateStringRep() throws TclRuntimeError
TclRuntimeError
- if object is not exclusively owned.public final boolean isShared()
public final TclObject duplicate()
public final TclObject takeExclusive() throws TclRuntimeError
TclRuntimeError
public final int getRefCount()
protected final void disposeObject()
TclRuntimeError
- if the object has already been deallocated.protected final void disposedError()
public final boolean hasNoStringRep()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |