Class BarData

java.lang.Object
hec.gfx2d.swing.charts.bar.BarData

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

HEC-Java NEXGEN

  • Constructor Details

    • BarData

      public BarData(int streamOrder, String location)
      builds a location data default with a location
      Parameters:
      location - the location for this data
  • Method Details

    • getLocation

      public String getLocation()
      fetch this data's location
      Returns:
      this data's location
    • getStreamOrder

      public int getStreamOrder()
      fetch this data's order in the relevant stream lower values are higher upstream
      Returns:
      the stream order priority value (lower value = upstream)
    • setValue

      public void setValue(Double value)
      establishes this bar's value, with no quality information
      Parameters:
      value - the value to insert
    • setValue

      public void setValue(Double value, Integer quality)
      establishes the bar's value, with quality information
      Parameters:
      value - the value to insert
      quality - the quality rating of that value
    • updateQuality

      public void updateQuality(Integer quality)
      provide a new quality rating for a known value
      Parameters:
      quality - the new data quality
    • getValue

      public Double getValue()
      fetch data value
      Returns:
      the value stored at this bar
    • getQuality

      public Integer getQuality()
      fetch data quality
      Returns:
      the quality stored at this bar
    • copy

      public void copy(BarData data)
      overwrites the data at the current location with the data from another
      Parameters:
      data - the location data to write into this location
    • streamComparator

      public static Comparator<BarData> streamComparator(boolean upstream)
      constructs a comparator for sorting location data by stream order
      Parameters:
      upstream - whether upstream data should come sooner in the list than downstream data(true) or not (false)
      Returns:
      the comparator
    • valueComparator

      public static Comparator<BarData> valueComparator(boolean reverse)
      constructs a comparator for sorting location data by value
      Parameters:
      reverse - sorting direction (low to high or high to low)
      Returns:
      the comparator
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object