java - How to reference another method of the same class in Javadoc? -
suppose class has 2 methods:
contains() , containssame() the distinction between them subtle , you'd mention part of javadoc
in javadoc, how can reference method in same class, name?
use @link inline tag, , refer method leading #.
/** * ... * method similar {@link #contains()}, following differences: * ... */ public boolean containssame(); /** * method ... */ public boolean contains(); this example works if there contains() method has no arguments (which, actually, seems not useful). if have contains method arguments, either write argument types in parentheses:
/** * ... * method similar {@link #contains(element)}, following differences: * ... */ public boolean containssame(element e); /** * method ... */ public boolean contains(element e); or can omit parentheses @ all:
/** * ... * method similar {@link #contains}, following differences: * ... */ public boolean containssame(element e); /** * method ... */ public boolean contains(element e); if have several methods named contains (with different parameter lists), version can't decide 1 use (the link jump of them, , similar things).
Comments
Post a Comment