org.opentripplanner.graph_builder.module.osm.SafetyFeaturesEditor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.graph_builder.module.osm;
import java.beans.PropertyEditorSupport;
import org.opentripplanner.common.model.P2;
public class SafetyFeaturesEditor extends PropertyEditorSupport {
private P2 value;
public void setAsText(String safetyFeatures) {
String[] strings = safetyFeatures.split(",");
value = new P2(Double.parseDouble(strings[0]), Double.parseDouble(strings[1]));
}
public String getAsText() {
return value.first + ", " + value.second;
}
public Object getValue() {
return value;
}
@SuppressWarnings("unchecked")
public void setValue(Object object) {
value = (P2) object;
}
}