001 /* 002 * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. 003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 004 * 005 * This code is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU General Public License version 2 only, as 007 * published by the Free Software Foundation. Sun designates this 008 * particular file as subject to the "Classpath" exception as provided 009 * by Sun in the LICENSE file that accompanied this code. 010 * 011 * This code is distributed in the hope that it will be useful, but WITHOUT 012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 014 * version 2 for more details (a copy is included in the LICENSE file that 015 * accompanied this code). 016 * 017 * You should have received a copy of the GNU General Public License version 018 * 2 along with this work; if not, write to the Free Software Foundation, 019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 020 * 021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 022 * CA 95054 USA or visit www.sun.com if you need additional information or 023 * have any questions. 024 */ 025 026 package com.sun.javadoc; 027 028 /** 029 * Represents a method of a java class. 030 * 031 * @since 1.2 032 * @author Robert Field 033 */ 034 public interface MethodDoc extends ExecutableMemberDoc { 035 036 /** 037 * Return true if this method is abstract 038 */ 039 boolean isAbstract(); 040 041 /** 042 * Get return type. 043 * 044 * @return the return type of this method, null if it 045 * is a constructor. 046 */ 047 Type returnType(); 048 049 /** 050 * Return the class containing the method that this method overrides. 051 * 052 * <p> <i>The <code>overriddenClass</code> method cannot 053 * accommodate certain generic type constructs. The 054 * <code>overriddenType</code> method should be used instead.</i> 055 * 056 * @return a ClassDoc representing the superclass 057 * defining a method that this method overrides, or null if 058 * this method does not override. 059 */ 060 ClassDoc overriddenClass(); 061 062 /** 063 * Return the type containing the method that this method overrides. 064 * It may be a <code>ClassDoc</code> or a <code>ParameterizedType</code>. 065 * 066 * @return the supertype whose method is overridden, or null if this 067 * method does not override another in a superclass 068 * @since 1.5 069 */ 070 Type overriddenType(); 071 072 /** 073 * Return the method that this method overrides. 074 * 075 * @return a MethodDoc representing a method definition 076 * in a superclass this method overrides, null if 077 * this method does not override. 078 */ 079 MethodDoc overriddenMethod(); 080 081 /** 082 * Tests whether this method overrides another. 083 * The overridden method may be one declared in a superclass or 084 * a superinterface (unlike {@link #overriddenMethod()}). 085 * 086 * <p> When a non-abstract method overrides an abstract one, it is 087 * also said to <i>implement</i> the other. 088 * 089 * @param meth the other method to examine 090 * @return <tt>true</tt> if this method overrides the other 091 * @since 1.5 092 */ 093 boolean overrides(MethodDoc meth); 094 }