001/*
002  File: Cell.java
003
004  Originally written by Doug Lea and released into the public domain. 
005  Thanks for the assistance and support of Sun Microsystems Labs, Agorics 
006  Inc, Loral, and everyone contributing, testing, and using this code.
007
008  History:
009  Date     Who                What
010  24Sep95  dl@cs.oswego.edu   Create from collections.java  working file
011  9Apr97   dl                 made Serializable
012
013*/
014package cnslab.cnsmath;
015
016
017/**
018 *
019 *
020 * Cell is the base of a bunch of implementation classes
021 * for lists and the like.
022 * The base version just holds an Object as its element value
023 * @author Doug Lea
024 * @version 0.93
025 *
026 * <P> For an introduction to this package see <A HREF="index.html"> Overview </A>.
027**/
028
029public class Cell<T extends Comparable>  implements java.io.Serializable ,Cloneable{
030
031// instance variables
032
033  public T element_;
034
035/**
036 * Make a cell with element value v
037**/
038  public Cell(T v)                  { element_ = v; }
039/**
040 * Make A cell with null element value
041**/
042
043  public Cell()                          { element_ = null; }
044
045/**
046 * return the element value
047**/
048
049  public final T element()          { return element_; }
050
051/**
052 * set the element value
053**/
054
055  public final void   element(T v)  { element_ = v; }
056
057
058  protected Object clone() throws CloneNotSupportedException
059  {
060          Cell a=new Cell(element_);
061        return a;
062  }
063
064}
065