Package org.opengis.temporal

Examples of org.opengis.temporal.TemporalPrimitive


     * @param begin {@code true} if we are asking for the start time,
     *              or {@code false} for the end time.
     * @return The requested time as a Java date, or {@code null} if none.
     */
    private Date getTime(final boolean begin) {
        final TemporalPrimitive extent = this.extent;
        final Instant instant;
        if (extent instanceof Instant) {
            instant = (Instant) extent;
        } else if (extent instanceof Period) {
            instant = begin ? ((Period) extent).getBeginning() : ((Period) extent).getEnding();
View Full Code Here


     * @param  endTime   The end date and time for the content of the dataset, or {@code null} if none.
     * @throws UnsupportedOperationException If no implementation of {@code TemporalFactory} has been found
     *         on the classpath.
     */
    public void setBounds(final Date startTime, final Date endTime) throws UnsupportedOperationException {
        TemporalPrimitive value = null;
        if (startTime != null || endTime != null) {
            if (endTime == null || endTime.equals(startTime)) {
                value = TemporalUtilities.createInstant(startTime);
            } else if (startTime == null) {
                value = TemporalUtilities.createInstant(endTime);
View Full Code Here

     * @return The time period, or {@code null}.
     */
    @XmlElement(name = "TimePeriod")
    public TimePeriod getTimePeriod() {
        if (!skip()) {
            final TemporalPrimitive metadata = this.metadata;
            if (metadata instanceof Period) {
                return new TimePeriod((Period) metadata);
            }
        }
        return null;
View Full Code Here

     * @return The time instant, or {@code null}.
     */
    @XmlElement(name = "TimeInstant")
    public TimeInstant getTimeInstant() {
        if (!skip()) {
            final TemporalPrimitive metadata = this.metadata;
            if (metadata instanceof Instant) {
                return new TimeInstant((Instant) metadata);
            }
        }
        return null;
View Full Code Here

                if (t instanceof DefaultTemporalExtent) {
                    final DefaultTemporalExtent dt = (DefaultTemporalExtent) t;
                    startTime = dt.getStartTime(); // Maybe user has overridden those methods.
                    endTime   = dt.getEndTime();
                } else {
                    final TemporalPrimitive p = t.getExtent();
                    startTime = DefaultTemporalExtent.getTime(p, true);
                    endTime   = DefaultTemporalExtent.getTime(p, false);
                }
                if (startTime != null && (min == null || startTime.before(min))) min = startTime;
                if endTime != null && (max == null ||   endTime.after (max))) max =   endTime;
View Full Code Here

                if (t instanceof DefaultTemporalExtent) {
                    final DefaultTemporalExtent dt = (DefaultTemporalExtent) t;
                    if (location != 1) startTime = dt.getStartTime(); // Maybe user has overridden those methods.
                    if (location != 0)   endTime = dt.getEndTime();
                } else {
                    final TemporalPrimitive p = t.getExtent();
                    if (location != 1) startTime = DefaultTemporalExtent.getTime(p, true);
                    if (location != 0)   endTime = DefaultTemporalExtent.getTime(p, false);
                }
                if (startTime != null && (min == null || startTime.before(min))) min = startTime;
                if endTime != null && (max == null ||   endTime.after (max))) max =   endTime;
View Full Code Here

     *
     * @return The time period, or {@code null}.
     */
    @XmlElement(name = "TimePeriod")
    public TimePeriod getTimePeriod() {
        final TemporalPrimitive metadata = this.metadata;
        return (metadata instanceof Period) ? new TimePeriod((Period) metadata) : null;
    }
View Full Code Here

     *
     * @return The time instant, or {@code null}.
     */
    @XmlElement(name = "TimeInstant")
    public TimeInstant getTimeInstant() {
        final TemporalPrimitive metadata = this.metadata;
        return (metadata instanceof Instant) ? new TimeInstant((Instant) metadata) : null;
    }
View Full Code Here

     * @param  endTime   The end date and time for the content of the dataset, or {@code null} if none.
     * @throws UnsupportedOperationException If no implementation of {@code TemporalFactory} has been found
     *         on the classpath.
     */
    public void setBounds(final Date startTime, final Date endTime) throws UnsupportedOperationException {
        TemporalPrimitive value = null;
        if (startTime != null || endTime != null) {
            if (endTime == null || endTime.equals(startTime)) {
                value = TemporalUtilities.createInstant(startTime);
            } else if (startTime == null) {
                value = TemporalUtilities.createInstant(endTime);
View Full Code Here

    public MatchAction getMatchAction() {
        return matchAction;
    }

    public boolean evaluate(Object object) {
        TemporalPrimitive left = toTemporal(object, e1);
        TemporalPrimitive right = toTemporal(object, e2);
       
        if (left == null || right == null) {
            return false;
        }
       
View Full Code Here

TOP

Related Classes of org.opengis.temporal.TemporalPrimitive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.