public class ComparableCopyableName
1: /**
2: A mutable class that represents a person's name
3: that can be compared and cloned.
4:
5: @author Frank M. Carrano
6: @author Timothy M. Henry
7: @version 4.0
8: */
9: public class ComparableCopyableName
10: implements ComparableAndCopyable<ComparableCopyableName>
11: {
12: // . . .
13:
14: public Object clone()
15: {
16: ComparableCopyableName theCopy = null;
17: try
18: {
19: theCopy = (ComparableCopyableName)super.clone(); // Object can throw an exception
20: }
21: catch (CloneNotSupportedException e)
22: {
23: System.err.println("Name cannot clone: " + e.toString());
24: }
25:
26: return theCopy;
27: } // end clone
28: } // end ComparableCopyableName