/** * Constructs IP by four numbers. * * @param a First number of the IP address. * @param b Second number of the IP address. * @param c Third number of the IP address. * @param d Last number of the IP address. */ public IP(int a, int b, int c, int d) { checkArgument(checkRange(a) && checkRange(b) && checkRange(c) && checkRange(d), "Each number of IP must in 0 ~ 255"); this.a = a; this.b = b; this.c = c; this.d = d; value = this.toLong(); }
/** * Constructs IP by four numbers. * * @param a First number of the IP address. * @param b Second number of the IP address. * @param c Third number of the IP address. * @param d Last number of the IP address. */ public IP(int a, int b, int c, int d) { checkArgument(checkRange(a) && checkRange(b) && checkRange(c) && checkRange(d), "Each number of IP must in 0 ~ 255"); this.a = a; this.b = b; this.c = c; this.d = d; value = this.toLong(); }