Exemplo n.º 1
0
 /** Gets the index of the first occurence of any string of array <i>ss</i> ignoring case. */
 public int indexOfIgnoreCase(String[] ss) {
   Parser par = new Parser(str, index);
   while (par.hasMore()) {
     if (par.startsWithIgnoreCase(ss)) return par.getPos();
     else par.skipChar();
   }
   return -1;
 }
Exemplo n.º 2
0
 /** Removes specified parameter (if present) */
 public void removeParameter(String name) {
   int index = url.indexOf(';');
   if (index < 0) return;
   Parser par = new Parser(url, index);
   while (par.hasMore()) {
     int begin_param = par.getPos();
     par.skipChar();
     if (par.getWord(SipParser.param_separators).equals(name)) {
       String top = url.substring(0, begin_param);
       par.goToSkippingQuoted(';');
       String bottom = "";
       if (par.hasMore()) bottom = url.substring(par.getPos());
       url = top.concat(bottom);
       return;
     }
     par.goTo(';');
   }
 }
Exemplo n.º 3
0
 /** Gets list of tokens (as Vector of Strings). */
 public Vector getElements() {
   Vector elements = new Vector();
   Parser par = new Parser(value);
   char[] delim = {','};
   while (par.hasMore()) {
     String elem = par.getWord(delim).trim();
     if (elem != null && elem.length() > 0) elements.addElement(elem);
     par.skipChar();
   }
   return elements;
 }