@Test public void testTransformCoord() { Date result = temporalCoordinateSystem1.transformCoord(temporalCoordinate1); assertFalse(temporalCoordinateSystem2.transformCoord(temporalCoordinate2).equals(result)); }
public Date transformCoord(TemporalCoordinate c_value) { Date response; final long yearMS = 31536000000L; final long monthMS = 2628000000L; final long weekMS = 604800000L; final long dayMS = 86400000L; final long hourMS = 3600000L; final long minMS = 60000L; final long secondMS = 1000L; DefaultTemporalCoordinate value = (DefaultTemporalCoordinate) c_value; Number f = 0; if (value.getFrame() != null && value.getFrame() instanceof TemporalCoordinateSystem) { if (value.getCoordinateValue() != null) { float n = value.getCoordinateValue().floatValue(); if (interval.toString().equals("year")) { f = n * (float) yearMS; } else if (interval.toString().equals("month")) { f = n * (float) monthMS; } else if (interval.toString().equals("week")) { f = n * (float) weekMS; } else if (interval.toString().equals("day")) { f = n * (float) dayMS; } else if (interval.toString().equals("hour")) { f = n * (float) hourMS; } else if (interval.toString().equals("minute")) { f = n * (float) minMS; } else if (interval.toString().equals("second")) { f = n * (float) secondMS; } else if (interval.toString().equals("millisecond")) { f = n; } else { throw new IllegalArgumentException("The name of a single unit of measure used as the base interval for the scale in this current TemporalCoordinateSystem is not supported !"); } response = new Date(origin.getTime() + f.longValue()); return response; } else { return null; } } else { throw new IllegalArgumentException("The TemporalCoordinate argument must be a TemporalCoordinate ! "); } }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public Date transformCoord(TemporalCoordinate c_value) { Date response; final long yearMS = 31536000000L; final long monthMS = 2628000000L; final long weekMS = 604800000L; final long dayMS = 86400000L; final long hourMS = 3600000L; final long minMS = 60000L; final long secondMS = 1000L; DefaultTemporalCoordinate value = (DefaultTemporalCoordinate) c_value; Number f = 0; if (value.getFrame() != null && value.getFrame() instanceof TemporalCoordinateSystem) { if (value.getCoordinateValue() != null) { float n = value.getCoordinateValue().floatValue(); if (interval.toString().equals("year")) { f = n * (float) yearMS; } else if (interval.toString().equals("month")) { f = n * (float) monthMS; } else if (interval.toString().equals("week")) { f = n * (float) weekMS; } else if (interval.toString().equals("day")) { f = n * (float) dayMS; } else if (interval.toString().equals("hour")) { f = n * (float) hourMS; } else if (interval.toString().equals("minute")) { f = n * (float) minMS; } else if (interval.toString().equals("second")) { f = n * (float) secondMS; } else if (interval.toString().equals("millisecond")) { f = n; } else { throw new IllegalArgumentException("The name of a single unit of measure used as the base interval for the scale in this current TemporalCoordinateSystem is not supported !"); } response = new Date(origin.getTime() + f.longValue()); return response; } else { return null; } } else { throw new IllegalArgumentException("The TemporalCoordinate argument must be a TemporalCoordinate ! "); } } }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public Date transformCoord(TemporalCoordinate c_value) { Date response; final long yearMS = 31536000000L; final long monthMS = 2628000000L; final long weekMS = 604800000L; final long dayMS = 86400000L; final long hourMS = 3600000L; final long minMS = 60000L; final long secondMS = 1000L; DefaultTemporalCoordinate value = (DefaultTemporalCoordinate) c_value; Number f = 0; if (value.getFrame() != null && value.getFrame() instanceof TemporalCoordinateSystem) { if (value.getCoordinateValue() != null) { float n = value.getCoordinateValue().floatValue(); if (interval.toString().equals("year")) { f = n * (float) yearMS; } else if (interval.toString().equals("month")) { f = n * (float) monthMS; } else if (interval.toString().equals("week")) { f = n * (float) weekMS; } else if (interval.toString().equals("day")) { f = n * (float) dayMS; } else if (interval.toString().equals("hour")) { f = n * (float) hourMS; } else if (interval.toString().equals("minute")) { f = n * (float) minMS; } else if (interval.toString().equals("second")) { f = n * (float) secondMS; } else if (interval.toString().equals("millisecond")) { f = n; } else { throw new IllegalArgumentException("The name of a single unit of measure used as the base interval for the scale in this current TemporalCoordinateSystem is not supported !"); } response = new Date(origin.getTime() + f.longValue()); return response; } else { return null; } } else { throw new IllegalArgumentException("The TemporalCoordinate argument must be a TemporalCoordinate ! "); } } DefaultTemporalCoordinateSystem(ReferenceIdentifier name, Extent domainOfValidity, Date origin, InternationalString interval); }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public Date transformCoord(TemporalCoordinate c_value) { Date response; final long yearMS = 31536000000L; final long monthMS = 2628000000L; final long weekMS = 604800000L; final long dayMS = 86400000L; final long hourMS = 3600000L; final long minMS = 60000L; final long secondMS = 1000L; DefaultTemporalCoordinate value = (DefaultTemporalCoordinate) c_value; Number f = 0; if (value.getFrame() != null && value.getFrame() instanceof TemporalCoordinateSystem) { if (value.getCoordinateValue() != null) { float n = value.getCoordinateValue().floatValue(); if (interval.toString().equals("year")) { f = n * (float) yearMS; } else if (interval.toString().equals("month")) { f = n * (float) monthMS; } else if (interval.toString().equals("week")) { f = n * (float) weekMS; } else if (interval.toString().equals("day")) { f = n * (float) dayMS; } else if (interval.toString().equals("hour")) { f = n * (float) hourMS; } else if (interval.toString().equals("minute")) { f = n * (float) minMS; } else if (interval.toString().equals("second")) { f = n * (float) secondMS; } else if (interval.toString().equals("millisecond")) { f = n; } else { throw new IllegalArgumentException("The name of a single unit of measure used as the base interval for the scale in this current TemporalCoordinateSystem is not supported !"); } response = new Date(origin.getTime() + f.longValue()); return response; } else { return null; } } else { throw new IllegalArgumentException("The TemporalCoordinate argument must be a TemporalCoordinate ! "); } } DefaultTemporalCoordinateSystem(ReferenceIdentifier name, Extent domainOfValidity, Date origin, InternationalString interval); void setOrigin(Date origin); void setInterval(InternationalString interval); Date getOrigin(); InternationalString getInterval(); Date transformCoord(TemporalCoordinate c_value); TemporalCoordinate transformDateTime(Date dateTime); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString(); }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public Date transformCoord(TemporalCoordinate c_value) { Date response; final long yearMS = 31536000000L; final long monthMS = 2628000000L; final long weekMS = 604800000L; final long dayMS = 86400000L; final long hourMS = 3600000L; final long minMS = 60000L; final long secondMS = 1000L; DefaultTemporalCoordinate value = (DefaultTemporalCoordinate) c_value; Number f = 0; if (value.getFrame() != null && value.getFrame() instanceof TemporalCoordinateSystem) { if (value.getCoordinateValue() != null) { float n = value.getCoordinateValue().floatValue(); if (interval.toString().equals("year")) { f = n * (float) yearMS; } else if (interval.toString().equals("month")) { f = n * (float) monthMS; } else if (interval.toString().equals("week")) { f = n * (float) weekMS; } else if (interval.toString().equals("day")) { f = n * (float) dayMS; } else if (interval.toString().equals("hour")) { f = n * (float) hourMS; } else if (interval.toString().equals("minute")) { f = n * (float) minMS; } else if (interval.toString().equals("second")) { f = n * (float) secondMS; } else if (interval.toString().equals("millisecond")) { f = n; } else { throw new IllegalArgumentException("The name of a single unit of measure used as the base interval for the scale in this current TemporalCoordinateSystem is not supported !"); } response = new Date(origin.getTime() + f.longValue()); return response; } else { return null; } } else { throw new IllegalArgumentException("The TemporalCoordinate argument must be a TemporalCoordinate ! "); } } DefaultTemporalCoordinateSystem(ReferenceIdentifier name, Extent domainOfValidity, Date origin, InternationalString interval); void setOrigin(Date origin); void setInterval(InternationalString interval); Date getOrigin(); InternationalString getInterval(); Date transformCoord(TemporalCoordinate c_value); TemporalCoordinate transformDateTime(Date dateTime); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString();  }