Cloneable.hx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package java.lang;
  2. /*
  3. * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
  4. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5. *
  6. * This code is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 only, as
  8. * published by the Free Software Foundation. Oracle designates this
  9. * particular file as subject to the "Classpath" exception as provided
  10. * by Oracle in the LICENSE file that accompanied this code.
  11. *
  12. * This code is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. * version 2 for more details (a copy is included in the LICENSE file that
  16. * accompanied this code).
  17. *
  18. * You should have received a copy of the GNU General Public License version
  19. * 2 along with this work; if not, write to the Free Software Foundation,
  20. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21. *
  22. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23. * or visit www.oracle.com if you need additional information or have any
  24. * questions.
  25. */
  26. /**
  27. * A class implements the <code>Cloneable</code> interface to
  28. * indicate to the {@link java.lang.Object#clone()} method that it
  29. * is legal for that method to make a
  30. * field-for-field copy of instances of that class.
  31. * <p>
  32. * Invoking Object's clone method on an instance that does not implement the
  33. * <code>Cloneable</code> interface results in the exception
  34. * <code>CloneNotSupportedException</code> being thrown.
  35. * <p>
  36. * By convention, classes that implement this interface should override
  37. * <tt>Object.clone</tt> (which is protected) with a public method.
  38. * See {@link java.lang.Object#clone()} for details on overriding this
  39. * method.
  40. * <p>
  41. * Note that this interface does <i>not</i> contain the <tt>clone</tt> method.
  42. * Therefore, it is not possible to clone an object merely by virtue of the
  43. * fact that it implements this interface. Even if the clone method is invoked
  44. * reflectively, there is no guarantee that it will succeed.
  45. *
  46. * @author unascribed
  47. * @see java.lang.CloneNotSupportedException
  48. * @see java.lang.Object#clone()
  49. * @since JDK1.0
  50. */
  51. @:require(java0) extern interface Cloneable
  52. {
  53. }