X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fserialization%2Fimpl%2FReferableRecordSerializer.java;h=864459aa315cffa481af288e745b916e108a1a65;hb=refs%2Fchanges%2F30%2F3130%2F1;hp=c379994a4338f1da045d3e633db4727e495e262e;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/impl/ReferableRecordSerializer.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/impl/ReferableRecordSerializer.java
index c379994a4..864459aa3 100644
--- a/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/impl/ReferableRecordSerializer.java
+++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/impl/ReferableRecordSerializer.java
@@ -1,164 +1,164 @@
-package org.simantics.databoard.serialization.impl;
-
-import gnu.trove.map.hash.TObjectIntHashMap;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.List;
-
-import org.simantics.databoard.binding.RecordBinding;
-import org.simantics.databoard.binding.error.BindingException;
-import org.simantics.databoard.serialization.SerializationException;
-import org.simantics.databoard.serialization.Serializer;
-import org.simantics.databoard.serialization.Serializer.RecursiveSerializer;
-import org.simantics.databoard.type.RecordType;
-
-public class ReferableRecordSerializer extends RecursiveSerializer {
-
- RecordBinding binding;
- public Serializer[] componentSerializers;
-
- /** The combined size elements, or null
*/
- Integer fixedSizeOfContent;
- int minContentSize;
-
- public ReferableRecordSerializer(RecordBinding binding, Serializer[] componentSerializers) {
- this.binding = binding;
- this.componentSerializers = componentSerializers;
- }
-
- @Override
- public void finalizeConstruction() {
- fixedSizeOfContent = null;
- for (Serializer componentSerializer : componentSerializers) {
- minContentSize += componentSerializer.getMinSize();
- Integer componentFixedSize = componentSerializer.getConstantSize();
- if (componentFixedSize==null) {
- fixedSizeOfContent = null;
- break;
- }
- fixedSizeOfContent = fixedSizeOfContent==null ? componentFixedSize : fixedSizeOfContent + componentFixedSize;
- }
- }
-
- boolean referable() {
- return ((RecordType)binding.type()).isReferable();
- }
-
- @Override
- public Object deserialize(DataInput in, List