jpaul.Misc
Class MCell<T>

java.lang.Object
  extended by jpaul.Misc.MCell<T>

public class MCell<T>
extends java.lang.Object

MCell is a mutable cell with content of type T. Sometimes useful when using anonymous classes that can access only final variables of the surounding method: we declare a final variable pointing to a mutable cell, and the anonymous class is free to mutate the cell's content.

Version:
$Id: MCell.java,v 1.5 2006/03/14 02:29:31 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Field Summary
 T value
          The current content of this cell.
 
Constructor Summary
MCell(T initValue)
          Creates a MutableCell.
 
Method Summary
 java.lang.String toString()
          Returns a string description containing both the value and the address of this MCell: "MCell{" + value + "}@" + System.identityHashCode(this).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public T value
The current content of this cell.

Constructor Detail

MCell

public MCell(T initValue)
Creates a MutableCell.

Method Detail

toString

public java.lang.String toString()
Returns a string description containing both the value and the address of this MCell: "MCell{" + value + "}@" + System.identityHashCode(this).

Overrides:
toString in class java.lang.Object


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu