Lines Matching refs:bucket
40 * The index enables the access of items and bucket labels as one unified list.
42 * [Bucket A]: [photo 1], [photo 2]
43 * [Bucket B]: [photo 3]
46 * [Bucket A], [photo 1], [photo 2], [Bucket B], [photo 3]
50 * bucket labels need to always be at the beginning:
51 * [Bucket B], [photo 3], [Bucket A], [photo 2], [photo 1]
56 * - size: get the total number of items (bucket labels and MTP objects)
179 * @return the bucket label or MtpObjectInfo at the specified position and
185 DateBucket bucket = mBuckets[mUnifiedLookupIndex[position]];
186 if (bucket.unifiedStartIndex == position) {
187 return bucket.bucket;
189 return mMtpObjects[bucket.itemsStartIndex + position - 1
190 - bucket.unifiedStartIndex];
194 DateBucket bucket = mBuckets[mUnifiedLookupIndex[zeroIndex]];
195 if (bucket.unifiedEndIndex == zeroIndex) {
196 return bucket.bucket;
198 return mMtpObjects[bucket.itemsStartIndex + zeroIndex
199 - bucket.unifiedStartIndex];
258 DateBucket bucket = mBuckets[mUnifiedLookupIndex[position]];
259 if (bucket.unifiedStartIndex == position) position++;
260 return bucket.itemsStartIndex + position - 1 - bucket.unifiedStartIndex;
263 DateBucket bucket = mBuckets[mUnifiedLookupIndex[zeroIndex]];
264 if (bucket.unifiedEndIndex == zeroIndex) zeroIndex--;
265 return mMtpObjects.length - 1 - bucket.itemsStartIndex
266 - zeroIndex + bucket.unifiedStartIndex;
321 SimpleDate bucket;
328 public DateBucket(SimpleDate bucket) {
329 this.bucket = bucket;
332 public DateBucket(SimpleDate bucket, MtpObjectInfo firstElement) {
333 this(bucket);
343 return bucket.toString();
348 return bucket.hashCode();
357 if (bucket == null) {
358 if (other.bucket != null) return false;
359 } else if (!bucket.equals(other.bucket)) {
367 return this.bucket.compareTo(another.bucket);
414 * constant time and respecting the need to have bucket names always come before items
415 * in that bucket when accessing the list sequentially, both in ascending and descending
419 * [Bucket A]: [photo 1], [photo 2]
420 * [Bucket B]: [photo 3]
425 * Now, whether we access the list in ascending or descending order, we know which bucket
426 * to look in (0 corresponds to A and 1 to B), and can return the bucket label as the first
427 * item in a bucket as needed. The individual IndexBUckets have a startIndex and endIndex
429 * offset of the specific item we want from within a specific bucket.
440 DateBucket bucket = mBuckets[i];
441 nextUnifiedEntry = currentUnifiedIndexEntry + bucket.tempElementsList.size() + 1;
443 bucket.unifiedStartIndex = currentUnifiedIndexEntry;
444 bucket.unifiedEndIndex = nextUnifiedEntry - 1;
447 bucket.itemsStartIndex = currentItemsEntry;
448 bucket.numItems = bucket.tempElementsList.size();
449 for (int j = 0; j < bucket.numItems; j++) {
450 mMtpObjects[currentItemsEntry] = bucket
453 bucket.tempElementsList = null;
545 DateBucket bucket = mBucketsTemp.get(mDateInstance);
546 if (bucket == null) {
547 bucket = new DateBucket(mDateInstance, objectInfo);
548 mBucketsTemp.put(mDateInstance, bucket);
553 bucket.tempElementsList.add(objectInfo);
562 for (DateBucket bucket : mBuckets) {
563 bucket.sortElements(sMtpObjectComparator);