Salome HOME
toString method is redefined.
authorrkv <rkv@opencascade.com>
Thu, 15 Nov 2012 13:42:46 +0000 (13:42 +0000)
committerrkv <rkv@opencascade.com>
Thu, 15 Nov 2012 13:42:46 +0000 (13:42 +0000)
Workspace/Siman-Common/src/org/splat/service/dto/DocumentDTO.java
Workspace/Siman-Common/src/org/splat/service/dto/FileDTO.java
Workspace/Siman-Common/src/org/splat/service/dto/StepDTO.java

index 6838cd5a3ef2111ae577a265f5f31b924b638acf..8652cd96436b1773a1b8316e004c938fc9d335f8 100644 (file)
@@ -104,4 +104,22 @@ public class DocumentDTO {
                _files.add(fileDTO);
                return fileDTO;
        }
+
+       /**
+        * {@inheritDoc}
+        * 
+        * @see java.lang.Object#toString()
+        */
+       @Override
+       public String toString() {
+               StringBuffer buf = new StringBuffer();
+               String indent = "    ";
+               buf.append(indent).append("Document: ").append(getTitle()).append('\n')
+                               .append(indent).append("    Document ID: ").append(getId())
+                               .append('\n');
+               for (FileDTO file : getFiles()) {
+                       buf.append(file);
+               }
+               return buf.toString();
+       }
 }
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();
+       }
 }
index 93b89e26f4ae74d1b512dd4add3aeb87fb2405c6..dfead5f41727afb3ac2227ebce6a2a99f184fe9c 100644 (file)
@@ -70,6 +70,7 @@ public class StepDTO {
 
        /**
         * Get the key.
+        * 
         * @return the key
         */
        public String getKey() {
@@ -78,7 +79,9 @@ public class StepDTO {
 
        /**
         * Set the key.
-        * @param key the key to set
+        * 
+        * @param key
+        *            the key to set
         */
        public void setKey(final String key) {
                _key = key;
@@ -86,6 +89,7 @@ public class StepDTO {
 
        /**
         * Get the number.
+        * 
         * @return the number
         */
        public int getNumber() {
@@ -94,7 +98,9 @@ public class StepDTO {
 
        /**
         * Set the number.
-        * @param number the number to set
+        * 
+        * @param number
+        *            the number to set
         */
        public void setNumber(final int number) {
                _number = number;
@@ -102,6 +108,7 @@ public class StepDTO {
 
        /**
         * Get the module.
+        * 
         * @return the module
         */
        public String getModule() {
@@ -110,9 +117,27 @@ public class StepDTO {
 
        /**
         * Set the module.
-        * @param module the module to set
+        * 
+        * @param module
+        *            the module to set
         */
        public void setModule(final String module) {
                _module = module;
        }
+
+       /**
+        * {@inheritDoc}
+        * 
+        * @see java.lang.Object#toString()
+        */
+       @Override
+       public String toString() {
+               StringBuffer buf = new StringBuffer();
+               buf.append("Activity ID: " + getNumber() + "\nSALOME module: "
+                               + getModule() + "\n");
+               for (DocumentDTO doc : getDocs()) {
+                       buf.append(doc);
+               }
+               return buf.toString();
+       }
 }