Code example for Collection

Methods: addAllclear

0
   *  
   * @param list the new labels 
   */ 
  public void setLabels(List<String> list) {
    Collection<String> labels = checkLabels();
    labels.clear();
    labels.addAll(list);
  } 
 
  /** 
   * Sets the labels. 
   *  
   * @param labels the new labels 
   */ 
  public void setLabels(String... labels) {
    setLabels(Arrays.asList(labels));
  } 
 
  /** 
   * Sets the tick length. 
   *  
   * @param tickLength the new tick length 
   */ 
  public void setTickLength(Integer tickLength) {
    set("tick-length", tickLength);
  } 
 
  private Collection<String> checkLabels() {
    Collection<String> labels = get("labels");
    if (labels == null) {
      labels = new ArrayList<String>();
      set("labels", labels);
    } 
    return labels;
  } 
} 
Contextual code suggestions in your IDE  Get Codota for Java