Example usage for java.time.temporal TemporalField equals

List of usage examples for java.time.temporal TemporalField equals

Introduction

In this page you can find the example usage for java.time.temporal TemporalField equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:msi.gama.util.GamaDate.java

@Override
public boolean isSupported(final TemporalField field) {
    return internal.isSupported(field) || field.equals(ChronoField.OFFSET_SECONDS)
            || field.equals(ChronoField.INSTANT_SECONDS);
}

From source file:msi.gama.util.GamaDate.java

@Override
public long getLong(final TemporalField field) {
    if (internal.isSupported(field)) {
        return internal.getLong(field);
    }/*  ww w .java  2 s.  c o m*/
    if (field.equals(ChronoField.OFFSET_SECONDS)) {
        // If no offset or time zone is supplied, we assume it is the zone of the modeler
        return GamaDateType.DEFAULT_OFFSET_IN_SECONDS.getTotalSeconds();
    }
    if (field.equals(ChronoField.INSTANT_SECONDS)) {
        return GamaDateType.EPOCH.until(internal, ChronoUnit.SECONDS);
    }
    return 0l;

}