Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve method type parameter substitution
- Loading branch information
1 parent
a8904db
commit 558fc9b
Showing
7 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,38 @@ | |||
class CompilationUnit { | |||
|
|||
} | |||
|
|||
public interface VoidVisitor<A> { | |||
|
|||
void visit(CompilationUnit n, A arg); | |||
|
|||
void visit(JavadocComment n, A arg); | |||
} | |||
|
|||
public interface GenericVisitor<R, A> { | |||
|
|||
R visit(CompilationUnit n, A arg); | |||
|
|||
R visit(JavadocComment n, A arg); | |||
} | |||
|
|||
class JavadocComment { | |||
|
|||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) { | |||
return v.visit(this, arg); | |||
} | |||
|
|||
public <A> void accept(VoidVisitor<A> v, A arg) { | |||
v.visit(this, arg); | |||
} | |||
|
|||
} | |||
|
|||
public abstract class VoidVisitorAdapter<A> implements VoidVisitor<A> { | |||
|
|||
@Override public void visit(final AnnotationDeclaration n, final A arg) { | |||
JavadocComment javadocComment; | |||
javadocComment.accept(this, arg); | |||
} | |||
|
|||
} |