Package gnu.java.lang

Examples of gnu.java.lang.CPStringBuilder


   */
  public static String toString(char[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here


   */
  public static String toString(short[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

   *
   * @return a <code>String</code> for this object
   */
  public String toString()
  {
    CPStringBuilder sb = new CPStringBuilder("(").append(location);
    if (certs == null || certs.isEmpty())
      sb.append(" <no certificates>");
    else
      {
        Iterator iter = certs.iterator();
        for (int i = certs.size(); --i >= 0; )
          sb.append(' ').append(iter.next());
      }
    return sb.append(")").toString();
  }
View Full Code Here

   */
  public static String toString(int[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

   *           <code>algorithm</code> is an empty string.
   */
  public static CertPathBuilder getInstance(String algorithm, Provider provider)
      throws NoSuchAlgorithmException
  {
    CPStringBuilder sb = new CPStringBuilder("CertPathBuilder for algorithm [")
        .append(algorithm).append("] from provider[")
        .append(provider).append("] could not be created");
    Throwable cause;
    try
      {
        Object spi = Engine.getInstance(CERT_PATH_BUILDER, algorithm, provider);
        return new CertPathBuilder((CertPathBuilderSpi) spi, provider, algorithm);
      }
    catch (InvocationTargetException x)
      {
        cause = x.getCause();
        if (cause instanceof NoSuchAlgorithmException)
          throw (NoSuchAlgorithmException) cause;
        if (cause == null)
          cause = x;
      }
    catch (ClassCastException x)
      {
        cause = x;
      }
    NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
    x.initCause(cause);
    throw x;
  }
View Full Code Here

   */
  public static String toString(long[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

   */
  public static String toString(float[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

      in.unread(ch);
    return (ttype = '-');
        }
    }

  CPStringBuilder tokbuf = new CPStringBuilder();
  tokbuf.append((char) ch);

  int decCount = 0;
  while (isNumeric(ch = in.read()) && ch != '-')
    if (ch == '.' && decCount++ > 0)
      break;
    else
      tokbuf.append((char) ch);

  if (ch != TT_EOF)
    in.unread(ch);
  ttype = TT_NUMBER;
  try
    {
      nval = Double.valueOf(tokbuf.toString()).doubleValue();
    }
  catch (NumberFormatException _)
    {
      nval = 0.0;
    }
  if (isNegative)
    nval = -nval;
      }
    else if (isAlphabetic(ch))
      {
  CPStringBuilder tokbuf = new CPStringBuilder();
  tokbuf.append((char) ch);
  while (isAlphabetic(ch = in.read()) || isNumeric(ch))
    tokbuf.append((char) ch);
  if (ch != TT_EOF)
    in.unread(ch);
  ttype = TT_WORD;
  sval = tokbuf.toString();
  if (lowerCase)
    sval = sval.toLowerCase();
      }
    else if (isComment(ch))
      {
  while ((ch = in.read()) != '\n' && ch != '\r' && ch != TT_EOF)
    ;
       
  if (ch != TT_EOF)
    in.unread(ch);
  return nextToken()// Recursive, but not too deep in normal cases.
      }
    else if (isQuote(ch))
      {
  ttype = ch;
  CPStringBuilder tokbuf = new CPStringBuilder();
  while ((ch = in.read()) != ttype && ch != '\n' && ch != '\r' &&
         ch != TT_EOF)
    {
      if (ch == '\\')
        switch (ch = in.read())
    {
      case 'a':  ch = 0x7;
        break;
      case 'b':  ch = '\b';
        break;
      case 'f':  ch = 0xC;
        break;
      case 'n':  ch = '\n';
        break;
      case 'r':  ch = '\r';
        break;
      case 't':  ch = '\t';
        break;
      case 'v':  ch = 0xB;
        break;
      case '\n':    ch = '\n';
        break;
                  case '\r':    ch = '\r';
        break;
      case '\"':
      case '\'':
      case '\\':
        break;
      default:
        int ch1, nextch;
        if ((nextch = ch1 = ch) >= '0' && ch <= '7')
          {
            ch -= '0';
            if ((nextch = in.read()) >= '0' && nextch <= '7')
        {
          ch = ch * 8 + nextch - '0';
          if ((nextch = in.read()) >= '0' && nextch <= '7' &&
        ch1 >= '0' && ch1 <= '3')
            {
        ch = ch * 8 + nextch - '0';
        nextch = in.read();
            }
        }
          }

        if (nextch != TT_EOF)
          in.unread(nextch);
    }

      tokbuf.append((char) ch);
    }

  // Throw away matching quote char.
  if (ch != ttype && ch != TT_EOF)
    in.unread(ch);

  sval = tokbuf.toString();
      }
    else
      {
  ttype = ch;
      }
View Full Code Here

   */
  public static String toString(double[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

   */
  public static String toString(Object[] v)
  {
    if (v == null)
      return "null";
    CPStringBuilder b = new CPStringBuilder("[");
    for (int i = 0; i < v.length; ++i)
      {
  if (i > 0)
    b.append(", ");
  b.append(v[i]);
      }
    b.append("]");
    return b.toString();
  }
View Full Code Here

TOP

Related Classes of gnu.java.lang.CPStringBuilder

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.