private PortScan setMethod(int method) {
        switch (method) {
            case METHOD_UDP:
            case METHOD_TCP:
                this.method = method;
                break;
            default:
                throw new IllegalArgumentException("Invalid method type " + method);
        }
        return this;
    }
Set scan method, either TCP or UDP

@param method - the transport method to use to scan, either PortScan.METHOD_UDP or PortScan.METHOD_TCP
@return this object to allow chaining
@throws IllegalArgumentException - if invalid method
library/src/main/java/com/stealthcopter/networktools/PortScan.java