public class DataBank extends Object implements Serializable
Only the following types are allowed to be stored: boolean, boolean[], int, int[], double, double[], String and String[].
Constructor and Description |
---|
DataBank() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String key)
Finds if an element exist inside the DataBank
|
boolean |
delete(String key)
Deletes a value associated to a single element key.
|
void |
deleteAll()
Deletes all content of this DataBank.
|
boolean |
getBoolean(String key)
Gets an stored boolean inside the DataBank.
|
boolean[] |
getBooleanArray(String key)
Gets an stored boolean array inside the DataBank.
|
double |
getDouble(String key)
Gets an stored double inside the DataBank.
|
double[] |
getDoubleArray(String key)
Gets an stored double array inside the DataBank.
|
int |
getInt(String key)
Gets an stored int inside the DataBank.
|
int[] |
getIntArray(String key)
Gets an stored int array inside the DataBank.
|
String |
getString(String key)
Gets an stored String inside the DataBank.
|
String[] |
getStringArray(String key)
Gets an stored String array inside the DataBank.
|
void |
setBoolean(String key,
boolean value)
Sets or stores a boolean inside the DataBank.
|
void |
setBooleanArray(String key,
boolean[] value)
Sets or stores a boolean array inside the DataBank.
|
void |
setDouble(String key,
double value)
Sets or stores a double inside the DataBank.
|
void |
setDoubleArray(String key,
double[] value)
Sets or stores a double array inside the DataBank.
|
void |
setInt(String key,
int value)
Sets or stores an int inside the DataBank.
|
void |
setIntArray(String key,
int[] value)
Sets or stores an int array inside the DataBank.
|
void |
setString(String key,
String value)
Sets or stores an String inside the DataBank.
|
void |
setStringArray(String key,
String[] value)
Sets or stores a double array inside the DataBank.
|
public void deleteAll()
public boolean delete(String key)
key
- Key where the data is storedpublic boolean contains(String key)
key
- Key to be searchedpublic void setBoolean(String key, boolean value)
key
- Key where the element will be stored.value
- boolean value to be stored.public void setBooleanArray(String key, boolean[] value)
key
- Key where the element will be stored.value
- boolean array to be stored.public void setInt(String key, int value)
key
- Key where the element will be stored.value
- int value to be stored.public void setIntArray(String key, int[] value)
key
- Key where the element will be stored.value
- int array to be stored.public void setDouble(String key, double value)
key
- Key where the element will be stored.value
- double value to be stored.public void setDoubleArray(String key, double[] value)
key
- Key where the element will be stored.value
- double array to be stored.public void setString(String key, String value)
key
- Key where the element will be stored.value
- String value to be stored.public void setStringArray(String key, String[] value)
key
- Key where the element will be stored.value
- String array to be stored.public boolean getBoolean(String key)
key
- Key where the element should be storedpublic boolean[] getBooleanArray(String key)
key
- Key where the element should be storedpublic int getInt(String key)
key
- Key where the element should be storedpublic int[] getIntArray(String key)
key
- Key where the element should be storedpublic double getDouble(String key)
key
- Key where the element should be storedpublic double[] getDoubleArray(String key)
key
- Key where the element should be storedpublic String getString(String key)
key
- Key where the element should be storedCopyright © 2020. All rights reserved.