Java Number Negate Negation(String StartIP, String netmask)

Here you can find the source of Negation(String StartIP, String netmask)

Description

Negation

License

Open Source License

Declaration

private static String Negation(String StartIP, String netmask) 

Method Source Code

//package com.java2s;

public class Main {

    private static String Negation(String StartIP, String netmask) {
        String[] temp1 = StartIP.trim().split("\\.");
        String[] temp2 = netmask.trim().split("\\.");
        int[] rets = new int[4];
        for (int i = 0; i < 4; i++) {
            rets[i] = Integer.parseInt(temp1[i]) & Integer.parseInt(temp2[i]);
        }/*from w  w  w  . j  a  v  a 2s  .c  o  m*/
        return rets[0] + "." + rets[1] + "." + rets[2] + "." + rets[3];
    }
}

Related

  1. negate(String string, String trueValue, String falseValue)
  2. negate(String value)
  3. negateExact(double a)
  4. negateExpression(String expression)
  5. negateInPlace(float[] in)
  6. negative(float a)
  7. negative(int b)
  8. negative(Number n)
  9. negativeInf()