android.content
public
final
class
android.content.ContentValues
This class is used to store a set of values that the ContentResolver
can process.
Summary
Constants
Public Constructors
Public Methods
|
|
|
|
|
void |
clear() |
|
|
|
|
|
boolean |
containsKey(String key) |
|
|
|
|
|
int |
describeContents() |
|
|
|
|
|
boolean |
equals(Object object) |
|
|
|
|
|
Object |
get(String key) |
|
|
|
|
|
Boolean |
getAsBoolean(String key) |
|
|
|
|
|
Byte |
getAsByte(String key) |
|
|
|
|
|
byte[] |
getAsByteArray(String key) |
|
|
|
|
|
Double |
getAsDouble(String key) |
|
|
|
|
|
Float |
getAsFloat(String key) |
|
|
|
|
|
Integer |
getAsInteger(String key) |
|
|
|
|
|
Long |
getAsLong(String key) |
|
|
|
|
|
Short |
getAsShort(String key) |
|
|
|
|
|
String |
getAsString(String key) |
|
|
|
|
|
int |
hashCode() |
|
|
|
|
|
void |
put(String key, Integer value) |
|
|
|
|
|
void |
put(String key, Short value) |
|
|
|
|
|
void |
put(String key, byte[] value) |
|
|
|
|
|
void |
put(String key, Byte value) |
|
|
|
|
|
void |
put(String key, String value) |
|
|
|
|
|
void |
put(String key, Long value) |
|
|
|
|
|
void |
put(String key, Boolean value) |
|
|
|
|
|
void |
put(String key, Float value) |
|
|
|
|
|
void |
put(String key, Double value) |
|
|
|
|
|
void |
putAll(ContentValues other) |
|
|
|
|
|
void |
putNull(String key) |
|
|
|
|
|
void |
remove(String key) |
|
|
|
|
|
int |
size() |
|
|
|
|
|
String |
toString() |
|
|
|
|
|
Set<Entry<String, Object>> |
valueSet() |
|
|
|
|
|
void |
writeToParcel(Parcel parcel, int flags) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
String
TAG
Constant Value:
"ContentValues"
Public Constructors
public
ContentValues()
Creates an empty set of values using the default initial size
public
ContentValues(int size)
Creates an empty set of values using the given initial size
Parameters
size
| the initial size of the set of values
|
public
ContentValues(ContentValues from)
Creates a set of values copied from the given set
Public Methods
public
void
clear()
Removes all values.
public
boolean
containsKey(String key)
Returns true if this object has the named value.
Parameters
key
| the value to check for |
Returns
true
if the value is present, false
otherwise
public
int
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
public
boolean
equals(Object object)
Compares the argument to the receiver, and returns true if they represent
the
same object using a class specific comparison. The
implementation in Object returns true only if the argument is the exact
same object as the receiver (==).
Parameters
object
| Object the object to compare with this object. |
Returns
- boolean
true
if the object is the same as this
object false
if it is different from this object.
Gets a value and converts it to a Boolean.
Returns
- the Boolean value, or null if the value is missing or cannot be converted
public
Byte
getAsByte(String key)
Gets a value and converts it to a Byte.
Returns
- the Byte value, or null if the value is missing or cannot be converted
public
byte[]
getAsByteArray(String key)
Gets a value that is a byte array. Note that this method will not convert
any other types to byte arrays.
Returns
- the byte[] value, or null is the value is missing or not a byte[]
public
Double
getAsDouble(String key)
Gets a value and converts it to a Double.
Returns
- the Double value, or null if the value is missing or cannot be converted
public
Float
getAsFloat(String key)
Gets a value and converts it to a Float.
Returns
- the Float value, or null if the value is missing or cannot be converted
Gets a value and converts it to an Integer.
Returns
- the Integer value, or null if the value is missing or cannot be converted
public
Long
getAsLong(String key)
Gets a value and converts it to a Long.
Returns
- the Long value, or null if the value is missing or cannot be converted
public
Short
getAsShort(String key)
Gets a value and converts it to a Short.
Returns
- the Short value, or null if the value is missing or cannot be converted
public
String
getAsString(String key)
Gets a value and converts it to a String.
public
int
hashCode()
Returns an integer hash code for the receiver. Any two objects which
answer
true
when passed to
.equals
must
answer the same value for this method.
public
void
put(String key, Integer value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Short value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, byte[] value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Byte value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, String value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Long value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Boolean value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Float value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
public
void
put(String key, Double value)
Adds a value to the set.
Parameters
key
| the name of the value to put |
value
| the data for the value to put
|
Adds all values from the passed in ContentValues.
Parameters
other
| the ContentValues from which to copy
|
public
void
putNull(String key)
Adds a null value to the set.
Parameters
key
| the name of the value to make null
|
public
void
remove(String key)
Remove a single value.
Parameters
key
| the name of the value to remove
|
public
int
size()
Returns the number of values.
public
String
toString()
Returns a string containing a concise, human-readable description of the
receiver.
Returns
- String a printable representation for the receiver.
Returns a set of all of the keys and values
Returns
- a set of all of the keys and values
public
void
writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel.