コード例 #1
0
 @Override
 public boolean addUsage(SymbolReference usage) {
   if (usage != null) {
     usage.setSymbolDefinition(this);
     if (usages == null) {
       usages = new LinkedList<SymbolReference>();
     }
     return usages.add(usage);
   }
   return false;
 }
コード例 #2
0
 @Override
 public boolean addBodyReference(SymbolReference bodyReference) {
   if (bodyReference != null) {
     SymbolDefinition definition = bodyReference.getSymbolDefinition();
     if (definition != null) {
       int scope = definition.getScopeLevel();
       if (scope <= scopeLevel) {
         if (bodyReferences == null) {
           bodyReferences = new LinkedList<SymbolReference>();
         }
         return bodyReferences.add(bodyReference);
       }
     }
   }
   return false;
 }