Lines Matching refs:key

143      * Make a Bundle for a single key/value pair.
147 public static Bundle forPair(String key, String value) {
150 b.putString(key, value);
292 * Returns true if the given key is contained in the mapping
295 * @param key a String key
296 * @return true if the key is part of the mapping, false otherwise
298 public boolean containsKey(String key) {
300 return mMap.containsKey(key);
304 * Returns the entry with the given key as an object.
306 * @param key a String key
309 public Object get(String key) {
311 return mMap.get(key);
315 * Removes any entry with the given key from the mapping of this Bundle.
317 * @param key a String key
319 public void remove(String key) {
321 mMap.remove(key);
416 * any existing value for the given key. Either key or value may be null.
418 * @param key a String, or null
421 public void putBoolean(String key, boolean value) {
423 mMap.put(key, value);
428 * any existing value for the given key.
430 * @param key a String, or null
433 public void putByte(String key, byte value) {
435 mMap.put(key, value);
440 * any existing value for the given key.
442 * @param key a String, or null
445 public void putChar(String key, char value) {
447 mMap.put(key, value);
452 * any existing value for the given key.
454 * @param key a String, or null
457 public void putShort(String key, short value) {
459 mMap.put(key, value);
464 * any existing value for the given key.
466 * @param key a String, or null
469 public void putInt(String key, int value) {
471 mMap.put(key, value);
476 * any existing value for the given key.
478 * @param key a String, or null
481 public void putLong(String key, long value) {
483 mMap.put(key, value);
488 * any existing value for the given key.
490 * @param key a String, or null
493 public void putFloat(String key, float value) {
495 mMap.put(key, value);
500 * any existing value for the given key.
502 * @param key a String, or null
505 public void putDouble(String key, double value) {
507 mMap.put(key, value);
512 * any existing value for the given key. Either key or value may be null.
514 * @param key a String, or null
517 public void putString(String key, String value) {
519 mMap.put(key, value);
524 * any existing value for the given key. Either key or value may be null.
526 * @param key a String, or null
529 public void putCharSequence(String key, CharSequence value) {
531 mMap.put(key, value);
536 * any existing value for the given key. Either key or value may be null.
538 * @param key a String, or null
541 public void putParcelable(String key, Parcelable value) {
543 mMap.put(key, value);
549 * replacing any existing value for the given key. Either key or value may
552 * @param key a String, or null
555 public void putParcelableArray(String key, Parcelable[] value) {
557 mMap.put(key, value);
563 * replacing any existing value for the given key. Either key or value may
566 * @param key a String, or null
569 public void putParcelableArrayList(String key,
572 mMap.put(key, value);
577 public void putParcelableList(String key, List<? extends Parcelable> value) {
579 mMap.put(key, value);
585 * Bundle, replacing any existing value for the given key. Either key
588 * @param key a String, or null
591 public void putSparseParcelableArray(String key,
594 mMap.put(key, value);
600 * any existing value for the given key. Either key or value may be null.
602 * @param key a String, or null
605 public void putIntegerArrayList(String key, ArrayList<Integer> value) {
607 mMap.put(key, value);
612 * any existing value for the given key. Either key or value may be null.
614 * @param key a String, or null
617 public void putStringArrayList(String key, ArrayList<String> value) {
619 mMap.put(key, value);
624 * any existing value for the given key. Either key or value may be null.
626 * @param key a String, or null
629 public void putCharSequenceArrayList(String key, ArrayList<CharSequence> value) {
631 mMap.put(key, value);
636 * any existing value for the given key. Either key or value may be null.
638 * @param key a String, or null
641 public void putSerializable(String key, Serializable value) {
643 mMap.put(key, value);
648 * any existing value for the given key. Either key or value may be null.
650 * @param key a String, or null
653 public void putBooleanArray(String key, boolean[] value) {
655 mMap.put(key, value);
660 * any existing value for the given key. Either key or value may be null.
662 * @param key a String, or null
665 public void putByteArray(String key, byte[] value) {
667 mMap.put(key, value);
672 * any existing value for the given key. Either key or value may be null.
674 * @param key a String, or null
677 public void putShortArray(String key, short[] value) {
679 mMap.put(key, value);
684 * any existing value for the given key. Either key or value may be null.
686 * @param key a String, or null
689 public void putCharArray(String key, char[] value) {
691 mMap.put(key, value);
696 * any existing value for the given key. Either key or value may be null.
698 * @param key a String, or null
701 public void putIntArray(String key, int[] value) {
703 mMap.put(key, value);
708 * any existing value for the given key. Either key or value may be null.
710 * @param key a String, or null
713 public void putLongArray(String key, long[] value) {
715 mMap.put(key, value);
720 * any existing value for the given key. Either key or value may be null.
722 * @param key a String, or null
725 public void putFloatArray(String key, float[] value) {
727 mMap.put(key, value);
732 * any existing value for the given key. Either key or value may be null.
734 * @param key a String, or null
737 public void putDoubleArray(String key, double[] value) {
739 mMap.put(key, value);
744 * any existing value for the given key. Either key or value may be null.
746 * @param key a String, or null
749 public void putStringArray(String key, String[] value) {
751 mMap.put(key, value);
756 * any existing value for the given key. Either key or value may be null.
758 * @param key a String, or null
761 public void putCharSequenceArray(String key, CharSequence[] value) {
763 mMap.put(key, value);
768 * any existing value for the given key. Either key or value may be null.
770 * @param key a String, or null
773 public void putBundle(String key, Bundle value) {
775 mMap.put(key, value);
780 * any existing value for the given key. Either key or value may be null.
789 * @param key a String, or null
792 public void putBinder(String key, IBinder value) {
794 mMap.put(key, value);
799 * any existing value for the given key. Either key or value may be null.
801 * @param key a String, or null
808 public void putIBinder(String key, IBinder value) {
810 mMap.put(key, value);
814 * Returns the value associated with the given key, or false if
815 * no mapping of the desired type exists for the given key.
817 * @param key a String
820 public boolean getBoolean(String key) {
824 return getBoolean(key, false);
828 private void typeWarning(String key, Object value, String className,
832 sb.append(key);
844 private void typeWarning(String key, Object value, String className,
846 typeWarning(key, value, className, "<null>", e);
850 * Returns the value associated with the given key, or defaultValue if
851 * no mapping of the desired type exists for the given key.
853 * @param key a String
854 * @param defaultValue Value to return if key does not exist
857 public boolean getBoolean(String key, boolean defaultValue) {
859 Object o = mMap.get(key);
866 typeWarning(key, o, "Boolean", defaultValue, e);
872 * Returns the value associated with the given key, or (byte) 0 if
873 * no mapping of the desired type exists for the given key.
875 * @param key a String
878 public byte getByte(String key) {
880 return getByte(key, (byte) 0);
884 * Returns the value associated with the given key, or defaultValue if
885 * no mapping of the desired type exists for the given key.
887 * @param key a String
888 * @param defaultValue Value to return if key does not exist
891 public Byte getByte(String key, byte defaultValue) {
893 Object o = mMap.get(key);
900 typeWarning(key, o, "Byte", defaultValue, e);
906 * Returns the value associated with the given key, or (char) 0 if
907 * no mapping of the desired type exists for the given key.
909 * @param key a String
912 public char getChar(String key) {
914 return getChar(key, (char) 0);
918 * Returns the value associated with the given key, or defaultValue if
919 * no mapping of the desired type exists for the given key.
921 * @param key a String
922 * @param defaultValue Value to return if key does not exist
925 public char getChar(String key, char defaultValue) {
927 Object o = mMap.get(key);
934 typeWarning(key, o, "Character", defaultValue, e);
940 * Returns the value associated with the given key, or (short) 0 if
941 * no mapping of the desired type exists for the given key.
943 * @param key a String
946 public short getShort(String key) {
948 return getShort(key, (short) 0);
952 * Returns the value associated with the given key, or defaultValue if
953 * no mapping of the desired type exists for the given key.
955 * @param key a String
956 * @param defaultValue Value to return if key does not exist
959 public short getShort(String key, short defaultValue) {
961 Object o = mMap.get(key);
968 typeWarning(key, o, "Short", defaultValue, e);
974 * Returns the value associated with the given key, or 0 if
975 * no mapping of the desired type exists for the given key.
977 * @param key a String
980 public int getInt(String key) {
982 return getInt(key, 0);
986 * Returns the value associated with the given key, or defaultValue if
987 * no mapping of the desired type exists for the given key.
989 * @param key a String
990 * @param defaultValue Value to return if key does not exist
993 public int getInt(String key, int defaultValue) {
995 Object o = mMap.get(key);
1002 typeWarning(key, o, "Integer", defaultValue, e);
1008 * Returns the value associated with the given key, or 0L if
1009 * no mapping of the desired type exists for the given key.
1011 * @param key a String
1014 public long getLong(String key) {
1016 return getLong(key, 0L);
1020 * Returns the value associated with the given key, or defaultValue if
1021 * no mapping of the desired type exists for the given key.
1023 * @param key a String
1024 * @param defaultValue Value to return if key does not exist
1027 public long getLong(String key, long defaultValue) {
1029 Object o = mMap.get(key);
1036 typeWarning(key, o, "Long", defaultValue, e);
1042 * Returns the value associated with the given key, or 0.0f if
1043 * no mapping of the desired type exists for the given key.
1045 * @param key a String
1048 public float getFloat(String key) {
1050 return getFloat(key, 0.0f);
1054 * Returns the value associated with the given key, or defaultValue if
1055 * no mapping of the desired type exists for the given key.
1057 * @param key a String
1058 * @param defaultValue Value to return if key does not exist
1061 public float getFloat(String key, float defaultValue) {
1063 Object o = mMap.get(key);
1070 typeWarning(key, o, "Float", defaultValue, e);
1076 * Returns the value associated with the given key, or 0.0 if
1077 * no mapping of the desired type exists for the given key.
1079 * @param key a String
1082 public double getDouble(String key) {
1084 return getDouble(key, 0.0);
1088 * Returns the value associated with the given key, or defaultValue if
1089 * no mapping of the desired type exists for the given key.
1091 * @param key a String
1092 * @param defaultValue Value to return if key does not exist
1095 public double getDouble(String key, double defaultValue) {
1097 Object o = mMap.get(key);
1104 typeWarning(key, o, "Double", defaultValue, e);
1110 * Returns the value associated with the given key, or null if
1111 * no mapping of the desired type exists for the given key or a null
1112 * value is explicitly associated with the key.
1114 * @param key a String, or null
1117 public String getString(String key) {
1119 final Object o = mMap.get(key);
1123 typeWarning(key, o, "String", e);
1129 * Returns the value associated with the given key, or defaultValue if
1130 * no mapping of the desired type exists for the given key.
1132 * @param key a String, or null
1133 * @param defaultValue Value to return if key does not exist
1134 * @return the String value associated with the given key, or defaultValue
1135 * if no valid String object is currently mapped to that key.
1137 public String getString(String key, String defaultValue) {
1138 final String s = getString(key);
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 CharSequence getCharSequence(String key) {
1152 final Object o = mMap.get(key);
1156 typeWarning(key, o, "CharSequence", e);
1162 * Returns the value associated with the given key, or defaultValue if
1163 * no mapping of the desired type exists for the given key.
1165 * @param key a String, or null
1166 * @param defaultValue Value to return if key does not exist
1167 * @return the CharSequence value associated with the given key, or defaultValue
1168 * if no valid CharSequence object is currently mapped to that key.
1170 public CharSequence getCharSequence(String key, CharSequence defaultValue) {
1171 final CharSequence cs = getCharSequence(key);
1176 * Returns the value associated with the given key, or null if
1177 * no mapping of the desired type exists for the given key or a null
1178 * value is explicitly associated with the key.
1180 * @param key a String, or null
1183 public Bundle getBundle(String key) {
1185 Object o = mMap.get(key);
1192 typeWarning(key, o, "Bundle", e);
1198 * Returns the value associated with the given key, or null if
1199 * no mapping of the desired type exists for the given key or a null
1200 * value is explicitly associated with the key.
1202 * @param key a String, or null
1205 public <T extends Parcelable> T getParcelable(String key) {
1207 Object o = mMap.get(key);
1214 typeWarning(key, o, "Parcelable", e);
1220 * Returns the value associated with the given key, or null if
1221 * no mapping of the desired type exists for the given key or a null
1222 * value is explicitly associated with the key.
1224 * @param key a String, or null
1227 public Parcelable[] getParcelableArray(String key) {
1229 Object o = mMap.get(key);
1236 typeWarning(key, o, "Parcelable[]", e);
1242 * Returns the value associated with the given key, or null if
1243 * no mapping of the desired type exists for the given key or a null
1244 * value is explicitly associated with the key.
1246 * @param key a String, or null
1249 public <T extends Parcelable> ArrayList<T> getParcelableArrayList(String key) {
1251 Object o = mMap.get(key);
1258 typeWarning(key, o, "ArrayList", e);
1264 * Returns the value associated with the given key, or null if
1265 * no mapping of the desired type exists for the given key or a null
1266 * value is explicitly associated with the key.
1268 * @param key a String, or null
1272 public <T extends Parcelable> SparseArray<T> getSparseParcelableArray(String key) {
1274 Object o = mMap.get(key);
1281 typeWarning(key, o, "SparseArray", e);
1287 * Returns the value associated with the given key, or null if
1288 * no mapping of the desired type exists for the given key or a null
1289 * value is explicitly associated with the key.
1291 * @param key a String, or null
1294 public Serializable getSerializable(String key) {
1296 Object o = mMap.get(key);
1303 typeWarning(key, o, "Serializable", e);
1309 * Returns the value associated with the given key, or null if
1310 * no mapping of the desired type exists for the given key or a null
1311 * value is explicitly associated with the key.
1313 * @param key a String, or null
1316 public ArrayList<Integer> getIntegerArrayList(String key) {
1318 Object o = mMap.get(key);
1325 typeWarning(key, o, "ArrayList<Integer>", e);
1331 * Returns the value associated with the given key, or null if
1332 * no mapping of the desired type exists for the given key or a null
1333 * value is explicitly associated with the key.
1335 * @param key a String, or null
1338 public ArrayList<String> getStringArrayList(String key) {
1340 Object o = mMap.get(key);
1347 typeWarning(key, o, "ArrayList<String>", e);
1353 * Returns the value associated with the given key, or null if
1354 * no mapping of the desired type exists for the given key or a null
1355 * value is explicitly associated with the key.
1357 * @param key a String, or null
1360 public ArrayList<CharSequence> getCharSequenceArrayList(String key) {
1362 Object o = mMap.get(key);
1369 typeWarning(key, o, "ArrayList<CharSequence>", e);
1375 * Returns the value associated with the given key, or null if
1376 * no mapping of the desired type exists for the given key or a null
1377 * value is explicitly associated with the key.
1379 * @param key a String, or null
1382 public boolean[] getBooleanArray(String key) {
1384 Object o = mMap.get(key);
1391 typeWarning(key, o, "byte[]", e);
1397 * Returns the value associated with the given key, or null if
1398 * no mapping of the desired type exists for the given key or a null
1399 * value is explicitly associated with the key.
1401 * @param key a String, or null
1404 public byte[] getByteArray(String key) {
1406 Object o = mMap.get(key);
1413 typeWarning(key, o, "byte[]", e);
1419 * Returns the value associated with the given key, or null if
1420 * no mapping of the desired type exists for the given key or a null
1421 * value is explicitly associated with the key.
1423 * @param key a String, or null
1426 public short[] getShortArray(String key) {
1428 Object o = mMap.get(key);
1435 typeWarning(key, o, "short[]", e);
1441 * Returns the value associated with the given key, or null if
1442 * no mapping of the desired type exists for the given key or a null
1443 * value is explicitly associated with the key.
1445 * @param key a String, or null
1448 public char[] getCharArray(String key) {
1450 Object o = mMap.get(key);
1457 typeWarning(key, o, "char[]", e);
1463 * Returns the value associated with the given key, or null if
1464 * no mapping of the desired type exists for the given key or a null
1465 * value is explicitly associated with the key.
1467 * @param key a String, or null
1470 public int[] getIntArray(String key) {
1472 Object o = mMap.get(key);
1479 typeWarning(key, o, "int[]", e);
1485 * Returns the value associated with the given key, or null if
1486 * no mapping of the desired type exists for the given key or a null
1487 * value is explicitly associated with the key.
1489 * @param key a String, or null
1492 public long[] getLongArray(String key) {
1494 Object o = mMap.get(key);
1501 typeWarning(key, o, "long[]", e);
1507 * Returns the value associated with the given key, or null if
1508 * no mapping of the desired type exists for the given key or a null
1509 * value is explicitly associated with the key.
1511 * @param key a String, or null
1514 public float[] getFloatArray(String key) {
1516 Object o = mMap.get(key);
1523 typeWarning(key, o, "float[]", e);
1529 * Returns the value associated with the given key, or null if
1530 * no mapping of the desired type exists for the given key or a null
1531 * value is explicitly associated with the key.
1533 * @param key a String, or null
1536 public double[] getDoubleArray(String key) {
1538 Object o = mMap.get(key);
1545 typeWarning(key, o, "double[]", e);
1551 * Returns the value associated with the given key, or null if
1552 * no mapping of the desired type exists for the given key or a null
1553 * value is explicitly associated with the key.
1555 * @param key a String, or null
1558 public String[] getStringArray(String key) {
1560 Object o = mMap.get(key);
1567 typeWarning(key, o, "String[]", e);
1573 * Returns the value associated with the given key, or null if
1574 * no mapping of the desired type exists for the given key or a null
1575 * value is explicitly associated with the key.
1577 * @param key a String, or null
1580 public CharSequence[] getCharSequenceArray(String key) {
1582 Object o = mMap.get(key);
1589 typeWarning(key, o, "CharSequence[]", e);
1595 * Returns the value associated with the given key, or null if
1596 * no mapping of the desired type exists for the given key or a null
1597 * value is explicitly associated with the key.
1599 * @param key a String, or null
1602 public IBinder getBinder(String key) {
1604 Object o = mMap.get(key);
1611 typeWarning(key, o, "IBinder", e);
1617 * Returns the value associated with the given key, or null if
1618 * no mapping of the desired type exists for the given key or a null
1619 * value is explicitly associated with the key.
1621 * @param key a String, or null
1628 public IBinder getIBinder(String key) {
1630 Object o = mMap.get(key);
1637 typeWarning(key, o, "IBinder", e);