| 1 | /* |
| 2 | * Copyright (C) 2007 Steve Ratcliffe |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * |
| 14 | * Author: Steve Ratcliffe |
| 15 | * Create date: Jan 1, 2008 |
| 16 | */ |
| 17 | package uk.me.parabola.imgfmt.app.lbl; |
| 18 | |
| 19 | import uk.me.parabola.imgfmt.app.Label; |
| 20 | import uk.me.parabola.imgfmt.app.ImgFileWriter; |
| 21 | |
| 22 | /** |
| 23 | * A country contains one or more regions. |
| 24 | * |
| 25 | * @author Steve Ratcliffe |
| 26 | */ |
| 27 | public class Country { |
| 28 | // The country number. This is not recorded in the file |
| 29 | private int index; |
| 30 | private final Label label; |
| 31 | |
| 32 | public Country(int index, Label label) { |
| 33 | this.index = index; |
| 34 | this.label = label; |
| 35 | } |
| 36 | |
| 37 | void write(ImgFileWriter writer) { |
| 38 | writer.put3u(label.getOffset()); |
| 39 | } |
| 40 | |
| 41 | public int getIndex() { |
| 42 | return index; |
| 43 | } |
| 44 | |
| 45 | public Label getLabel() { |
| 46 | return label; |
| 47 | } |
| 48 | |
| 49 | public void setIndex(int index) { |
| 50 | this.index = index; |
| 51 | } |
| 52 | } |