Package java.lang

Examples of java.lang.String.startsWith()


    }
  m = ratioPat.matcher(s);
  if(m.matches())
    {
    String numerator = m.group(1);
    if (numerator.startsWith("+")) numerator = numerator.substring(1);

    return Numbers.divide(Numbers.reduceBigInt(BigInt.fromBigInteger(new BigInteger(numerator))),
                          Numbers.reduceBigInt(BigInt.fromBigInteger(new BigInteger(m.group(2)))));
    }
  return null;
View Full Code Here


      return '\b';
    else if(token.equals("formfeed"))
      return '\f';
    else if(token.equals("return"))
      return '\r';
    else if(token.startsWith("u"))
      {
      char c = (char) readUnicodeChar(token, 1, 4, 16);
      if(c >= '\uD800' && c <= '\uDFFF') // surrogate code unit?
        throw Util.runtimeException("Invalid character constant: \\u" + Integer.toString(c, 16));
      return c;
View Full Code Here

      char c = (char) readUnicodeChar(token, 1, 4, 16);
      if(c >= '\uD800' && c <= '\uDFFF') // surrogate code unit?
        throw Util.runtimeException("Invalid character constant: \\u" + Integer.toString(c, 16));
      return c;
      }
    else if(token.startsWith("o"))
      {
      int len = token.length() - 1;
      if(len > 3)
        throw Util.runtimeException("Invalid octal escape sequence length: " + len);
      int uc = readUnicodeChar(token, 1, len, 8);
View Full Code Here

    Node propertiesDict = createNode("dict", appendTo);

    for (Iterator i = javaProperties.keySet().iterator(); i.hasNext();) {
      String key = (String) i.next();

      if (key.startsWith("com.apple.") && (version >= 1.4)) {
        System.out.println("Deprecated as of 1.4: " + key);
        continue;
      }

      writeKeyStringPair(key, (String)javaProperties.get(key), propertiesDict);
View Full Code Here

    String stage = getActualStage();

    Properties result = new Properties();
    for ( Map.Entry<Object, Object> entry : props.entrySet() ) {
      String key = String.valueOf( entry.getKey() );
      if ( key.startsWith( stage ) ) {
        String newKey = key.substring( stage.length() + 1 );
        result.setProperty( newKey, ( String ) entry.getValue() );
      }
    }
    return result;
View Full Code Here

     

      // JvB: send a 400 response for requests (except ACK)
      // Currently only UDP, @todo also other transports
      String msgString = new String(msgBytes, 0, packetLength);
      if (!msgString.startsWith("SIP/") && !msgString.startsWith("ACK ")) {

        String badReqRes = createBadReqRes(msgString, ex);
        if (badReqRes != null) {
          if (sipStack.isLoggingEnabled()) {
            sipStack.getLogWriter().logDebug(
View Full Code Here

     

      // JvB: send a 400 response for requests (except ACK)
      // Currently only UDP, @todo also other transports
      String msgString = new String(msgBytes, 0, packetLength);
      if (!msgString.startsWith("SIP/") && !msgString.startsWith("ACK ")) {

        String badReqRes = createBadReqRes(msgString, ex);
        if (badReqRes != null) {
          if (sipStack.isLoggingEnabled()) {
            sipStack.getLogWriter().logDebug(
View Full Code Here

            return Double.parseDouble(s);
        }
        m = ratioPat.matcher(s);
        if (m.matches()) {
            String numerator = m.group(1);
            if (numerator.startsWith("+"))
                numerator = numerator.substring(1);

            return Numbers.divide(
                    Numbers.reduceBigInt(BigInt.fromBigInteger(new BigInteger(numerator))),
                    Numbers.reduceBigInt(BigInt.fromBigInteger(new BigInteger(m.group(2)))));
View Full Code Here

        if (dc == null) {
            return;
        }

        altDDName = altDDName.trim();
        if (altDDName.startsWith("/")) {
            altDDName = altDDName.substring(1);
        }
     
        String appLoc = dc.getSource().getParentArchive().getURI().getPath();
        altDDName = appLoc + altDDName;
View Full Code Here

  public List<?> load( @Nonnull Reader in ) throws IOException {
    //noinspection IOResourceOpenedButNotSafelyClosed
    BufferedReader br = new BufferedReader( in );
    String firstLine = br.readLine().trim();//xml

    if ( !firstLine.startsWith( XML_HEADER_BEGIN ) || !firstLine.endsWith( XML_HEADER_SUFFIX ) ) {
      throw new IllegalStateException( "Invalid start of file. Was <" + firstLine + "> but exepcted something like <" + XML_HEADER_BEGIN + XML_HEADER_SUFFIX + '>' );
    }

    return ( ( Configurations ) xStream.fromXML( br ) ).getConfigurations();
  }
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.