public class ContentValues
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
Constructor and Description |
---|
ContentValues()
Creates an empty set of values using the default initial size
|
ContentValues(ContentValues from)
Creates a set of values copied from the given set
|
ContentValues(int size)
Creates an empty set of values using the given initial size
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all values.
|
boolean |
containsKey(java.lang.String key)
Returns true if this object has the named value.
|
int |
describeContents() |
boolean |
equals(java.lang.Object object) |
java.lang.Object |
get(java.lang.String key)
Gets a value.
|
java.lang.Boolean |
getAsBoolean(java.lang.String key)
Gets a value and converts it to a Boolean.
|
java.lang.Byte |
getAsByte(java.lang.String key)
Gets a value and converts it to a Byte.
|
byte[] |
getAsByteArray(java.lang.String key)
Gets a value that is a byte array.
|
java.lang.Double |
getAsDouble(java.lang.String key)
Gets a value and converts it to a Double.
|
java.lang.Float |
getAsFloat(java.lang.String key)
Gets a value and converts it to a Float.
|
java.lang.Integer |
getAsInteger(java.lang.String key)
Gets a value and converts it to an Integer.
|
java.lang.Long |
getAsLong(java.lang.String key)
Gets a value and converts it to a Long.
|
java.lang.Short |
getAsShort(java.lang.String key)
Gets a value and converts it to a Short.
|
java.lang.String |
getAsString(java.lang.String key)
Gets a value and converts it to a String.
|
int |
hashCode() |
java.util.Set<java.lang.String> |
keySet()
Returns a set of all of the keys
|
ContentValues |
put(java.lang.String key,
java.lang.Boolean value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Byte value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
byte[] value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Double value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Float value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Integer value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Long value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.Short value)
Adds a value to the set.
|
ContentValues |
put(java.lang.String key,
java.lang.String value)
Adds a value to the set.
|
ContentValues |
putAll(ContentValues other)
Adds all values from the passed in ContentValues.
|
ContentValues |
putNull(java.lang.String key)
Adds a null value to the set.
|
void |
remove(java.lang.String key)
Remove a single value.
|
int |
size()
Returns the number of values.
|
java.lang.String |
toString()
Returns a string containing a concise, human-readable description of this object.
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
valueSet()
Returns a set of all of the keys and values
|
public static final java.lang.String TAG
public ContentValues()
public ContentValues(int size)
size
- the initial size of the set of valuespublic ContentValues(ContentValues from)
from
- the values to copypublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ContentValues put(java.lang.String key, java.lang.String value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues putAll(ContentValues other)
other
- the ContentValues from which to copypublic ContentValues put(java.lang.String key, java.lang.Byte value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Short value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Integer value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Long value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Float value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Double value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, java.lang.Boolean value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues put(java.lang.String key, byte[] value)
key
- the name of the value to forceInsertvalue
- the data for the value to forceInsertpublic ContentValues putNull(java.lang.String key)
key
- the name of the value to make nullpublic int size()
public void remove(java.lang.String key)
key
- the name of the value to removepublic void clear()
public boolean containsKey(java.lang.String key)
key
- the value to check fortrue
if the value is present, false
otherwisepublic java.lang.Object get(java.lang.String key)
String
, Boolean
, and
Number
implementations.key
- the value to getpublic java.lang.String getAsString(java.lang.String key)
key
- the value to getpublic java.lang.Long getAsLong(java.lang.String key)
key
- the value to getpublic java.lang.Integer getAsInteger(java.lang.String key)
key
- the value to getpublic java.lang.Short getAsShort(java.lang.String key)
key
- the value to getpublic java.lang.Byte getAsByte(java.lang.String key)
key
- the value to getpublic java.lang.Double getAsDouble(java.lang.String key)
key
- the value to getpublic java.lang.Float getAsFloat(java.lang.String key)
key
- the value to getpublic java.lang.Boolean getAsBoolean(java.lang.String key)
key
- the value to getpublic byte[] getAsByteArray(java.lang.String key)
key
- the value to getpublic java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> valueSet()
public java.util.Set<java.lang.String> keySet()
public int describeContents()
public java.lang.String toString()
toString
in class java.lang.Object