21 package org.matsim.core.population;
41 final class ActivityImpl
implements Activity {
50 private static final double UNDEFINED_TIME = Double.NEGATIVE_INFINITY;
51 private double endTime = UNDEFINED_TIME;
56 private double startTime = UNDEFINED_TIME;
58 private double dur = UNDEFINED_TIME;
61 private Coord coord = null;
67 ActivityImpl(
final String type) {
68 this.type = type.intern();
71 private static OptionalTime asOptionalTime(
double seconds) {
77 return asOptionalTime(this.endTime);
81 public void setEndTime(
final double endTime) {
83 this.endTime = endTime;
87 public void setEndTimeUndefined() {
88 this.endTime = UNDEFINED_TIME;
96 return asOptionalTime(this.startTime);
103 public void setStartTime(
final double startTime) {
105 this.startTime = startTime;
108 public void setStartTimeUndefined() {
109 this.startTime = UNDEFINED_TIME;
113 public String getType() {
118 public void setType(
final String type) {
119 this.type = type.intern();
123 public Coord getCoord() {
127 public void setCoord(
final Coord coord) {
139 return this.facilityId;
145 this.facilityId = facilityId;
149 public void setLinkId(
final Id<Link> linkId) {
152 this.linkId = linkId;
156 public String toString() {
176 + this.facilityId +
"]" ;
181 return asOptionalTime(this.dur);
185 public void setMaximumDuration(
final double dur) {
191 public void setMaximumDurationUndefined() {
192 this.dur = UNDEFINED_TIME;
197 if (this.attributes != null) {
198 return this.attributes;
static final String writeTime(final double seconds, final String timeformat)
static OptionalTime defined(double seconds)
static void assertDefined(double seconds)
static OptionalTime undefined()