diff options
author | paltherr <paltherr@epfl.ch> | 2004-03-04 14:16:41 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-03-04 14:16:41 +0000 |
commit | ec819190334417ec423387b8ab1017fae56d5b90 (patch) | |
tree | c1edd48f62b5dfeefcc636fbab5d63ce9048b3fa /sources | |
parent | 0bb65de0e0503eeaa8e7b34b043a31a61f4fff9a (diff) | |
download | scala-ec819190334417ec423387b8ab1017fae56d5b90.tar.gz scala-ec819190334417ec423387b8ab1017fae56d5b90.tar.bz2 scala-ec819190334417ec423387b8ab1017fae56d5b90.zip |
- Removed duplicated code
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/tools/scaladoc/SymbolTablePrinter.java | 66 |
1 files changed, 6 insertions, 60 deletions
diff --git a/sources/scala/tools/scaladoc/SymbolTablePrinter.java b/sources/scala/tools/scaladoc/SymbolTablePrinter.java index d2ba9d61ac..8b0b21832e 100644 --- a/sources/scala/tools/scaladoc/SymbolTablePrinter.java +++ b/sources/scala/tools/scaladoc/SymbolTablePrinter.java @@ -51,51 +51,6 @@ public abstract class MySymbolTablePrinter extends SymbolTablePrinter { public abstract void printSymbol(Symbol sym, boolean addLink); //######################################################################## - // Public Methods - Printing scopes - - /** - * Prints the members of the given scope. - * - * @param scope - */ - public SymbolTablePrinter printScope(Scope scope) { - return printScope(scope, false); - } - - /** - * Prints the members of the given scope. - * - * @param scope - * @param lazy - */ - public SymbolTablePrinter printScope(Scope scope, boolean lazy) { - boolean first = true; - for (SymbolIterator i = scope.iterator(); i.hasNext(); ) { - Symbol member = i.next(); - if (!mustShowMember(member)) continue; - if (first) print("{").indent(); else print(", "); - first = false; - line(); - printSignature(member, false); - } - if (!first) - line().undent().print("}"); - else if (!lazy) - print("{}"); - return this; - } - - /** - * Returns <code>true</code> iff the given member must be printed. - * The default implementation always returns <code>true</code>. - * - * @param member - */ - public boolean mustShowMember(Symbol member) { - return true; - } - - //######################################################################## // Public Methods - Printing symbols /** @@ -154,6 +109,10 @@ public abstract class MySymbolTablePrinter extends SymbolTablePrinter { printSignature(sym, addLink); } + public SymbolTablePrinter printSignature(Symbol symbol) { + return printSignature(symbol, false); + } + /** * Prints the signature of the given symbol. * @@ -226,23 +185,10 @@ public abstract class MySymbolTablePrinter extends SymbolTablePrinter { if (symbol.isClass()) { // type parameters Symbol[] tparams = symbol.typeParams(); - if (tparams.length != 0 || global.debug) { - print('['); - for (int i = 0; i < tparams.length; i++) { - if (i > 0) print(","); - printSignature(tparams[i], false); - } - print(']'); - } + if (tparams.length != 0 || global.debug) printTypeParams(tparams); // value parameters Symbol[] vparams = symbol.valueParams(); - print('('); - for (int i = 0; i < vparams.length; i++) { - if (i > 0) print(", "); // vincent - if (vparams[i].isDefParameter()) print("def "); - defString(vparams[i], false); - } - print(')'); + printValueParams(vparams); } // parents |