PageRenderTime 61ms CodeModel.GetById 51ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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 */
16package com.google.test.metric.cpp.dom;
17
18public class BaseClass {
19  public enum AccessSpecifier {
20    PRIVATE, PROTECTED, PUBLIC
21  }
22
23  private ClassDeclaration declaration;
24  private final String access_specifier;
25
26  BaseClass(String specifier) {
27    this.access_specifier = specifier;
28  }
29
30  public AccessSpecifier getAccessSpecifier() {
31    AccessSpecifier tmp = AccessSpecifier.PUBLIC;
32    if (this.access_specifier.contentEquals("public")) {
33      tmp = AccessSpecifier.PUBLIC;
34    } else if (this.access_specifier.contentEquals("protected")) {
35      tmp = AccessSpecifier.PROTECTED;
36    } else if (this.access_specifier.contentEquals("private")) {
37      tmp = AccessSpecifier.PRIVATE;
38    }
39    return tmp;
40  }
41
42  public void setDeclaration(ClassDeclaration base) {
43    this.declaration = base;
44  }
45
46  public ClassDeclaration getDeclaration() {
47    return declaration;
48  }
49}