Package ch.agent.t2.time

Examples of ch.agent.t2.time.DayRankingSubPeriodPattern


  }

  public void test_21() {
    try {
      UpdatableSeries<Double> s = db.getUpdatableSeries(SERIES, true).typeCheck(Double.class);
      TimeIndex t = s.getTimeDomain().time("2011-03-08");
      s.scanValue(t, "42.01");
      s.applyUpdates();
      db.commit();
      Chronicle chronicle = db.getChronicle(CHRONICLE, true);
      Series<Double>[] ss = chronicle.getSeries(new String[]{"test", "test4"}, Double.class, true);
View Full Code Here


  }
 
  public void test_22() {
    try {
      UpdatableSeries<Double> s = db.getUpdatableSeries(SERIES, true).typeCheck(Double.class);
      TimeIndex t = s.getTimeDomain().time("2011-03-08");
      s.scanValue(t, "42");
      s.applyUpdates();
      db.commit();
      Chronicle chronicle = db.getChronicle(CHRONICLE, true);
      chronicle.getSeries(new String[]{"test", "test2", "test4"}, Double.class, true);
View Full Code Here

  }
 
  public void test_23() {
    try {
      UpdatableSeries<Double> s = db.getUpdatableSeries(SERIES, true).typeCheck(Double.class);
      TimeIndex t = s.getTimeDomain().time("2011-03-08");
      s.scanValue(t, "42");
      s.applyUpdates();
      db.commit();
      Chronicle chronicle = db.getChronicle(CHRONICLE, false);
      Series<Double>[] ss = chronicle.getSeries(new String[]{"test", "test2", "test4"}, Double.class, false);
View Full Code Here

  }

  public void test_24() {
    try {
      UpdatableSeries<Double> s = db.getSeries(SERIES, true).edit().typeCheck(Double.class);
      TimeIndex t = s.getTimeDomain().time("2011-03-08");
      assertEquals(42.0, s.getValue(t));
      t = s.getTimeDomain().time("2011-03-14");
      s.scanValue(t, "51.3");
      s.scanValue(t.add(2), "55");
      s.applyUpdates();
      if (DUMP)
        System.out.println(t.getTimeDomain() + " " + s.getRange());
      assertEquals(9, s.getRange().getSize());
      if (DUMP)
        System.out.println(s.getValues(null));
      boolean done = s.setRange(new Range(t.getTimeDomain(), "2011-03-12", "2011-03-17", Adjustment.NONE));
      if (DUMP)
        System.out.println(s.getValues(null));
      assertFalse(done);
      done = s.setRange(new Range(t.getTimeDomain(), "2011-03-12", "2011-03-16", Adjustment.NONE));
      s.applyUpdates();
      if (DUMP)
        System.out.println(s.getValues(null));
      assertEquals(3, s.getRange().getSize());
      done = s.setRange(null);
View Full Code Here

  }
 
  public void testGetValueOutOfRange() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-07-15");
      assertEquals(Double.NaN, s.getValue(t));
    } catch (Exception e) {
      fail(e.toString());
    }
  }
View Full Code Here

  }
 
  public void testGetMissingValue_1() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-06-15");
      assertEquals(Double.NaN, s.getValue(t));
    } catch (Exception e) {
      fail(e.toString());
    }
  }
View Full Code Here

  }
 
  public void testGetMissingValue_2() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-06-15");
      assertEquals(Double.NaN, s.getValue(t));
    } catch (Exception e) {
      fail(e.toString());
    }
  }
View Full Code Here

  }
 
  public void testGetValue() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-07-01");
      assertEquals(201107.01, s.getValue(t));
    } catch (Exception e) {
      fail(e.toString());
    }
  }
View Full Code Here

  }
 
  public void testGetLastValue_2() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-04-30");
      Observation<Double> obs = s.getLastObservation(t);
      assertNull(obs);
    } catch (Exception e) {
      fail(e.toString());
    }
View Full Code Here

  }
 
  public void testGetFirstValue_1() {
    try {
      Series<Double> s = makeSeries(makeTimeSeries());
      TimeIndex t = s.getTimeDomain().time("2011-06-01");
      assertEquals(201106.01, s.getFirstObservation(t).getValue());
    } catch (Exception e) {
      fail(e.toString());
    }
  }
View Full Code Here

TOP

Related Classes of ch.agent.t2.time.DayRankingSubPeriodPattern

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.