Subnet Calculator in Java