Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixingsFacet.java @ 5515:87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
This also fixes hydr_boundaries_poly which refered to the wrong
table
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 17:13:53 +0100 |
parents | b195fede1c3b |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.model.fixings; import de.intevation.artifacts.CallContext; import de.intevation.flys.artifacts.model.DataFacet; import de.intevation.flys.artifacts.states.DefaultState.ComputeType; /** * Facet to access the current Km from the context safely * * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> */ public class FixingsFacet extends DataFacet { public static final Double INVALID_KM = Double.valueOf(-1d); public static final String CURRENT_KM = "currentKm"; public FixingsFacet() { } public FixingsFacet(String name, String description) { super(0, name, description, ComputeType.ADVANCE, null, null); } public FixingsFacet( int index, String name, String description, ComputeType type, String hash, String stateId ) { super(index, name, description, type, hash, stateId); } /** * Returns the current km from the context. * If the context is null or doesn't contain a currentKm then a double value of -1 will * be returned. * @param context The CallContext instance * @return the current km as double */ protected double getCurrentKm(CallContext context) { if (context == null) { return INVALID_KM; } Double dkm = (Double)context.getContextValue(CURRENT_KM); if (dkm == null) { return INVALID_KM; } return dkm.doubleValue(); } }