Save This Page
Home » jcommon-1.0.13 » org.jfree » data » xy » [javadoc | source]
org.jfree.data.xy
public class: XYSeries [javadoc | source]
java.lang.Object
   org.jfree.data.general.Series
      org.jfree.data.xy.XYSeries

All Implemented Interfaces:
    Cloneable, Serializable

Represents a sequence of zero or more data items in the form (x, y). By default, items in the series will be sorted into ascending order by x-value, and duplicate x-values are permitted. Both the sorting and duplicate defaults can be changed in the constructor. Y-values can be null to represent missing values.
Field Summary
static final  long serialVersionUID    For serialization. 
protected  List data    Storage for the data items in the series. 
Constructor:
 public XYSeries(Comparable key) 
    Creates a new empty series. By default, items added to the series will be sorted into ascending order by x-value, and duplicate x-values will be allowed (these defaults can be modified with another constructor.
    Parameters:
    key - the series key (null not permitted).
 public XYSeries(Comparable key,
    boolean autoSort) 
    Constructs a new empty series, with the auto-sort flag set as requested, and duplicate values allowed.
    Parameters:
    key - the series key (null not permitted).
    autoSort - a flag that controls whether or not the items in the series are sorted.
 public XYSeries(Comparable key,
    boolean autoSort,
    boolean allowDuplicateXValues) 
    Constructs a new xy-series that contains no data. You can specify whether or not duplicate x-values are allowed for the series.
    Parameters:
    key - the series key (null not permitted).
    autoSort - a flag that controls whether or not the items in the series are sorted.
    allowDuplicateXValues - a flag that controls whether duplicate x-values are allowed.
Method from org.jfree.data.xy.XYSeries Summary:
add,   add,   add,   add,   add,   add,   add,   add,   addOrUpdate,   addOrUpdate,   clear,   clone,   createCopy,   delete,   equals,   getAllowDuplicateXValues,   getAutoSort,   getDataItem,   getItemCount,   getItems,   getMaximumItemCount,   getX,   getY,   hashCode,   indexOf,   remove,   remove,   setMaximumItemCount,   toArray,   update,   update,   updateByIndex
Methods from org.jfree.data.general.Series:
addChangeListener,   addPropertyChangeListener,   clone,   equals,   firePropertyChange,   fireSeriesChanged,   getDescription,   getItemCount,   getKey,   getNotify,   hashCode,   isEmpty,   notifyListeners,   removeChangeListener,   removePropertyChangeListener,   setDescription,   setKey,   setNotify
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.data.xy.XYSeries Detail:
 public  void add(XYDataItem item) 
    Adds a data item to the series and sends a SeriesChangeEvent to all registered listeners.
 public  void add(double x,
    double y) 
    Adds a data item to the series and sends a SeriesChangeEvent to all registered listeners.
 public  void add(double x,
    Number y) 
    Adds a data item to the series and sends a SeriesChangeEvent to all registered listeners. The unusual pairing of parameter types is to make it easier to add null y-values.
 public  void add(Number x,
    Number y) 
    Adds new data to the series and sends a SeriesChangeEvent to all registered listeners.

    Throws an exception if the x-value is a duplicate AND the allowDuplicateXValues flag is false.

 public  void add(XYDataItem item,
    boolean notify) 
    Adds a data item to the series and, if requested, sends a SeriesChangeEvent to all registered listeners.
 public  void add(double x,
    double y,
    boolean notify) 
    Adds a data item to the series and, if requested, sends a SeriesChangeEvent to all registered listeners.
 public  void add(double x,
    Number y,
    boolean notify) 
    Adds a data item to the series and, if requested, sends a SeriesChangeEvent to all registered listeners. The unusual pairing of parameter types is to make it easier to add null y-values.
 public  void add(Number x,
    Number y,
    boolean notify) 
    Adds new data to the series and, if requested, sends a SeriesChangeEvent to all registered listeners.

    Throws an exception if the x-value is a duplicate AND the allowDuplicateXValues flag is false.

 public XYDataItem addOrUpdate(double x,
    double y) 
    Adds or updates an item in the series and sends a SeriesChangeEvent to all registered listeners.
 public XYDataItem addOrUpdate(Number x,
    Number y) 
 public  void clear() 
    Removes all data items from the series.
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the series.
 public XYSeries createCopy(int start,
    int end) throws CloneNotSupportedException 
    Creates a new series by copying a subset of the data in this time series.
 public  void delete(int start,
    int end) 
    Deletes a range of items from the series and sends a SeriesChangeEvent to all registered listeners.
 public boolean equals(Object obj) 
    Tests this series for equality with an arbitrary object.
 public boolean getAllowDuplicateXValues() 
    Returns a flag that controls whether duplicate x-values are allowed. This flag can only be set in the constructor.
 public boolean getAutoSort() 
    Returns the flag that controls whether the items in the series are automatically sorted. There is no setter for this flag, it must be defined in the series constructor.
 public XYDataItem getDataItem(int index) 
    Return the data item with the specified index.
 public int getItemCount() 
    Returns the number of items in the series.
 public List getItems() 
    Returns the list of data items for the series (the list contains XYDataItem objects and is unmodifiable).
 public int getMaximumItemCount() 
    Returns the maximum number of items that will be retained in the series. The default value is Integer.MAX_VALUE.
 public Number getX(int index) 
    Returns the x-value at the specified index.
 public Number getY(int index) 
    Returns the y-value at the specified index.
 public int hashCode() 
    Returns a hash code.
 public int indexOf(Number x) 
    Returns the index of the item with the specified x-value, or a negative index if the series does not contain an item with that x-value. Be aware that for an unsorted series, the index is found by iterating through all items in the series.
 public XYDataItem remove(int index) 
    Removes the item at the specified index and sends a SeriesChangeEvent to all registered listeners.
 public XYDataItem remove(Number x) 
    Removes the item with the specified x-value and sends a SeriesChangeEvent to all registered listeners.
 public  void setMaximumItemCount(int maximum) 
    Sets the maximum number of items that will be retained in the series. If you add a new item to the series such that the number of items will exceed the maximum item count, then the first element in the series is automatically removed, ensuring that the maximum item count is not exceeded.

    Typically this value is set before the series is populated with data, but if it is applied later, it may cause some items to be removed from the series (in which case a SeriesChangeEvent will be sent to all registered listeners.

 public double[][] toArray() 
    Returns a new array containing the x and y values from this series.
 public  void update(int index,
    Number y) 
Deprecated! Renamed - #updateByIndex(int, Number) to avoid confusion with the #update(Number, Number) method.

    Updates the value of an item in the series and sends a SeriesChangeEvent to all registered listeners.
 public  void update(Number x,
    Number y) 
    Updates an item in the series.
 public  void updateByIndex(int index,
    Number y) 
    Updates the value of an item in the series and sends a SeriesChangeEvent to all registered listeners.