Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce some overly verbose comments
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 21:55:39 +0000 (22:55 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 21:55:39 +0000 (22:55 +0100)
src/bindings/java/org/simgrid/msg/Comm.java
src/bindings/java/org/simgrid/msg/File.java
src/bindings/java/org/simgrid/msg/Host.java
src/bindings/java/org/simgrid/msg/HostFailureException.java
src/bindings/java/org/simgrid/msg/HostNotFoundException.java
src/bindings/java/org/simgrid/msg/JniException.java
src/bindings/java/org/simgrid/msg/Msg.java
src/bindings/java/org/simgrid/msg/MsgException.java
src/bindings/java/org/simgrid/msg/Mutex.java
src/bindings/java/org/simgrid/msg/NativeException.java
src/bindings/java/org/simgrid/msg/Process.java

index 86c33cb..8d07c51 100644 (file)
@@ -11,13 +11,9 @@ package org.simgrid.msg;
  * between processes.
  */
 public class Comm {
-       /**
-        * Indicates if the communication is a receiving communication
-        */
+       /** Indicates if the communication is a receiving communication */
        protected boolean receiving;
-       /**
-        * Indicates if the communication is finished
-        */
+       /** Indicates if the communication is finished */
        protected boolean finished = false;
        /**
         * Represents the bind between the java comm and the
@@ -25,13 +21,9 @@ public class Comm {
         * automatically set.
         */
        private long bind = 0;
-       /**
-        * Represents the bind for the task object pointer. Don't touch it.
-        */
+       /** Represents the bind for the task object pointer. Don't touch it. */
        private long taskBind = 0;
-       /**
-        * Task associated with the comm. Beware, it can be null 
-        */
+       /** Task associated with the comm. Beware, it can be null */
        protected Task task = null;
        /**
         * Protected constructor, used by Comm factories
@@ -75,9 +67,7 @@ public class Comm {
                return task;
        }
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                org.simgrid.NativeLib.nativeInit();
index 456e474..633f1ff 100644 (file)
@@ -41,9 +41,7 @@ public class File {
         * @param nMemb is the number of elements of data to write 
         */
        public native long write(long size, long nMemb);
-       /**
-        * Close the file.      
-        */
+       /** Close the file. */
        public native void close();
 
        /** Class initializer, to initialize various JNI stuff */
index ae953ee..c15b2af 100644 (file)
@@ -49,18 +49,10 @@ public class Host {
         * @see                         Host.getByName().
         */ 
        private long bind;
-       /**
-        * Host name
-        */
        protected String name;
 
-       /**
-        * User data.
-        */ 
+       /** User data. */ 
        private Object data;
-       /**
-        *
-        */
        protected Host() {
                this.bind = 0;
                this.data = null;
@@ -84,26 +76,13 @@ public class Host {
         */ 
        public native static Host getByName(String name) 
                        throws HostNotFoundException, NullPointerException;
-       /**
-        * This static method returns the count of the installed hosts.
-        *
-        * @return                      The count of the installed hosts.
-        */ 
+       /** Counts the installed hosts. */ 
        public native static int getCount();
 
-       /**
-        * This static method return an instance to the host of the current process.
-        *
-        * @return                      The host on which the current process is executed.
-        */ 
+       /** Returns the host of the current process. */ 
        public native static Host currentHost();
 
-       /**
-        * This static method returns all of the hosts of the installed platform.
-        *
-        * @return                      An array containing all the hosts installed.
-        *
-        */ 
+       /** Returns all hosts of the installed platform. */ 
        public native static Host[] all();
 
        /** 
@@ -120,99 +99,54 @@ public class Host {
        public static native void setAsyncMailbox(String mailboxName);
 
 
-       /**
-        * This method returns the name of a host.
-        * @return                      The name of the host.
-        *
-        */ 
+       /** Returns the name of an host. */ 
        public String getName() {
                return name;
        }
 
-       /**
-        * Sets the data of the host.
-        * @param data
-        */
+       /** Sets the user data of the host. */
        public void setData(Object data) {
                this.data = data;
        } 
-       /**
-        * Gets the data of the host.
-        *
-        * @return The data object associated with the host.
-        */
+       /** Gets the user data of the host. */
        public Object getData() {
                return this.data;
        }
-
-       /**
-        * Checks whether a host has data.
-        *
-        * @return True if the host has an associated data object.
-        */
+       /** Returns true if the host has an associated data object. */
        public boolean hasData() {
                return null != this.data;
        }
 
-       /**
-        * This method start the host if it is off
-        */ 
+       /** Starts the host if it is off */ 
        public native void on();
-
-       /**
-        * This method stop the host if it is on
-        */ 
+       /** Stops the host if it is on */ 
        public native void off();
 
 
        /**
-        * This method returns the speed of the processor of a host,
+        * This method returns the speed of the processor of a host (in flops),
         * regardless of the current load of the machine.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
         */ 
        public native double getSpeed();
-
-       /**
-        * This method returns the number of core of a host.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
-        */ 
+       /** Returns the number of core of a host. */ 
        public native double getCoreNumber();
 
-       /**
-        * Returns the value of a given host property. 
-        */
+       /** Returns the value of a given host property. */
        public native String getProperty(String name);
-
-       /**
-        * Change the value of a given host property. 
-        */
+       /** Changes the value of a given host property. */
        public native void setProperty(String name, String value);
-
-       /** This method tests if a host is up and running.
-        * @return True if the host is available.
-        */
+       /** Tests if an host is up and running. */
        public native boolean isOn();
 
-       /** This methods returns the list of mount point names on an host
-        * @return An array containing all mounted storages on the host
-        */
+       /** Returns the list of mount point names on an host */
        public native Storage[] getMountedStorage();
-
-       /** This methods returns the list of storages attached to an host
-        * @return An array containing all storages (name) attached to the host
-        */
+       /** This methods returns the list of storages (names) attached to an host */
        public native String[] getAttachedStorage();
 
        /** Returns the amount of Joules consumed by that host so far */
        public native double getConsumedEnergy();
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                nativeInit();
index 01eb5b9..7070131 100644 (file)
@@ -1,5 +1,3 @@
-/* This exception is raised when looking for a non-existing host. */
-
 /* Copyright (c) 2006-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -8,9 +6,7 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when the host on which you are running has just been rebooted.
- */
+/** This exception is raised when the host on which you are running has just been rebooted. */
 public class HostFailureException extends MsgException {
        private static final long serialVersionUID = 1L;
 
@@ -18,11 +14,7 @@ public class HostFailureException extends MsgException {
        public HostFailureException() {
                super();
        }
-       /**
-        * Constructs an <code>HostFailureException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>HostFailureException</code> with a detail message. */
        public HostFailureException(String s) {
                super(s);
        }
index 86b830e..79ef54c 100644 (file)
@@ -1,5 +1,3 @@
-/* This exception is raised when looking for a non-existing host. */
-
 /* Copyright (c) 2006-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -8,9 +6,7 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when looking for a non-existing host.
- */
+/** This exception is raised when looking for a non-existing host. */
 public class HostNotFoundException extends MsgException {
        private static final long serialVersionUID = 1L;
 
@@ -18,11 +14,7 @@ public class HostNotFoundException extends MsgException {
        public HostNotFoundException() {
                super();
        }
-       /**
-        * Constructs an <code>HostNotFoundException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>HostNotFoundException</code> with a detail message. */
        public HostNotFoundException(String s) {
                super(s);
        }
index ee3cafe..322ffde 100644 (file)
@@ -16,20 +16,14 @@ public class JniException extends RuntimeException {
        private static final long serialVersionUID = 1L;
 
 
-       /**
-        * Constructs an <code>JniException</code> without a 
-        * detail message. 
-        */
+       /** Constructs an <code>JniException</code> without a detail message. */
        public JniException() {
                super();
        }
-       /**
-        * Constructs an <code>JniException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */ public JniException(String s) {
+       /** Constructs an <code>JniException</code> with a detail message. */ 
+       public JniException(String s) {
                 super(s);
-        }
+       }
        public JniException(String string, Exception e) {
                super(string,e);
        }
index 263a22f..d16eb99 100644 (file)
@@ -12,47 +12,26 @@ import org.simgrid.NativeLib;
 
 public final class Msg {
 
-       /** Retrieve the simulation time
-        * @return The simulation time.
-        */
+       /** Retrieves the simulation time */
        public final static native double getClock();
-       /**
-        * Issue a debug logging message.
-        * @param s message to log.
-        */
-       public final static native void debug(String s);
-       /**
-        * Issue an verbose logging message.
-        * @param s message to log.
-        */
-       public final static native void verb(String s);
-
-       /** Issue an information logging message
-        * @param s
-        */
-       public final static native void info(String s);
-       /**
-        * Issue an warning logging message.
-        * @param s message to log.
-        */
-       public final static native void warn(String s);
-       /**
-        * Issue an error logging message.
-        * @param s message to log.
-        */
-       public final static native void error(String s);
-       /**
-        * Issue an critical logging message.
-        * @param s message to log.
-        */
+       /** Issue a debug logging message. */
+       public final static native void debug(String msg);
+       /** Issue a verbose logging message. */
+       public final static native void verb(String msg);
+       /** Issue an information logging message */
+       public final static native void info(String msg);
+       /** Issue a warning logging message. */
+       public final static native void warn(String msg);
+       /** Issue an error logging message. */
+       public final static native void error(String msg);
+       /** Issue a critical logging message. */
        public final static native void critical(String s);
 
        /*********************************************************************************
         * Deployment and initialization related functions                               *
         *********************************************************************************/
 
-       /**
-        * The natively implemented method to initialize a MSG simulation.
+       /** Initialize a MSG simulation.
         *
         * @param args            The arguments of the command line of the simulation.
         */
@@ -61,8 +40,7 @@ public final class Msg {
        /** Tell the kernel that you want to use the energy plugin */
        public final static native void energyInit();
 
-       /**
-        * Run the MSG simulation.
+       /** Run the MSG simulation.
         *
         * The simulation is not cleaned afterward (see  
         * {@link #clean()} if you really insist on cleaning the C side), so you can freely 
@@ -75,22 +53,12 @@ public final class Msg {
        @Deprecated
        public final static void clean(){}
 
-       /**
-        * The native implemented method to create the environment of the simulation.
-        *
-        * @param platformFile    The XML file which contains the description of the environment of the simulation
-        *
-        */
+       /** Create the simulation environment by parsing a platform file. */
        public final static native void createEnvironment(String platformFile);
 
        public final static native As environmentGetRoutingRoot();
 
-       /**
-        * The method to deploy the simulation.
-        *
-        *
-        * @param deploymentFile
-        */
+       /** Starts your processes by parsing a deployment file. */
        public final static native void deployApplication(String deploymentFile);
 
        /** Example launcher. You can use it or provide your own launcher, as you wish
index bebfe32..e683264 100644 (file)
@@ -8,32 +8,16 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is an abstract class grouping all MSG-related exceptions
- *
- *  <!--
- *    DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
- *    DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
- *    DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
- *    DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
- *  -->
- */
+/** This exception is an abstract class grouping all MSG-related exceptions */
 public abstract class MsgException extends Exception {
        private static final long serialVersionUID = 1L;
 
-       /**
-        * Constructs an <code>MsgException</code> without a 
-        * detail message. 
-        */
+       /** Constructs an <code>MsgException</code> without a detail message. */
        public MsgException() {
                super();
        }
-       /**
-        * Constructs an <code>MsgException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */ 
-       public MsgException(String s) {
-               super(s);
+       /** Constructs an <code>MsgException</code> with a detail message. */ 
+       public MsgException(String msg) {
+               super(msg);
        }
 }
index ed7340b..d670f55 100644 (file)
@@ -8,7 +8,8 @@ package org.simgrid.msg;
 /** A mutex  implemented on top of SimGrid synchronization mechanisms. 
  * You can use it exactly the same way that you use the mutexes, 
  * but to handle the interactions between the processes within the simulation.   
- *
+ * 
+ * Don't mix simgrid synchronization with Java native one, or it will deadlock!
  */
 public class Mutex {
        private long bind; // The C object -- don't touch it
@@ -29,9 +30,7 @@ public class Mutex {
        public native void acquire();
        public native void release();
 
-       /**
-        * Class initializer, to initialize various JNI stuff
-        */
+       /** Class initializer, to initialize various JNI stuff */
        public static native void nativeInit();
        static {
                org.simgrid.NativeLib.nativeInit();
index 0787db1..73b2523 100644 (file)
@@ -8,18 +8,11 @@
 
 package org.simgrid.msg;
 
-/**
- * This exception is raised when there is an error within the C world of SimGrid. 
- * Refer to the string message for more info on what went wrong.
- */
+/** This exception is raised when there is an error within the C world of SimGrid. */
 public class NativeException extends MsgException {
        private static final long serialVersionUID = 1L;
 
-       /**
-        * Constructs an <code>NativeException</code> with a detail message. 
-        *
-        * @param   s   the detail message.
-        */
+       /** Constructs an <code>NativeException</code> with a detail message. */
        public NativeException(String s) {
                super(s);
        }
index f408d16..42d1276 100644 (file)
@@ -47,9 +47,7 @@ public abstract class Process implements Runnable {
         * access to it. It is set automatically during the build of the object.
         */
        private long bind;
-       /**
-        * Indicates if the process is started
-        */
+       /** Indicates if the process is started */
        boolean started;
        /**
         * Even if this attribute is public you must never access to it.
@@ -66,8 +64,7 @@ public abstract class Process implements Runnable {
 
        /** Time at which the process should be created  */
        protected double startTime = 0;
-       /** Time at which th
-        * Kill time of the process
+       /** Time at which the process should be killed.
         * 
         * Set at creation, and used internally by SimGrid
         */
@@ -83,9 +80,7 @@ public abstract class Process implements Runnable {
        public Vector<String> args;
 
 
-       /**
-        * Default constructor
-        */
+       /**  Default constructor */
        protected Process() {
                this.id = nextProcessId++;
                this.name = null;