Package kg.apc.charting.elements

Examples of kg.apc.charting.elements.GraphPanelChartSumElement


     * @param xVal
     * @param yVal
     */
    @Override
    public void add(long xVal, double yVal) {
        GraphPanelChartSumElement el;
        if (values.containsKey(xVal)) {
            el = values.get(xVal);
            el.add(yVal);
            yVal = el.getValue();
        } else {
            el = new GraphPanelChartSumElement(yVal);
            values.put(xVal, el);
            countX++;
        }
        super.add(xVal, yVal);
    }
View Full Code Here


        return iterator.hasNext();
    }

    public Entry<Long, AbstractGraphPanelChartElement> next() {
        Entry<Long, GraphPanelChartSumElement> entry = iterator.next();
        GraphPanelChartSumElement ret = entry.getValue();

        //log.info("Rolling: " + entry.getKey() + " " + rollingSum);
        ExactEntry retValue = null;
        if (isRollingSum) {
            rollingSum += ret.getValue();
            retValue = new ExactEntry(entry.getKey(), new GraphPanelChartSumElement(rollingSum));
        } else {
            retValue = new ExactEntry(entry.getKey(), new GraphPanelChartSumElement(ret.getValue()));
        }
        return retValue;
    }
View Full Code Here

                    sum += entry.getValue().getValue();
                    if (entry.getKey() == value) {
                        valueReached = true;
                    }
                }
                return new GraphPanelChartSumElement(sum);
            }
        }
    }
View Full Code Here

    public void testGetElement()
    {
        System.out.println("getElement");
        long value = 100L;
        GraphRowSumValues instance = new GraphRowSumValues();
        AbstractGraphPanelChartElement expResult = new GraphPanelChartSumElement(10);
        instance.add(value, 10);
        AbstractGraphPanelChartElement result = instance.getElement(value);
        assertTrue(instance.getElement(value).getValue() == expResult.getValue());
    }
View Full Code Here

   @Test
   public void testAdd()
   {
      System.out.println("add");
      double yVal = 0.0;
      GraphPanelChartSumElement instance = new GraphPanelChartSumElement();
      instance.add(yVal);
   }
View Full Code Here

    */
   @Test
   public void testGetValue()
   {
      System.out.println("getValue");
      GraphPanelChartSumElement instance = new GraphPanelChartSumElement();
      double expResult = 0.0;
      double result = instance.getValue();
      assertEquals(expResult, result, 0.0);
   }
View Full Code Here

    */
   @Test
   public void testGetCount()
   {
      System.out.println("getCount");
      GraphPanelChartSumElement instance = new GraphPanelChartSumElement();
      int expResult = 0;
      int result = instance.getCount();
      assertEquals(expResult, result);
   }
View Full Code Here

TOP

Related Classes of kg.apc.charting.elements.GraphPanelChartSumElement

Copyright © 2018 www.massapicom. 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.