Tabnine Logo
TimeParser.parsePeriod
Code IndexAdd Tabnine to your IDE (free)

How to use
parsePeriod
method
in
org.geoserver.ows.kvp.TimeParser

Best Java code snippets using org.geoserver.ows.kvp.TimeParser.parsePeriod (Showing top 4 results out of 315)

origin: geoserver/geoserver

private static Number parseValue(String s, Class dataType) throws ParseException {
  if (Date.class.isAssignableFrom(dataType)) {
    return TimeParser.parsePeriod(s);
  }
  // TODO: add support for Number, e.g., elevation
  throw new IllegalArgumentException("Unsupported value type " + dataType);
}
origin: geoserver/geoserver

  durationOffset = parsePeriod(period[0]);
} else {
  begin = beginning(getFuzzyDate(period[0]));
    durationOffset = parsePeriod(period[1]);
    final Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(begin.getTime() + durationOffset);
origin: geoserver/geoserver

/**
 * Tests only the increment part of the time parameter.
 *
 * @throws ParseException if the string can't be parsed.
 */
public void testPeriod() throws ParseException {
  final long millisInDay = TimeParser.MILLIS_IN_DAY;
  assertEquals(millisInDay, TimeParser.parsePeriod("P1D"));
  assertEquals(3 * millisInDay, TimeParser.parsePeriod("P3D"));
  assertEquals(14 * millisInDay, TimeParser.parsePeriod("P2W"));
  assertEquals(8 * millisInDay, TimeParser.parsePeriod("P1W1D"));
  assertEquals(millisInDay, TimeParser.parsePeriod("PT24H"));
  assertEquals(Math.round(1.5 * millisInDay), TimeParser.parsePeriod("P1.5D"));
}
origin: geoserver/geoserver

Date[] range = parseTimeDuration(period);
final long millisIncrement = parsePeriod(period[2]);
final long startTime = range[0].getTime();
final long endTime = range[1].getTime();
org.geoserver.ows.kvpTimeParserparsePeriod

Javadoc

Parses the increment part of a period and returns it in milliseconds.

Popular methods of TimeParser

  • parse
  • <init>
  • getFuzzyDate
    Parses date given in parameter according the ISO-8601 standard. This parameter should follow a synta
  • addDate
  • addPeriod
    Tries to avoid insertion of multiple time values.
  • beginning
  • checkMaxTimes
  • end
  • getMaxTimes
    Maximum number of times this parser will parse before throwing an exception
  • parseTimeDuration

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Sublime Text plugins
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