1. /*
  2. * @(#)MethodDoc.java 1.11 04/05/20
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.javadoc;
  8. /**
  9. * Represents a method of a java class.
  10. *
  11. * @since JDK1.2
  12. * @author Robert Field
  13. */
  14. public interface MethodDoc extends ExecutableMemberDoc {
  15. /**
  16. * Return true if this method is abstract
  17. */
  18. boolean isAbstract();
  19. /**
  20. * Get return type.
  21. *
  22. * @return the return type of this method, null if it
  23. * is a constructor.
  24. */
  25. Type returnType();
  26. /**
  27. * Return the class containing the method that this method overrides.
  28. *
  29. * <p> <i>The <code>overriddenClass</code> method cannot
  30. * accommodate certain generic type constructs. The
  31. * <code>overriddenType</code> method should be used instead.</i>
  32. *
  33. * @return a ClassDoc representing the superclass
  34. * defining a method that this method overrides, or null if
  35. * this method does not override.
  36. */
  37. ClassDoc overriddenClass();
  38. /**
  39. * Return the type containing the method that this method overrides.
  40. * It may be a <code>ClassDoc</code> or a <code>ParameterizedType</code>.
  41. *
  42. * @return the supertype whose method is overridden, or null if this
  43. * method does not override another in a superclass
  44. * @since 1.5
  45. */
  46. Type overriddenType();
  47. /**
  48. * Return the method that this method overrides.
  49. *
  50. * @return a MethodDoc representing a method definition
  51. * in a superclass this method overrides, null if
  52. * this method does not override.
  53. */
  54. MethodDoc overriddenMethod();
  55. /**
  56. * Tests whether this method overrides another.
  57. * The overridden method may be one declared in a superclass or
  58. * a superinterface (unlike {@link #overriddenMethod()}).
  59. *
  60. * <p> When a non-abstract method overrides an abstract one, it is
  61. * also said to <i>implement</i> the other.
  62. *
  63. * @param meth the other method to examine
  64. * @return <tt>true</tt> if this method overrides the other
  65. * @since 1.5
  66. */
  67. boolean overrides(MethodDoc meth);
  68. }