Salome HOME
toString method is redefined.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / dto / FileDTO.java
index 4c0cd8c391a57239927a1a32e45888f3e1abc31c..0dda6c5e2848eb1b4b70ae6768da666e4a7154c6 100644 (file)
@@ -120,4 +120,29 @@ public class FileDTO {
        public void setPath(final String path) {
                _path = path;
        }
+
+       /**
+        * {@inheritDoc}
+        * 
+        * @see java.lang.Object#toString()
+        */
+       @Override
+       public String toString() {
+               StringBuffer buf = new StringBuffer();
+               String indent = "        ";
+               String ftype = "Source";
+               if (isResult()) {
+                       ftype = "Result";
+               }
+               String fstate = "file-actual";
+               if (getState() == 'O') {
+                       fstate = "file-outdated";
+               }
+               buf.append(indent).append(ftype).append(" file: ").append(getPath())
+                               .append('\n').append(indent).append(
+                                               "    Automatic processing: ").append(getProcessing())
+                               .append('\n').append(indent).append("    State: ").append(
+                                               fstate).append('\n');
+               return buf.toString();
+       }
 }