X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FField.java;h=089d8cdc2d1a623b89f0d7b7e4615b6524fb128e;hp=5f28fc578c3c39debbac07fc4944a1615ed5e72d;hb=54b9d8bc8f0025ccf97a67d9dd217ef1f9cf082f;hpb=52bf9e8686c916be37a26a0b75340393d4478b05 diff --git a/tim/prune/data/Field.java b/tim/prune/data/Field.java index 5f28fc5..089d8cd 100644 --- a/tim/prune/data/Field.java +++ b/tim/prune/data/Field.java @@ -21,9 +21,9 @@ public class Field public static final Field WAYPT_TYPE = new Field("fieldname.waypointtype", FieldType.NONE); public static final Field NEW_SEGMENT = new Field("fieldname.newsegment", FieldType.BOOL); - public static final Field[] ALL_AVAILABLE_FIELDS = { - LATITUDE, LONGITUDE, ALTITUDE, TIMESTAMP, WAYPT_NAME, WAYPT_TYPE, NEW_SEGMENT, - new Field("fieldname.custom", FieldType.NONE) + private static final Field[] ALL_AVAILABLE_FIELDS = { + LATITUDE, LONGITUDE, ALTITUDE, TIMESTAMP, WAYPT_NAME, WAYPT_TYPE, NEW_SEGMENT, + new Field("fieldname.custom", FieldType.NONE) }; /** @@ -95,4 +95,33 @@ public class Field { return (isBuiltIn() == inOther.isBuiltIn() && getName().equals(inOther.getName())); } + + /** + * Get the field for the given field name + * @param inFieldName name of field to look for + * @return Field if found, or null otherwise + */ + public static Field getField(String inFieldName) + { + for (int i=0; i