Package org.jfree.data.time

Examples of org.jfree.data.time.Second


     * Test that a Second instance is equal to itself.
     *
     * SourceForge Bug ID: 558850.
     */
    public void testEqualsSelf() {
        Second second = new Second();
        assertTrue(second.equals(second));
    }
View Full Code Here


     */
    public void testEquals() {
        Day day1 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour1 = new Hour(15, day1);
        Minute minute1 = new Minute(15, hour1);
        Second second1 = new Second(34, minute1);
        Day day2 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour2 = new Hour(15, day2);
        Minute minute2 = new Minute(15, hour2);
        Second second2 = new Second(34, minute2);
        assertTrue(second1.equals(second2));
    }
View Full Code Here

     * Use this to check the Second constructor.
     */
    public void testDateConstructor1() {

        TimeZone zone = TimeZone.getTimeZone("GMT");
        Second s1 = new Second(new Date(1016729758999L), zone);
        Second s2 = new Second(new Date(1016729759000L), zone);

        assertEquals(58, s1.getSecond());
        assertEquals(1016729758999L, s1.getLastMillisecond(zone));

        assertEquals(59, s2.getSecond());
        assertEquals(1016729759000L, s2.getFirstMillisecond(zone));

    }
View Full Code Here

     * java.util.Date(1016751359000L). Use this to check the Second constructor.
     */
    public void testDateConstructor2() {

        TimeZone zone = TimeZone.getTimeZone("America/Chicago");
        Second s1 = new Second(new Date(1016751358999L), zone);
        Second s2 = new Second(new Date(1016751359000L), zone);

        assertEquals(58, s1.getSecond());
        assertEquals(1016751358999L, s1.getLastMillisecond(zone));

        assertEquals(59, s2.getSecond());
        assertEquals(1016751359000L, s2.getFirstMillisecond(zone));

    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        Second s1 = new Second();
        Second s2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(s1);
View Full Code Here

     * A basic check for the testPreviousStandardDate() method when the
     * tick unit is 1 second.
     */
    public void testPreviousStandardDateSecondA() {
        MyDateAxis axis = new MyDateAxis("Second");
        Second s0 = new Second(58, 31, 12, 1, 4, 2007);
        Second s1 = new Second(59, 31, 12, 1, 4, 2007);
       
        // five dates to check...
        Date d0 = new Date(s0.getFirstMillisecond());
        Date d1 = new Date(s0.getFirstMillisecond() + 50L);
        Date d2 = new Date(s0.getMiddleMillisecond());
        Date d3 = new Date(s0.getMiddleMillisecond() + 50L);
        Date d4 = new Date(s0.getLastMillisecond());
    
        Date end = new Date(s1.getLastMillisecond());
       
        DateTickUnit unit = new DateTickUnit(DateTickUnit.SECOND, 1);
        axis.setTickUnit(unit);

        // START: check d0 and d1
View Full Code Here

     * A basic check for the testPreviousStandardDate() method when the
     * tick unit is 5 seconds (just for the sake of having a multiple).
     */
    public void testPreviousStandardDateSecondB() {
        MyDateAxis axis = new MyDateAxis("Second");
        Second s0 = new Second(58, 31, 12, 1, 4, 2007);
        Second s1 = new Second(59, 31, 12, 1, 4, 2007);
       
        // five dates to check...
        Date d0 = new Date(s0.getFirstMillisecond());
        Date d1 = new Date(s0.getFirstMillisecond() + 50L);
        Date d2 = new Date(s0.getMiddleMillisecond());
        Date d3 = new Date(s0.getMiddleMillisecond() + 50L);
        Date d4 = new Date(s0.getLastMillisecond());
    
        Date end = new Date(s1.getLastMillisecond());
       
        DateTickUnit unit = new DateTickUnit(DateTickUnit.SECOND, 5);
        axis.setTickUnit(unit);

        // START: check d0 and d1
View Full Code Here

        while (_sampling)
    {
      try
      {
        Second now = new Second(new Date());
        Integer numberOfTransactions = (Integer)TransactionServiceMX.getTransactionServiceMX().getAgentInterface().getAgent().getAttribute(new ObjectName(objectName), "NumberOfTransactions");
              _dataSeries[NUMBER_OF_TRANSACTIONS_SERIES].add(now, numberOfTransactions.intValue());

        Integer numberOfNestedTransactions = (Integer)TransactionServiceMX.getTransactionServiceMX().getAgentInterface().getAgent().getAttribute(new ObjectName(objectName), "NumberOfNestedTransactions");
        _dataSeries[NUMBER_OF_NESTED_TRANSACTIONS_SERIES].add(now, numberOfNestedTransactions.intValue());
View Full Code Here

    label.setIcon(new ImageIcon(image));
  }

  public void addHistoryPower(double newPower) {
    if (nodeHistorySerie != null) {
      nodeHistorySerie.addOrUpdate(new Second(), newPower);
    }
  }
View Full Code Here

          int groupSize = getGroupSize(node);
          if (groupSize > 1) {
            series.clear();
            updateSeries(series, node, groupSize);
          } else {
            series.addOrUpdate(new Second(new Date(data.getNodeTime())), getSensorDataValue(data));
          }
          chartPanel.repaint();
          break;
        }
      }
View Full Code Here

TOP

Related Classes of org.jfree.data.time.Second

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.