edu.upenn.crimson
Class Model

java.lang.Object
  extended by edu.upenn.crimson.Model
All Implemented Interfaces:
java.lang.Cloneable

public class Model
extends java.lang.Object
implements java.lang.Cloneable

Contains model info.

Version:
$Id: Model.java,v 1.9 2007/05/16 18:55:58 fisher Exp $

Field Summary
private  java.lang.String details
          Brief description of this Model.
private  java.lang.String id
          This is a unique name for the Model object.
private  java.lang.String notes
          Notes specific to this Model object.
 
Constructor Summary
Model(java.lang.String id)
          Create a new Model object.
Model(java.lang.String id, boolean withSave)
          Create a new Model object.
 
Method Summary
 java.lang.Object clone()
          Create a shallow clone (just clone the structure, not the Objects) of the existing object.
 java.lang.Object clone(java.lang.String id)
          Create a shallow clone (just clone the structure, not the Objects) of the existing object.
 java.lang.String getDetails()
           
 java.lang.String getID()
          Get the ID.
 java.lang.String getNotes()
           
 void setDetails(java.lang.String details)
          Sets the value of the details field.
 void setDetails(java.lang.String details, boolean withSave)
          Sets the value of the details field.
 void setNotes(java.lang.String notes)
          Sets the value of the notes field.
 void setNotes(java.lang.String notes, boolean withSave)
          Sets the value of the notes field.
 java.lang.String toString()
          Returns Model information formatted for JLists.
 java.lang.String toStringFull()
          Returns Model information for debugging purposes.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private java.lang.String id
This is a unique name for the Model object. It must conform to the Oracle table name definition: no more than 28 char long (plus "_T" or "_P"), no spaces or hyphens, and must begin with a character.


notes

private java.lang.String notes
Notes specific to this Model object.


details

private java.lang.String details
Brief description of this Model.

Constructor Detail

Model

public Model(java.lang.String id)
Create a new Model object.


Model

public Model(java.lang.String id,
             boolean withSave)
Create a new Model object. If 'withUpdate' is true, then the new model will be saved to the database.

Notes:
Shouldn't allow new models if the database isn't open because the models can't be saved. Should throw an exception in this case.
Method Detail

getID

public java.lang.String getID()
Get the ID.


setNotes

public void setNotes(java.lang.String notes)
Sets the value of the notes field. This will also update the value in the MODELS table.


setNotes

public void setNotes(java.lang.String notes,
                     boolean withSave)
Sets the value of the notes field. This will also update the value in the MODELS table, if 'withSave' is true.


getNotes

public java.lang.String getNotes()

setDetails

public void setDetails(java.lang.String details)
Sets the value of the details field. This will also update the value in the MODELS table.


setDetails

public void setDetails(java.lang.String details,
                       boolean withSave)
Sets the value of the details field. This will also update the value in the MODELS table, if 'withSave' is true.


getDetails

public java.lang.String getDetails()

clone

public java.lang.Object clone()
Create a shallow clone (just clone the structure, not the Objects) of the existing object. This will randomly assign the clone's ID, based on the ID for the parent object.

Overrides:
clone in class java.lang.Object

clone

public java.lang.Object clone(java.lang.String id)
Create a shallow clone (just clone the structure, not the Objects) of the existing object. Do not save the clone until all fields have been set.


toStringFull

public java.lang.String toStringFull()
Returns Model information for debugging purposes.


toString

public java.lang.String toString()
Returns Model information formatted for JLists.

Overrides:
toString in class java.lang.Object



Copyright 2006 Stephen Fisher, Susan Davidson, and Junhyong Kim, University of Pennsylvania.