Class IdentifierSerializer
- java.lang.Object
-
- org.palladiosimulator.edp2.repository.local.dao.internal.backgroundlist.serializer.IdentifierSerializer
-
- All Implemented Interfaces:
Serializer<org.palladiosimulator.metricspec.Identifier>
public class IdentifierSerializer extends Object implements Serializer<org.palladiosimulator.metricspec.Identifier>
-
-
Constructor Summary
Constructors Constructor Description IdentifierSerializer(org.palladiosimulator.metricspec.TextualBaseMetricDescription metricDescription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.palladiosimulator.metricspec.Identifier[]
deserialise(byte[] bytes)
Convert a serialised form into an array of elements of the serialiser's typelong
getElementLength()
byte[]
serialise(Object[] objects, int count)
Convert the given array of elements into their serialised form.
-
-
-
Method Detail
-
getElementLength
public long getElementLength()
- Specified by:
getElementLength
in interfaceSerializer<org.palladiosimulator.metricspec.Identifier>
- Returns:
- The size of each element in serialised form, e.g., for doubles it could be 8 bytes (IEEE format). The result is not allowed to change at runtime
-
serialise
public byte[] serialise(Object[] objects, int count)
Description copied from interface:Serializer
Convert the given array of elements into their serialised form. Attention: Due to a flaw in Java Generics, this signature cannot be serialise(T[] objects, int count) as this leads to a class cast exception despite the fact that you pass the right array. We kept the Type parameter to get at least a type save deserialise.- Specified by:
serialise
in interfaceSerializer<org.palladiosimulator.metricspec.Identifier>
- Parameters:
objects
- The array of elements to serialisecount
- The number of elements to serialise- Returns:
- The elements in their serialised form
-
deserialise
public org.palladiosimulator.metricspec.Identifier[] deserialise(byte[] bytes)
Description copied from interface:Serializer
Convert a serialised form into an array of elements of the serialiser's type- Specified by:
deserialise
in interfaceSerializer<org.palladiosimulator.metricspec.Identifier>
- Parameters:
bytes
- The byte array to deserialise- Returns:
- An array of elements deserialised from the given byte array
-
-