Reference:Android.content.ContentValues

From Triled Wiki

Jump to: navigation, search


android.content
public final class android.content.ContentValues

java.lang.Object
android.content.ContentValues Parcelable

This class is used to store a set of values that the ContentResolver can process.

[edit] Summary

[edit] Constants

      Value  
Creator   CREATOR        
String   TAG     "ContentValues" 

[edit] Public Constructors

          ContentValues ()
Creates an empty set of values using the default initial size
          ContentValues (int size)
Creates an empty set of values using the given initial size
          ContentValues (ContentValues from)
Creates a set of values copied from the given set

[edit] Public Methods

        void  clear ()
Removes all values.
        boolean  containsKey (String key)
Returns true if this object has the named value.
        boolean  equals (Object object)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
        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.
        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.
        int  hashCode ()
Answers an integer hash code for the receiver.
        void  put (String key, Integer value)
Adds a value to the set.
        void  put (String key, Short value)
Adds a value to the set.
        void  put (String key, Byte value)
Adds a value to the set.
        void  put (String key, String value)
Adds a value to the set.
        void  put (String key, Long value)
Adds a value to the set.
        void  put (String key, Boolean value)
Adds a value to the set.
        void  put (String key, Float value)
Adds a value to the set.
        void  put (String key, Double value)
Adds a value to the set.
        void  remove (String key)
Remove a single value.
        int  size ()
Returns the number of values.
        String   toString ()
Answers a string containing a concise, human-readable description of the receiver.
        Set   valueSet ()
Returns a set of all of the keys and values
        void  writeToParcel (Parcel parcel)

[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
[edit] Methods inherited from interface android.os.Parcelable

writeToParcel

[edit] Details

[edit] Constants

[edit] public static final Creator CREATOR

[edit] public static final String TAG

Constant Value: "ContentValues"

[edit] Public Constructors

[edit] public ContentValues()

Creates an empty set of values using the default initial size

[edit] 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

[edit] public ContentValues(ContentValues from)

Creates a set of values copied from the given set

Parameters

from the values to copy

[edit] Public Methods

[edit] public void clear()

Removes all values.

[edit] 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

[edit] public boolean equals(Object object)

Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).

Parameters

object Object the object to compare with this object.

[edit] public Object get(String key)

Gets a value. Valid value types are String, Boolean, and Number implementations.

Parameters

key the value to get

Returns

  • the data for the value

[edit] public Boolean getAsBoolean(String key)

Gets a value and converts it to a Boolean.

Parameters

key the value to get

Returns

  • the Boolean value, or null if the value is missing or cannot be converted

[edit] public Byte getAsByte(String key)

Gets a value and converts it to a Byte.

Parameters

key the value to get

Returns

  • the Byte value, or null if the value is missing or cannot be converted

[edit] public Double getAsDouble(String key)

Gets a value and converts it to a Double.

Parameters

key the value to get

Returns

  • the Double value, or null if the value is missing or cannot be converted

[edit] public Float getAsFloat(String key)

Gets a value and converts it to a Float.

Parameters

key the value to get

Returns

  • the Float value, or null if the value is missing or cannot be converted

[edit] public Integer getAsInteger(String key)

Gets a value and converts it to an Integer.

Parameters

key the value to get

Returns

  • the Integer value, or null if the value is missing or cannot be converted

[edit] public Long getAsLong(String key)

Gets a value and converts it to a Long.

Parameters

key the value to get

Returns

  • the Long value, or null if the value is missing or cannot be converted

[edit] public Short getAsShort(String key)

Gets a value and converts it to a Short.

Parameters

key the value to get

Returns

  • the Short value, or null if the value is missing or cannot be converted

[edit] public String getAsString(String key)

Gets a value and converts it to a String.

Parameters

key the value to get

Returns

  • the String for the value

[edit] public int hashCode()

Answers 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.

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] public void remove(String key)

Remove a single value.

Parameters

key the name of the value to remove

[edit] public int size()

Returns the number of values.

Returns

  • the number of values

[edit] public String toString()

Answers a string containing a concise, human-readable description of the receiver.

[edit] public Set valueSet()

Returns a set of all of the keys and values

Returns

  • a set of all of the keys and values

[edit] public void writeToParcel(Parcel parcel)

[edit] References

Personal tools