Package gnu.java.lang

Examples of gnu.java.lang.CPStringBuilder


  /**
   * @return A string expression of this matcher.
   */
  public String toString()
  {
    CPStringBuilder sb = new CPStringBuilder();
    sb.append(this.getClass().getName())
      .append("[pattern=").append(pattern.pattern())
      .append(" region=").append(regionStart).append(",").append(regionEnd)
      .append(" anchoringBounds=").append(anchoringBounds == 0)
      .append(" transparentBounds=").append(transparentBounds)
      .append(" lastmatch=").append(match == null ? "" : match.toString())
      .append("]");
    return sb.toString();
  }
View Full Code Here


   
    int baseLen = baseName.length();

    // Build up a CPStringBuilder containing the complete bundle name, fully
    // qualified by locale.
    CPStringBuilder sb = new CPStringBuilder(baseLen + variant.length() + 7);

    sb.append(baseName);
   
    if (language.length() > 0)
      {
  sb.append('_');
  sb.append(language);
 
  if (country.length() > 0)
    {
      sb.append('_');
      sb.append(country);
     
      if (variant.length() > 0)
        {
          sb.append('_');
    sb.append(variant);
        }
    }
      }

    // Now try to load bundles, starting with the most specialized name.
    // Build up the parent chain as we go.
    String bundleName = sb.toString();
    ResourceBundle first = null; // The most specialized bundle.
    ResourceBundle last = null; // The least specialized bundle.
   
    while (true)
      {
View Full Code Here

   * negative.
   */
  public String getMessage()
  {
    String lineSep = System.getProperty("line.separator");
    CPStringBuilder sb = new CPStringBuilder(desc);
    sb.append(lineSep);
    sb.append('\t');
    sb.append(pattern);
    if (index != -1)
      {
  sb.append(lineSep);
  sb.append('\t');
  for (int i=0; i<index; i++)
    sb.append(' ');
  sb.append('^');
      }
    return sb.toString();
  }
View Full Code Here

          && classLoader.equals(key.classLoader);
    }   

    public String toString()
    {
      CPStringBuilder builder = new CPStringBuilder(getClass().getName());
      builder.append("[defaultLocale=");
      builder.append(defaultLocale);
      builder.append(",baseName=");
      builder.append(baseName);
      builder.append(",locale=");
      builder.append(locale);
      builder.append(",classLoader=");
      builder.append(classLoader);
      builder.append("]");
      return builder.toString();
    }
View Full Code Here

   * @return the String representation of the Method
   */
  public String toString()
  {
    // 128 is a reasonable buffer initial size for constructor
    CPStringBuilder sb = new CPStringBuilder(128);
    Modifier.toString(getModifiers(), sb).append(' ');
    sb.append(ClassHelper.getUserName(getReturnType())).append(' ');
    sb.append(getDeclaringClass().getName()).append('.');
    sb.append(getName()).append('(');
    Class[] c = getParameterTypes();
    if (c.length > 0)
      {
        sb.append(ClassHelper.getUserName(c[0]));
        for (int i = 1; i < c.length; i++)
          sb.append(',').append(ClassHelper.getUserName(c[i]));
      }
    sb.append(')');
    c = getExceptionTypes();
    if (c.length > 0)
      {
        sb.append(" throws ").append(c[0].getName());
        for (int i = 1; i < c.length; i++)
          sb.append(',').append(c[i].getName());
      }
    return sb.toString();
  }
View Full Code Here

  }

  public String toGenericString()
  {
    // 128 is a reasonable buffer initial size for constructor
    CPStringBuilder sb = new CPStringBuilder(128);
    Modifier.toString(getModifiers(), sb).append(' ');
    Constructor.addTypeParameters(sb, getTypeParameters());
    sb.append(getGenericReturnType()).append(' ');
    sb.append(getDeclaringClass().getName()).append('.');
    sb.append(getName()).append('(');
    Type[] types = getGenericParameterTypes();
    if (types.length > 0)
      {
        sb.append(types[0]);
        for (int i = 1; i < types.length; i++)
          sb.append(',').append(types[i]);
      }
    sb.append(')');
    types = getGenericExceptionTypes();
    if (types.length > 0)
      {
        sb.append(" throws ").append(types[0]);
        for (int i = 1; i < types.length; i++)
          sb.append(',').append(types[i]);
      }
    return sb.toString();
  }
View Full Code Here

   * @param mod the modifier.
   * @return the String representing the modifiers.
   */
  public static String toString(int mod)
  {
    return toString(mod, new CPStringBuilder()).toString();
  }
View Full Code Here

  {
    if (language.length() == 0 && country.length() == 0)
      return "";
    else if (country.length() == 0 && variant.length() == 0)
      return language;
    CPStringBuilder result = new CPStringBuilder(language);
    result.append('_').append(country);
    if (variant.length() != 0)
      result.append('_').append(variant);
    return result.toString();
  }
View Full Code Here

   * @param locale locale to use for formatting
   * @return String version of this locale, suitable for display to the user
   */
  public String getDisplayName(Locale locale)
  {
    CPStringBuilder result = new CPStringBuilder();
    int count = 0;
    String[] delimiters = {"", " (", ","};
    if (language.length() != 0)
      {
        result.append(delimiters[count++]);
        result.append(getDisplayLanguage(locale));
      }
    if (country.length() != 0)
      {
        result.append(delimiters[count++]);
        result.append(getDisplayCountry(locale));
      }
    if (variant.length() != 0)
      {
        result.append(delimiters[count++]);
        result.append(getDisplayVariant(locale));
      }
    if (count > 1)
      result.append(")");
    return result.toString();
  }
View Full Code Here

   * @return A String describing this SampleModel.
   * @see java.lang.Object#toString()
   */
  public String toString()
  {
    CPStringBuilder result = new CPStringBuilder();
    result.append(getClass().getName());
    result.append("[");
    result.append("scanlineStride=").append(scanlineStride);
    for(int i = 0; i < bitMasks.length; i+=1)
    {
      result.append(", mask[").append(i).append("]=0x").append(
          Integer.toHexString(bitMasks[i]));
    }
   
    result.append("]");
    return result.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.