Class Name

java.lang.Object
   |
   +----Name

public class Name
extends Object
The Name class is used to store a person's name. Currently it only supports first and last names.

This is proably overkill for such a simple object but its purpose is to demonstrate a functional object.


Constructor Index

 o Name()
Constructor
 o Name(Name)
Clone Constructor
 o Name(String, String)
Full Constructor

Method Index

 o equals(Object)
Determine if an object is equal to this object.
 o getFirst()
Get the value of first.
 o getLast()
Get the value of last.
 o setFirst(String)
Set the value of first
 o setLast(String)
Set the value of last
 o toString()
Convert object to String

Constructors

 o Name
 public Name()
Constructor

 o Name
 public Name(Name obj)
Clone Constructor

Parameters:
obj - clone this object.
 o Name
 public Name(String first,
             String last)
Full Constructor

Parameters:
first - - First name
last - - Last name

Methods

 o setFirst
 public void setFirst(String first)
Set the value of first

 o getFirst
 public String getFirst()
Get the value of first.

Returns:
First name
 o setLast
 public void setLast(String last)
Set the value of last

 o getLast
 public String getLast()
Get the value of last.

Returns:
Last name
 o toString
 public String toString()
Convert object to String

Returns:
Name as "First Last".
Overrides:
toString in class Object
 o equals
 public boolean equals(Object obj)
Determine if an object is equal to this object.

Parameters:
obj - the object to test.
Returns:
true if obj is equal to this object.
Overrides:
equals in class Object