Rev 186 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
* Copyright (C) 2008 Steve Ratcliffe
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* Author: Steve Ratcliffe
* Create date: 30-Aug-2008
*/
package test.display;
/**
* Subdiv information as read from the tre section.
*
* @author Steve Ratcliffe
*/
public class Subdiv {
private int latitude;
private int longitude;
private boolean hasPoint;
private boolean hasIndPoint;
private boolean hasLine;
private boolean hasShape;
private int bits;
private int rgnOffset;
private int endRgnOffset;
private int number;
private int level;
public void setLocation(int lat, int lon) {
latitude = lat;
longitude = lon;
}
public void setTypes(int elem) {
if ((elem & 0x10) != 0)
hasPoint = true;
if ((elem & 0x20) != 0)
hasIndPoint = true;
if ((elem & 0x40) != 0)
hasLine = true;
if ((elem & 0x80) != 0)
hasShape = true;
}
public void setBits(int bits) {
this.bits = bits;
}
public int getLatitude() {
return latitude;
}
public int getLongitude() {
return longitude;
}
public boolean hasPoint() {
return hasPoint;
}
public boolean hasIndPoint() {
return hasIndPoint;
}
public boolean hasLine() {
return hasLine;
}
public boolean hasShape() {
return hasShape;
}
public int getBits() {
return bits;
}
public int getRgnOffset() {
return rgnOffset;
}
public void setRgnOffset(int rgnOffset) {
this.rgnOffset = rgnOffset;
}
public int numberOfPointers() {
int count = 0;
if (hasPoint) count++;
if (hasIndPoint) count++;
if (hasLine) count++;
if (hasShape) count++;
if (count > 0)
count--;
return count;
}
public void setRgnEnd(int endRgnOffset) {
this.endRgnOffset = endRgnOffset;
}
public int getEndRgnOffset() {
return endRgnOffset;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
}