public StationFeatureCopyFactory(StationPointFeature proto) throws IOException { stationMap = new HashMap<>(); StructureData sdata = proto.getFeatureData(); sm = new StructureMembers(sdata.getStructureMembers()); sizeInBytes = OBJECT_SIZE + POINTER_SIZE + // PointFeatureCopy - 1 pointer 48 2 * 8 + 2 * POINTER_SIZE + // PointFeatureImpl - 2 doubles and 2 pointers 32 OBJECT_SIZE + 3 * 8 + // Earth Location - 3 doubles 64 OBJECT_SIZE + // StructureDataDeep 4 + POINTER_SIZE + // StructureDataA - 1 int and 1 pointer OBJECT_SIZE + 4 + 2 * POINTER_SIZE + // ArrayStructureBB - 1 int and 2 pointers (heap is optional) 2 * POINTER_SIZE + 4 + // ArrayStructure - 2 pointers and an int OBJECT_SIZE + 8 * 4 + 8 + POINTER_SIZE + // ByteBuffer - 8 ints, 1 long, 1 pointer sm.getStructureSize(); // LOOK vlens, Strings (Heap Size) }
public StationPointFeature deepCopy(StationPointFeature from) throws IOException { StationFeature s = from.getStation(); StationFeatureImpl sUse = stationMap.get(s.getName()); if (sUse == null) { sUse = new StationFeatureImpl(s); stationMap.put(s.getName(), sUse); } sUse.incrNobs(); StationPointFeatureCopy deep = new StationPointFeatureCopy(sUse, from); deep.data = StructureDataDeep.copy(from.getFeatureData(), sm); return deep; }
public StationPointFeature deepCopy(StationPointFeature from) throws IOException { StationFeature s = from.getStation(); StationFeatureImpl sUse = stationMap.get(s.getName()); if (sUse == null) { sUse = new StationFeatureImpl(s); stationMap.put(s.getName(), sUse); } sUse.incrNobs(); StationPointFeatureCopy deep = new StationPointFeatureCopy(sUse, from); deep.data = StructureDataDeep.copy(from.getFeatureData(), sm); return deep; }
StructureData obsData = spf.getFeatureData();
StructureData obsData = spf.getFeatureData();
assert pf instanceof StationPointFeature; StationPointFeature s = (StationPointFeature) pf; StructureData sdata = s.getFeatureData(); StructureMembers.Member m = sdata.findMember("stnInfo"); assert m == null : "stnInfo in leaf";