Class GtdSpmFormat

  • All Implemented Interfaces:
    SpmFormat

    public class GtdSpmFormat
    extends java.lang.Object
    implements SpmFormat

    SPM-file format with GTD notation.

    This notation is devided in two parts: topics and actions. A topic represents a project in GTD (something that requires more than one action to take place). An action represents one single step in a project. Typical for GTD are the next steps.

    Topics are all lines that start with one or more # followed by a SPACE. The remains of the line describes the topic. The number of hashes describe a hierarchy of topics. Actions are all lines that start with a single * followed by a SPACE, followed by the action symbol in braces followed by a SPACE. The remains of the line describes the action. All other lines are supposed to be task content.

    Action symbols

    The following action symbols are supported:

    Supported symbols
    Symbol Meaning State Remark
    ! Something to do (a next step). CURRENT This next step has priority 1. '!' is equivalent to '1').
    (n) Something to do (a next step) with the priority n.. (1) and (!) are equivalent. CURRENT 'n' ranges from 1 to 9. 0 means unknown.
    '1' is equivalent to '!').
    @ Something on a schedule. SCHEDULE
    / Something that is done already. DONE
    ? Something maybe/somtime (future project). FUTURE
    # Something to do in future (a future next step). FUTURE
    : Something to wait for someone other fullfills it. WAITING
    All other lines starting with an asteriks and a SPACE will be used as CURRENT tasks to avoid that typos result in missing tasks. Example:
     
     # Topic on level one
     * (!) a next step
     * (4) a next step with priority 4
     * (/) something that is done
     * (#) something to to in some future
     ## Topic on level two (subtopic)
     * (:) waiting for someone
     * (?) maybe do this some time?
     ** This is some content. Maybe describing the action before
     This is another content for the maybe action
     * (@) This action is scheduled
     # Second topic
     * The missing symbol will create a next step
     
     
    Author:
    alexxismachine (Ulrich David)
    • Constructor Summary

      Constructors 
      Constructor Description
      GtdSpmFormat()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void parseLines​(Task rootTask, java.util.List<java.lang.String> lines)
      Parse the lines into the given root task.
      Task parseLines​(java.util.List<java.lang.String> lines)
      Parse the lines into a new root task.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GtdSpmFormat

        public GtdSpmFormat()
    • Method Detail

      • parseLines

        public Task parseLines​(java.util.List<java.lang.String> lines)
        Parse the lines into a new root task.
        Specified by:
        parseLines in interface SpmFormat
        Parameters:
        lines - the lines to parse
        Returns:
        the root task containing the converted lines.
      • parseLines

        public void parseLines​(Task rootTask,
                               java.util.List<java.lang.String> lines)
        Parse the lines into the given root task.
        Specified by:
        parseLines in interface SpmFormat
        Parameters:
        rootTask - the root task to add the lines to.
        lines - the lines to parse.