PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. */
  20. package org.jedit.ruby.ast;
  21. import java.util.Set;
  22. import java.util.HashSet;
  23. /**
  24. * @author robmckinnon at users.sourceforge.net
  25. */
  26. public abstract class ParentMember extends Member {
  27. ParentMember(String name) {
  28. super(name);
  29. }
  30. public final Set<Method> getMethods() {
  31. final Set<Method> methods = new HashSet<Method>();
  32. visitChildren(new MemberVisitorAdapter() {
  33. public void handleMethod(Method method) {
  34. methods.add(method);
  35. }
  36. });
  37. return methods;
  38. }
  39. }