Class MemoryRepositoryData

    • Constructor Detail

      • MemoryRepositoryData

        public MemoryRepositoryData​(String name)
        Creates a memory repository data with the given name
        Parameters:
        name - the name of the current data
      • MemoryRepositoryData

        public MemoryRepositoryData​(String name,
                                    String defaultPrefix)
        Creates a memory repository data with the given name
        Parameters:
        name - the name of the current data
        defaultPrefix - prefix to use for properties and child nodes
    • Method Detail

      • getString

        public String getString​(String name,
                                String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the string data stored in the repository with the given name
        Specified by:
        getString in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getStrings

        public String[] getStrings​(String name,
                                   String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple string data stored in the repository with the given name
        Specified by:
        getStrings in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as a string array
      • getDate

        public Calendar getDate​(String name,
                                String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the date data stored as calendar in the repository with the given name
        Specified by:
        getDate in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getDates

        public Calendar[] getDates​(String name,
                                   String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple date data as calendar stored in the repository with the given name
        Specified by:
        getDates in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as a date array
      • getLong

        public Long getLong​(String name,
                            String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the long data stored in the repository with the given name
        Specified by:
        getLong in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getLongs

        public Long[] getLongs​(String name,
                               String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple long data stored in the repository with the given name
        Specified by:
        getLongs in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as a long array
      • getDouble

        public Double getDouble​(String name,
                                String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the double data stored in the repository with the given name
        Specified by:
        getDouble in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getDoubles

        public Double[] getDoubles​(String name,
                                   String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple double data stored in the repository with the given name
        Specified by:
        getDoubles in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as a double array
      • getBoolean

        public Boolean getBoolean​(String name,
                                  String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the boolean data stored in the repository with the given name
        Specified by:
        getBoolean in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getBooleans

        public Boolean[] getBooleans​(String name,
                                     String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple boolean data stored in the repository with the given name
        Specified by:
        getBooleans in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as a boolean array
      • getDataNames

        public Set<StringgetDataNames​(String prefix)
        Description copied from interface: RepositoryData
        Retrieves the names of data in this repository data with the given prefix
        Specified by:
        getDataNames in interface RepositoryData
        Parameters:
        prefix - prefix of the data names to retrieve. If null, retrieves all the data names of this repository data
        Returns:
        the names of data by this repository data
      • getName

        public String getName()
        Description copied from interface: RepositoryData
        Retrieves the name of the current repository data, excluding its prefix
        Specified by:
        getName in interface RepositoryData
        Returns:
        the name of the current repository data
      • hasValue

        public boolean hasValue​(String name,
                                String prefix)
        Description copied from interface: RepositoryData
        Checks if there is a value for the data stored in the repository with the given name
        Specified by:
        hasValue in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        true if there is value for the data, false otherwise
      • getType

        public String getType​(String name,
                              String prefix)
                       throws UnknownDataException
        Description copied from interface: RepositoryData
        Retrieves the type of the value for the data stored in the repository with the given name
        Specified by:
        getType in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value's type of the data
        Throws:
        UnknownDataException - if there is no data stored with the given name
      • isMultiple

        public boolean isMultiple​(String name,
                                  String prefix)
                           throws UnknownDataException
        Description copied from interface: RepositoryData
        Checks if the value for the data stored in the repository with the given name is multiple
        Specified by:
        isMultiple in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        true if the value for the data is multiple, false otherwise
        Throws:
        UnknownDataException - if there is no data stored with the given name
      • setValue

        public void setValue​(String name,
                             String value,
                             String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the value of the string data stored in the repository with the given name
        Specified by:
        setValue in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        value - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValues

        public void setValues​(String name,
                              String[] values,
                              String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the values of the multiple string data stored in the repository with the given name
        Specified by:
        setValues in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        values - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValues

        public void setValues​(String name,
                              Calendar[] values,
                              String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the values of the multiple date data stored in the repository with the given name
        Specified by:
        setValues in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        values - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValue

        public void setValue​(String name,
                             Long value,
                             String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the value of the long data stored in the repository with the given name
        Specified by:
        setValue in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        value - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValues

        public void setValues​(String name,
                              Long[] values,
                              String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the values of the multiple long data stored in the repository with the given name
        Specified by:
        setValues in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        values - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValue

        public void setValue​(String name,
                             Double value,
                             String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the value of the double data stored in the repository with the given name
        Specified by:
        setValue in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        value - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValues

        public void setValues​(String name,
                              Double[] values,
                              String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the values of the multiple double data stored in the repository with the given name
        Specified by:
        setValues in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        values - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValue

        public void setValue​(String name,
                             Boolean value,
                             String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the value of the boolean data stored in the repository with the given name
        Specified by:
        setValue in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        value - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • setValues

        public void setValues​(String name,
                              Boolean[] values,
                              String prefix)
        Description copied from interface: ModifiableRepositoryData
        Sets the values of the multiple boolean data stored in the repository with the given name
        Specified by:
        setValues in interface ModifiableRepositoryData
        Parameters:
        name - name of the data
        values - the value to set
        prefix - prefix of the data name, to use instead of the default one.
      • getStream

        public InputStream getStream​(String name,
                                     String prefix)
        Description copied from interface: RepositoryData
        Retrieves the value of the stream data stored in the repository with the given name
        Specified by:
        getStream in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the value of the data
      • getStreamLength

        public Long getStreamLength​(String name,
                                    String prefix)
        Description copied from interface: RepositoryData
        Retrieves the length of the value of the stream data stored in the repository with the given name
        Specified by:
        getStreamLength in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the length of the value of the data
      • getStreams

        public InputStream[] getStreams​(String name,
                                        String prefix)
        Description copied from interface: RepositoryData
        Retrieves the values of the multiple stream data stored in the repository with the given name
        Specified by:
        getStreams in interface RepositoryData
        Parameters:
        name - name of the data
        prefix - prefix of the data name, to use instead of the default one.
        Returns:
        the values of the data as an input stream array