Code example for ArrayList

Methods: addcontains

0
    addPreference(preference);
  } 
 
  @Implementation 
  public boolean addPreference(Preference preference) {
    if (preferenceList.contains(preference)) {
      return true; 
    } 
 
    // TODO currently punting on ordering logic 
    preferenceList.add(preference);
 
    return true; 
  } 
 
  @Implementation 
  public Preference getPreference(int index) {
    return preferenceList.get(index);
  } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE