| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
package uk.me.parabola.imgfmt.mps; |
| 14 |
|
| 15 |
import java.io.IOException; |
| 16 |
|
| 17 |
import uk.me.parabola.io.StructuredOutputStream; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public class MapBlock extends MpsBlock { |
| 28 |
private static final int BLOCK_TYPE = 0x4c; |
| 29 |
|
| 30 |
private int familyId; |
| 31 |
private int productId; |
| 32 |
|
| 33 |
private int mapNumber; |
| 34 |
private int hexNumber; |
| 35 |
private String seriesName; |
| 36 |
private String mapDescription; |
| 37 |
private String areaName; |
| 38 |
|
| 39 |
public MapBlock(int codePage) { |
| 40 |
super(BLOCK_TYPE, codePage); |
| 41 |
} |
| 42 |
|
| 43 |
protected void writeBody(StructuredOutputStream out) throws IOException { |
| 44 |
out.write2(productId); |
| 45 |
out.write2(familyId); |
| 46 |
out.write4(mapNumber); |
| 47 |
out.writeString(seriesName); |
| 48 |
out.writeString(mapDescription); |
| 49 |
out.writeString(areaName); |
| 50 |
out.write4(hexNumber); |
| 51 |
out.write4(0); |
| 52 |
} |
| 53 |
|
| 54 |
public void setIds(int familyId, int productId) { |
| 55 |
this.familyId = familyId; |
| 56 |
this.productId = productId; |
| 57 |
} |
| 58 |
|
| 59 |
public void setSeriesName(String seriesName) { |
| 60 |
this.seriesName = seriesName; |
| 61 |
} |
| 62 |
|
| 63 |
public void setMapNumber(int mapNumber) { |
| 64 |
this.mapNumber = mapNumber; |
| 65 |
} |
| 66 |
|
| 67 |
public void setHexNumber(int hexNumber) { |
| 68 |
this.hexNumber = hexNumber; |
| 69 |
} |
| 70 |
|
| 71 |
public void setMapDescription(String mapDescription) { |
| 72 |
this.mapDescription = mapDescription; |
| 73 |
} |
| 74 |
|
| 75 |
public void setAreaName(String areaName) { |
| 76 |
this.areaName = areaName; |
| 77 |
} |
| 78 |
|
| 79 |
public int getFamilyId() { |
| 80 |
return familyId; |
| 81 |
} |
| 82 |
|
| 83 |
public int getProductId() { |
| 84 |
return productId; |
| 85 |
} |
| 86 |
|
| 87 |
public int getMapNumber() { |
| 88 |
return mapNumber; |
| 89 |
} |
| 90 |
|
| 91 |
public int getHexNumber() { |
| 92 |
return hexNumber; |
| 93 |
} |
| 94 |
|
| 95 |
public String getSeriesName() { |
| 96 |
return seriesName; |
| 97 |
} |
| 98 |
|
| 99 |
public String getMapDescription() { |
| 100 |
return mapDescription; |
| 101 |
} |
| 102 |
|
| 103 |
public String getAreaName() { |
| 104 |
return areaName; |
| 105 |
} |
| 106 |
} |