Commit 38ab88de authored by Deepak Jayaram's avatar Deepak Jayaram
Browse files

feb 27 fine tuning

parent ceda0474
......@@ -74,6 +74,9 @@ public class DefaultVehicularPointInformation<S extends Object> implements Vehic
@Override
public <T> void setAttribute(AvailableInformationAttributes pKey, T pValue) {
if (pKey.equals(AvailableInformationAttributes.VALUE)) {
_value = (S) pValue;
}
_attributes.put(pKey, pValue);
}
......@@ -114,6 +117,11 @@ public class DefaultVehicularPointInformation<S extends Object> implements Vehic
return null;
}
@Override
public PointInformation createDefaultInformation() {
throw new UnsupportedOperationException("Cannot create default");
}
protected DefaultVehicularPointInformation<S> cloneInformation() {
return new DefaultVehicularPointInformation<>(getEdge(), getLocation(), getDetectionDate(), getValue());
}
......
......@@ -27,4 +27,11 @@ public class JamInformation extends DefaultVehicularPointInformation<Boolean> {
protected DefaultVehicularPointInformation<Boolean> cloneInformation() {
return new JamInformation(getEdge(), getLocation(), getDetectionDate(), getValue());
}
@Override
public PointInformation createDefaultInformation() {
PointInformation<Boolean> information = clonePointInformation();
information.setAttribute(AvailableInformationAttributes.VALUE, false);
return information;
}
}
......@@ -97,4 +97,8 @@ public class NotificationBasedVehicularPointInformation implements VehicularPoin
throw new UnsupportedOperationException("Cannot set date");
}
@Override
public PointInformation createDefaultInformation() {
throw new UnsupportedOperationException("Cannot create default");
}
}
......@@ -63,4 +63,6 @@ public interface PointInformation<S extends Object> extends Cloneable {
PointInformation<S> clonePointInformation();
void setDetectionTime(long _detectionTime);
PointInformation createDefaultInformation();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment