public static class Rows.Row
extends java.lang.Object
implements java.util.Map<java.lang.String,java.lang.Object>
It is not possible to implement both List and Map but that is the practical purpose of this class.
| Constructor and Description |
|---|
Row() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object value)
Adds
value as the last column |
java.util.List<java.lang.Object> |
asList() |
void |
clear()
Sets all values to null, but does not modify RowKeys or change the length of
values. |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
java.lang.Object |
get(int index) |
java.lang.Object |
get(java.lang.Object keyOrIndex) |
java.lang.Object |
get(java.lang.String key)
Gets the value for the key/column.
|
boolean |
getBoolean(int index) |
boolean |
getBoolean(java.lang.String key) |
float |
getFloat(int index) |
float |
getFloat(java.lang.String key) |
int |
getInt(int index) |
int |
getInt(java.lang.String key) |
java.lang.String |
getKey(int index) |
long |
getLong(int index) |
long |
getLong(java.lang.String key) |
java.lang.String |
getString(int index) |
java.lang.String |
getString(java.lang.String key) |
int |
indexOf(java.lang.String key) |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Translates
key into a column index and inserts value at that index. |
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m) |
java.lang.Object |
remove(java.lang.Object key)
Sets the value for
keyOrIndex to null. |
void |
set(int index,
java.lang.Object value)
Sets the
indexth column to value |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<java.lang.Object> |
values() |
public java.lang.String getKey(int index)
index - the column key to getpublic java.lang.String getString(int index)
index - the column number to getindex stringified if it existspublic java.lang.String getString(java.lang.String key)
key - the column name to getkey stringified if it existspublic int getInt(int index)
index - the column number to getindex stringified and parsed as an int if it existspublic int getInt(java.lang.String key)
key - the column name to getkey stringified and parsed as an int if it existspublic long getLong(int index)
index - the column value to getindex stringified and parsed as a long if it existspublic long getLong(java.lang.String key)
key - the columnn name to getkey stringified and parsed as a long if it existspublic float getFloat(int index)
index - the column number to getindex stringified and parsed as a float if it existspublic float getFloat(java.lang.String key)
key - the column name to getkey stringified and parsed as a float if it existspublic boolean getBoolean(int index)
index - the column number to getindex stringified and parsed as a boolean if it existspublic boolean getBoolean(java.lang.String key)
key - the key of the value to getkey stringified and parsed as a boolean if it existspublic java.lang.String toString()
toString in class java.lang.Objectpublic int size()
size in interface java.util.Map<java.lang.String,java.lang.Object>public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.String,java.lang.Object>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.String,java.lang.Object>public int indexOf(java.lang.String key)
public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.String,java.lang.Object>public java.lang.Object get(java.lang.String key)
key - the column name to getkey if it exists, otherwise null.public java.lang.Object get(int index)
throws java.lang.ArrayIndexOutOfBoundsException
index - the column number to getindexjava.lang.ArrayIndexOutOfBoundsException - if index is >= values.length()public java.lang.Object get(java.lang.Object keyOrIndex)
get in interface java.util.Map<java.lang.String,java.lang.Object>keyOrIndex - the String key or an Integer index to retrievepublic void set(int index,
java.lang.Object value)
indexth column to valueindex - the column number to setvalue - the value to setpublic void add(java.lang.Object value)
value as the last columnvalue - the value to addpublic java.lang.Object put(java.lang.String key,
java.lang.Object value)
key into a column index and inserts value at that index.
If key does not exists, it is add to the shared RowKeys as the last column.
put in interface java.util.Map<java.lang.String,java.lang.Object>key - the column name to setvalue - the column value to setpublic java.lang.Object remove(java.lang.Object key)
keyOrIndex to null.
It does not actually remove the key from RowKeys or remove the Row list element because RowKeys is shared across all Row instances and the iteration order and number of keys/columns needs to be the same for all of them.
remove in interface java.util.Map<java.lang.String,java.lang.Object>key - the String key or an Integer index to remove.public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m)
putAll in interface java.util.Map<java.lang.String,java.lang.Object>public void clear()
values.clear in interface java.util.Map<java.lang.String,java.lang.Object>public java.util.Set<java.lang.String> keySet()
keySet in interface java.util.Map<java.lang.String,java.lang.Object>Rows.RowKeys.keySet()public java.util.Collection<java.lang.Object> values()
values in interface java.util.Map<java.lang.String,java.lang.Object>public java.util.List<java.lang.Object> asList()
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet in interface java.util.Map<java.lang.String,java.lang.Object>Copyright © 2021 Rocket Partners, LLC. All rights reserved.