Strumenti Utente

Strumenti Sito


lpr-b-2007-2008:queryanswer
package nslookup;
 
import java.io.Serializable;
import java.net.InetAddress;
 
public class QueryAnswer implements Serializable {
 
        InetAddress ia = null; 
        String hostName = null; 
        boolean valid = false;
 
        public QueryAnswer(String h, InetAddress i) {
                ia = i; hostName = h;
                valid = true;
        }
 
        public QueryAnswer() {
                valid = false; 
        }
 
        public String getHostName() { 
                if(valid) 
                        return hostName; 
                else 
                        return null; }
        public InetAddress getInetAddress() { 
                if(valid)
                        return ia; 
                else 
                        return null; }
 
        public String toString() { 
                if(valid) return hostName+" has address "+ia.toString(); else return "Not valid";
        }
 
}
lpr-b-2007-2008/queryanswer.txt · Ultima modifica: 19/09/2008 alle 14:08 (11 anni fa) (modifica esterna)