gausssoft.lang
Interface CloneableObject
- All Superinterfaces:
- Cloneable
- All Known Implementing Classes:
- ArraySet, MapEntry, InstanceChecker, Stopwatch
- public interface CloneableObject
- extends Cloneable
The CloneableObject interface is used to identify an object which can be
cloned freely.
This interface differs from the Cloneable interface
in the way it forces the class implementing the interface to have a clone
method which is public, and does not throw a
CloneNotSupportedException.
This allows any object to test if it can clone an object without having to
know it's class type (for example, Object is not directly
cloneable, but java.util.Vector is, however, if a Vector is
stored in an Object pointer, it is not directly possible to tell if the
object is publicly cloneable or not, as the clone method in
Object has protected access).
- Author:
- Allan Crooks
- See Also:
Cloneable
clone
public Object clone()
- Clones this object.
- Overrides:
clone in class Object
- Returns:
- A copy of this object.
- See Also:
Object.clone()