Пример #1
0
  public FieldArray getInheritedFields() {
    FieldArray result = new FieldArrayImpl();
    FieldDeclaration curField;

    for (TypeDeclarationIterator typeIter = getAncestors().getIterator(); typeIter.hasNext(); ) {
      for (FieldIterator fieldIter = typeIter.getNext().getFields().getIterator();
          fieldIter.hasNext(); ) {
        curField = fieldIter.getNext();
        if (isVisible(curField) && !isRedefined(curField)) {
          result.add(curField);
        }
      }
    }

    return result;
  }
Пример #2
0
 public boolean isEmpty() {
   if (_localVars != null) {
     return _localVars.isEmpty();
   } else if (_fields != null) {
     return _fields.isEmpty();
   } else {
     return true;
   }
 }
Пример #3
0
 public int getCount() {
   if (_localVars != null) {
     return _localVars.getCount();
   } else if (_fields != null) {
     return _fields.getCount();
   } else {
     return 0;
   }
 }
Пример #4
0
 public VariableDeclaration get(int idx) {
   if (_localVars != null) {
     return _localVars.get(idx);
   } else if (_fields != null) {
     return _fields.get(idx);
   } else {
     return null;
   }
 }
Пример #5
0
 public void add(FieldDeclaration decl) {
   if (_fields == null) {
     _fields = new FieldArrayImpl();
   }
   _fields.add(decl);
 }