Code example for StringTokenizer

Methods: countTokens, nextToken

0
        if (value == null)
        { 
            logger_.error("Could not find end point information for " + key + ", will use default.");
            value = hostProperties.getProperty("default");
        } 
        StringTokenizer st = new StringTokenizer(value, ":");
        if (st.countTokens() < 2)
        { 
            logger_.error("Value for " + key + " is invalid: " + value);
            return new String [] {"default", "default"};
        } 
        return new String[] {st.nextToken(), st.nextToken()};
    } 
 
    /** 
     * Return the data center for which an endpoint resides in 
     *   
     * @param endPoint the endPoint to process 
     * @return string of data center 
     */ 
    public String getDataCenterForEndPoint(InetAddress endPoint) {