congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CalendarPeriod$Field.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
ucar.nc2.time.CalendarPeriod$Field

Best Java code snippets using ucar.nc2.time.CalendarPeriod$Field.toString (Showing top 10 results out of 315)

origin: Unidata/thredds

public CoordinateRuntime(List<Long> runtimeSorted, CalendarPeriod timeUnit) {
 this.runtimes = new long[runtimeSorted.size()];
 int idx = 0;
 for (long val : runtimeSorted)
  this.runtimes[idx++] = val;
 this.firstDate = CalendarDate.of(runtimeSorted.get(0));
 this.timeUnit = timeUnit == null ? CalendarPeriod.Hour : timeUnit;
 CalendarPeriod.Field cf = this.timeUnit.getField();
 if (cf == CalendarPeriod.Field.Month || cf == CalendarPeriod.Field.Year)
  this.periodName = "calendar "+ cf.toString();
 else
  this.periodName = cf.toString();
}
origin: Unidata/thredds

public String getTimeIntervalName() {
 if (!isInterval()) return null;
 // are they the same length ?
 int firstValue = -1;
 boolean same = true;
 for (Tinv tinv : intervals) {
  int value = (tinv.b2 - tinv.b1);
  if (firstValue < 0) firstValue = value;
  else if (value != firstValue) same = false;
 }
 if (same) {
  firstValue = (firstValue * calendarPeriod.getValue());
  return firstValue + "_" + calendarPeriod.getField().toString();
 } else {
  return CoordinateTimeAbstract.MIXED_INTERVALS;
 }
}
origin: Unidata/thredds

/**
 * Check if we all time intervals have the same length.
 * @return time interval name or MIXED_INTERVALS
 */
public String getTimeIntervalName() {
 // are they the same length ?
 int firstValue = -1;
 for (TimeCoord.Tinv tinv : timeIntervals) {
  int value = (tinv.getBounds2() - tinv.getBounds1());
  if (firstValue < 0) firstValue = value;
  else if (value != firstValue) return MIXED_INTERVALS;
 }
 firstValue = (firstValue * timeUnit.getValue());
 return firstValue + "_" + timeUnit.getField().toString();
}
origin: Unidata/thredds

CoordinateTimeAbstract(int code, CalendarPeriod timeUnit, CalendarDate refDate, int[] time2runtime) {
 this.code = code;
 this.timeUnit = timeUnit;
 this.refDate = (cdf == null) ? refDate : cdf.get(refDate);
 this.time2runtime = time2runtime;
 CalendarPeriod.Field cf = timeUnit.getField();
 if (cf == CalendarPeriod.Field.Month || cf == CalendarPeriod.Field.Year)
  this.periodName = "calendar "+ cf.toString();
 else
  this.periodName = cf.toString();
}
origin: Unidata/thredds

public String getUnits() {
 if (units != null) return units;
 CalendarPeriod.Field cf = calendarPeriod.getField();
 if (cf == CalendarPeriod.Field.Month || cf == CalendarPeriod.Field.Year)
  return "calendar "+ cf.toString() + " since " + runDate;
 else
  return calendarPeriod.getField().toString() + " since " + runDate;
}
origin: Unidata/thredds

/**
 * String representation
 * @return getText()
 */
public String toString() {
 return timeUnit.toString();
}
origin: Unidata/thredds

private void assertAddReturnsExpectedDate(String baseDate, double value, Field units, String expectedResult) {
 CalendarDate base = CalendarDateFormatter.isoStringToCalendarDate(Calendar.gregorian, baseDate);
 CalendarDate result = base.add(value, units);
 assertEquals(units.toString(), expectedResult, CalendarDateFormatter.toDateTimeStringISO(result));
}
origin: edu.ucar/cdm

/**
 * String representation
 * @return getText()
 */
public String toString() {
 return timeUnit.toString();
}
origin: edu.ucar/cdm

private CalendarDateUnit(Calendar calt, CalendarPeriod.Field periodField, CalendarDate baseDate) {
 this.cal = calt;
 this.periodField = periodField;
 this.baseDate = baseDate;
 String periodName;
 if (periodField == CalendarPeriod.Field.Month || periodField == CalendarPeriod.Field.Year) {
  periodName = "calendar "+ periodField.toString();
  isCalendarField = true;
 } else {
  periodName = periodField.toString();
  isCalendarField = false;
 }
 unitString = periodName + " since " + baseDate.toString();
}
origin: edu.ucar/netcdf

/**
 * Get the String text
 * @return the text
 */
public String getText() {
 return text == null ? timeUnit.toString() : text;
}
ucar.nc2.timeCalendarPeriod$FieldtoString

Popular methods of CalendarPeriod$Field

  • hashCode

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now