congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
OrgContent
Code IndexAdd Tabnine to your IDE (free)

How to use
OrgContent
in
com.orgzly.org

Best Java code snippets using com.orgzly.org.OrgContent (Showing top 14 results out of 315)

origin: orgzly/org-java

private OrgContent getContentObject() {
  if (content == null) {
    content = new OrgContent();
  }
  return content;
}
origin: orgzly/org-java

/**
 * @return {@code true} if there is a text below heading, {@code false} otherwise
 */
public boolean hasContent() {
  return content != null && !content.isEmpty();
}
origin: orgzly/org-java

public boolean hasTimestamps() {
  if (timestamps == null) {
    return false;
  }
  if (dirty) {
    reparse();
  }
  return !timestamps.isEmpty();
}
origin: orgzly/org-java

@Test
public void testReparse() {
  OrgContent o = new OrgContent();
  o.append("<2000-01-01 10:10>");
  o.set("\n\n<2001-01-01 10:10>");
  Assert.assertEquals(1, o.getTimestamps().size());
  Assert.assertEquals("<2001-01-01 10:10>", o.getTimestamps().get(0).toString());
}
origin: orgzly/org-java

@Test
public void testTimestamp() {
  OrgContent o = new OrgContent();
  o.append("<2000-01-01 10:10>");
  Assert.assertEquals(1, o.getTimestamps().size());
  Assert.assertEquals("<2000-01-01 10:10>", o.getTimestamps().get(0).toString());
}
origin: orgzly/org-java

  @Test
  public void testEmptyContent() {
    OrgContent o = new OrgContent();
    Assert.assertEquals(0, o.getTimestamps().size());
    Assert.assertFalse(o.hasTimestamps());
  }
}
origin: orgzly/org-java

public void setContent(String s) {
  getContentObject().set(s);
}
origin: orgzly/org-java

public List<OrgRange> getTimestamps() {
  return getContentObject().getTimestamps();
}
origin: orgzly/org-java

public boolean hasTimestamps() {
  return getContentObject().hasTimestamps();
}
origin: orgzly/org-java

public void appendContent(String s) {
  getContentObject().append(s);
}
origin: orgzly/org-java

/**
 * Content (body). Text after the heading.
 *
 * @return the content text
 */
public String getContent() {
  return getContentObject().toString();
}
origin: orgzly/org-java

@Test
public void testTimestampMultiline() {
  OrgContent o = new OrgContent();
  o.append("<2000-01-01 10:10>\n<2001-01-01 10:10>");
  Assert.assertEquals(2, o.getTimestamps().size());
  Assert.assertEquals("<2000-01-01 10:10>", o.getTimestamps().get(0).toString());
  Assert.assertEquals("<2001-01-01 10:10>", o.getTimestamps().get(1).toString());
}
origin: orgzly/org-java

/** Parse all plain timestamps in this content and rebuild the timestamps list. */
private void reparse() {
  timestamps.clear();
  Matcher m = OrgPatterns.DT_OR_RANGE_P.matcher(toString());
  while (m.find()) {
    timestamps.add(OrgRange.parse(m.group()));
  }
  dirty = false;
}
origin: orgzly/org-java

/**
 * @return the list of plain timestamps in this content text
 */
public List<OrgRange> getTimestamps() {
  if (timestamps == null) {
    timestamps = new ArrayList<>();
  }
  if (dirty) {
    reparse();
  }
  return timestamps;
}
com.orgzly.orgOrgContent

Javadoc

Text below a heading.

Most used methods

  • <init>
    Whether timestamps are out of sync with `value`, and need to be reparsed.
  • append
  • getTimestamps
  • hasTimestamps
  • set
  • isEmpty
  • reparse
    Parse all plain timestamps in this content and rebuild the timestamps list.
  • toString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JComboBox (javax.swing)
  • JList (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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