@Test public void testTransformDateTime() { TemporalCoordinate result = temporalCoordinateSystem1.transformDateTime(new Date()); assertFalse(temporalCoordinateSystem2.transformDateTime(new Date()).equals(result)); }
public TemporalCoordinate transformDateTime(Date dateTime) { TemporalCoordinate 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; Number coordinateValue = Math.abs(dateTime.getTime() - origin.getTime()); if (interval.toString().equals("year")) { coordinateValue = (float) coordinateValue.longValue() / (float) yearMS; } else if (interval.toString().equals("month")) { coordinateValue = (float) coordinateValue.longValue() / (float) monthMS; } else if (interval.toString().equals("week")) { coordinateValue = (float) coordinateValue.longValue() / (float) weekMS; } else if (interval.toString().equals("day")) { coordinateValue = (float) coordinateValue.longValue() / (float) dayMS; } else if (interval.toString().equals("hour")) { coordinateValue = (float) coordinateValue.longValue() / (float) hourMS; } else if (interval.toString().equals("minute")) { coordinateValue = (float) coordinateValue.longValue() / (float) minMS; } else if (interval.toString().equals("second")) { coordinateValue = (float) coordinateValue.longValue() / (float) secondMS; } response = new DefaultTemporalCoordinate(this, null, coordinateValue); return response; }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public TemporalCoordinate transformDateTime(Date dateTime) { TemporalCoordinate 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; Number coordinateValue = Math.abs(dateTime.getTime() - origin.getTime()); if (interval.toString().equals("year")) { coordinateValue = (float) coordinateValue.longValue() / (float) yearMS; } else if (interval.toString().equals("month")) { coordinateValue = (float) coordinateValue.longValue() / (float) monthMS; } else if (interval.toString().equals("week")) { coordinateValue = (float) coordinateValue.longValue() / (float) weekMS; } else if (interval.toString().equals("day")) { coordinateValue = (float) coordinateValue.longValue() / (float) dayMS; } else if (interval.toString().equals("hour")) { coordinateValue = (float) coordinateValue.longValue() / (float) hourMS; } else if (interval.toString().equals("minute")) { coordinateValue = (float) coordinateValue.longValue() / (float) minMS; } else if (interval.toString().equals("second")) { coordinateValue = (float) coordinateValue.longValue() / (float) secondMS; } response = new DefaultTemporalCoordinate(this, null, coordinateValue); return response; } }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public TemporalCoordinate transformDateTime(Date dateTime) { TemporalCoordinate 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; Number coordinateValue = Math.abs(dateTime.getTime() - origin.getTime()); if (interval.toString().equals("year")) { coordinateValue = (float) coordinateValue.longValue() / (float) yearMS; } else if (interval.toString().equals("month")) { coordinateValue = (float) coordinateValue.longValue() / (float) monthMS; } else if (interval.toString().equals("week")) { coordinateValue = (float) coordinateValue.longValue() / (float) weekMS; } else if (interval.toString().equals("day")) { coordinateValue = (float) coordinateValue.longValue() / (float) dayMS; } else if (interval.toString().equals("hour")) { coordinateValue = (float) coordinateValue.longValue() / (float) hourMS; } else if (interval.toString().equals("minute")) { coordinateValue = (float) coordinateValue.longValue() / (float) minMS; } else if (interval.toString().equals("second")) { coordinateValue = (float) coordinateValue.longValue() / (float) secondMS; } response = new DefaultTemporalCoordinate(this, null, coordinateValue); return response; } DefaultTemporalCoordinateSystem(ReferenceIdentifier name, Extent domainOfValidity, Date origin, InternationalString interval); }
DefaultTemporalCoordinateSystem extends DefaultTemporalReferenceSystem implements TemporalCoordinateSystem { public TemporalCoordinate transformDateTime(Date dateTime) { TemporalCoordinate 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; Number coordinateValue = Math.abs(dateTime.getTime() - origin.getTime()); if (interval.toString().equals("year")) { coordinateValue = (float) coordinateValue.longValue() / (float) yearMS; } else if (interval.toString().equals("month")) { coordinateValue = (float) coordinateValue.longValue() / (float) monthMS; } else if (interval.toString().equals("week")) { coordinateValue = (float) coordinateValue.longValue() / (float) weekMS; } else if (interval.toString().equals("day")) { coordinateValue = (float) coordinateValue.longValue() / (float) dayMS; } else if (interval.toString().equals("hour")) { coordinateValue = (float) coordinateValue.longValue() / (float) hourMS; } else if (interval.toString().equals("minute")) { coordinateValue = (float) coordinateValue.longValue() / (float) minMS; } else if (interval.toString().equals("second")) { coordinateValue = (float) coordinateValue.longValue() / (float) secondMS; } response = new DefaultTemporalCoordinate(this, null, coordinateValue); return response; } 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 TemporalCoordinate transformDateTime(Date dateTime) { TemporalCoordinate 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; Number coordinateValue = Math.abs(dateTime.getTime() - origin.getTime()); if (interval.toString().equals("year")) { coordinateValue = (float) coordinateValue.longValue() / (float) yearMS; } else if (interval.toString().equals("month")) { coordinateValue = (float) coordinateValue.longValue() / (float) monthMS; } else if (interval.toString().equals("week")) { coordinateValue = (float) coordinateValue.longValue() / (float) weekMS; } else if (interval.toString().equals("day")) { coordinateValue = (float) coordinateValue.longValue() / (float) dayMS; } else if (interval.toString().equals("hour")) { coordinateValue = (float) coordinateValue.longValue() / (float) hourMS; } else if (interval.toString().equals("minute")) { coordinateValue = (float) coordinateValue.longValue() / (float) minMS; } else if (interval.toString().equals("second")) { coordinateValue = (float) coordinateValue.longValue() / (float) secondMS; } response = new DefaultTemporalCoordinate(this, null, coordinateValue); return response; } 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();  }