PageRenderTime 76ms CodeModel.GetById 73ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/bundles/plugins-trunk/RubyPlugin/src/org/jedit/ruby/ast/ParentMember.java

#
Java | 45 lines | 17 code | 6 blank | 22 comment | 0 complexity | 8e5eb8c6009ebc1663749b71954908f8 MD5 | raw file
 1/*
 2 * ParentMember.java - 
 3 *
 4 * Copyright 2005 Robert McKinnon
 5 *
 6 * This program is free software; you can redistribute it and/or
 7 * modify it under the terms of the GNU General Public License
 8 * as published by the Free Software Foundation; either version 2
 9 * of the License, or any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 */
20package org.jedit.ruby.ast;
21
22import java.util.Set;
23import java.util.HashSet;
24
25/**
26 * @author robmckinnon at users.sourceforge.net
27 */
28public abstract class ParentMember extends Member {
29
30    ParentMember(String name) {
31        super(name);
32    }
33
34    public final Set<Method> getMethods() {
35        final Set<Method> methods = new HashSet<Method>();
36
37        visitChildren(new MemberVisitorAdapter() {
38            public void handleMethod(Method method) {
39                methods.add(method);
40            }
41        });
42
43        return methods;
44    }
45}