- Code Formatierung durch eclipse
authorfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 14:43:23 +0000 (14:43 +0000)
committerfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 14:43:23 +0000 (14:43 +0000)
git-svn-id: https://www.internetallee.de/svn/bytewurf@42 a944a559-bf0e-0410-8ddc-85264b264b6c

projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/HostConfig.java

index 3135134..3d73419 100644 (file)
@@ -14,18 +14,22 @@ import java.net.UnknownHostException;
  */
 public class HostConfig {
        public static final int MIN_PORT_NUMBER = 0;
-       public static final int MAX_PORT_NUMBER = (1<<16);
+
+       public static final int MAX_PORT_NUMBER = (1 << 16);
+
        private InetAddress host;
+
        private int portA = 0;
+
        private int portB = 0;
-       
+
        public String getHostname() {
                if (host == null)
                        return "localhost";
-               
+
                return host.getHostName();
        }
-       
+
        public void setHostname(String hostname) {
                try {
                        host = InetAddress.getByName(hostname);
@@ -33,27 +37,31 @@ public class HostConfig {
                        throw new IllegalArgumentException("Hostname nicht gültig");
                }
        }
-       
+
        public int getPortA() {
                return portA;
        }
-       
+
        public void setPortA(int portA) {
                if (!isValidPortnumber(portA))
-                       throw new IllegalArgumentException("Port ausserhalb des gültigen Bereichs");
+                       throw new IllegalArgumentException(
+                                       "Port ausserhalb des gültigen Bereichs");
                this.portA = portA;
        }
 
        private boolean isValidPortnumber(int portA) {
                return ((portA > MIN_PORT_NUMBER) && (portA < MAX_PORT_NUMBER));
        }
+
        public int getPortB() {
                return portB;
        }
+
        public void setPortB(int portB) {
                if (!isValidPortnumber(portB))
-                       throw new IllegalArgumentException("Port ausserhalb des gültigen Bereichs");
+                       throw new IllegalArgumentException(
+                                       "Port ausserhalb des gültigen Bereichs");
                this.portB = portB;
        }
-       
+
 }