public class MemoryRepositoryData extends Object implements ModifiableRepositoryData
Modifier and Type | Field and Description |
---|---|
private Map<String,Pair<String,Object>> |
_data |
private String |
_defaultPrefix |
private String |
_fullName |
DATA_NAME_PATTERN
BOOLEAN_REPOSITORY_DATA_TYPE, CALENDAR_REPOSITORY_DATA_TYPE, DOUBLE_REPOSITORY_DATA_TYPE, LONG_REPOSITORY_DATA_TYPE, STREAM_REPOSITORY_DATA_TYPE, STRING_REPOSITORY_DATA_TYPE
Constructor and Description |
---|
MemoryRepositoryData(String name)
Creates a memory repository data with the given name
|
MemoryRepositoryData(String name,
String defaultPrefix)
Creates a memory repository data with the given name
|
Modifier and Type | Method and Description |
---|---|
private void |
_checkDataName(String name) |
private String |
_getFullName(String name,
String prefix) |
private void |
_setValue(String name,
String dataTypeName,
Object value,
String prefix) |
ModifiableRepositoryData |
addRepositoryData(String name,
String dataTypeName,
String prefix)
Creates a repository data and stores it in the repository with the given name
|
Boolean |
getBoolean(String name,
String prefix)
Retrieves the value of the boolean data stored in the repository with the given name
|
Boolean[] |
getBooleans(String name,
String prefix)
Retrieves the values of the multiple boolean data stored in the repository with the given name
|
Set<String> |
getDataNames(String prefix)
Retrieves the names of data in this repository data with the given prefix
|
Calendar |
getDate(String name,
String prefix)
Retrieves the value of the date data stored as calendar in the repository with the given name
|
Calendar[] |
getDates(String name,
String prefix)
Retrieves the values of the multiple date data as calendar stored in the repository with the given name
|
String |
getDefaultPrefix()
Retrieves the default prefix
|
Double |
getDouble(String name,
String prefix)
Retrieves the value of the double data stored in the repository with the given name
|
Double[] |
getDoubles(String name,
String prefix)
Retrieves the values of the multiple double data stored in the repository with the given name
|
String |
getFullName()
Retrieves the full name of the current repository data, including its prefix
|
Long |
getLong(String name,
String prefix)
Retrieves the value of the long data stored in the repository with the given name
|
Long[] |
getLongs(String name,
String prefix)
Retrieves the values of the multiple long data stored in the repository with the given name
|
String |
getPath()
Retrieves the path of the repository data.
|
ModifiableRepositoryData |
getRepositoryData(String name,
String prefix)
Retrieves the value of the repository data stored in the repository with the given name
|
InputStream |
getStream(String name,
String prefix)
Retrieves the value of the stream data stored in the repository with the given name
|
Long |
getStreamLength(String name,
String prefix)
Retrieves the length of the value of the stream data stored in the repository with the given name
|
InputStream[] |
getStreams(String name,
String prefix)
Retrieves the values of the multiple stream data stored in the repository with the given name
|
String |
getString(String name,
String prefix)
Retrieves the value of the string data stored in the repository with the given name
|
String[] |
getStrings(String name,
String prefix)
Retrieves the values of the multiple string data stored in the repository with the given name
|
String |
getType(String name,
String prefix)
Retrieves the type of the value for the data stored in the repository with the given name
|
boolean |
hasValue(String name,
String prefix)
Checks if there is a value for the data stored in the repository with the given name
|
boolean |
isMultiple(String name,
String prefix)
Checks if the value for the data stored in the repository with the given name is multiple
|
void |
removeValue(String name,
String prefix)
Removes the value of the data stored in the repository with the given name
|
void |
rename(String newName,
String prefix)
Rename the current repository data
|
void |
setValue(String name,
Boolean value,
String prefix)
Sets the value of the boolean data stored in the repository with the given name
|
void |
setValue(String name,
Calendar value,
String prefix)
Sets the value of the date data stored in the repository with the given name
|
void |
setValue(String name,
Double value,
String prefix)
Sets the value of the double data stored in the repository with the given name
|
void |
setValue(String name,
InputStream value,
String prefix)
Sets the value of the input stream data stored in the repository with the given name
|
void |
setValue(String name,
Long value,
String prefix)
Sets the value of the long data stored in the repository with the given name
|
void |
setValue(String name,
String value,
String prefix)
Sets the value of the string data stored in the repository with the given name
|
void |
setValues(String name,
Boolean[] values,
String prefix)
Sets the values of the multiple boolean data stored in the repository with the given name
|
void |
setValues(String name,
Calendar[] values,
String prefix)
Sets the values of the multiple date data stored in the repository with the given name
|
void |
setValues(String name,
Double[] values,
String prefix)
Sets the values of the multiple double data stored in the repository with the given name
|
void |
setValues(String name,
InputStream[] values,
String prefix)
Sets the values of the multiple input stream data stored in the repository with the given name
|
void |
setValues(String name,
Long[] values,
String prefix)
Sets the values of the multiple long data stored in the repository with the given name
|
void |
setValues(String name,
String[] values,
String prefix)
Sets the values of the multiple string data stored in the repository with the given name
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addRepositoryData, getRepositoryData, removeValue, rename, setValue, setValue, setValue, setValue, setValue, setValue, setValues, setValues, setValues, setValues, setValues, setValues
getAllDataNames, getBoolean, getBooleans, getDataNames, getDate, getDates, getDouble, getDoubles, getLong, getLongs, getName, getStream, getStreamLength, getStreams, getString, getStrings, getType, hasValue, isMultiple
private String _defaultPrefix
public MemoryRepositoryData(String name)
name
- the name of the current datapublic MemoryRepositoryData(String name, String defaultPrefix)
name
- the name of the current datadefaultPrefix
- prefix to use for properties and child nodespublic String getString(String name, String prefix)
RepositoryData
getString
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public String[] getStrings(String name, String prefix)
RepositoryData
getStrings
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Calendar getDate(String name, String prefix)
RepositoryData
getDate
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Calendar[] getDates(String name, String prefix)
RepositoryData
getDates
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long getLong(String name, String prefix)
RepositoryData
getLong
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long[] getLongs(String name, String prefix)
RepositoryData
getLongs
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Double getDouble(String name, String prefix)
RepositoryData
getDouble
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Double[] getDoubles(String name, String prefix)
RepositoryData
getDoubles
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Boolean getBoolean(String name, String prefix)
RepositoryData
getBoolean
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Boolean[] getBooleans(String name, String prefix)
RepositoryData
getBooleans
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public ModifiableRepositoryData getRepositoryData(String name, String prefix)
RepositoryData
getRepositoryData
in interface ModifiableRepositoryData
getRepositoryData
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Set<String> getDataNames(String prefix)
RepositoryData
getDataNames
in interface RepositoryData
prefix
- prefix of the data names to retrieve. If null
, retrieves all the data names of this repository datapublic String getFullName()
RepositoryData
getFullName
in interface RepositoryData
public boolean hasValue(String name, String prefix)
RepositoryData
hasValue
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public String getType(String name, String prefix)
RepositoryData
getType
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public boolean isMultiple(String name, String prefix)
RepositoryData
isMultiple
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public String getDefaultPrefix()
RepositoryData
getDefaultPrefix
in interface RepositoryData
public ModifiableRepositoryData addRepositoryData(String name, String dataTypeName, String prefix)
ModifiableRepositoryData
addRepositoryData
in interface ModifiableRepositoryData
name
- name of the datadataTypeName
- data type name to use on creationprefix
- prefix of the data name, to use instead of the default one.public void rename(String newName, String prefix)
ModifiableRepositoryData
rename
in interface ModifiableRepositoryData
newName
- the new nameprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, String value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, String[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Calendar value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Calendar[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Long value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Long[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Double value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Double[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Boolean value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Boolean[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.private void _checkDataName(String name)
public void removeValue(String name, String prefix)
ModifiableRepositoryData
removeValue
in interface ModifiableRepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.private String _getFullName(String name, String prefix)
public InputStream getStream(String name, String prefix)
RepositoryData
getStream
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long getStreamLength(String name, String prefix)
RepositoryData
getStreamLength
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public InputStream[] getStreams(String name, String prefix)
RepositoryData
getStreams
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, InputStream value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, InputStream[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public String getPath()
RepositoryData
AmetysObject
parentgetPath
in interface RepositoryData