Subversion Repositories Projects

Rev

Rev 206 | Rev 242 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 206 Rev 223
Line 1... Line 1...
1
public class DUBwiseHelper
1
public final class DUBwiseHelper
2
{
2
{
3
    public String ip_digit_zeroes(int digit)
3
    public final static String ip_digit_zeroes(int digit)
4
    {   return "" + digit/100 + "" +   (digit/10)%10 + "" + (digit)%10;   }
4
    {   return "" + digit/100 + "" +   (digit/10)%10 + "" + (digit)%10;   }
Line 5... Line 5...
5
 
5
 
6
 
6
 
7
    public String ip_str(int[] ip,boolean with_zeroes)
7
    public final static  String ip_str(int[] ip,boolean with_zeroes)
8
    {
8
    {
9
        if(with_zeroes)
9
        if(with_zeroes)
10
            return ip_digit_zeroes(ip[0]) + "." +ip_digit_zeroes(ip[1]) + "."+ip_digit_zeroes(ip[2]) + "."+ip_digit_zeroes(ip[3]) + ":"+ip_digit_zeroes(ip[4]) ;
10
            return ip_digit_zeroes(ip[0]) + "." +ip_digit_zeroes(ip[1]) + "."+ip_digit_zeroes(ip[2]) + "."+ip_digit_zeroes(ip[3]) + ":"+ip_digit_zeroes(ip[4]) ;
Line 11... Line 11...
11
        else
11
        else
Line 12... Line 12...
12
            return ip[0]+"."+ip[1]+"."+ip[2]+"."+ip[3]+":"+ip[4];
12
            return ip[0]+"."+ip[1]+"."+ip[2]+"."+ip[3]+":"+ip[4];
13
           
13
           
14
    }
14
    }
Line 15... Line 15...
15
 
15
 
16
    public int pow(int val,int pow)
16
    public final static  int pow(int val,int pow)
Line 17... Line 17...
17
    {
17
    {
18
        int res=1;
18
        int res=1;
Line 19... Line 19...
19
 
19
 
20
        for (int p=0;p<pow;p++)
20
        for (int p=0;p<pow;p++)
Line 21... Line 21...
21
            res*=val;
21
            res*=val;
Line 22... Line 22...
22
 
22