Building Parsers with Java

sjm.examples.cloning
Class Course

java.lang.Object
  |
  +--sjm.examples.cloning.Course

public class Course
extends java.lang.Object
implements PubliclyCloneable

This class shows a typical clone() method.


Field Summary
protected  Professor professor
           
protected  Textbook textbook
           
 
Constructor Summary
Course()
           
 
Method Summary
 java.lang.Object clone()
          Return a copy of this object.
 Professor getProfessor()
          Get the professor.
 Textbook getTextbook()
          Get the textbook.
 void setProfessor(Professor professor)
          Set the professor.
 void setTextbook(Textbook textbook)
          Set the textbook.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

professor

protected Professor professor

textbook

protected Textbook textbook
Constructor Detail

Course

public Course()
Method Detail

clone

public java.lang.Object clone()
Return a copy of this object.
Specified by:
clone in interface PubliclyCloneable
Overrides:
clone in class java.lang.Object
Returns:
a copy of this object

getProfessor

public Professor getProfessor()
Get the professor.
Returns:
the professor

getTextbook

public Textbook getTextbook()
Get the textbook.
Returns:
the textbook

setProfessor

public void setProfessor(Professor professor)
Set the professor.
Parameters:
Professor - professor

setTextbook

public void setTextbook(Textbook textbook)
Set the textbook.
Parameters:
Textbook - textbook

by Steve Metsker