ix.util.context
Class ContextInt

java.lang.Object
  extended by ix.util.context.ContextInt

public class ContextInt
extends java.lang.Object

An object that contains a single context-dependent int value.


Field Summary
(package private)  ContextHolder holder
           
(package private)  ContextLink link
           
 
Constructor Summary
ContextInt(ContextHolder holder, int rootValue)
           
ContextInt(int rootValue)
           
 
Method Summary
 int add(int incr)
          Increment by the indicated amount, then return the new value.
 int get()
           
 int incrAfter()
          Increment then return the old value.
 int incrBefore()
          Increment then return the new value.
 void set(int new_value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

holder

ContextHolder holder

link

ContextLink link
Constructor Detail

ContextInt

public ContextInt(int rootValue)

ContextInt

public ContextInt(ContextHolder holder,
                  int rootValue)
Method Detail

get

public int get()

set

public void set(int new_value)

add

public int add(int incr)
Increment by the indicated amount, then return the new value.


incrBefore

public int incrBefore()
Increment then return the new value. Like ++i.


incrAfter

public int incrAfter()
Increment then return the old value. Like i++.