Lines Matching refs:index

104      * Returns an index in the array that has data.
106 * @param at The index you would like to returned, ranging from 0 to
109 * @return The index at the given offset, which can be used with
135 * Retrieves the styled string value for the attribute at <var>index</var>.
140 * @param index Index of attribute to retrieve.
147 public CharSequence getText(int index) {
152 index *= AssetManager.STYLE_NUM_ENTRIES;
154 final int type = data[index+AssetManager.STYLE_TYPE];
158 return loadStringValueAt(index);
162 if (getValueAt(index, v)) {
171 * Retrieves the string value for the attribute at <var>index</var>.
176 * @param index Index of attribute to retrieve.
184 public String getString(int index) {
189 index *= AssetManager.STYLE_NUM_ENTRIES;
191 final int type = data[index+AssetManager.STYLE_TYPE];
195 return loadStringValueAt(index).toString();
199 if (getValueAt(index, v)) {
209 * Retrieves the string value for the attribute at <var>index</var>, but
216 * @param index Index of attribute to retrieve.
223 public String getNonResourceString(int index) {
228 index *= AssetManager.STYLE_NUM_ENTRIES;
230 final int type = data[index+AssetManager.STYLE_TYPE];
232 final int cookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
235 data[index+AssetManager.STYLE_DATA]).toString();
242 * Retrieves the string value for the attribute at <var>index</var> that is
245 * @param index Index of attribute to retrieve.
254 public String getNonConfigurationString(int index, int allowedChangingConfigs) {
259 index *= AssetManager.STYLE_NUM_ENTRIES;
261 final int type = data[index+AssetManager.STYLE_TYPE];
262 if ((data[index+AssetManager.STYLE_CHANGING_CONFIGURATIONS]&~allowedChangingConfigs) != 0) {
268 return loadStringValueAt(index).toString();
272 if (getValueAt(index, v)) {
283 * Retrieve the boolean value for the attribute at <var>index</var>.
290 * @param index Index of attribute to retrieve.
298 public boolean getBoolean(int index, boolean defValue) {
303 index *= AssetManager.STYLE_NUM_ENTRIES;
305 final int type = data[index+AssetManager.STYLE_TYPE];
310 return data[index+AssetManager.STYLE_DATA] != 0;
314 if (getValueAt(index, v)) {
324 * Retrieve the integer value for the attribute at <var>index</var>.
329 * @param index Index of attribute to retrieve.
337 public int getInt(int index, int defValue) {
342 index *= AssetManager.STYLE_NUM_ENTRIES;
344 final int type = data[index+AssetManager.STYLE_TYPE];
349 return data[index+AssetManager.STYLE_DATA];
353 if (getValueAt(index, v)) {
363 * Retrieve the float value for the attribute at <var>index</var>.
368 * @param index Index of attribute to retrieve.
374 public float getFloat(int index, float defValue) {
379 index *= AssetManager.STYLE_NUM_ENTRIES;
381 final int type = data[index+AssetManager.STYLE_TYPE];
385 return Float.intBitsToFloat(data[index+AssetManager.STYLE_DATA]);
388 return data[index+AssetManager.STYLE_DATA];
392 if (getValueAt(index, v)) {
405 * Retrieve the color value for the attribute at <var>index</var>. If
413 * @param index Index of attribute to retrieve.
423 public int getColor(int index, @ColorInt int defValue) {
428 index *= AssetManager.STYLE_NUM_ENTRIES;
430 final int type = data[index+AssetManager.STYLE_TYPE];
435 return data[index+AssetManager.STYLE_DATA];
438 if (getValueAt(index, value)) {
446 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
448 "Failed to resolve attribute at index " + index + ": " + value);
456 * Retrieve the ColorStateList for the attribute at <var>index</var>.
464 * @param index Index of attribute to retrieve.
474 public ColorStateList getColorStateList(int index) {
480 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
483 "Failed to resolve attribute at index " + index + ": " + value);
491 * Retrieve the integer value for the attribute at <var>index</var>.
496 * @param index Index of attribute to retrieve.
505 public int getInteger(int index, int defValue) {
510 index *= AssetManager.STYLE_NUM_ENTRIES;
512 final int type = data[index+AssetManager.STYLE_TYPE];
517 return data[index+AssetManager.STYLE_DATA];
520 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
522 "Failed to resolve attribute at index " + index + ": " + value);
530 * Retrieve a dimensional unit attribute at <var>index</var>. Unit
538 * @param index Index of attribute to retrieve.
551 public float getDimension(int index, float defValue) {
556 index *= AssetManager.STYLE_NUM_ENTRIES;
558 final int type = data[index+AssetManager.STYLE_TYPE];
563 data[index + AssetManager.STYLE_DATA], mMetrics);
566 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
568 "Failed to resolve attribute at index " + index + ": " + value);
576 * Retrieve a dimensional unit attribute at <var>index</var> for use
585 * @param index Index of attribute to retrieve.
598 public int getDimensionPixelOffset(int index, int defValue) {
603 index *= AssetManager.STYLE_NUM_ENTRIES;
605 final int type = data[index+AssetManager.STYLE_TYPE];
610 data[index + AssetManager.STYLE_DATA], mMetrics);
613 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
615 "Failed to resolve attribute at index " + index + ": " + value);
623 * Retrieve a dimensional unit attribute at <var>index</var> for use
633 * @param index Index of attribute to retrieve.
646 public int getDimensionPixelSize(int index, int defValue) {
651 index *= AssetManager.STYLE_NUM_ENTRIES;
653 final int type = data[index+AssetManager.STYLE_TYPE];
658 data[index+AssetManager.STYLE_DATA], mMetrics);
661 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
663 "Failed to resolve attribute at index " + index + ": " + value);
679 * @param index Index of the attribute to retrieve.
688 public int getLayoutDimension(int index, String name) {
693 index *= AssetManager.STYLE_NUM_ENTRIES;
695 final int type = data[index+AssetManager.STYLE_TYPE];
698 return data[index+AssetManager.STYLE_DATA];
701 data[index+AssetManager.STYLE_DATA], mMetrics);
704 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
706 "Failed to resolve attribute at index " + index + ": " + value);
719 * @param index Index of the attribute to retrieve.
727 public int getLayoutDimension(int index, int defValue) {
732 index *= AssetManager.STYLE_NUM_ENTRIES;
734 final int type = data[index+AssetManager.STYLE_TYPE];
737 return data[index+AssetManager.STYLE_DATA];
740 data[index + AssetManager.STYLE_DATA], mMetrics);
747 * Retrieves a fractional unit attribute at <var>index</var>.
749 * @param index Index of attribute to retrieve.
764 public float getFraction(int index, int base, int pbase, float defValue) {
769 index *= AssetManager.STYLE_NUM_ENTRIES;
771 final int type = data[index+AssetManager.STYLE_TYPE];
776 data[index+AssetManager.STYLE_DATA], base, pbase);
779 getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value);
781 "Failed to resolve attribute at index " + index + ": " + value);
790 * <var>index</var>. Note that attribute resource as resolved when
796 * @param index Index of attribute to retrieve.
804 public int getResourceId(int index, int defValue) {
809 index *= AssetManager.STYLE_NUM_ENTRIES;
811 if (data[index+AssetManager.STYLE_TYPE] != TypedValue.TYPE_NULL) {
812 final int resid = data[index+AssetManager.STYLE_RESOURCE_ID];
822 * <var>index</var>.
824 * @param index Index of attribute to retrieve.
832 public int getThemeAttributeId(int index, int defValue) {
837 index *= AssetManager.STYLE_NUM_ENTRIES;
839 if (data[index + AssetManager.STYLE_TYPE] == TypedValue.TYPE_ATTRIBUTE) {
840 return data[index + AssetManager.STYLE_DATA];
846 * Retrieve the Drawable for the attribute at <var>index</var>.
851 * @param index Index of attribute to retrieve.
859 public Drawable getDrawable(int index) {
865 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
868 "Failed to resolve attribute at index " + index + ": " + value);
876 * Retrieve the CharSequence[] for the attribute at <var>index</var>.
884 * @param index Index of attribute to retrieve.
890 public CharSequence[] getTextArray(int index) {
896 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
903 * Retrieve the raw TypedValue for the attribute at <var>index</var>.
905 * @param index Index of attribute to retrieve.
912 public boolean getValue(int index, TypedValue outValue) {
917 return getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, outValue);
921 * Returns the type of attribute at the specified index.
923 * @param index Index of attribute whose type to retrieve.
928 public int getType(int index) {
933 index *= AssetManager.STYLE_NUM_ENTRIES;
934 return mData[index + AssetManager.STYLE_TYPE];
938 * Determines whether there is an attribute at <var>index</var>.
943 * @param index Index of attribute to retrieve.
948 public boolean hasValue(int index) {
953 index *= AssetManager.STYLE_NUM_ENTRIES;
955 final int type = data[index+AssetManager.STYLE_TYPE];
960 * Determines whether there is an attribute at <var>index</var>, returning
964 * @param index Index of attribute to retrieve.
969 public boolean hasValueOrEmpty(int index) {
974 index *= AssetManager.STYLE_NUM_ENTRIES;
976 final int type = data[index+AssetManager.STYLE_TYPE];
978 || data[index+AssetManager.STYLE_DATA] == TypedValue.DATA_NULL_EMPTY;
982 * Retrieve the raw TypedValue for the attribute at <var>index</var>
986 * @param index Index of attribute to retrieve.
993 public TypedValue peekValue(int index) {
999 if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
1070 final int index = i * AssetManager.STYLE_NUM_ENTRIES;
1071 if (data[index + AssetManager.STYLE_TYPE] != TypedValue.TYPE_ATTRIBUTE) {
1077 data[index + AssetManager.STYLE_TYPE] = TypedValue.TYPE_NULL;
1079 final int attr = data[index + AssetManager.STYLE_DATA];
1120 final int index = i * AssetManager.STYLE_NUM_ENTRIES;
1121 final int type = data[index + AssetManager.STYLE_TYPE];
1125 changingConfig |= data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS];
1130 private boolean getValueAt(int index, TypedValue outValue) {
1132 final int type = data[index+AssetManager.STYLE_TYPE];
1137 outValue.data = data[index+AssetManager.STYLE_DATA];
1138 outValue.assetCookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
1139 outValue.resourceId = data[index+AssetManager.STYLE_RESOURCE_ID];
1140 outValue.changingConfigurations = data[index+AssetManager.STYLE_CHANGING_CONFIGURATIONS];
1141 outValue.density = data[index+AssetManager.STYLE_DENSITY];
1142 outValue.string = (type == TypedValue.TYPE_STRING) ? loadStringValueAt(index) : null;
1146 private CharSequence loadStringValueAt(int index) {
1148 final int cookie = data[index+AssetManager.STYLE_ASSET_COOKIE];
1152 data[index+AssetManager.STYLE_DATA]);
1156 return mAssets.getPooledStringForCookie(cookie, data[index+AssetManager.STYLE_DATA]);