public <T> T convert(Object source, Class<T> target) throws Exception { return (T) new DefaultInstant(new DefaultPosition((Date) source)); } };
@Override public int hashCode() { int hash = super.hashCode(); hash = 37 * hash + (this.coordinateValue != null ? this.coordinateValue.hashCode() : 0); return hash; }
@Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultOrdinalPosition && super.equals(object)) { final DefaultOrdinalPosition that = (DefaultOrdinalPosition) object; return Utilities.equals(this.ordinalPosition, that.ordinalPosition); } return false; }
@Before public void setUp() { Calendar cal = Calendar.getInstance(); cal.set(1995, 1, 1); Instant begining1 = new DefaultInstant(new DefaultPosition(cal.getTime())); cal.set(2000, 1, 1); Instant ending1 = new DefaultInstant(new DefaultPosition(cal.getTime())); cal.set(2000, 1, 1); Instant begining2 = new DefaultInstant(new DefaultPosition(cal.getTime())); cal.set(2012, 1, 1); Instant ending2 = new DefaultInstant(new DefaultPosition(cal.getTime())); period1 = new DefaultPeriod(begining1, ending1); period2 = new DefaultPeriod(begining2, ending2); }
/** Test of setEnding method, of class DefaultPeriod. */ @Test public void testSetEnding_Instant() { Instant result = period1.getEnding(); Instant newInstant = new DefaultInstant(new DefaultPosition(new Date())); ((DefaultPeriod) period1).setEnding(newInstant); assertFalse(period1.getEnding().equals(result)); }
/** Test of setBegining method, of class DefaultPeriod. */ @Test public void testSetBegining_Instant() { Instant result = period1.getBeginning(); Instant newInstant = new DefaultInstant(new DefaultPosition(new Date())); ((DefaultPeriod) period1).setBegining(newInstant); assertFalse(period1.getBeginning().equals(result)); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Instant begining = new DefaultInstant((Position) node.getChild("BeginPosition").getValue()); Instant ending = new DefaultInstant((Position) node.getChild("EndPosition").getValue()); Period timePeriod = new DefaultPeriod(begining, ending); return timePeriod; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Position timePosition = new DefaultPosition(new SimpleInternationalString((String) value)); return timePosition; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Position pos = (Position) node.getChildValue(Position.class); return new DefaultInstant(pos); } }
/** * This constructor replace the constructor with further DateTime object which will be included * in the futur version of jdk (jdk7). example of datetime argument: format specified by the * ISO8601 yyyy-mm-DDTHH:MM:SSZ - example : 2003-02-13T12:28:00.000GMT-08:00. * * @param dateTime * @throws java.text.ParseException */ public DefaultPosition(final InternationalString datetime) throws ParseException { this.position = Utils.getDateFromString(datetime.toString()); }
public void setEnding(Date date) { this.ending = new DefaultInstant(new DefaultPosition(date)); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Instant begining = new DefaultInstant((Position) node.getChild("beginPosition").getValue()); Instant ending = new DefaultInstant((Position) node.getChild("endPosition").getValue()); Period timePeriod = new DefaultPeriod(begining, ending); return timePeriod; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Position timePosition = new DefaultPosition(new SimpleInternationalString((String) value)); return timePosition; }
@Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultClockTime && super.equals(object)) { final DefaultClockTime that = (DefaultClockTime) object; return Utilities.equals(this.clockTime, that.clockTime); } return false; }
public void setBegining(Date date) { this.begining = new DefaultInstant(new DefaultPosition(date)); }
@Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultCalendarDate && super.equals(object)) { final DefaultCalendarDate that = (DefaultCalendarDate) object; return Utilities.equals(this.calendarDate, that.calendarDate) && Utilities.equals(this.calendarEraName, that.calendarEraName); } return false; }
protected Instant instant(String d) throws ParseException { return new DefaultInstant(new DefaultPosition(date(d))); }
protected Instant instant(String d) throws ParseException { return new DefaultInstant(new DefaultPosition(date(d))); }
@Before public void setUp() { cal.set(2000, 1, 1); position1 = new DefaultPosition(cal.getTime()); cal.set(1998, 1, 1); position2 = new DefaultPosition(cal.getTime()); instant1 = new DefaultInstant(position1); instant2 = new DefaultInstant(position2); }
@Before public void setUp() { cal.set(1981, 6, 25); Date date = cal.getTime(); Calendar c2 = Calendar.getInstance(); c2.set(2018, 4, 21); position1 = new DefaultPosition(date); position2 = new DefaultPosition(c2.getTime()); temporalGeomericPrimitive1 = new DefaultInstant(position1); temporalGeomericPrimitive2 = new DefaultInstant(position2); }