Package java.util

Examples of java.util.StringTokenizer


        iRandomSelection = properties.getPropertyBoolean("SimulatedAnnealing.Random", iRandomSelection);
        iUpdatePoints = properties.getPropertyBoolean("SimulatedAnnealing.Update", iUpdatePoints);
        String neighbours = properties.getProperty("SimulatedAnnealing.Neighbours",
                ItcSwapMove.class.getName()+"@1;"+
                ItcRandomMove.class.getName()+"@1");
        for (StringTokenizer s=new StringTokenizer(neighbours,";");s.hasMoreTokens();) {
            String nsClassName = s.nextToken();
            double bonus = 1.0;
            if (nsClassName.indexOf('@')>=0) {
                bonus = Double.parseDouble(nsClassName.substring(nsClassName.indexOf('@')+1));
                nsClassName = nsClassName.substring(0, nsClassName.indexOf('@'));
            }
View Full Code Here


      return false;
    String filesDenied = getServlet().getInitParameter("filesDenied");
    if(filesDenied==null)
      return true;
   
    StringTokenizer st = new StringTokenizer(filesDenied, ",");
    while(st.hasMoreElements()){
      if(ext.equalsIgnoreCase(st.nextToken()))
        return false;
    }
    return true;
  }
View Full Code Here

              + s.substring(2, 3) + s.substring(2, 3)
              + s.substring(3, 4) + s.substring(3, 4);
        if (s.length() == 7)
          return new Color(Integer.parseInt(s.substring(1), 16));
      } else if (s.startsWith("rgb")) {
        StringTokenizer tk = new StringTokenizer(s.substring(3),
            " \t\r\n\f(),");
        int[] cc = new int[3];
        for (int k = 0; k < 3; ++k) {
          if (!tk.hasMoreTokens())
            return null;
          String t = tk.nextToken();
          float n;
          if (t.endsWith("%")) {
            n = Float.parseFloat(t.substring(0, t.length() - 1));
            n = n * 255f / 100f;
          } else
View Full Code Here

   */
  public static Properties parseAttributes(String string) {
    Properties result = new Properties();
    if (string == null)
      return result;
    StringTokenizer keyValuePairs = new StringTokenizer(string, ";");
    StringTokenizer keyValuePair;
    String key;
    String value;
    while (keyValuePairs.hasMoreTokens()) {
      keyValuePair = new StringTokenizer(keyValuePairs.nextToken(), ":");
      if (keyValuePair.hasMoreTokens())
        key = keyValuePair.nextToken().trim();
      else
        continue;
      if (keyValuePair.hasMoreTokens())
        value = keyValuePair.nextToken().trim();
      else
        continue;
      if (value.startsWith("\""))
        value = value.substring(1);
      if (value.endsWith("\""))
View Full Code Here

  public static synchronized void addInterceptors(String listInterceptorClassName, List interceptors) throws Exception {
    if (listInterceptorClassName != null && interceptors != null) {
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "addInterceptors(" + listInterceptorClassName + ", " + interceptors + ')');
      String error = null;
      StringTokenizer token = new StringTokenizer(listInterceptorClassName, INTERCEPTOR_CLASS_NAME_SEPARATOR);
      while (token.hasMoreTokens()) {
        String interceptorClassName = token.nextToken();
        try {
          interceptors.add((MessageInterceptor)Class.forName(interceptorClassName).newInstance());
        } catch(Throwable t) {
          if (logger.isLoggable(BasicLevel.WARN))
            logger.log(BasicLevel.WARN, "addInterceptors", t);
View Full Code Here

  public static synchronized void removeInterceptors(String listInterceptorClassName, List interceptors) throws Exception {
    if (listInterceptorClassName != null && interceptors != null) {
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "removeInterceptors(" + listInterceptorClassName + ", " + interceptors + ')');
      String error = null;
      StringTokenizer token = new StringTokenizer(listInterceptorClassName, INTERCEPTOR_CLASS_NAME_SEPARATOR);
      while (token.hasMoreTokens()) {
        String interceptorClassName = token.nextToken();
        try {
          removeInterceptor(interceptorClassName, interceptors);
        } catch(Throwable t) {
          if (logger.isLoggable(BasicLevel.WARN))
            logger.log(BasicLevel.WARN, "removeInterceptors", t);
View Full Code Here

  public final String getOptions() {
    return options;
  }
  public final void setOptions(String options) {
    this.options = options;
    StringTokenizer st = new StringTokenizer(options, ";");
    while(st.hasMoreElements()){
      String tk = st.nextToken();
      if("bookmark".equalsIgnoreCase(tk))
        this.setBookmark(1);
      else if("elite".equalsIgnoreCase(tk))
        this.setElite(1);
      else if("top".equalsIgnoreCase(tk))
View Full Code Here

   * @return
   */
  public List list_songs(String mids){
    if(mids == null)
      return null;
    StringTokenizer st = new StringTokenizer(mids,",");
    List ids = new ArrayList();
    while(st.hasMoreElements()){
      String sid = st.nextToken();
      try{
        ids.add(new Integer(sid));
      }catch(Exception e){}
    }
    return MusicDAO.listSongs(ids);
View Full Code Here

   * path="/images/test.gif" <br />
   * context="/test/index.html"<br />
   * result="../images/test.gif"
   */
  private String localizePath(String path, String context) {
    StringTokenizer st = new StringTokenizer(context,"/");
    int depth = st.countTokens();
    if (! context.endsWith("/")) {
      depth--;
    }     

    StringBuffer sb = new StringBuffer();
View Full Code Here

    public IPathElement getChildElement(String name) {
        return getNode(name);
    }

    public INode getSubnode(String name) {
        StringTokenizer st = new StringTokenizer(name, "/");
        TransientNode retval = this;
        TransientNode runner;

        while (st.hasMoreTokens() && (retval != null)) {
            runner = retval;

            String next = st.nextToken().trim().toLowerCase();

            if ("".equals(next)) {
                retval = this;
            } else {
                retval = (runner.nodeMap == null) ? null
View Full Code Here

TOP

Related Classes of java.util.StringTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.