package ipv4;

public class Address {
	
	private String address;
	
	public Address() {}
	
	public Address( String address ) {
		setAddress( address );
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setAddress( String address ) {	
		this.address = address;
	}
	
	public void setAddress( long addressValue ) {
		this.setAddress( toDottedDecimal( addressValue ) );
	}

	public void setAddress( Address address ) {
		this.address = address.getAddress();
	}
	  
	public long toValue() {
		long intEndIP = 0;
		
		if ( ! address.equals( "INVALID" ) ) {	
			String ipSplit[] = this.getAddress().split( "\\." );
			
			int k = 0;
			
			do {
				intEndIP |= Long.parseLong( ipSplit[ k ] );

				if ( k < 3 ) {
					intEndIP = intEndIP << 8;
				}
				
				k++;
			} while( k < 4 );
			
			intEndIP &= 0xffffffff;
			
		} else {
			intEndIP = Long.MAX_VALUE;
		}
		
		return intEndIP;
	}
	
	private String toDottedDecimal( long value ) {
		String host = "";
			
		host += ( value >>> 24 ) + "." +
				( ( value & 0x0000000000ff0000L ) >>> 16 ) + "." +
				( ( value & 0x000000000000ff00L ) >>> 8 ) + "." +
				( value & 0x00000000000000ffL );	
			
		return host;
	}	
}
@@ -559,53 +559,12 @@
 %09%0D%0A%09
-%09if ( ! address.equals( %22INVALID%22 ) ) %7B%09%0D%0A%09%09%09
+    
 Stri
@@ -620,17 +620,16 @@
 %0A%09%09%09%0D%0A%09%09
-%09
 int k = 
@@ -637,17 +637,16 @@
 ;%0D%0A%09%09%09%0D%0A
-%09
 %09%09do %7B%0D%0A
@@ -648,17 +648,16 @@
 o %7B%0D%0A%09%09%09
-%09
 intEndIP
@@ -698,17 +698,16 @@
 ;%0D%0A%0D%0A%09%09%09
-%09
 if ( k %3C
@@ -714,17 +714,16 @@
  3 ) %7B%0D%0A
-%09
 %09%09%09%09intE
@@ -748,17 +748,16 @@
  8;%0D%0A%09%09%09
-%09
 %7D%0D%0A%09%09%09%09%0D
@@ -764,16 +764,14 @@
 %0A%09%09%09
-%09
 k++;%0D%0A
-%09
 %09%09%7D 
@@ -790,25 +790,24 @@
  );%0D%0A%09%09%09%0D%0A%09%09
-%09
 intEndIP &= 
@@ -823,61 +823,8 @@
 f;%0D%0A
-%09%09%09%0D%0A%09%09%7D else %7B%0D%0A%09%09%09intEndIP = Long.MAX_VALUE;%0D%0A%09%09%7D%0D%0A
 %09%09%0D%0A
@@ -905,41 +905,14 @@
 %0D%0A%09%09
-String host = %22%22;%0D%0A%09%09%09%0D%0A%09%09host +=
+return
  ( v
@@ -1088,29 +1088,8 @@
 ;%09%0D%0A
-%09%09%09%0D%0A%09%09return host;%0D%0A
 %09%7D%09%0D

Remove redundant code