Search in sources :

Example 1 with MultiTypeParameter

use of com.github.javaparser.ast.body.MultiTypeParameter in project javaparser by javaparser.

the class EqualsVisitor method visit.

@Override
public Boolean visit(MultiTypeParameter n1, Node arg) {
    MultiTypeParameter n2 = (MultiTypeParameter) arg;
    if (n1.getTypes().size() != n2.getTypes().size()) {
        return Boolean.FALSE;
    }
    Iterator<Type> n1types = n1.getTypes().iterator();
    Iterator<Type> n2types = n2.getTypes().iterator();
    while (n1types.hasNext() && n2types.hasNext()) {
        if (!nodeEquals(n1types.next(), n2types.next())) {
            return Boolean.FALSE;
        }
    }
    return visit((BaseParameter) n1, arg);
}
Also used : MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter)

Example 2 with MultiTypeParameter

use of com.github.javaparser.ast.body.MultiTypeParameter in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(MultiTypeParameter _n, Object _arg) {
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<Type> types = visit(_n.getTypes(), _arg);
    VariableDeclaratorId id = cloneNodes(_n.getId(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    MultiTypeParameter r = new MultiTypeParameter(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, types, id);
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) VariableDeclaratorId(com.github.javaparser.ast.body.VariableDeclaratorId) MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter)

Example 3 with MultiTypeParameter

use of com.github.javaparser.ast.body.MultiTypeParameter in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(CatchClause _n, Object _arg) {
    MultiTypeParameter except = cloneNodes(_n.getExcept(), _arg);
    BlockStmt catchBlock = cloneNodes(_n.getCatchBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    CatchClause r = new CatchClause(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), except.getModifiers(), except.getAnnotations(), except.getTypes(), except.getId(), catchBlock);
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter)

Aggregations

MultiTypeParameter (com.github.javaparser.ast.body.MultiTypeParameter)3 BlockComment (com.github.javaparser.ast.comments.BlockComment)2 Comment (com.github.javaparser.ast.comments.Comment)2 JavadocComment (com.github.javaparser.ast.comments.JavadocComment)2 LineComment (com.github.javaparser.ast.comments.LineComment)2 VariableDeclaratorId (com.github.javaparser.ast.body.VariableDeclaratorId)1