/** * Get the string name for the ith time coordinate. * * @param index which time coordinate * @return time name. * @deprecated */ public String getTimeName(int index) { List<CalendarDate> cdates = getCalendarDates(); if ((index < 0) || (index >= cdates.size())) throw new IllegalArgumentException("getTimeName illegal index = " + index); return cdates.get(index).toString(); }
/** * Get the string name for the ith time coordinate. * * @param index which time coordinate * @return time name. * @deprecated */ public String getTimeName(int index) { List<CalendarDate> cdates = getCalendarDates(); if ((index < 0) || (index >= cdates.size())) throw new IllegalArgumentException("getTimeName illegal index = " + index); return cdates.get(index).toString(); }
/** * Get the string name for the ith time coordinate. * * @param index which time coordinate * @return time name. * @deprecated */ public String getTimeName(int index) { List<CalendarDate> cdates = getCalendarDates(); if ((index < 0) || (index >= cdates.size())) throw new IllegalArgumentException("getTimeName illegal index = " + index); return cdates.get(index).toString(); }
/** * Get the index corresponding to the time name. * * @param name time name * @return time index, or -1 if not found * @deprecated */ public int getTimeIndex(String name) { List<CalendarDate> cdates = getCalendarDates(); for (int i=0; i < cdates.size(); i++) { if( cdates.get(i).toString().equals(name)) return i; } return -1; }
/** * Get the index corresponding to the time name. * * @param name time name * @return time index, or -1 if not found * @deprecated */ public int getTimeIndex(String name) { List<CalendarDate> cdates = getCalendarDates(); for (int i=0; i < cdates.size(); i++) { if( cdates.get(i).toString().equals(name)) return i; } return -1; }
/** * Get the index corresponding to the time name. * * @param name time name * @return time index, or -1 if not found * @deprecated */ public int getTimeIndex(String name) { List<CalendarDate> cdates = getCalendarDates(); for (int i=0; i < cdates.size(); i++) { if( cdates.get(i).toString().equals(name)) return i; } return -1; }
/** * Get the list of time names, to be used for user selection. * The ith one refers to the ith time coordinate. * * @return List of ucar.nc2.util.NamedObject, or empty list. */ public List<NamedObject> getTimes() { List<CalendarDate> cdates = getCalendarDates(); List<NamedObject> times = new ArrayList<>( cdates.size()); for (CalendarDate cd: cdates) { times.add(new ucar.nc2.util.NamedAnything(cd.toString(), "calendar date")); } return times; }
/** * Get the list of time names, to be used for user selection. * The ith one refers to the ith time coordinate. * * @return List of ucar.nc2.util.NamedObject, or empty list. */ public List<NamedObject> getTimes() { List<CalendarDate> cdates = getCalendarDates(); List<NamedObject> times = new ArrayList<NamedObject>( cdates.size()); for (CalendarDate cd: cdates) { times.add(new ucar.nc2.util.NamedAnything(cd.toString(), "calendar date")); } return times; }
/** * Get the list of time names, to be used for user selection. * The ith one refers to the ith time coordinate. * * @return List of ucar.nc2.util.NamedObject, or empty list. */ public List<NamedObject> getTimes() { List<CalendarDate> cdates = getCalendarDates(); List<NamedObject> times = new ArrayList<>( cdates.size()); for (CalendarDate cd: cdates) { times.add(new ucar.nc2.util.NamedAnything(cd.toString(), "calendar date")); } return times; }