Sequenceablepublic class ValuesBucket extends Object implements Sequenceable
Values in buckets are stored in key-value pairs.
SystemCapability.Data#DATA_APPDATAMGRSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
ValuesBucket() |
A no-argument constructor used to create an empty
ValuesBucket instance with the default initial size. |
ValuesBucket(int size) |
A constructor used to create an empty
ValuesBucket instance with a given initial size. |
ValuesBucket(ValuesBucket values) |
A constructor used to create a
ValuesBucket instance by copying values from an existing one. |
ValuesBucket(Parcel in) |
A constructor used to create a
ValuesBucket instance by copying values from a
Parcel object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
clear() |
Clears all values in the current
ValuesBucket. |
void |
delete(String columnName) |
Deletes the value of a specified column name from the current
ValuesBucket. |
boolean |
equals(Object object) |
Indicates whether some other object is "equal to" this one.
|
Set<Map.Entry<String,Object>> |
getAll() |
Obtains a
Set containing all columns and their values stored in the current ValuesBucket. |
Boolean |
getBoolean(String columnName) |
Obtains the
Boolean value of a specified column name. |
Byte |
getByte(String columnName) |
Obtains the byte value of a specified column name.
|
byte[] |
getByteArray(String columnName) |
Obtains the byte array value of a specified column name.
|
Set<String> |
getColumnSet() |
Obtains a
Set containing all columns stored in the current ValuesBucket. |
Double |
getDouble(String columnName) |
Obtains the
Double value of a specified column name. |
Float |
getFloat(String columnName) |
Obtains the
Float value of a specified column name. |
Integer |
getInteger(String columnName) |
Obtains the
Integer value of a specified column name. |
Long |
getLong(String columnName) |
Obtains the
Long value of a specified column name. |
Object |
getObject(String columnName) |
Obtains the
Object value of a specified column name. |
Short |
getShort(String columnName) |
Obtains the
Short value of a specified column name. |
String |
getString(String columnName) |
Obtains the
String value of a specified column name. |
boolean |
hasColumn(String columnName) |
Checks whether the current
ValuesBucket contains the value of a specified column name. |
int |
hashCode() |
Returns a hash code value for the object.
|
boolean |
isEmpty() |
Checks whether the current
ValuesBucket is empty. |
boolean |
marshalling(Parcel out) |
Write ValuesBucket object to Parcel.
|
void |
putBoolean(String columnName,
Boolean value) |
Puts a
Boolean value into the current ValuesBucket and associates it with a given column name. |
void |
putByte(String columnName,
Byte value) |
Puts a byte value into the current
ValuesBucket and associates it with a given column name. |
void |
putByteArray(String columnName,
byte[] value) |
Puts a byte array value into the current
ValuesBucket and associates it with a given column name. |
void |
putDouble(String columnName,
Double value) |
Puts a
Double value into the current ValuesBucket and associates it with a given column name. |
void |
putFloat(String columnName,
Float value) |
Puts a
Float value into the current ValuesBucket and associates it with a given column name. |
void |
putInteger(String columnName,
Integer value) |
Puts an
Integer value into the current ValuesBucket and associates it with a given column name. |
void |
putLong(String columnName,
Long value) |
Puts a
Long value into the current ValuesBucket and associates it with a given column name. |
void |
putNull(String columnName) |
Puts a
null value into the current ValuesBucket and associates it with a given column name. |
void |
putShort(String columnName,
Short value) |
Puts a
Short value into the current ValuesBucket and associates it with a given column name. |
void |
putString(String columnName,
String value) |
Puts a
String value into the current ValuesBucket and associates it with a given column name. |
void |
putValues(ValuesBucket other) |
Puts values of a designated
ValuesBucket into the current ValuesBucket. |
int |
size() |
Obtains the number of values stored in the current
ValuesBucket. |
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Reads ValuesBucket objects from Parcel.
|
hasFileDescriptorpublic ValuesBucket()
ValuesBucket instance with the default initial size.public ValuesBucket(int size)
ValuesBucket instance with a given initial size.size - Indicates the initial size of the ValuesBucket instance.public ValuesBucket(ValuesBucket values)
ValuesBucket instance by copying values from an existing one.values - Indicates the existing ValuesBucket object.public void putString(String columnName, String value)
String value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the String value.value - Indicates the String value.public void putValues(ValuesBucket other)
ValuesBucket into the current ValuesBucket.
If any specified columns already exist in the current ValuesBucket, their values will be replaced by
those of the columns in the designated ValuesBucket.
other - Indicates the designated ValuesBucket.public void putByte(String columnName, Byte value)
ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the byte value.value - Indicates the byte value.public void putShort(String columnName, Short value)
Short value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Short value.value - Indicates the Short value.public void putInteger(String columnName, Integer value)
Integer value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Integer value.value - Indicates the Integer value.public void putLong(String columnName, Long value)
Long value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Long value.value - Indicates the Long value.public void putFloat(String columnName, Float value)
Float value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Float value.value - Indicates the Float value.public void putDouble(String columnName, Double value)
Double value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Double value.value - Indicates the Double value.public void putBoolean(String columnName, Boolean value)
Boolean value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the Boolean value.value - Indicates the Boolean value.public void putByteArray(String columnName, byte[] value)
ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by the given value.
columnName - Indicates the column name of the byte array value.value - Indicates the byte array value.public void putNull(String columnName)
null value into the current ValuesBucket and associates it with a given column name.
If the given column name already exists in the ValuesBucket,
its value will be replaced by null.
columnName - Indicates the column name of the null value.public int size()
ValuesBucket.ValuesBucket.public boolean isEmpty()
ValuesBucket is empty.true if the ValuesBucket does not contain any value; returns false
otherwise.public void delete(String columnName)
ValuesBucket.
If the ValuesBucket does not contain the given column name,
this method will not perform any operation.
columnName - Indicates the column name of the value to delete.public void clear()
ValuesBucket.
The current ValuesBucket will be empty after this method is called.
public boolean hasColumn(String columnName)
ValuesBucket contains the value of a specified column name.columnName - Indicates the column name of the value.true if the value of the given column name exists; returns false otherwise.public Object getObject(String columnName)
Object value of a specified column name.columnName - Indicates the column name of the Object value.Object value of the given column name if any; returns null otherwise.public String getString(String columnName)
String value of a specified column name.columnName - Indicates the column name of the String value.String value of the given column name if any; returns null otherwise.public Long getLong(String columnName)
Long value of a specified column name.columnName - Indicates the column name of the Long value.Long value of the given column name if any; returns null otherwise.public Integer getInteger(String columnName)
Integer value of a specified column name.columnName - Indicates the column name of the Integer value.Integer value of the given column name if any; returns null otherwise.public Short getShort(String columnName)
Short value of a specified column name.columnName - Indicates the column name of the Short value.Short value of the given column name if any; returns null otherwise.public Byte getByte(String columnName)
columnName - Indicates the column name of the byte value.null otherwise.public Double getDouble(String columnName)
Double value of a specified column name.columnName - Indicates the column name of the Double value.Double value of the given column name if any; returns null otherwise.public Float getFloat(String columnName)
Float value of a specified column name.columnName - Indicates the column name of the Float value.Float value of the given column name if any; returns null otherwise.public Boolean getBoolean(String columnName)
Boolean value of a specified column name.columnName - Indicates the column name of the Boolean value.Boolean value of the given column name if any; returns null otherwise.public byte[] getByteArray(String columnName)
columnName - Indicates the column name of the byte array value.null otherwise.public Set<Map.Entry<String,Object>> getAll()
Set containing all columns and their values stored in the current ValuesBucket.Set containing all columns and their values stored in the current ValuesBucket.public Set<String> getColumnSet()
Set containing all columns stored in the current ValuesBucket.Set containing all columns stored in the current ValuesBucket.public boolean equals(Object object)
Object
The equals method implements an equivalence relation
on non-null object references:
x, x.equals(x) should return
true.
x and y, x.equals(y)
should return true if and only if
y.equals(x) returns true.
x, y, and z, if
x.equals(y) returns true and
y.equals(z) returns true, then
x.equals(z) should return true.
x and y, multiple invocations of
x.equals(y) consistently return true
or consistently return false, provided no
information used in equals comparisons on the
objects is modified.
x,
x.equals(null) should return false.
The equals method for class Object implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x and
y, this method returns true if and only
if x and y refer to the same object
(x == y has the value true).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode method, which states
that equal objects must have equal hash codes.
equals 在类中 Objectobject - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.Object.hashCode(),
HashMappublic int hashCode()
ObjectHashMap.
The general contract of hashCode is:
hashCode method
must consistently return the same integer, provided no information
used in equals comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public boolean marshalling(Parcel out)
marshalling 在接口中 Sequenceableout - Indicates the target Parcel.public boolean unmarshalling(Parcel in)
unmarshalling 在接口中 Sequenceablein - Indicates the target Parcel.