+
+
+ /**
+ * Resize the value array
+ * @param inNewIndex new index to allow
+ */
+ private void resizeValueArray(int inNewIndex)
+ {
+ int newSize = inNewIndex + 1;
+ if (newSize > _fieldValues.length)
+ {
+ String[] newArray = new String[newSize];
+ System.arraycopy(_fieldValues, 0, newArray, 0, _fieldValues.length);
+ _fieldValues = newArray;
+ }
+ }
+
+
+ /**
+ * @return a clone object with copied data
+ */
+ public DataPoint clonePoint()
+ {
+ // Copy all values
+ String[] valuesCopy = new String[_fieldValues.length];
+ System.arraycopy(_fieldValues, 0, valuesCopy, 0, _fieldValues.length);
+ // Make new object to hold cloned data
+ DataPoint point = new DataPoint(valuesCopy, _fieldList, _altitude.getFormat());
+ return point;
+ }
+
+
+ /**
+ * Restore the contents from another point
+ * @param inOther point containing contents to copy
+ * @return true if successful
+ */
+ public boolean restoreContents(DataPoint inOther)
+ {
+ if (inOther != null)
+ {
+ // Copy string values across
+ _fieldValues = inOther._fieldValues;
+ if (_altitude != null)
+ {
+ parseFields(_altitude.getFormat());
+ }
+ else
+ {
+ // use default altitude format of metres
+ parseFields(Altitude.FORMAT_METRES);
+ }
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Get string for debug
+ * @see java.lang.Object#toString()
+ */
+ public String toString()
+ {
+ return "[Lat=" + getLatitude().toString() + ", Lon=" + getLongitude().toString() + "]";
+ }