protected boolean containsCharacteristic(Characteristic<?> characteristic) { if (mCharacteristics != null) { for (Characteristic<?> charac : mCharacteristics) { if (charac.equals(characteristic)) { return true; } } } return false; }
public Characteristic<?> getCharacteristics(String name) { if (mCharacteristics != null) { for (Characteristic<?> characteristic : mCharacteristics) { if (characteristic.getName().equals(name)) { return characteristic; } } } return null; }
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); }