Package org.dbwiki.lib

Examples of org.dbwiki.lib.Counter


          if (!labelCounter.containsKey(label)) {
            labelCounter.put(label,  labelIndex.get(label));
          }
          labelIndex.get(label).inc();
        } else {
          labelIndex.put(label,  new Counter());
        }
      }
      // Reset the counter for labels that occur more than once
      Iterator<Counter> elements = labelCounter.values().iterator();
      while (elements.hasNext()) {
        elements.next().reset(1);
      }
      try {
        _resultSchema = new GroupSchemaNode(-1, "result", null, new TimeSequence(1));
        for (SubTreeSelectStatement stmt : _statements) {
          SchemaNode schema = stmt.targetPath().lastElement().entity();
          String label = null;
          if (stmt.label() != null) {
            label = stmt.label();
          } else {
            label = schema.label();
          }
          if (labelCounter.containsKey(label)) {
            Counter counter = labelCounter.get(label);
            label = label + Integer.toString(counter.value());
            stmt.setLabel(label);
            counter.inc();
          }
          SchemaNode renamedSchema = null;
          if (schema.isAttribute()) {
            renamedSchema = new AttributeSchemaNode(-1, label, _resultSchema, schema.getTimestamp());
            //renamedSchema = new AttributeSchemaNode(schema.id(), label, _resultSchema, schema.getTimestamp());
View Full Code Here

TOP

Related Classes of org.dbwiki.lib.Counter

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.