public void FillFields(RecordInputStream in1) { this.field_Addr_number = in1.ReadShort(); this.field_regions_list = new ArrayList(this.field_Addr_number); for (int k = 0; k < this.field_Addr_number; k++) { short first_row = in1.ReadShort(); short first_col = in1.ReadShort(); short last_row = first_row; short last_col = first_col; if (in1.Remaining >= 4) { last_row = in1.ReadShort(); last_col = in1.ReadShort(); } else { // Ran out of data // For now, Issue a warning, finish, and // hope for the best.... logger.Log(POILogger.WARN, "Ran out of data reading cell references for DVRecord"); k = this.field_Addr_number; } AddrStructure region = new AddrStructure(first_row, first_col, last_row, last_col); this.field_regions_list.Add(region); } }
/** * Add an AddR structure . * @param first_row - the upper left hand corner's row * @param first_col - the upper left hand corner's col * @param last_row - the lower right hand corner's row * @param last_col - the lower right hand corner's col * @return the index of this AddR structure */ public int AddAddRStructure(short first_row, short first_col, short last_row, short last_col) { if (this.field_regions_list == null) { //just to be sure :-) this.field_Addr_number = 0; this.field_regions_list = new ArrayList(10); } AddrStructure region = new AddrStructure(first_row, last_row, first_col, last_col); this.field_regions_list.Add(region); this.field_Addr_number++; return(this.field_Addr_number); }
/** * Add an AddR structure . * @param first_row - the upper left hand corner's row * @param first_col - the upper left hand corner's col * @param last_row - the lower right hand corner's row * @param last_col - the lower right hand corner's col * @return the index of this AddR structure */ public int AddAddRStructure(short first_row, short first_col, short last_row, short last_col) { if (field_regions_list == null) { //just to be sure :-) field_Addr_number = 0; field_regions_list = new List <object>(10); } AddrStructure region = new AddrStructure(first_row, last_row, first_col, last_col); field_regions_list.Add(region); field_Addr_number++; return(field_Addr_number); }
public int Serialize(int offSet, byte[] data) { int pos = 2; LittleEndian.PutShort(data, offSet, this.AddRStructureNumber); for (int k = 0; k < this.AddRStructureNumber; k++) { AddrStructure region = this.GetAddRStructureAt(k); LittleEndian.PutShort(data, offSet + pos, region.FirstRow); pos += 2; LittleEndian.PutShort(data, offSet + pos, region.LastRow); pos += 2; LittleEndian.PutShort(data, offSet + pos, region.FirstColumn); pos += 2; LittleEndian.PutShort(data, offSet + pos, region.LastColumn); pos += 2; } return(this.Size); }
/** * Add an AddR structure . * @param first_row - the upper left hand corner's row * @param first_col - the upper left hand corner's col * @param last_row - the lower right hand corner's row * @param last_col - the lower right hand corner's col * @return the index of this AddR structure */ public int AddAddRStructure(short first_row, short first_col, short last_row, short last_col) { if (this.field_regions_list == null) { //just to be sure :-) this.field_Addr_number = 0; this.field_regions_list = new ArrayList(10); } AddrStructure region = new AddrStructure(first_row, last_row, first_col, last_col); this.field_regions_list.Add(region); this.field_Addr_number++; return this.field_Addr_number; }