Lines Matching refs:index

98      * Return an index in the array that has data.
100 * @param at The index you would like to returned, ranging from 0 to
103 * @return The index at the given offset, which can be used with
126 * Retrieve the styled string value for the attribute at <var>index</var>.
128 * @param index Index of attribute to retrieve.
133 public CharSequence getText(int index) {
138 index *= AssetManager.STYLE_NUM_ENTRIES;
140 final int type = data[index+AssetManager.STYLE_TYPE];
144 return loadStringValueAt(index);
148 if (getValueAt(index, v)) {
158 * Retrieve the string value for the attribute at <var>index</var>.
160 * @param index Index of attribute to retrieve.
165 public String getString(int index) {
170 index *= AssetManager.STYLE_NUM_ENTRIES;
172 final int type = data[index+AssetManager.STYLE_TYPE];
176 return loadStringValueAt(index).toString();
180 if (getValueAt(index, v)) {
191 * Retrieve the string value for the attribute at <var>index</var>, but
198 * @param index Index of attribute to retrieve.
204 public String getNonResourceString(int index) {
209 index *= AssetManager.STYLE_NUM_ENTRIES;
211 final int type = data[index+AssetManager.STYLE_TYPE];
213 final int cookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
216 data[index+AssetManager.STYLE_DATA]).toString();
224 * Retrieve the string value for the attribute at <var>index</var> that is
227 * @param index Index of attribute to retrieve.
234 public String getNonConfigurationString(int index, int allowedChangingConfigs) {
239 index *= AssetManager.STYLE_NUM_ENTRIES;
241 final int type = data[index+AssetManager.STYLE_TYPE];
242 if ((data[index+AssetManager.STYLE_CHANGING_CONFIGURATIONS]&~allowedChangingConfigs) != 0) {
248 return loadStringValueAt(index).toString();
252 if (getValueAt(index, v)) {
263 * Retrieve the boolean value for the attribute at <var>index</var>.
265 * @param index Index of attribute to retrieve.
270 public boolean getBoolean(int index, boolean defValue) {
275 index *= AssetManager.STYLE_NUM_ENTRIES;
277 final int type = data[index+AssetManager.STYLE_TYPE];
282 return data[index+AssetManager.STYLE_DATA] != 0;
286 if (getValueAt(index, v)) {
297 * Retrieve the integer value for the attribute at <var>index</var>.
299 * @param index Index of attribute to retrieve.
304 public int getInt(int index, int defValue) {
309 index *= AssetManager.STYLE_NUM_ENTRIES;
311 final int type = data[index+AssetManager.STYLE_TYPE];
316 return data[index+AssetManager.STYLE_DATA];
320 if (getValueAt(index, v)) {
331 * Retrieve the float value for the attribute at <var>index</var>.
333 * @param index Index of attribute to retrieve.
337 public float getFloat(int index, float defValue) {
342 index *= AssetManager.STYLE_NUM_ENTRIES;
344 final int type = data[index+AssetManager.STYLE_TYPE];
348 return Float.intBitsToFloat(data[index+AssetManager.STYLE_DATA]);
351 return data[index+AssetManager.STYLE_DATA];
355 if (getValueAt(index, v)) {
368 * Retrieve the color value for the attribute at <var>index</var>. If
373 * @param index Index of attribute to retrieve.
379 public int getColor(int index, int defValue) {
384 index *= AssetManager.STYLE_NUM_ENTRIES;
386 final int type = data[index+AssetManager.STYLE_TYPE];
391 return data[index+AssetManager.STYLE_DATA];
394 if (getValueAt(index, value)) {
401 throw new RuntimeException("Failed to resolve attribute at index " + index);
409 * Retrieve the ColorStateList for the attribute at <var>index</var>.
413 * @param index Index of attribute to retrieve.
417 public ColorStateList getColorStateList(int index) {
423 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
425 throw new RuntimeException("Failed to resolve attribute at index " + index);
433 * Retrieve the integer value for the attribute at <var>index</var>.
435 * @param index Index of attribute to retrieve.
441 public int getInteger(int index, int defValue) {
446 index *= AssetManager.STYLE_NUM_ENTRIES;
448 final int type = data[index+AssetManager.STYLE_TYPE];
453 return data[index+AssetManager.STYLE_DATA];
455 throw new RuntimeException("Failed to resolve attribute at index " + index);
463 * Retrieve a dimensional unit attribute at <var>index</var>. Unit
468 * @param index Index of attribute to retrieve.
478 public float getDimension(int index, float defValue) {
483 index *= AssetManager.STYLE_NUM_ENTRIES;
485 final int type = data[index+AssetManager.STYLE_TYPE];
490 data[index+AssetManager.STYLE_DATA], mMetrics);
492 throw new RuntimeException("Failed to resolve attribute at index " + index);
500 * Retrieve a dimensional unit attribute at <var>index</var> for use
506 * @param index Index of attribute to retrieve.
516 public int getDimensionPixelOffset(int index, int defValue) {
521 index *= AssetManager.STYLE_NUM_ENTRIES;
523 final int type = data[index+AssetManager.STYLE_TYPE];
528 data[index+AssetManager.STYLE_DATA], mMetrics);
530 throw new RuntimeException("Failed to resolve attribute at index " + index);
538 * Retrieve a dimensional unit attribute at <var>index</var> for use
545 * @param index Index of attribute to retrieve.
555 public int getDimensionPixelSize(int index, int defValue) {
560 index *= AssetManager.STYLE_NUM_ENTRIES;
562 final int type = data[index+AssetManager.STYLE_TYPE];
567 data[index+AssetManager.STYLE_DATA], mMetrics);
569 throw new RuntimeException("Failed to resolve attribute at index " + index);
582 * @param index Index of the attribute to retrieve.
588 public int getLayoutDimension(int index, String name) {
593 index *= AssetManager.STYLE_NUM_ENTRIES;
595 final int type = data[index+AssetManager.STYLE_TYPE];
598 return data[index+AssetManager.STYLE_DATA];
601 data[index+AssetManager.STYLE_DATA], mMetrics);
603 throw new RuntimeException("Failed to resolve attribute at index " + index);
616 * @param index Index of the attribute to retrieve.
623 public int getLayoutDimension(int index, int defValue) {
628 index *= AssetManager.STYLE_NUM_ENTRIES;
630 final int type = data[index+AssetManager.STYLE_TYPE];
633 return data[index+AssetManager.STYLE_DATA];
636 data[index+AssetManager.STYLE_DATA], mMetrics);
643 * Retrieve a fractional unit attribute at <var>index</var>.
645 * @param index Index of attribute to retrieve.
657 public float getFraction(int index, int base, int pbase, float defValue) {
662 index *= AssetManager.STYLE_NUM_ENTRIES;
664 final int type = data[index+AssetManager.STYLE_TYPE];
669 data[index+AssetManager.STYLE_DATA], base, pbase);
671 throw new RuntimeException("Failed to resolve attribute at index " + index);
680 * <var>index</var>. Note that attribute resource as resolved when
686 * @param index Index of attribute to retrieve.
692 public int getResourceId(int index, int defValue) {
697 index *= AssetManager.STYLE_NUM_ENTRIES;
699 if (data[index+AssetManager.STYLE_TYPE] != TypedValue.TYPE_NULL) {
700 final int resid = data[index+AssetManager.STYLE_RESOURCE_ID];
710 * <var>index</var>.
712 * @param index Index of attribute to retrieve.
718 public int getThemeAttributeId(int index, int defValue) {
723 index *= AssetManager.STYLE_NUM_ENTRIES;
725 if (data[index + AssetManager.STYLE_TYPE] == TypedValue.TYPE_ATTRIBUTE) {
726 return data[index + AssetManager.STYLE_DATA];
732 * Retrieve the Drawable for the attribute at <var>index</var>.
734 * @param index Index of attribute to retrieve.
739 public Drawable getDrawable(int index) {
745 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
747 throw new RuntimeException("Failed to resolve attribute at index " + index);
755 * Retrieve the CharSequence[] for the attribute at <var>index</var>.
760 * @param index Index of attribute to retrieve.
764 public CharSequence[] getTextArray(int index) {
770 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
777 * Retrieve the raw TypedValue for the attribute at <var>index</var>.
779 * @param index Index of attribute to retrieve.
785 public boolean getValue(int index, TypedValue outValue) {
790 return getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, outValue);
794 * Returns the type of attribute at the specified index.
796 * @param index Index of attribute whose type to retrieve.
799 public int getType(int index) {
804 index *= AssetManager.STYLE_NUM_ENTRIES;
805 return mData[index + AssetManager.STYLE_TYPE];
809 * Determines whether there is an attribute at <var>index</var>.
814 * @param index Index of attribute to retrieve.
818 public boolean hasValue(int index) {
823 index *= AssetManager.STYLE_NUM_ENTRIES;
825 final int type = data[index+AssetManager.STYLE_TYPE];
830 * Determines whether there is an attribute at <var>index</var>, returning
834 * @param index Index of attribute to retrieve.
838 public boolean hasValueOrEmpty(int index) {
843 index *= AssetManager.STYLE_NUM_ENTRIES;
845 final int type = data[index+AssetManager.STYLE_TYPE];
847 || data[index+AssetManager.STYLE_DATA] == TypedValue.DATA_NULL_EMPTY;
851 * Retrieve the raw TypedValue for the attribute at <var>index</var>
855 * @param index Index of attribute to retrieve.
861 public TypedValue peekValue(int index) {
867 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
923 final int index = i * AssetManager.STYLE_NUM_ENTRIES;
924 if (data[index + AssetManager.STYLE_TYPE] != TypedValue.TYPE_ATTRIBUTE) {
929 data[index + AssetManager.STYLE_TYPE] = TypedValue.TYPE_NULL;
931 final int attr = data[index + AssetManager.STYLE_DATA];
960 final int index = i * AssetManager.STYLE_NUM_ENTRIES;
961 final int type = data[index + AssetManager.STYLE_TYPE];
965 changingConfig |= data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS];
970 private boolean getValueAt(int index, TypedValue outValue) {
972 final int type = data[index+AssetManager.STYLE_TYPE];
977 outValue.data = data[index+AssetManager.STYLE_DATA];
978 outValue.assetCookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
979 outValue.resourceId = data[index+AssetManager.STYLE_RESOURCE_ID];
980 outValue.changingConfigurations = data[index+AssetManager.STYLE_CHANGING_CONFIGURATIONS];
981 outValue.density = data[index+AssetManager.STYLE_DENSITY];
982 outValue.string = (type == TypedValue.TYPE_STRING) ? loadStringValueAt(index) : null;
986 private CharSequence loadStringValueAt(int index) {
988 final int cookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
992 data[index+AssetManager.STYLE_DATA]);
996 return mAssets.getPooledStringForCookie(cookie, data[index+AssetManager.STYLE_DATA]);