|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.content.ContentValues
public final class ContentValues
This class is used to store a set of values that the ContentResolver
can process.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface android.os.Parcelable |
|---|
Parcelable.Creator<T> |
| Field Summary | |
|---|---|
static Parcelable.Creator<ContentValues> |
CREATOR
|
static String |
TAG
|
| Fields inherited from interface android.os.Parcelable |
|---|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all values. |
boolean |
containsKey(String key)
Returns true if this object has the named value. |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation. |
boolean |
equals(Object object)
Compares this instance with the specified object and indicates if they are equal. |
Object |
get(String key)
Gets a value. |
Boolean |
getAsBoolean(String key)
Gets a value and converts it to a Boolean. |
Byte |
getAsByte(String key)
Gets a value and converts it to a Byte. |
byte[] |
getAsByteArray(String key)
Gets a value that is a byte array. |
Double |
getAsDouble(String key)
Gets a value and converts it to a Double. |
Float |
getAsFloat(String key)
Gets a value and converts it to a Float. |
Integer |
getAsInteger(String key)
Gets a value and converts it to an Integer. |
Long |
getAsLong(String key)
Gets a value and converts it to a Long. |
Short |
getAsShort(String key)
Gets a value and converts it to a Short. |
String |
getAsString(String key)
Gets a value and converts it to a String. |
ArrayList<String> |
getStringArrayList(String key)
Deprecated. |
int |
hashCode()
Returns an integer hash code for this object. |
void |
put(String key,
Boolean value)
Adds a value to the set. |
void |
put(String key,
Byte value)
Adds a value to the set. |
void |
put(String key,
byte[] value)
Adds a value to the set. |
void |
put(String key,
Double value)
Adds a value to the set. |
void |
put(String key,
Float value)
Adds a value to the set. |
void |
put(String key,
Integer value)
Adds a value to the set. |
void |
put(String key,
Long value)
Adds a value to the set. |
void |
put(String key,
Short value)
Adds a value to the set. |
void |
put(String key,
String value)
Adds a value to the set. |
void |
putAll(ContentValues other)
Adds all values from the passed in ContentValues. |
void |
putNull(String key)
Adds a null value to the set. |
void |
putStringArrayList(String key,
ArrayList<String> value)
Deprecated. |
void |
remove(String key)
Remove a single value. |
int |
size()
Returns the number of values. |
String |
toString()
Returns a string containing a concise, human-readable description of this object. |
Set<Map.Entry<String,Object>> |
valueSet()
Returns a set of all of the keys and values |
void |
writeToParcel(Parcel parcel,
int flags)
Flatten this object in to a Parcel. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TAG
public static final Parcelable.Creator<ContentValues> CREATOR
| Constructor Detail |
|---|
public ContentValues()
public ContentValues(int size)
size - the initial size of the set of valuespublic ContentValues(ContentValues from)
from - the values to copy| Method Detail |
|---|
public boolean equals(Object object)
Objecto must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be both transitive and reflexive.
The implementation in Object returns true only if o is the exact same object as the receiver (using the == operator for
comparison). Subclasses often implement equals(Object) so that
it takes into account the two object's types and states.
The general contract for the equals(Object) and Object.hashCode() methods is that if equals returns true for
any two objects, then hashCode() must return the same value for
these objects. This means that subclasses of Object usually
override either both methods or none of them.
equals in class Objectobject - the object to compare this instance with.
true if the specified object is equal to this Object; false otherwise.Object.hashCode()public int hashCode()
Objectequals(Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
hashCode in class ObjectObject.equals(java.lang.Object)
public void put(String key,
String value)
key - the name of the value to putvalue - the data for the value to putpublic void putAll(ContentValues other)
other - the ContentValues from which to copy
public void put(String key,
Byte value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Short value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Integer value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Long value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Float value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Double value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
Boolean value)
key - the name of the value to putvalue - the data for the value to put
public void put(String key,
byte[] value)
key - the name of the value to putvalue - the data for the value to putpublic void putNull(String key)
key - the name of the value to make nullpublic int size()
public void remove(String key)
key - the name of the value to removepublic void clear()
public boolean containsKey(String key)
key - the value to check for
true if the value is present, false otherwisepublic Object get(String key)
String, Boolean, and
Number implementations.
key - the value to get
public String getAsString(String key)
key - the value to get
public Long getAsLong(String key)
key - the value to get
public Integer getAsInteger(String key)
key - the value to get
public Short getAsShort(String key)
key - the value to get
public Byte getAsByte(String key)
key - the value to get
public Double getAsDouble(String key)
key - the value to get
public Float getAsFloat(String key)
key - the value to get
public Boolean getAsBoolean(String key)
key - the value to get
public byte[] getAsByteArray(String key)
key - the value to get
public Set<Map.Entry<String,Object>> valueSet()
public int describeContents()
Parcelable
describeContents in interface Parcelable
public void writeToParcel(Parcel parcel,
int flags)
Parcelable
writeToParcel in interface Parcelableparcel - The Parcel in which the object should be written.flags - Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
@Deprecated
public void putStringArrayList(String key,
ArrayList<String> value)
@Deprecated public ArrayList<String> getStringArrayList(String key)
public String toString()
ObjectObject.hashCode(),
that is, it is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString in class Object
|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||