Package java.util

Examples of java.util.BitSet.nextSetBit()


   *      a bag to be filled with components
   * @return the {@code fillBag}, filled with the entities components
   */
  public Bag<Component> getComponentsFor(Entity e, Bag<Component> fillBag) {
    BitSet componentBits = e.getComponentBits();
    for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i+1)) {
      if (typeFactory.isPackedComponent(i)) {
        fillBag.add(packedComponents.get(i));
      } else {
        fillBag.add(componentsByType.get(i).get(e.getId()));
      }
View Full Code Here


   *      a bag to be filled with components
   * @return the {@code fillBag}, filled with the entities components
   */
  public Bag<Component> getComponentsFor(Entity e, Bag<Component> fillBag) {
    BitSet componentBits = e.getComponentBits();
    for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i+1)) {
      if (typeFactory.isPackedComponent(i)) {
        fillBag.add(packedComponents.get(i));
      } else {
        fillBag.add(componentsByType.get(i).get(e.getId()));
      }
View Full Code Here

                } catch (VisitorException e) {
                    LOG.warn("Feature visitor failed", e);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (int i=feature.nextSetBit(0); i>=0; i=feature.nextSetBit(i+1)) {
                if (sb.length() > 0) sb.append(",");            
                sb.append(PIG_FEATURE.values()[i].name());
            }
            retStr = sb.toString();
            featureMap.put(mro, retStr);
View Full Code Here

                } catch (VisitorException e) {
                    LOG.warn("Feature visitor failed", e);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (int i=feature.nextSetBit(0); i>=0; i=feature.nextSetBit(i+1)) {
                if (sb.length() > 0) sb.append(",");            
                sb.append(PIG_FEATURE.values()[i].name());
            }
            retStr = sb.toString();
            featureMap.put(mro, retStr);
View Full Code Here

    int size = bs.cardinality();
    actives.setSize(size);
    actives.ensureCapacity(size);
    EntityManager em = world.getEntityManager();
    Object[] activesArray = actives.getData();
    for (int i = bs.nextSetBit(0), index = 0; i >= 0; i = bs.nextSetBit(i + 1)) {
      activesArray[index++] = em.getEntity(i);
    }
   
    activesIsDirty = false;
    world.rebuiltIndices++;
View Full Code Here

    int size = bs.cardinality();
    actives.setSize(size);
    actives.ensureCapacity(size);
    EntityManager em = world.getEntityManager();
    Object[] activesArray = actives.getData();
    for (int i = bs.nextSetBit(0), index = 0; i >= 0; i = bs.nextSetBit(i + 1)) {
      activesArray[index++] = em.getEntity(i);
    }
   
    activesIsDirty = false;
    world.rebuiltIndices++;
View Full Code Here

          }

          conflictingAlts = evalSemanticContext(D.predicates, outerContext, true);
          if ( conflictingAlts.cardinality()==1 ) {
            if ( debug ) System.out.println("Full LL avoided");
            return conflictingAlts.nextSetBit(0);
          }

          if (conflictIndex != startIndex) {
            // restore the index so reporting the fallback to full
            // context occurs with the index at the correct spot
View Full Code Here

        switch (alts.cardinality()) {
        case 0:
          throw noViableAlt(input, outerContext, D.configs, startIndex);

        case 1:
          return alts.nextSetBit(0);

        default:
          // report ambiguity after predicate evaluation to make sure the correct
          // set of ambig alts is reported.
          reportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs);
View Full Code Here

        default:
          // report ambiguity after predicate evaluation to make sure the correct
          // set of ambig alts is reported.
          reportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs);
          return alts.nextSetBit(0);
        }
      }

      previousD = D;
View Full Code Here

    }
    else {
      // There are preds in configs but they might go away
      // when OR'd together like {p}? || NONE == NONE. If neither
      // alt has preds, resolve to min alt
      dfaState.prediction = altsToCollectPredsFrom.nextSetBit(0);
    }
  }

  // comes back with reach.uniqueAlt set to a valid alt
  protected int execATNWithFullContext(DFA dfa,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.