public static PortRange getInstance(String value) {
        int lowerBound = UNBOUND;
        int upperBound = UNBOUND;

        // first off, make sure there's actually content here
        if ((value.length() == 0) || (value.equals("-")))
            return new PortRange();

        // there's content, so figure where the '-' is, if at all
        int dashPos = value.indexOf('-');

        if (dashPos == -1) {
            // there's no dash, so it's just a single number
            lowerBound = upperBound = Integer.parseInt(value);
        } else if (dashPos == 0) {
            // it starts with a dash, so it's just upper-range bound
            upperBound = Integer.parseInt(value.substring(1));
        } else {
            // it's a number followed by a dash, so get the lower-bound...
            lowerBound = Integer.parseInt(value.substring(0, dashPos));
            int len = value.length();

            // ... and see if there is a second port number
            if (dashPos != (len - 1)) {
                // the dash wasn't at the end, so there's an upper-bound
                upperBound = Integer.parseInt(value.substring(dashPos + 1,
                                                              len));
            }
        }

        return new PortRange(lowerBound, upperBound);
    }