Examples of capacity()


Examples of java.util.Vector.capacity()

                    int b = (int) l[j++] & 0xff;
                    Color color = new Color( r, g, b );
                    int index = colors.indexOf( color );
                    if ( index < 0 )
                    {
                        if ( colors.size() < colors.capacity() )
                        {
                            colors.addElement( color );
                            index = colors.size() - 1;
                        }
                        else
View Full Code Here

Examples of javax.swing.DefaultListModel.capacity()

  public void test(TestHarness harness)     
  {
    harness.checkPoint("capacity()");
    DefaultListModel m1 = new DefaultListModel();
    m1.ensureCapacity(99);
    harness.check(m1.capacity() >= 99);
  }

}
View Full Code Here

Examples of kodkod.engine.bool.Dimensions.capacity()

    if (c==Expression.UNIV) {
      final IntSet all =  Ints.rangeSet(Ints.range(0, univSize-1));
      return factory().matrix(Dimensions.square(univSize, 1), all, all);
    } else if (c==Expression.IDEN) {
      final Dimensions dim2 = Dimensions.square(univSize, 2);
      final IntSet iden = Ints.bestSet(dim2.capacity());
      for(int i = 0; i < univSize; i++) {
        iden.add(i*univSize + i);
      }     
      return factory().matrix(dim2, iden, iden);
    } else if (c==Expression.NONE) {
View Full Code Here

Examples of kodkod.instance.TupleSet.capacity()

    final TupleFactory f = bounds.universe().factory();
    final Instance instance = new Instance(bounds.universe());
//    System.out.println(varUsage);
    for(Relation r : bounds.relations()) {
      TupleSet lower = bounds.lowerBound(r);
      IntSet indeces = Ints.bestSet(lower.capacity());
      indeces.addAll(lower.indexView());
      IntSet vars = primaryVarUsage.get(r);
      if (vars!=null) {
        int lit = vars.min();
        for(IntIterator iter = bounds.upperBound(r).indexView().iterator(); iter.hasNext();) {
View Full Code Here

Examples of krati.store.ArrayStore.capacity()

        ArrayStore store = storeFactory.create(_config);
        assertEquals(StaticArrayStorePartition.class, store.getClass());
       
        StaticArrayStorePartition p = (StaticArrayStorePartition)store;
        assertEquals(p.capacity(), p.length());
        assertEquals(p.capacity(), store.capacity());
        assertEquals(p.capacity(), _config.getInitialCapacity());
        assertEquals(p.getIndexStart(), ((StorePartitionConfig)_config).getPartitionStart());
       
        store.close();
    }
View Full Code Here

Examples of krati.store.ArrayStorePartition.capacity()

                count,
                segmentFileSizeMB,
                segmentFactory);
       
        assertEquals(length, store.length());
        assertEquals(length, store.capacity());
        assertEquals(start, store.getIndexStart());
        store.clear();
        store.close();
       
        // Fail on smaller capacity
View Full Code Here

Examples of krati.store.DynamicDataSet.capacity()

        }
    }
   
    protected void doInitialCapacity(int initialCapacity) throws Exception {
        DynamicDataSet store = create(initialCapacity);
        int capacity = store.capacity();
        if(initialCapacity == DynamicConstants.SUB_ARRAY_SIZE) {
            assertEquals(initialCapacity, capacity);
        } else {
            assertTrue(capacity >= initialCapacity);
        }
View Full Code Here

Examples of krati.store.DynamicDataStore.capacity()

        // Check store initLevel
        assertEquals(maxLevel, store.getLevel());
       
        // Check store capacity
        int capacityExpected = DynamicConstants.SUB_ARRAY_SIZE << maxLevel;
        assertEquals(capacityExpected, store.capacity());
        assertEquals(capacityExpected, store.getDataArray().length());
       
        store.close();
    }
}
View Full Code Here

Examples of krati.store.StaticArrayStorePartition.capacity()

        ArrayStoreFactory storeFactory = new StaticArrayStoreFactory();
        ArrayStore store = storeFactory.create(_config);
        assertEquals(StaticArrayStorePartition.class, store.getClass());
       
        StaticArrayStorePartition p = (StaticArrayStorePartition)store;
        assertEquals(p.capacity(), p.length());
        assertEquals(p.capacity(), store.capacity());
        assertEquals(p.capacity(), _config.getInitialCapacity());
        assertEquals(p.getIndexStart(), ((StorePartitionConfig)_config).getPartitionStart());
       
        store.close();
View Full Code Here

Examples of krati.store.StaticDataStore.capacity()

        config.setIndexesCached(false); // Do not cache indexes in memory
       
        StaticDataStore store = StoreFactory.createStaticDataStore(config);
       
        // Check store capacity
        assertEquals(Integer.MAX_VALUE, store.capacity());
        assertEquals(Integer.MAX_VALUE, store.getDataArray().length());
       
        store.close();
    }
}
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.