Lines Matching refs:key

136      * Make a Bundle for a single key/value pair.
140 public static Bundle forPair(String key, String value) {
143 b.putString(key, value);
264 * Returns true if the given key is contained in the mapping
267 * @param key a String key
268 * @return true if the key is part of the mapping, false otherwise
270 public boolean containsKey(String key) {
272 return mMap.containsKey(key);
276 * Returns the entry with the given key as an object.
278 * @param key a String key
281 public Object get(String key) {
283 return mMap.get(key);
287 * Removes any entry with the given key from the mapping of this Bundle.
289 * @param key a String key
291 public void remove(String key) {
293 mMap.remove(key);
389 * any existing value for the given key. Either key or value may be null.
391 * @param key a String, or null
394 public void putBoolean(String key, boolean value) {
396 mMap.put(key, value);
401 * any existing value for the given key.
403 * @param key a String, or null
406 public void putByte(String key, byte value) {
408 mMap.put(key, value);
413 * any existing value for the given key.
415 * @param key a String, or null
418 public void putChar(String key, char value) {
420 mMap.put(key, value);
425 * any existing value for the given key.
427 * @param key a String, or null
430 public void putShort(String key, short value) {
432 mMap.put(key, value);
437 * any existing value for the given key.
439 * @param key a String, or null
442 public void putInt(String key, int value) {
444 mMap.put(key, value);
449 * any existing value for the given key.
451 * @param key a String, or null
454 public void putLong(String key, long value) {
456 mMap.put(key, value);
461 * any existing value for the given key.
463 * @param key a String, or null
466 public void putFloat(String key, float value) {
468 mMap.put(key, value);
473 * any existing value for the given key.
475 * @param key a String, or null
478 public void putDouble(String key, double value) {
480 mMap.put(key, value);
485 * any existing value for the given key. Either key or value may be null.
487 * @param key a String, or null
490 public void putString(String key, String value) {
492 mMap.put(key, value);
497 * any existing value for the given key. Either key or value may be null.
499 * @param key a String, or null
502 public void putCharSequence(String key, CharSequence value) {
504 mMap.put(key, value);
509 * any existing value for the given key. Either key or value may be null.
511 * @param key a String, or null
514 public void putParcelable(String key, Parcelable value) {
516 mMap.put(key, value);
522 * replacing any existing value for the given key. Either key or value may
525 * @param key a String, or null
528 public void putParcelableArray(String key, Parcelable[] value) {
530 mMap.put(key, value);
536 * replacing any existing value for the given key. Either key or value may
539 * @param key a String, or null
542 public void putParcelableArrayList(String key,
545 mMap.put(key, value);
551 * Bundle, replacing any existing value for the given key. Either key
554 * @param key a String, or null
557 public void putSparseParcelableArray(String key,
560 mMap.put(key, value);
566 * any existing value for the given key. Either key or value may be null.
568 * @param key a String, or null
571 public void putIntegerArrayList(String key, ArrayList<Integer> value) {
573 mMap.put(key, value);
578 * any existing value for the given key. Either key or value may be null.
580 * @param key a String, or null
583 public void putStringArrayList(String key, ArrayList<String> value) {
585 mMap.put(key, value);
590 * any existing value for the given key. Either key or value may be null.
592 * @param key a String, or null
595 public void putCharSequenceArrayList(String key, ArrayList<CharSequence> value) {
597 mMap.put(key, value);
602 * any existing value for the given key. Either key or value may be null.
604 * @param key a String, or null
607 public void putSerializable(String key, Serializable value) {
609 mMap.put(key, value);
614 * any existing value for the given key. Either key or value may be null.
616 * @param key a String, or null
619 public void putBooleanArray(String key, boolean[] value) {
621 mMap.put(key, value);
626 * any existing value for the given key. Either key or value may be null.
628 * @param key a String, or null
631 public void putByteArray(String key, byte[] value) {
633 mMap.put(key, value);
638 * any existing value for the given key. Either key or value may be null.
640 * @param key a String, or null
643 public void putShortArray(String key, short[] value) {
645 mMap.put(key, value);
650 * any existing value for the given key. Either key or value may be null.
652 * @param key a String, or null
655 public void putCharArray(String key, char[] value) {
657 mMap.put(key, value);
662 * any existing value for the given key. Either key or value may be null.
664 * @param key a String, or null
667 public void putIntArray(String key, int[] value) {
669 mMap.put(key, value);
674 * any existing value for the given key. Either key or value may be null.
676 * @param key a String, or null
679 public void putLongArray(String key, long[] value) {
681 mMap.put(key, value);
686 * any existing value for the given key. Either key or value may be null.
688 * @param key a String, or null
691 public void putFloatArray(String key, float[] value) {
693 mMap.put(key, value);
698 * any existing value for the given key. Either key or value may be null.
700 * @param key a String, or null
703 public void putDoubleArray(String key, double[] value) {
705 mMap.put(key, value);
710 * any existing value for the given key. Either key or value may be null.
712 * @param key a String, or null
715 public void putStringArray(String key, String[] value) {
717 mMap.put(key, value);
722 * any existing value for the given key. Either key or value may be null.
724 * @param key a String, or null
727 public void putCharSequenceArray(String key, CharSequence[] value) {
729 mMap.put(key, value);
734 * any existing value for the given key. Either key or value may be null.
736 * @param key a String, or null
739 public void putBundle(String key, Bundle value) {
741 mMap.put(key, value);
746 * any existing value for the given key. Either key or value may be null.
748 * @param key a String, or null
755 public void putIBinder(String key, IBinder value) {
757 mMap.put(key, value);
761 * Returns the value associated with the given key, or false if
762 * no mapping of the desired type exists for the given key.
764 * @param key a String
767 public boolean getBoolean(String key) {
769 return getBoolean(key, false);
773 private void typeWarning(String key, Object value, String className,
777 sb.append(key);
789 private void typeWarning(String key, Object value, String className,
791 typeWarning(key, value, className, "<null>", e);
795 * Returns the value associated with the given key, or defaultValue if
796 * no mapping of the desired type exists for the given key.
798 * @param key a String
799 * @param defaultValue Value to return if key does not exist
802 public boolean getBoolean(String key, boolean defaultValue) {
804 Object o = mMap.get(key);
811 typeWarning(key, o, "Boolean", defaultValue, e);
817 * Returns the value associated with the given key, or (byte) 0 if
818 * no mapping of the desired type exists for the given key.
820 * @param key a String
823 public byte getByte(String key) {
825 return getByte(key, (byte) 0);
829 * Returns the value associated with the given key, or defaultValue if
830 * no mapping of the desired type exists for the given key.
832 * @param key a String
833 * @param defaultValue Value to return if key does not exist
836 public Byte getByte(String key, byte defaultValue) {
838 Object o = mMap.get(key);
845 typeWarning(key, o, "Byte", defaultValue, e);
851 * Returns the value associated with the given key, or (char) 0 if
852 * no mapping of the desired type exists for the given key.
854 * @param key a String
857 public char getChar(String key) {
859 return getChar(key, (char) 0);
863 * Returns the value associated with the given key, or defaultValue if
864 * no mapping of the desired type exists for the given key.
866 * @param key a String
867 * @param defaultValue Value to return if key does not exist
870 public char getChar(String key, char defaultValue) {
872 Object o = mMap.get(key);
879 typeWarning(key, o, "Character", defaultValue, e);
885 * Returns the value associated with the given key, or (short) 0 if
886 * no mapping of the desired type exists for the given key.
888 * @param key a String
891 public short getShort(String key) {
893 return getShort(key, (short) 0);
897 * Returns the value associated with the given key, or defaultValue if
898 * no mapping of the desired type exists for the given key.
900 * @param key a String
901 * @param defaultValue Value to return if key does not exist
904 public short getShort(String key, short defaultValue) {
906 Object o = mMap.get(key);
913 typeWarning(key, o, "Short", defaultValue, e);
919 * Returns the value associated with the given key, or 0 if
920 * no mapping of the desired type exists for the given key.
922 * @param key a String
925 public int getInt(String key) {
927 return getInt(key, 0);
931 * Returns the value associated with the given key, or defaultValue if
932 * no mapping of the desired type exists for the given key.
934 * @param key a String
935 * @param defaultValue Value to return if key does not exist
938 public int getInt(String key, int defaultValue) {
940 Object o = mMap.get(key);
947 typeWarning(key, o, "Integer", defaultValue, e);
953 * Returns the value associated with the given key, or 0L if
954 * no mapping of the desired type exists for the given key.
956 * @param key a String
959 public long getLong(String key) {
961 return getLong(key, 0L);
965 * Returns the value associated with the given key, or defaultValue if
966 * no mapping of the desired type exists for the given key.
968 * @param key a String
969 * @param defaultValue Value to return if key does not exist
972 public long getLong(String key, long defaultValue) {
974 Object o = mMap.get(key);
981 typeWarning(key, o, "Long", defaultValue, e);
987 * Returns the value associated with the given key, or 0.0f if
988 * no mapping of the desired type exists for the given key.
990 * @param key a String
993 public float getFloat(String key) {
995 return getFloat(key, 0.0f);
999 * Returns the value associated with the given key, or defaultValue if
1000 * no mapping of the desired type exists for the given key.
1002 * @param key a String
1003 * @param defaultValue Value to return if key does not exist
1006 public float getFloat(String key, float defaultValue) {
1008 Object o = mMap.get(key);
1015 typeWarning(key, o, "Float", defaultValue, e);
1021 * Returns the value associated with the given key, or 0.0 if
1022 * no mapping of the desired type exists for the given key.
1024 * @param key a String
1027 public double getDouble(String key) {
1029 return getDouble(key, 0.0);
1033 * Returns the value associated with the given key, or defaultValue if
1034 * no mapping of the desired type exists for the given key.
1036 * @param key a String
1037 * @param defaultValue Value to return if key does not exist
1040 public double getDouble(String key, double defaultValue) {
1042 Object o = mMap.get(key);
1049 typeWarning(key, o, "Double", defaultValue, e);
1055 * Returns the value associated with the given key, or null if
1056 * no mapping of the desired type exists for the given key or a null
1057 * value is explicitly associated with the key.
1059 * @param key a String, or null
1062 public String getString(String key) {
1064 Object o = mMap.get(key);
1071 typeWarning(key, o, "String", e);
1077 * Returns the value associated with the given key, or defaultValue if
1078 * no mapping of the desired type exists for the given key.
1080 * @param key a String, or null
1081 * @param defaultValue Value to return if key does not exist
1084 public String getString(String key, String defaultValue) {
1086 Object o = mMap.get(key);
1093 typeWarning(key, o, "String", e);
1099 * Returns the value associated with the given key, or null if
1100 * no mapping of the desired type exists for the given key or a null
1101 * value is explicitly associated with the key.
1103 * @param key a String, or null
1106 public CharSequence getCharSequence(String key) {
1108 Object o = mMap.get(key);
1115 typeWarning(key, o, "CharSequence", e);
1121 * Returns the value associated with the given key, or defaultValue if
1122 * no mapping of the desired type exists for the given key.
1124 * @param key a String, or null
1125 * @param defaultValue Value to return if key does not exist
1128 public CharSequence getCharSequence(String key, CharSequence defaultValue) {
1130 Object o = mMap.get(key);
1137 typeWarning(key, o, "CharSequence", e);
1143 * Returns the value associated with the given key, or null if
1144 * no mapping of the desired type exists for the given key or a null
1145 * value is explicitly associated with the key.
1147 * @param key a String, or null
1150 public Bundle getBundle(String key) {
1152 Object o = mMap.get(key);
1159 typeWarning(key, o, "Bundle", e);
1165 * Returns the value associated with the given key, or null if
1166 * no mapping of the desired type exists for the given key or a null
1167 * value is explicitly associated with the key.
1169 * @param key a String, or null
1172 public <T extends Parcelable> T getParcelable(String key) {
1174 Object o = mMap.get(key);
1181 typeWarning(key, o, "Parcelable", e);
1187 * Returns the value associated with the given key, or null if
1188 * no mapping of the desired type exists for the given key or a null
1189 * value is explicitly associated with the key.
1191 * @param key a String, or null
1194 public Parcelable[] getParcelableArray(String key) {
1196 Object o = mMap.get(key);
1203 typeWarning(key, o, "Parcelable[]", e);
1209 * Returns the value associated with the given key, or null if
1210 * no mapping of the desired type exists for the given key or a null
1211 * value is explicitly associated with the key.
1213 * @param key a String, or null
1216 public <T extends Parcelable> ArrayList<T> getParcelableArrayList(String key) {
1218 Object o = mMap.get(key);
1225 typeWarning(key, o, "ArrayList", e);
1231 * Returns the value associated with the given key, or null if
1232 * no mapping of the desired type exists for the given key or a null
1233 * value is explicitly associated with the key.
1235 * @param key a String, or null
1239 public <T extends Parcelable> SparseArray<T> getSparseParcelableArray(String key) {
1241 Object o = mMap.get(key);
1248 typeWarning(key, o, "SparseArray", e);
1254 * Returns the value associated with the given key, or null if
1255 * no mapping of the desired type exists for the given key or a null
1256 * value is explicitly associated with the key.
1258 * @param key a String, or null
1261 public Serializable getSerializable(String key) {
1263 Object o = mMap.get(key);
1270 typeWarning(key, o, "Serializable", e);
1276 * Returns the value associated with the given key, or null if
1277 * no mapping of the desired type exists for the given key or a null
1278 * value is explicitly associated with the key.
1280 * @param key a String, or null
1283 public ArrayList<Integer> getIntegerArrayList(String key) {
1285 Object o = mMap.get(key);
1292 typeWarning(key, o, "ArrayList<Integer>", e);
1298 * Returns the value associated with the given key, or null if
1299 * no mapping of the desired type exists for the given key or a null
1300 * value is explicitly associated with the key.
1302 * @param key a String, or null
1305 public ArrayList<String> getStringArrayList(String key) {
1307 Object o = mMap.get(key);
1314 typeWarning(key, o, "ArrayList<String>", e);
1320 * Returns the value associated with the given key, or null if
1321 * no mapping of the desired type exists for the given key or a null
1322 * value is explicitly associated with the key.
1324 * @param key a String, or null
1327 public ArrayList<CharSequence> getCharSequenceArrayList(String key) {
1329 Object o = mMap.get(key);
1336 typeWarning(key, o, "ArrayList<CharSequence>", e);
1342 * Returns the value associated with the given key, or null if
1343 * no mapping of the desired type exists for the given key or a null
1344 * value is explicitly associated with the key.
1346 * @param key a String, or null
1349 public boolean[] getBooleanArray(String key) {
1351 Object o = mMap.get(key);
1358 typeWarning(key, o, "byte[]", e);
1364 * Returns the value associated with the given key, or null if
1365 * no mapping of the desired type exists for the given key or a null
1366 * value is explicitly associated with the key.
1368 * @param key a String, or null
1371 public byte[] getByteArray(String key) {
1373 Object o = mMap.get(key);
1380 typeWarning(key, o, "byte[]", e);
1386 * Returns the value associated with the given key, or null if
1387 * no mapping of the desired type exists for the given key or a null
1388 * value is explicitly associated with the key.
1390 * @param key a String, or null
1393 public short[] getShortArray(String key) {
1395 Object o = mMap.get(key);
1402 typeWarning(key, o, "short[]", e);
1408 * Returns the value associated with the given key, or null if
1409 * no mapping of the desired type exists for the given key or a null
1410 * value is explicitly associated with the key.
1412 * @param key a String, or null
1415 public char[] getCharArray(String key) {
1417 Object o = mMap.get(key);
1424 typeWarning(key, o, "char[]", e);
1430 * Returns the value associated with the given key, or null if
1431 * no mapping of the desired type exists for the given key or a null
1432 * value is explicitly associated with the key.
1434 * @param key a String, or null
1437 public int[] getIntArray(String key) {
1439 Object o = mMap.get(key);
1446 typeWarning(key, o, "int[]", e);
1452 * Returns the value associated with the given key, or null if
1453 * no mapping of the desired type exists for the given key or a null
1454 * value is explicitly associated with the key.
1456 * @param key a String, or null
1459 public long[] getLongArray(String key) {
1461 Object o = mMap.get(key);
1468 typeWarning(key, o, "long[]", e);
1474 * Returns the value associated with the given key, or null if
1475 * no mapping of the desired type exists for the given key or a null
1476 * value is explicitly associated with the key.
1478 * @param key a String, or null
1481 public float[] getFloatArray(String key) {
1483 Object o = mMap.get(key);
1490 typeWarning(key, o, "float[]", e);
1496 * Returns the value associated with the given key, or null if
1497 * no mapping of the desired type exists for the given key or a null
1498 * value is explicitly associated with the key.
1500 * @param key a String, or null
1503 public double[] getDoubleArray(String key) {
1505 Object o = mMap.get(key);
1512 typeWarning(key, o, "double[]", e);
1518 * Returns the value associated with the given key, or null if
1519 * no mapping of the desired type exists for the given key or a null
1520 * value is explicitly associated with the key.
1522 * @param key a String, or null
1525 public String[] getStringArray(String key) {
1527 Object o = mMap.get(key);
1534 typeWarning(key, o, "String[]", e);
1540 * Returns the value associated with the given key, or null if
1541 * no mapping of the desired type exists for the given key or a null
1542 * value is explicitly associated with the key.
1544 * @param key a String, or null
1547 public CharSequence[] getCharSequenceArray(String key) {
1549 Object o = mMap.get(key);
1556 typeWarning(key, o, "CharSequence[]", e);
1562 * Returns the value associated with the given key, or null if
1563 * no mapping of the desired type exists for the given key or a null
1564 * value is explicitly associated with the key.
1566 * @param key a String, or null
1573 public IBinder getIBinder(String key) {
1575 Object o = mMap.get(key);
1582 typeWarning(key, o, "IBinder", e);