Package org.encog.util.time

Examples of org.encog.util.time.TimeSpan


public class TestTimeSpan extends TestCase {
  public void testDiffMonths()
  {
    Date date1 = DateUtil.createDate(1, 1, 2008);
    Date date2 = DateUtil.createDate(6, 1, 2008);
    TestCase.assertEquals(5, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
    date1 = DateUtil.createDate(12, 1, 2008);
    date2 = DateUtil.createDate(1, 1, 2009);
    TestCase.assertEquals(1, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
    date1 = DateUtil.createDate(12, 31, 2008);
    date2 = DateUtil.createDate(1, 1, 2009);
    TestCase.assertEquals(1, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
  }
View Full Code Here


public class TestTimeSpan extends TestCase {
  public void testDiffMonths()
  {
    Date date1 = DateUtil.createDate(1, 1, 2008);
    Date date2 = DateUtil.createDate(6, 1, 2008);
    TestCase.assertEquals(5, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
    date1 = DateUtil.createDate(12, 1, 2008);
    date2 = DateUtil.createDate(1, 1, 2009);
    TestCase.assertEquals(1, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
    date1 = DateUtil.createDate(12, 31, 2008);
    date2 = DateUtil.createDate(1, 1, 2009);
    TestCase.assertEquals(1, new TimeSpan(date1,date2).getSpan(TimeUnit.MONTHS));
  }
View Full Code Here

   */
  public int getSequenceFromDate(final Date when) {
    int sequence;

    if (this.startingPoint != null) {
      final TimeSpan span = new TimeSpan(this.startingPoint, when);
      sequence = (int) span.getSpan(this.sequenceGrandularity);
    } else {
      this.startingPoint = when;
      sequence = 0;
    }

View Full Code Here

TOP

Related Classes of org.encog.util.time.TimeSpan

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.