/cpp/src/main/java/com/google/test/metric/cpp/dom/BaseClass.java

http://testability-explorer.googlecode.com/ · Java · 49 lines · 28 code · 6 blank · 15 comment · 5 complexity · 89cc2e9dbe420853150f6aa2da9a5d7e MD5 · raw file

  1. /*
  2. * Copyright 2009 Google Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.google.test.metric.cpp.dom;
  17. public class BaseClass {
  18. public enum AccessSpecifier {
  19. PRIVATE, PROTECTED, PUBLIC
  20. }
  21. private ClassDeclaration declaration;
  22. private final String access_specifier;
  23. BaseClass(String specifier) {
  24. this.access_specifier = specifier;
  25. }
  26. public AccessSpecifier getAccessSpecifier() {
  27. AccessSpecifier tmp = AccessSpecifier.PUBLIC;
  28. if (this.access_specifier.contentEquals("public")) {
  29. tmp = AccessSpecifier.PUBLIC;
  30. } else if (this.access_specifier.contentEquals("protected")) {
  31. tmp = AccessSpecifier.PROTECTED;
  32. } else if (this.access_specifier.contentEquals("private")) {
  33. tmp = AccessSpecifier.PRIVATE;
  34. }
  35. return tmp;
  36. }
  37. public void setDeclaration(ClassDeclaration base) {
  38. this.declaration = base;
  39. }
  40. public ClassDeclaration getDeclaration() {
  41. return declaration;
  42. }
  43. }