]> source.dussan.org Git - poi.git/commitdiff
add isEmpty() and toString() to DateAndTime
authorSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:26:00 +0000 (11:26 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:26:00 +0000 (11:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144645 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java

index 967fc92647b553087d3005562143eba2ffa5d79e..be988043b307c6f0cf7fd30fe87b8d69461094b6 100644 (file)
@@ -83,4 +83,18 @@ public final class DateAndTime
   {
     return super.clone();
   }
+
+    public boolean isEmpty()
+    {
+        return _info == 0 && _info2 == 0;
+    }
+
+    @Override
+    public String toString()
+    {
+        if ( isEmpty() )
+            return "[DTTM] EMPTY";
+
+        return "[DTTM] " + getDate();
+    }
 }