Tabnine Logo
OrgDelay
Code IndexAdd Tabnine to your IDE (free)

How to use
OrgDelay
in
com.orgzly.org.datetime

Best Java code snippets using com.orgzly.org.datetime.OrgDelay (Showing top 5 results out of 315)

origin: orgzly/org-java

public static OrgDelay parse(String str) {
  OrgDelay delay = new OrgDelay();
  Matcher m = OrgPatterns.TIME_DELAY_P.matcher(str);
  if (m.find()) {
    if (m.groupCount() == 3) {
      delay.setTypeFromString(m.group(1));
      delay.setValue(m.group(2));
      delay.setUnit(m.group(3));
    } else {
      throw new IllegalArgumentException("Expected 3 groups (got " + m.groupCount() + ") when matching time delay " + str + " against " + OrgPatterns.TIME_DELAY_P);
    }
  } else {
    throw new IllegalArgumentException("Failed matching time delay " + str + " against " + OrgPatterns.TIME_DELAY_P);
  }
  return delay;
}
origin: orgzly/org-java

delay = OrgDelay.parse(m.group(0));
origin: orgzly/org-java

@Test
public void testDelayOnlyWithTime() {
  OrgDateTime time = OrgDateTime.parse("<2009-10-17 13:15 -2d>");
  Assert.assertFalse(time.hasRepeater());
  Assert.assertTrue(time.hasDelay());
  Assert.assertEquals(OrgDelay.Type.ALL, time.getDelay().getType());
  Assert.assertEquals(2, time.getDelay().getValue());
  Assert.assertEquals(OrgDelay.Unit.DAY, time.getDelay().getUnit());
}
origin: orgzly/org-java

@Test
public void testDelayOnlyWithWeekday() {
  OrgDateTime time = OrgDateTime.parse("<2009-10-17 Wed -2d>");
  Assert.assertFalse(time.hasRepeater());
  Assert.assertTrue(time.hasDelay());
  Assert.assertEquals(OrgDelay.Type.ALL, time.getDelay().getType());
  Assert.assertEquals(2, time.getDelay().getValue());
  Assert.assertEquals(OrgDelay.Unit.DAY, time.getDelay().getUnit());
}
origin: orgzly/org-java

@Test
public void testDelayFirstOccurrence() {
  OrgDateTime time = OrgDateTime.parse("<2009-10-17 13:15 +1m --2d>");
  Assert.assertTrue(time.hasRepeater());
  Assert.assertTrue(time.hasDelay());
  Assert.assertEquals(OrgDelay.Type.FIRST_ONLY, time.getDelay().getType());
  Assert.assertEquals(2, time.getDelay().getValue());
  Assert.assertEquals(OrgDelay.Unit.DAY, time.getDelay().getUnit());
}
com.orgzly.org.datetimeOrgDelay

Javadoc

Delay used for scheduled time. Also used as a warning period for deadline time. http://orgmode.org/manual/Deadlines-and-scheduling.html

Most used methods

  • <init>
  • getType
  • getUnit
  • getValue
  • parse
  • setTypeFromString
  • setUnit
  • setValue

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Github Copilot alternatives
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