Added clarifying comments
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / string / tokenizer / Terminator.java
index a298538..1a6c5ee 100755 (executable)
@@ -1,12 +1,7 @@
 /*
- * Svjatoslav Commons - shared library of common functionality.
- * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
+ * Svjatoslav Commons - shared library of common functionality. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
  */
-
 package eu.svjatoslav.commons.string.tokenizer;
 
 public class Terminator {
@@ -40,9 +35,8 @@ public class Terminator {
         return true;
     }
 
-    public enum TerminationStrategy {
-        PRESERVE,
-        DROP
+    public boolean hasEndSequence() {
+        return endSequence != null;
     }
 
     @Override
@@ -53,4 +47,9 @@ public class Terminator {
                 ", termination=" + termination +
                 '}';
     }
+
+    public enum TerminationStrategy {
+        PRESERVE, // Identify and return such tokens for further processing.
+        DROP // Identify but ignore such tokens, do not return them. Good for handling comments in scripts.
+    }
 }