예제 #1
0
파일: Entity.java 프로젝트: sivarajs/Dewbag
 protected boolean containsCharacteristic(Characteristic<?> characteristic) {
   if (mCharacteristics != null) {
     for (Characteristic<?> charac : mCharacteristics) {
       if (charac.equals(characteristic)) {
         return true;
       }
     }
   }
   return false;
 }
예제 #2
0
파일: Entity.java 프로젝트: sivarajs/Dewbag
  public Characteristic<?> getCharacteristics(String name) {

    if (mCharacteristics != null) {
      for (Characteristic<?> characteristic : mCharacteristics) {
        if (characteristic.getName().equals(name)) {
          return characteristic;
        }
      }
    }

    return null;
  }
예제 #3
0
파일: Entity.java 프로젝트: sivarajs/Dewbag
  public void addCharacteristic(Characteristic<?> characteristic) {

    if (mCharacteristics == null) {
      mCharacteristics = new ArrayList<Characteristic<?>>(1);
    }

    if (containsCharacteristic(characteristic)
        || (mExtendEntity != null && mExtendEntity.containsCharacteristic(characteristic))) {
      System.out.println(
          ">> WARNING: Duplicate "
              + characteristic.getClass().getSimpleName()
              + ": "
              + characteristic);
      return;
    }

    mCharacteristics.add(characteristic);
  }