Package com.ojn.gexf4j.core.impl.data

Source Code of com.ojn.gexf4j.core.impl.data.AttributeValueListImpl

package com.ojn.gexf4j.core.impl.data;

import static com.google.common.base.Preconditions.checkArgument;

import java.util.ArrayList;

import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeValue;
import com.ojn.gexf4j.core.data.AttributeValueList;

public class AttributeValueListImpl extends ArrayList<AttributeValue> implements AttributeValueList {
  private static final long serialVersionUID = 7730475001078826140L;

  public AttributeValueListImpl() {
    // do nothing
  }
 
  @Override
  public AttributeValueList addValue(Attribute attribute, String value) {
    createValue(attribute, value);
    return this;
  }

  @Override
  public AttributeValue createValue(Attribute attribute, String value) {
    checkArgument(value != null, "Value cannot be null.");
   
    AttributeValue rv = new AttributeValueImpl(attribute);
    rv.setValue(value);
    add(rv);
   
    return rv;
  }
}
TOP

Related Classes of com.ojn.gexf4j.core.impl.data.AttributeValueListImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.