List of usage examples for org.jfree.data KeyedObject setObject
public void setObject(Object object)
From source file:org.jfree.data.KeyedObjects.java
/** * Replaces an existing object, or adds a new object to the collection. * This is the same as the {@link #addObject(Comparable, Object)} * method./*from w w w . ja va 2 s. co m*/ * * @param key the key (<code>null</code> not permitted). * @param object the object. * * @see #getObject(Comparable) */ public void setObject(Comparable key, Object object) { int keyIndex = getIndex(key); if (keyIndex >= 0) { KeyedObject ko = (KeyedObject) this.data.get(keyIndex); ko.setObject(object); } else { KeyedObject ko = new KeyedObject(key, object); this.data.add(ko); } }