package eu.simstadt.nf4j; /** * Units (Blattschnitte) divide regions into sections. For instance, the city of Stuttgart could have the units * "Stg-Mitte", "Stg-West", "Bad Cannstatt", "Heslach", etc. * * @author Marcel Bruse * */ public class Unit { private static final String DEFAULT_EXTERIOR = "0"; private static final String DEFAULT_FRAME = "0"; private static final String DEFAULT_SELECT_MAP_SHEETS = "0"; private static final String DEFAULT_SUBDIVISION = "4"; /** The exterior attribute of the unit tag. */ private String exterior; /** The frame attribute of the unit tag. */ private String frame; /** The select mapsheet attribute of the unit tag. */ private String selectMapsheets; /** The subdivision attribute of the unit tag. */ private String subdivision; /** The actual value of the unit tag. */ private String value; public String getExterior() { return exterior; } public void setExterior(String exterior) { this.exterior = exterior; } public String getFrame() { return frame; } public void setFrame(String frame) { this.frame = frame; } public String getSelectMapsheets() { return selectMapsheets; } public void setSelectMapsheets(String selectMapsheets) { this.selectMapsheets = selectMapsheets; } public String getSubdivision() { return subdivision; } public void setSubdivision(String subdivision) { this.subdivision = subdivision; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } /** * @return Returns true, if the unit is valid. */ public boolean isValid() { return !(exterior.isEmpty() || frame.isEmpty() || selectMapsheets.isEmpty() || subdivision.isEmpty()); } public static Unit getDefaultUnit() { Unit unit = new Unit(); unit.setExterior(DEFAULT_EXTERIOR); unit.setFrame(DEFAULT_FRAME); unit.setSelectMapsheets(DEFAULT_SELECT_MAP_SHEETS); unit.setSubdivision(DEFAULT_SUBDIVISION); return unit; } }