Package ariba.util.core

Examples of ariba.util.core.FastStringBuffer


        return sublist(receiver, 0);
    }

    public String toString (Object receiver)
    {
        FastStringBuffer stringBuffer = new FastStringBuffer();
        stringBuffer.append("[Array:");
        int elementCount = size(receiver);
        for (int index = elementCount - 1; index >= 0; index--) {
            Object currentElement = elementAt(receiver, index);
            stringBuffer.append("\n    ");
            stringBuffer.append(currentElement.toString());
            stringBuffer.append(",");
        }
        stringBuffer.append("]");
        return stringBuffer.toString();
    }
View Full Code Here


        return ((Object[])receiver).length;
    }

    public String toString (Object receiver)
    {
        FastStringBuffer stringBuffer = new FastStringBuffer();
        stringBuffer.append("[Array:");
        Object objectArray[] = (Object[])receiver;
        int elementCount = objectArray.length;
        for (int index = elementCount - 1; index >= 0; index--) {
            Object currentElement = objectArray[index];
            stringBuffer.append("\n    ");
            stringBuffer.append(currentElement.toString());
            stringBuffer.append(",");
        }
        stringBuffer.append("]");
        return stringBuffer.toString();
    }
View Full Code Here

    */
    void printMessage(String s, AsyncAppender app, BoundedFIFO buff,
                           Throwable th)
    {
        if (!isConsoleWriteSuspended) {
            FastStringBuffer b = new FastStringBuffer(PREFIX);
            b.append(s);
            b.append(" Appender: ");
            b.append(app.getName());
            b.append('/');
            b.append(app);
            b.append(", buffer: ");
            b.append(buff);
            if (th != null) {
                b.append('\n');
                b.append(SystemUtil.stackTrace(th));
            }
            SystemUtil.out().println(b);
            SystemUtil.flushOutput();
        }
    }
View Full Code Here

                result = toUnits(seconds,
                                 (seconds == 1) ? SecondKey : SecondsKey);
            }
        }
        else {
            FastStringBuffer fsb = new FastStringBuffer();
            int days = (int)(millis / ariba.util.core.Date.MillisPerDay);
            millis -= days * ariba.util.core.Date.MillisPerDay;
            int hours = (int)(millis / ariba.util.core.Date.MillisPerHour);
            millis -= hours * ariba.util.core.Date.MillisPerHour;
            int minutes = (int)(millis / ariba.util.core.Date.MillisPerMinute);
            if (days > 0) {
                fsb.append(toUnits(days,
                                   (days == 1) ? DayKey : DaysKey));
                if (hours > 0 || minutes > 0) {
                    fsb.append(", ");
                }
            }
            if (hours > 0) {
                fsb.append(toUnits(hours,
                                   (hours == 1) ? HourKey : HoursKey));
                if (minutes > 0) {
                    fsb.append(", ");
                }
            }
            if (minutes > 0) {
                fsb.append(toUnits(minutes,
                                   (minutes == 1) ? MinuteKey : MinutesKey));
            }
            result = fsb.toString();
        }
        return result;
    }
View Full Code Here

        }
    }

    private String getMethodNameStr (ASTMethod node)
    {
        FastStringBuffer buffer = new FastStringBuffer(200);
        buffer.append(node.getMethodName());
        buffer.append("(");
        for (int i=0; i < node.jjtGetNumChildren(); i++) {
            Node child = node.jjtGetChild(i);
            if (i > 0) {
                buffer.append(", ");
            }
            TypeInfo type = child.getTypeInfo();
            // Just print the arugment type without the argument name.  The
            // argument name can be an expression and it would be hard to read.
            buffer.append(type != null ? type.getName() : "<type unknown>");
        }
        buffer.append(")");

        return buffer.toString();
    }
View Full Code Here

    {
        if ( getCause() == null ) {
          return super.getLocalizedMessage();
        }

        FastStringBuffer buffer = new FastStringBuffer(500);
        buffer.append(super.getLocalizedMessage());
        buffer.append("\nReason:\n");
        buffer.append(getCause());
        buffer.append("\n");
        return buffer.toString();
    }
View Full Code Here

        return _errorMsg;
    }

    private String formatErrorList (List errors)
    {
        FastStringBuffer fsb = new FastStringBuffer();
        for (int i = 0; i < errors.size(); i++) {
            AWErrorInfo error = (AWErrorInfo)errors.get(i);
            if (i > 0) {
                // the rendering code is expected to use safe escaping
                fsb.append("<br/>");
            }
            fsb.append(error.getMessage());
        }
        return fsb.toString();
    }
View Full Code Here

        }

        static String getMungedMethodName (String methodName,
                                           List parameters)
        {
            FastStringBuffer buffer = new FastStringBuffer();
            buffer.append(methodName);
            if (!ListUtil.nullOrEmptyList(parameters)) {
                for (int i=0; i < parameters.size(); i++) {
                    TypeInfo paramType = (TypeInfo)parameters.get(i);
                    buffer.append('#');
                    buffer.append(paramType.getName());
                }
            }
            return buffer.toString();
        }
View Full Code Here

TOP

Related Classes of ariba.util.core.FastStringBuffer

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.