public class PositionList
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private double[] |
latitude |
private double[] |
longitude |
private static long |
serialVersionUID |
private int |
size |
Constructor and Description |
---|
PositionList()
Creates a new empty instance of PositionList
|
Modifier and Type | Method and Description |
---|---|
void |
add(double latitude,
double longitude)
Add a position at the end of the list
|
java.lang.Object |
clone() |
private void |
ensureCapacity(int new_size) |
boolean |
equals(java.lang.Object obj) |
double |
getLatitude(int pos) |
double |
getLongitude(int pos) |
void |
insert(int pos,
double latitude,
double longitude)
Add a position at a given index in the list.
|
void |
remove(int pos)
Remove the position at the index, the rest of the list is shifted one place to the "left"
|
void |
replace(int pos,
double latitude,
double longitude)
Replace the position at the index with new values
|
int |
size() |
private static final long serialVersionUID
private double[] latitude
private double[] longitude
private int size
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
private void ensureCapacity(int new_size)
public int size()
public double getLongitude(int pos)
pos
- position indexpublic double getLatitude(int pos)
pos
- position indexpublic void add(double latitude, double longitude)
public void insert(int pos, double latitude, double longitude)
pos
- position indexpublic void replace(int pos, double latitude, double longitude)
pos
- position indexpublic void remove(int pos)
pos
- position index