Package PamController
Class PamControlledUnitSettings
java.lang.Object
PamController.PamControlledUnitSettings
- All Implemented Interfaces:
Serializable
,ManagedParameters
- See Also:
-
Constructor Summary
ConstructorDescriptionPamControlledUnitSettings
(byte[] data) PamControlledUnitSettings
(String unitType, String unitName, String ownerClass, long versionNo, byte[] serialisedData) Make a settings object with byte[] data from a psfx file or read from the database.PamControlledUnitSettings
(String unitType, String unitName, String ownerClass, long versionNo, Object settings) Make a settings object with unpacked data. -
Method Summary
Modifier and TypeMethodDescriptionstatic PamControlledUnitSettings
createFromNamedByteArray
(byte[] byteArray) Used when unpacking data from psfx files.byte[]
Get a byte array of the serialised data but with a small header giving the unitType, unitName, versionNO and the size of the serialised data objectGet the class type of the module that owned these settings.Get a set of data that describes all of the parameters in a classbyte[]
Get a byte array of the serialised data in this object.long
boolean
Find out if a set of settings are compatible with another set.boolean
isSettingsOf
(String unitType, String unitName) Find out if this settings unit is that for the given type and namevoid
setSettings
(Object settings) void
setUnitName
(String unitName) toString()
static Object
unpackByteArray
(byte[] byteArray) Create an object from a serialised byte array
-
Constructor Details
-
PamControlledUnitSettings
public PamControlledUnitSettings(String unitType, String unitName, String ownerClass, long versionNo, Object settings) Make a settings object with unpacked data. This must still be used with old style psf files- Parameters:
unitType
-unitName
-ownerClass
-versionNo
-settings
-
-
PamControlledUnitSettings
public PamControlledUnitSettings(String unitType, String unitName, String ownerClass, long versionNo, byte[] serialisedData) Make a settings object with byte[] data from a psfx file or read from the database. These will only be deserialized at the moment they are needed.This is required by the new plugin system, whereby settings for plugins will be loaded from file before the java class for those settings has been loaded.
- Parameters:
unitType
-unitName
-ownerClass
-versionNo
-serialisedData
-
-
PamControlledUnitSettings
public PamControlledUnitSettings(byte[] data)
-
-
Method Details
-
getSettings
- Returns:
- The unit settings.
-
setSettings
- Parameters:
settings
- the settings to set
-
getUnitName
- Returns:
- The unit name
-
setUnitName
- Parameters:
unitName
- the unitName to set
-
getUnitType
- Returns:
- The unit type
-
getVersionNo
public long getVersionNo()- Returns:
- the version number for these unit settings.
-
isSettingsOf
Find out if this settings unit is that for the given type and name- Parameters:
unitType
- Unit TypeunitName
- Unit Name- Returns:
- true if these settings correspond to that unit.
-
isSame
Find out if a set of settings are compatible with another set.- Parameters:
p
- another set of PamControlledUnitSettings.- Returns:
- true if they have the same name type and version number
-
getSerialisedByteArray
public byte[] getSerialisedByteArray()Get a byte array of the serialised data in this object. Note that this is generally the entire object, not it's settings, though that may change in a future release.- Returns:
- a byte array of the serialised data in this object
-
getNamedSerialisedByteArray
public byte[] getNamedSerialisedByteArray()Get a byte array of the serialised data but with a small header giving the unitType, unitName, versionNO and the size of the serialised data object- Returns:
- byte array.
-
createFromNamedByteArray
Used when unpacking data from psfx files. These seem to have the type, name, etc encoded, then repeated in the serialised data which is the entire PamControlledUnitSettings object, which contains those same data again. This will fail if loading a plugin module which is not actually present- Parameters:
byteArray
-- Returns:
-
unpackByteArray
Create an object from a serialised byte array- Parameters:
byteArray
- byte array- Returns:
- new object (or null if invalid byte array)
-
getOwnerClassName
Get the class type of the module that owned these settings. Gets used when importing settings so that modules can be easily identified.- Returns:
- the ownerClass
-
getParameterSet
Description copied from interface:ManagedParameters
Get a set of data that describes all of the parameters in a class- Specified by:
getParameterSet
in interfaceManagedParameters
- Returns:
- description of the parameters in a class.
-
toString
-