Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 731) sorted by relevance

12345678910>>...30

/libcore/ojluni/src/main/java/java/nio/channels/
DFileLock.java123 private final long size; field in FileLock
148 long position, long size, boolean shared) in FileLock() argument
152 if (size < 0) in FileLock()
154 if (position + size < 0) in FileLock()
158 this.size = size; in FileLock()
186 long position, long size, boolean shared) in FileLock() argument
190 if (size < 0) in FileLock()
192 if (position + size < 0) in FileLock()
196 this.size = size; in FileLock()
247 public final long size() { in size() method in FileLock
[all …]
/libcore/ojluni/src/main/java/java/util/
DArrayList.java155 private int size; field in ArrayList
192 if ((size = elementData.length) != 0) { in ArrayList()
195 elementData = Arrays.copyOf(elementData, size, Object[].class); in ArrayList()
209 if (size < elementData.length) { in trimToSize()
210 elementData = (size == 0) in trimToSize()
212 : Arrays.copyOf(elementData, size); in trimToSize()
291 public int size() { in size() method in ArrayList
292 return size; in size()
301 return size == 0; in isEmpty()
326 for (int i = 0; i < size; i++) in indexOf()
[all …]
DPriorityQueue.java102 int size; field in PriorityQueue
248 this.size = c.size(); in initFromPriorityQueue()
265 this.size = a.length; in initElementsFromCollection()
337 int i = size; in offer()
340 size = i + 1; in offer()
350 return (size == 0) ? null : (E) queue[0]; in peek()
355 for (int i = 0; i < size; i++) in indexOf()
391 for (int i = 0; i < size; i++) { in removeEq()
426 return Arrays.copyOf(queue, size); in toArray()
467 final int size = this.size; in toArray() local
[all …]
DJumboEnumSet.java47 private int size = 0; field in JumboEnumSet
67 size = to.ordinal() - from.ordinal() + 1; in addRange()
74 size = universe.length; in addAll()
81 size = universe.length - size; in complement()
150 size--; in remove()
161 public int size() { in size() method in JumboEnumSet
162 return size; in size()
171 return size == 0; in isEmpty()
211 size++; in add()
234 size--; in remove()
[all …]
DEnumMap.java104 private transient int size = 0; field in EnumMap
153 size = m.size; in EnumMap()
174 size = em.size; in EnumMap()
192 public int size() { in size() method in EnumMap
193 return size; in size()
273 size++; in put()
293 size--; in remove()
303 size--; in removeMapping()
346 size++; in putAll()
360 size = 0; in clear()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadLocalRandom8Test.java78 long size = 0; in testIntsCount() local
81 r.ints(size).parallel().forEach(x -> counter.increment()); in testIntsCount()
82 assertEquals(size, counter.sum()); in testIntsCount()
83 size += 524959; in testIntsCount()
93 long size = 0; in testLongsCount() local
96 r.longs(size).parallel().forEach(x -> counter.increment()); in testLongsCount()
97 assertEquals(size, counter.sum()); in testLongsCount()
98 size += 524959; in testLongsCount()
108 long size = 0; in testDoublesCount() local
111 r.doubles(size).parallel().forEach(x -> counter.increment()); in testDoublesCount()
[all …]
/libcore/luni/src/main/java/libcore/util/
DNativeAllocationRegistry.java58 private final long size; field in NativeAllocationRegistry
80 ClassLoader classLoader, long freeFunction, long size) { in createNonmalloced() argument
81 return new NativeAllocationRegistry(classLoader, freeFunction, size, false); in createNonmalloced()
107 ClassLoader classLoader, long freeFunction, long size) { in createMalloced() argument
108 return new NativeAllocationRegistry(classLoader, freeFunction, size, true); in createMalloced()
156 private NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size, in NativeAllocationRegistry() argument
158 if (size < 0) { in NativeAllocationRegistry()
159 throw new IllegalArgumentException("Invalid native allocation size: " + size); in NativeAllocationRegistry()
163 this.size = mallocAllocation ? (size | IS_MALLOCED) : (size & ~IS_MALLOCED); in NativeAllocationRegistry()
195 public NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size) { in NativeAllocationRegistry() argument
[all …]
/libcore/luni/src/main/java/libcore/io/
DMemoryMappedFile.java37 private final int size; field in MemoryMappedFile
40 public MemoryMappedFile(long address, long size) { in MemoryMappedFile() argument
43 if (size < 0 || size > Integer.MAX_VALUE) { in MemoryMappedFile()
44 throw new IllegalArgumentException("Unsupported file size=" + size); in MemoryMappedFile()
46 this.size = (int) size; in MemoryMappedFile()
56 long size = Libcore.os.fstat(fd).st_size; in mmapRO() local
57 long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0); in mmapRO()
58 return new MemoryMappedFile(address, size); in mmapRO()
75 Libcore.os.munmap(address, size); in close()
89 this, address, size, ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN); in bigEndianIterator()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DRandomTest.java59 final int size = 32; in test_ints$L() local
62 int[] rands = new int[size]; in test_ints$L()
63 for(int i = 0; i < size; ++i) { in test_ints$L()
67 int[] streamRands = new Random(0).ints(size).toArray(); in test_ints$L()
69 assertEquals(size, new Random(0).ints(size).count()); in test_ints$L()
97 final int size = 32; in test_ints$LII() local
101 int[] rands = new int[size]; in test_ints$LII()
102 for(int i = 0; i < size; ++i) { in test_ints$LII()
106 int[] streamRands = new Random(0).ints(size, origin, bound).toArray(); in test_ints$LII()
108 assertEquals(size, new Random(0).ints(size, origin, bound).count()); in test_ints$LII()
[all …]
DArraysTest.java579 for (int size : TEST_ARRAY_SIZES) { in streamInt()
580 int[] sourceArray = intTestArray(size); in streamInt()
586 assertEquals(size * (size - 1), sum); in streamInt()
599 assertEquals(size, destList.size()); in streamInt()
600 for (int i = 0; i < size; i++) { in streamInt()
608 final int size = 10; in streamIntStartEnd() local
609 int[] sourceArray = intTestArray(size); in streamIntStartEnd()
610 for (int start = 0; start < size - 1; start++) { in streamIntStartEnd()
611 for (int end = start; end < size; end++) { in streamIntStartEnd()
666 for (int size : TEST_ARRAY_SIZES) { in streamLong()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DStreamBuilderTest.java92 public void testAfterBuilding(int size) { in testAfterBuilding() argument
94 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding()
103 public void testStreamBuilder(int size) { in testStreamBuilder() argument
104 testStreamBuilder(size, (s) -> { in testStreamBuilder()
110 testStreamBuilder(size, (s) -> { in testStreamBuilder()
120 private void testStreamBuilder(int size, Function<Integer, Stream<Integer>> supplier) { in testStreamBuilder() argument
121 TestData.OfRef<Integer> data = TestData.Factory.ofSupplier(String.format("[0, %d)", size), in testStreamBuilder()
122 () -> supplier.apply(size)); in testStreamBuilder()
126 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
131 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
[all …]
/libcore/ojluni/src/main/java/java/text/
DCharacterIteratorFieldDelegate.java49 private int size; field in CharacterIteratorFieldDelegate
59 if (start < size) { in formatted()
61 int index = size; in formatted()
62 int asIndex = attributedStrings.size() - 1; in formatted()
76 if (size < start) { in formatted()
79 buffer.substring(size, start))); in formatted()
80 size = start; in formatted()
82 if (size < end) { in formatted()
84 int aStart = Math.max(start, size); in formatted()
90 size = end; in formatted()
[all …]
/libcore/ojluni/src/main/java/sun/nio/fs/
DNativeBuffers.java46 static NativeBuffer allocNativeBuffer(int size) { in allocNativeBuffer() argument
48 if (size < 2048) size = 2048; in allocNativeBuffer()
49 return new NativeBuffer(size); in allocNativeBuffer()
56 static NativeBuffer getNativeBufferFromCache(int size) { in getNativeBufferFromCache() argument
62 if (buffer != null && buffer.size() >= size) { in getNativeBufferFromCache()
76 static NativeBuffer getNativeBuffer(int size) { in getNativeBuffer() argument
77 NativeBuffer buffer = getNativeBufferFromCache(size); in getNativeBuffer()
82 return allocNativeBuffer(size); in getNativeBuffer()
109 if (existing.size() < buffer.size()) { in releaseNativeBuffer()
128 assert buffer.size() >= (len + 1); in copyCStringToNativeBuffer()
DNativeBuffer.java39 private final int size; field in NativeBuffer
56 NativeBuffer(int size) { in NativeBuffer() argument
57 this.address = unsafe.allocateMemory(size); in NativeBuffer()
58 this.size = size; in NativeBuffer()
76 int size() { in size() method in NativeBuffer
77 return size; in size()
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DNodeBuilderTest.java51 for (int size : sizes) { in createNodeBuilders()
52 ls.add(countTo(size)); in createNodeBuilders()
60 Object[][] params = new Object[ls.size() * ms.size()][]; in createNodeBuilders()
73 Node.Builder<Integer> nb = m.apply(l.size()); in testIteration()
74 nb.begin(l.size()); in testIteration()
81 assertEquals(n.count(), l.size()); in testIteration()
96 for (int size : sizes) { in createIntNodeBuilders()
97 ls.add(countTo(size)); in createIntNodeBuilders()
105 Object[][] params = new Object[ls.size() * ms.size()][]; in createIntNodeBuilders()
118 Node.Builder.OfInt nb = m.apply(l.size()); in testIntIteration()
[all …]
DSliceSpliteratorTest.java56 assertEquals(actual.size(), expected.size()); in assertContents()
63 void test(int size, int skip, int limit); in test() argument
73 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
74 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
86 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
87 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
99 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
100 … final Collection<Long> source = LongStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
112 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
113 …final Collection<Double> source = LongStream.range(0, size).asDoubleStream().boxed().collect(toLi… in sliceSpliteratorDataProvider()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DIOVecWrapper.java55 private final int size; field in IOVecWrapper
85 private IOVecWrapper(int size) { in IOVecWrapper() argument
86 this.size = size; in IOVecWrapper()
87 this.buf = new ByteBuffer[size]; in IOVecWrapper()
88 this.position = new int[size]; in IOVecWrapper()
89 this.remaining = new int[size]; in IOVecWrapper()
90 this.shadow = new ByteBuffer[size]; in IOVecWrapper()
91 this.vecArray = new AllocatedNativeObject(size * SIZE_IOVEC, false); in IOVecWrapper()
95 static IOVecWrapper get(int size) { in get() argument
97 if (wrapper != null && wrapper.size < size) { in get()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DArrayDequeTest.java66 assertEquals(0, new ArrayDeque<Object>().size()); in test_Constructor()
73 assertEquals(0, new ArrayDeque<Object>(new ArrayList<Object>()).size()); in test_Constructor_LCollection()
86 assertEquals(0, new ArrayDeque<Object>(8).size()); in test_Constructor_Int()
88 assertEquals(0, zeroCapQue.size()); in test_Constructor_Int()
90 assertEquals(1, zeroCapQue.size()); in test_Constructor_Int()
91 assertEquals(0, new ArrayDeque<Object>(0).size()); in test_Constructor_Int()
93 assertEquals(0, negCapQue.size()); in test_Constructor_Int()
95 assertEquals(1, negCapQue.size()); in test_Constructor_Int()
97 assertEquals(0, oneCapQue.size()); in test_Constructor_Int()
99 assertEquals(1, oneCapQue.size()); in test_Constructor_Int()
[all …]
DTreeMapTest.java128 assertTrue("Map is incorrect size", myTreeMap.size() == objArray.length); in test_ConstructorLjava_util_Map()
160 assertEquals("Cleared map returned non-zero size", 0, tm.size()); in test_clear()
247 anEntrySet.size() == objArray.length); in test_entrySet()
281 assertEquals(2, tm.values().size()); in test_getLjava_lang_Object()
282 assertEquals(2, tm.keySet().size()); in test_getLjava_lang_Object()
295 assertEquals("Returned map of incorrect size", 3, head.size()); in test_headMapLjava_lang_Object()
310 assertEquals(0, smap.size()); in test_headMapLjava_lang_Object()
313 assertEquals(0, keySet.size()); in test_headMapLjava_lang_Object()
316 assertEquals(0, entrySet.size()); in test_headMapLjava_lang_Object()
319 assertEquals(0, valueCollection.size()); in test_headMapLjava_lang_Object()
[all …]
DLinkedHashSetTest.java48 assertEquals("Created incorrect LinkedHashSet", 0, hs2.size()); in test_Constructor()
57 assertEquals("Created incorrect LinkedHashSet", 0, hs2.size()); in test_ConstructorI()
72 assertEquals("Created incorrect LinkedHashSet", 0, hs2.size()); in test_ConstructorIF()
106 .size() == objArray.length); in test_ConstructorLjava_util_Collection()
121 int size = hs.size(); in test_addLjava_lang_Object() local
123 assertTrue("Added element already contained by set", hs.size() == size); in test_addLjava_lang_Object()
126 hs.size() == size + 1); in test_addLjava_lang_Object()
138 assertEquals("Returned non-zero size after clear", 0, hs.size()); in test_clear()
196 assertTrue("Returned iteration of incorrect size", hs.size() == x); in test_iterator()
209 int size = hs.size(); in test_removeLjava_lang_Object() local
[all …]
DArrayListTest.java63 assertEquals("Incorrect arrayList created", 0, al.size()); in test_ConstructorI()
66 assertEquals("Incorrect arrayList created", 0, al.size()); in test_ConstructorI()
82 .size() == objArray.length); in test_ConstructorLjava_util_Collection()
147 alist.add(alist.size() + 1, new Object()); in test_addILjava_lang_Object()
155 alist.add(alist.size() + 1, null); in test_addILjava_lang_Object()
168 int size = alist.size(); in test_addILjava_lang_Object_2() local
169 alist.add(size, o); in test_addILjava_lang_Object_2()
170 assertEquals("Failed to add Object", alist.get(size), o); in test_addILjava_lang_Object_2()
171 assertEquals(alist.get(size - 2), objArray[size - 2]); in test_addILjava_lang_Object_2()
172 assertEquals(alist.get(size - 1), objArray[size - 1]); in test_addILjava_lang_Object_2()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DCache.java81 public abstract int size(); in size() method in Cache
106 public abstract void setCapacity(int size); in setCapacity() argument
122 public static <K,V> Cache<K,V> newSoftMemoryCache(int size) { in newSoftMemoryCache() argument
123 return new MemoryCache<>(true, size); in newSoftMemoryCache()
131 public static <K,V> Cache<K,V> newSoftMemoryCache(int size, int timeout) { in newSoftMemoryCache() argument
132 return new MemoryCache<>(true, size, timeout); in newSoftMemoryCache()
139 public static <K,V> Cache<K,V> newHardMemoryCache(int size) { in newHardMemoryCache() argument
140 return new MemoryCache<>(false, size); in newHardMemoryCache()
156 public static <K,V> Cache<K,V> newHardMemoryCache(int size, int timeout) { in newHardMemoryCache() argument
157 return new MemoryCache<>(false, size, timeout); in newHardMemoryCache()
[all …]
DKeyUtil.java52 int size = -1; in getKeySize() local
57 size = ruler.length(); in getKeySize()
62 if (size >= 0) { in getKeySize()
63 return size; in getKeySize()
72 size = (sk.getEncoded().length * 8); in getKeySize()
77 size = pubk.getModulus().bitLength(); in getKeySize()
89 size = params.getOrder().bitLength(); in getKeySize()
95 size = (params != null) ? params.getP().bitLength() : -1; in getKeySize()
98 size = pubk.getParams().getP().bitLength(); in getKeySize()
102 return size; in getKeySize()
/libcore/dom/src/test/java/org/w3c/domts/
DJUnitTestCaseAdapter.java235 assertEquals(assertID, expectedSize, collection.size()); in assertSize()
245 int size = expected.size(); in assertEqualsIgnoreCase() local
248 assertEquals(assertID,size, actual.size()); in assertEqualsIgnoreCase()
249 boolean equals = (expected != null && actual != null && size == actual.size()); in assertEqualsIgnoreCase()
273 int size = expected.size(); in assertEqualsIgnoreCase() local
276 assertEquals(assertID,size, actual.size()); in assertEqualsIgnoreCase()
277 boolean equals = (expected != null && actual != null && size == actual.size()); in assertEqualsIgnoreCase()
281 for(int i = 0; i < size; i++) { in assertEqualsIgnoreCase()
309 int size = expected.size(); in assertEquals() local
312 assertEquals(assertID,size, actual.size()); in assertEquals()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DBitSetBenchmark.java25 private int size; field in BitSetBenchmark
31 bs = new BitSet(size); in setUp()
41 bs.set(bs.size() - 1); in timeIsEmptyFalse()
49 bs.get(i % size); in timeGet()
55 bs.clear(i % size); in timeClear()
61 bs.set(i % size); in timeSet()
67 bs.set(i % size, true); in timeSetOn()
73 bs.set(i % size, false); in timeSetOff()

12345678910>>...30