Package org.zoolu.tools

Examples of org.zoolu.tools.Parser.indexOf()


   /** Gets host of SipURL */
   public String getHost() { 
     char[] host_terminators={':',';','?'};
     Parser par = new Parser(url);
     int begin = par.indexOf('@'); // skip "sip:user@"
     if (begin < 0) begin = 4; // skip "sip:"
     else begin++; // skip "@"
    
     par.setPos(begin);
     int end = par.indexOf(host_terminators);
View Full Code Here


     int begin = par.indexOf('@'); // skip "sip:user@"
     if (begin < 0) begin = 4; // skip "sip:"
     else begin++; // skip "@"
    
     par.setPos(begin);
     int end = par.indexOf(host_terminators);
     if (end < 0) return url.substring(begin);
       else return url.substring(begin,end);
   }

   /** Gets port of SipURL; returns -1 if port is not specidfied */
 
View Full Code Here

   /** Gets port of SipURL; returns -1 if port is not specidfied */
   public int getPort() { 
     char[] port_terminators={';','?'};
     Parser par = new Parser(url,4); // skip "sip:"
     int begin = par.indexOf(':');
     if (begin < 0) return -1;
     else
       begin++;
       par.setPos(begin);
       int end = par.indexOf(port_terminators);
View Full Code Here

     int begin = par.indexOf(':');
     if (begin < 0) return -1;
     else
       begin++;
       par.setPos(begin);
       int end = par.indexOf(port_terminators);
       if (end < 0) return Integer.parseInt(url.substring(begin));
       else return Integer.parseInt(url.substring(begin,end));
      }
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.