if (CF.POSITIVE_DOWN.equalsIgnoreCase(axis.getPositive())) { direction = OPPOSITES.get(type);
if (CF.POSITIVE_DOWN.equalsIgnoreCase(zAxis.getPositive())) { direction = OPPOSITES.get(axisType);
if (CF.POSITIVE_DOWN.equalsIgnoreCase(timeAxis.getPositive())) { direction = OPPOSITES.get(type);
@Override public boolean isZPositive() { CoordinateAxis vertZaxis = getVerticalAxis(); if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; if (vertZaxis.getAxisType() == AxisType.Pressure) return false; return true; // default }
@Override public boolean isZPositive() { CoordinateAxis vertZaxis = getVerticalAxis(); if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; if (vertZaxis.getAxisType() == AxisType.Pressure) return false; return true; // default }
/** * Instances which have same content are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateAxis)) return false; if (!super.equals(oo)) return false; CoordinateAxis o = (CoordinateAxis) oo; if (getAxisType() != null) if (!getAxisType().equals(o.getAxisType())) return false; if (getPositive() != null) if (!getPositive().equals(o.getPositive())) return false; return true; }
/** * Returns the direction of the given axis. This method infers the direction from * {@link CoordinateAxis#getAxisType()} and {@link CoordinateAxis#getPositive()}. * If the direction can not be determined, then this method returns * {@link AxisDirection#OTHER}. * * @param axis the axis for which to get the direction. * @return the direction of the given axis. */ public static AxisDirection getDirection(final CoordinateAxis axis) { final AxisType type = axis.getAxisType(); final boolean down = CF.POSITIVE_DOWN.equals(axis.getPositive()); if (type != null) { switch (type) { case Time: return down ? AxisDirection.PAST : AxisDirection.FUTURE; case Lon: case GeoX: return down ? AxisDirection.WEST : AxisDirection.EAST; case Lat: case GeoY: return down ? AxisDirection.SOUTH : AxisDirection.NORTH; case Pressure: case Height: case GeoZ: return down ? AxisDirection.DOWN : AxisDirection.UP; } } return AxisDirection.OTHER; }
/** * Instances which have same content are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateAxis)) return false; if (!super.equals(oo)) return false; CoordinateAxis o = (CoordinateAxis) oo; if (getAxisType() != null) if (!getAxisType().equals(o.getAxisType())) return false; if (getPositive() != null) if (!getPositive().equals(o.getPositive())) return false; return true; }
/** * Instances which have same content are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateAxis)) return false; if (!super.equals(oo)) return false; CoordinateAxis o = (CoordinateAxis) oo; if (getAxisType() != null) if (!getAxisType().equals(o.getAxisType())) return false; if (getPositive() != null) if (!getPositive().equals(o.getPositive())) return false; return true; }
/** * Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = super.hashCode(); if (getAxisType() != null) result = 37 * result + getAxisType().hashCode(); if (getPositive() != null) result = 37 * result + getPositive().hashCode(); hashCode = result; } return hashCode; }
/** * Override Object.hashCode() to implement equals. */ public int hashCode() { int result = super.hashCode(); if (getAxisType() != null) result = 37 * result + getAxisType().hashCode(); if (getPositive() != null) result = 37 * result + getPositive().hashCode(); return result; }
/** * Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = super.hashCode(); if (getAxisType() != null) result = 37 * result + getAxisType().hashCode(); if (getPositive() != null) result = 37 * result + getPositive().hashCode(); hashCode = result; } return hashCode; }
if (CF.POSITIVE_DOWN.equalsIgnoreCase(axis.getPositive())) { direction = OPPOSITES.get(type);
if (CF.POSITIVE_DOWN.equalsIgnoreCase(axis.getPositive())) { direction = OPPOSITES.get(type);
varElem.setAttribute("axisType", var.getAxisType().toString()); String positive = var.getPositive(); if (positive != null) varElem.setAttribute(CF.POSITIVE, positive);
varElem.setAttribute("axisType", var.getAxisType().toString()); String positive = var.getPositive(); if (positive != null) varElem.setAttribute(CF.POSITIVE, positive);
varElem.setAttribute("axisType", var.getAxisType().toString()); String positive = var.getPositive(); if (positive != null) varElem.setAttribute(CF.POSITIVE, positive);
Variable newV = writer.findVariable(axis.getFullNameEscaped()); if ((axis.getAxisType() == AxisType.Height) || (axis.getAxisType() == AxisType.Pressure) || (axis.getAxisType() == AxisType.GeoZ)) { if (null != axis.getPositive()) newV.addAttribute(new Attribute(CF.POSITIVE, axis.getPositive()));
Variable newV = writer.findVariable(axis.getFullNameEscaped()); if ((axis.getAxisType() == AxisType.Height) || (axis.getAxisType() == AxisType.Pressure) || (axis.getAxisType() == AxisType.GeoZ)) { if (null != axis.getPositive()) newV.addAttribute(new Attribute(CF.POSITIVE, axis.getPositive()));
Variable newV = writer.findVariable(axis.getFullNameEscaped()); if ((axis.getAxisType() == AxisType.Height) || (axis.getAxisType() == AxisType.Pressure) || (axis.getAxisType() == AxisType.GeoZ)) { if (null != axis.getPositive()) newV.addAttribute(new Attribute(CF.POSITIVE, axis.getPositive()));