Class DefaultChartModel

java.lang.Object
hec.gfx2d.swing.charts.data.DefaultChartModel
All Implemented Interfaces:
ChartModel

public final class DefaultChartModel extends Object implements ChartModel
Copyright (C) 2017 Hydrologic Engineering Center, United States Army Corps of Engineers, All Rights Reserved

HEC-Java NEXGEN

  • Constructor Details

  • Method Details

    • getId

      public RmaDataId getId()
      Specified by:
      getId in interface ChartModel
      Returns:
      the id for this chart or item item
    • getValue

      public double getValue(RmaDataId itemId, Date timeIndex)
      Specified by:
      getValue in interface ChartModel
      Parameters:
      itemId - the item to retrieve the value from
      timeIndex - the corresponding time for the value retrieved
      Returns:
      the operational value of a item
    • getMinValue

      public double getMinValue(RmaDataId itemId, Date timeIndex)
      Specified by:
      getMinValue in interface ChartModel
      Parameters:
      itemId - the item to retrieve the minimum value from
      timeIndex - the corresponding time for the value retrieved
      Returns:
      the minimum value of a item
    • getMaxValue

      public double getMaxValue(RmaDataId itemId, Date timeIndex)
      Specified by:
      getMaxValue in interface ChartModel
      Parameters:
      itemId - the item to retrieve the maximum value from
      timeIndex - the corresponding time for the value retrieved
      Returns:
      the maximum value of a item
    • getQuality

      public int getQuality(RmaDataId itemId, Date timeIndex)
      Specified by:
      getQuality in interface ChartModel
      Parameters:
      itemId - the item to retrieve the quality from
      timeIndex - the corresponding time for the value retrieved
      Returns:
      the quality of the item data
    • getUnits

      public String getUnits(RmaDataId itemId)
      Specified by:
      getUnits in interface ChartModel
      Parameters:
      itemId - the item to retrieve units for
      Returns:
      the units of the item identified
    • getEarliestDate

      public Date getEarliestDate()
      Specified by:
      getEarliestDate in interface ChartModel
      Returns:
      the java.util.Date corresponding to the earliest recorded value item
    • getLatestDate

      public Date getLatestDate()
      Specified by:
      getLatestDate in interface ChartModel
      Returns:
      the java.util.Date corresponding to the latest recorded value item
    • getClosestDate

      public Date getClosestDate(Date date)
      Specified by:
      getClosestDate in interface ChartModel
      Parameters:
      date - the java.util.Date in question, attempting to find a closest match existing in value mappings
      Returns:
      the date in values mapping that is the closest to the given date
    • setComparator

      public void setComparator(Comparator<RmaDataId> idComparator)
      Specified by:
      setComparator in interface ChartModel
      Parameters:
      idComparator - the comparator to use when sorting the item ids in the getItemIds() method
    • getItemIds

      public List<RmaDataId> getItemIds()
      Description copied from interface: ChartModel
      Returns a list of all item ids in the chart, sorted by the comparator provided in setComparator or by default comparison (alphabetically by id name) if no comparator has been provided
      Specified by:
      getItemIds in interface ChartModel
      Returns:
      the list of all item ids in the chart
      See Also: