| java.lang.Object tcl.lang.TclInteger
TclInteger | public class TclInteger implements InternalRep(Code) | | This class implements the integer object type in Tcl.
|
Method Summary | |
public void | dispose() Implement this no-op for the InternalRep interface. | public InternalRep | duplicate() Should never be invoked. | static void | exprSetInternalRep(TclObject tobj, int i) This special helper method is used only by
the Expression module. | public static int | get(Interp interp, TclObject tobj) Tcl_GetIntFromObj -> TclInteger.get
Returns the integer value of the object.
Parameters: interp - current interpreter. Parameters: tobj - the object to operate on. | static void | incr(Interp interp, TclObject tobj, int incrAmount) Increments the integer value of the object by the given
amount. | public static TclObject | newInstance(int i) Tcl_NewIntObj -> TclInteger.newInstance
Creates a new instance of a TclObject with a TclInteger internal
representation.
Parameters: b - initial value of the integer object. | public static void | set(TclObject tobj, int i) Changes the integer value of the object. | public String | toString() Should never be invoked. |
dispose | public void dispose()(Code) | | Implement this no-op for the InternalRep interface.
|
exprSetInternalRep | static void exprSetInternalRep(TclObject tobj, int i)(Code) | | This special helper method is used only by
the Expression module. This method will
change the internal rep to a TclInteger with
the passed in int value. This method does
not invalidate the string rep since the
object's value is not being changed.
Parameters: tobj - the object to operate on. Parameters: i - the new int value. |
get | public static int get(Interp interp, TclObject tobj) throws TclException(Code) | | Tcl_GetIntFromObj -> TclInteger.get
Returns the integer value of the object.
Parameters: interp - current interpreter. Parameters: tobj - the object to operate on. the integer value of the object. |
incr | static void incr(Interp interp, TclObject tobj, int incrAmount) throws TclException(Code) | | Increments the integer value of the object by the given
amount. One could implement this same operation by
calling get() and then set(), this method provides an
optimized implementation. This method is not public
since it will only be invoked by the incr command.
Parameters: interp - current interpreter. Parameters: tobj - the object to operate on. Parameters: incrAmount - amount to increment |
newInstance | public static TclObject newInstance(int i)(Code) | | Tcl_NewIntObj -> TclInteger.newInstance
Creates a new instance of a TclObject with a TclInteger internal
representation.
Parameters: b - initial value of the integer object. the TclObject with the given integer value. |
set | public static void set(TclObject tobj, int i)(Code) | | Changes the integer value of the object.
Parameters: interp - current interpreter. Parameters: tobj - the object to operate on. Parameters: i - the new integer value. |
toString | public String toString()(Code) | | Should never be invoked.
|
|
|