Strumenti Utente

Strumenti Sito


lpr-b: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/queryanswer.txt · Ultima modifica: 13/11/2007 alle 18:55 (12 anni fa) da Marco Danelutto