Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.SeriesDefinition


 
  private Collection<SeriesDefinition> ref2(Collection<SeriesDefinition> sss) throws T2DBException {
    List<SeriesDefinition> ssCopies = new ArrayList<SeriesDefinition>();
    for (SeriesDefinition ss : sss) {
      Collection<AttributeDefinition<?>> defCopies = ref1(ss.getNumber(), ss.getAttributeDefinitions());
      SeriesDefinition ssCopy = new SeriesDefinitionImpl(ss.getNumber(), ss.getDescription(), defCopies);
      ssCopies.add(ssCopy);
    }
    return ssCopies;
  }
View Full Code Here


  @Override
  public <T> UpdatableSeries<T> createSeries(String seriesName) throws T2DBException {
    Series<T> s = getSeries(seriesName);
    if (s != null)
      throw T2DBMsg.exception(D.D50108, s.getName(true));
    SeriesDefinition schema = getSchema(true).getSeriesDefinition(seriesName, true);
    UpdatableSeries<T> u = new UpdatableSeriesImpl<T>(this, seriesName, schema.getNumber(),
        new SurrogateImpl(getDatabase(), DBObjectType.SERIES, null));
    seriesUpdate.put(seriesName, u);
    return u;
  }
View Full Code Here

    return seriesDefinitions.getComponents();
  }

  @Override
  public SeriesDefinition getSeriesDefinition(String name, boolean mustExist) throws T2DBException {
    SeriesDefinition schema = seriesDefinitions.getComponent(name);
    if (schema == null && mustExist)
      throw T2DBMsg.exception(D.D30121, name, getName());
    return schema;
  }
View Full Code Here

    return schema;
  }
 
  @Override
  public SeriesDefinition getSeriesDefinition(int number, boolean mustExist) throws T2DBException {
    SeriesDefinition schema = seriesDefinitions.getComponent(number);
    if (schema == null && mustExist)
      throw T2DBMsg.exception(D.D30125, number, getName());
    return schema;
  }
View Full Code Here

  }
  @Override
  public void edit(SchemaComponent component) throws T2DBException {
    if (!(component instanceof SeriesDefinition))
      throw new IllegalArgumentException(component == null ? null : component.getClass().getName());
    SeriesDefinition arg = (SeriesDefinition) component;
    if (arg.isErasing())
      doSetErasing(true);
    else {
      if (arg.getDescription() != null)
        setDescription(arg.getDescription());
      attributes.consolidate();
    }
  }
View Full Code Here

  @Override
  public <T> UpdatableSeries<T> createSeries(String seriesName) throws T2DBException {
    Series<T> s = getSeries(seriesName);
    if (s != null)
      throw T2DBMsg.exception(D.D50108, s.getName(true));
    SeriesDefinition schema = getSchema(true).getSeriesDefinition(seriesName, true);
    UpdatableSeries<T> u = new UpdatableSeriesImpl<T>(this, seriesName, schema.getNumber(),
        new SurrogateImpl(getDatabase(), DBObjectType.SERIES, null));
    seriesUpdate.put(seriesName, u);
    return u;
  }
View Full Code Here

  }
 
  @Override
  public Collection<Attribute<?>> getAttributes() throws T2DBException {
    Collection<Attribute<?>> result = new ArrayList<Attribute<?>>();
    SeriesDefinition schema = getDefinition();
    if (schema != null) {
      Collection<AttributeDefinition<?>> defs = schema.getAttributeDefinitions();
      for (AttributeDefinition<?> def : defs) {
        if (!def.isComplete())
          throw T2DBMsg.exception(D.D50115, getName(true), def.getNumber());
        result.add(getAttribute(def.getName(), true));
      }
View Full Code Here

    int[] seriesNr = new int[names.length];
    Schema es = getSchema(true);
    if (es == null)
      throw T2DBMsg.exception(D.D40114, getName(true));
    for (int i = 0; i < names.length; i++) {
      SeriesDefinition ss = es.getSeriesDefinition(names[i], mustBeDefined);
      seriesNr[i] = ss == null ? 0 : ss.getNumber();
    }
    Series<T>[] series = getDatabase().getSeries(this, names, seriesNr);
    if (type != null) {
      for (Series<T> s : series) {
        if (s !=null)
View Full Code Here

 
  private Collection<SeriesDefinition> ref2(Collection<SeriesDefinition> sss) throws T2DBException {
    List<SeriesDefinition> ssCopies = new ArrayList<SeriesDefinition>();
    for (SeriesDefinition ss : sss) {
      Collection<AttributeDefinition<?>> defCopies = ref1(ss.getNumber(), ss.getAttributeDefinitions());
      SeriesDefinition ssCopy = new SeriesDefinitionImpl(ss.getNumber(), ss.getDescription(), defCopies);
      ssCopies.add(ssCopy);
    }
    return ssCopies;
  }
View Full Code Here

  public SeriesDefinition addSeries(int seriesNr) throws T2DBException {
    return addSeries(seriesNr, false);
  }
 
  private SeriesDefinition addSeries(int seriesNr, boolean merging) throws T2DBException {
    SeriesDefinition ss = new SeriesDefinitionImpl(seriesNr, null, null);
    boolean added = false;
    try {
      added = getSeriesDefinitionsObject().addComponent(ss);
    } catch (T2DBException e) {
      throw T2DBMsg.exception(e, D.D30137, seriesNr, this);
View Full Code Here

TOP

Related Classes of ch.agent.crnickl.api.SeriesDefinition

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.