Package java.lang

Examples of java.lang.StringBuffer


    private String formatColor(String[] saSide) {
        StringBuffer sb = new StringBuffer(19);
        return sb.append(border).append(saSide[0]).append(color).toString();
    }
    private String formatWidth(String[] saSide) {
        StringBuffer sb = new StringBuffer(19);
        return sb.append(border).append(saSide[0]).append(width).toString();
    }
View Full Code Here


        StringBuffer sb = new StringBuffer(19);
        return sb.append(border).append(saSide[0]).append(width).toString();
    }

    private String formatStyle(String[] saSide) {
        StringBuffer sb = new StringBuffer(19);
        return sb.append(border).append(saSide[0]).append(style).toString();
    }
View Full Code Here

        }
        return sessionBean;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer( 128 );
        sb.append( "[ " );
        sb.append( "sessionName( " + getSessionName() + " )" );
//        sb.append( ", status( " + getStatus() + " )" );
        sb.append( ", uid( " + uid + " )" );
        sb.append( ", startDate( " + getStartDateString() + " )" );
        sb.append( ", endDate( " + getEndDateString() + " )" );
        sb.append( ", playbackFile( " + playbackFile + " )" );
        sb.append( ", recordFile( " + recordFile + " )" );
        sb.append( ", testUser( " + getTestUser() + " )" );
        sb.append( ", recordDesc( " + recordSessionBean.getDescription() + " )" );
        sb.append( ", state( " + getSessionState() + " )" );
        sb.append( ", testCount( " + testCount() + " )" );
        sb.append( ", recorded test count( " + playbackSessionBean.getRecordedTestCount() + " )" );
        sb.append( ", passed( " + playbackSessionBean.getPassedCount() + " )" );
        sb.append( ", failed( " + playbackSessionBean.getFailedCount() + " )" );
        sb.append( ", inProgress( " + inProgressCnt() + " )" );
        sb.append( " ]" );
        return sb.toString();
    }
View Full Code Here

     * Log a particular message
     *
     * @param mail the mail to process
     */
    public void service(Mail mail) {
        log(new StringBuffer(160).append("Logging mail ").append(mail.getName()).toString());
        if (comment != null) log(comment);
        try {
            if (headers) log(getMessageHeaders(mail.getMessage()));
            if (body) {
                int len = bodyMax > 0 ? bodyMax : mail.getMessage().getSize();
                StringBuffer text = new StringBuffer(len);
                InputStream is = mail.getMessage().getRawInputStream();
                byte[] buf = new byte[1024];
                int read = 0;
                while (text.length() < len && (read = is.read(buf)) > -1) {
                    text.append(new String(buf, 0, Math.min(read, len - text.length())));
                }
                log(text.toString());
            }
        }
        catch (MessagingException e) {
            log("Error logging message.", e);
        }
View Full Code Here

     *
     * @param message
     */
    private String getMessageHeaders(MimeMessage message) throws MessagingException {
        Enumeration heads = message.getAllHeaderLines();
        StringBuffer headBuffer = new StringBuffer(1024).append("\n");
        while(heads.hasMoreElements()) {
            headBuffer.append(heads.nextElement().toString()).append("\n");
        }
        return headBuffer.toString();
    }
View Full Code Here

     * to <code>DISCONNECTED_STATE</code>.
     ***/
    public POP3()
    {
        setDefaultPort(DEFAULT_PORT);
        __commandBuffer = new StringBuffer();
        __popState = DISCONNECTED_STATE;
        _reader = null;
        __writer = null;
        _replyLines = new Vector();
        _commandSupport_ = new ProtocolCommandSupport(this);
View Full Code Here

      st . nextElement();
      return( st . hasMoreElements() ) ? Boolean.TRUE : null;
   }
   /** Convenience method.  token in values must be name tokens */
   final public void setEnumeration(String values){
      StringBuffer sb = new StringBuffer(";");
      if ( values == null || values.trim().length() == 0 ) {
         setSubProp( null , ENUM , Property.constraint);
         setSubPropEval( ENUM , null );
         setSubPropMerge( ENUM , null );
         return;
      }
      enableSubProp( "XMLString.ENUM" );
      values = values.trim();
      StringTokenizer st = new StringTokenizer( values , xmlWhitespace );
      while ( st . hasMoreElements() ) {
         String str = (String) st . nextElement();
         if ( str . equals("") || !isNm( "A"+str , null ).booleanValue() ) {
            throw new RuntimeException("Attempt to create enumeration with non-NMTOKEN value >" + str + "<\n");
         }
         sb . append( str );
         sb . append( ";" );
      }
      setSubProp( sb . toString() , ENUM , Property.constraint );
   }
View Full Code Here

        m_setterString = "addLiteralResultAttribute";

        return m_setterString;
      }

      StringBuffer outBuf = new StringBuffer();

      outBuf.append("set");

      if ((m_namespace != null)
              && m_namespace.equals(Constants.S_XMLNAMESPACEURI))
      {
        outBuf.append("Xml");
      }

      int n = m_name.length();

      for (int i = 0; i < n; i++)
      {
        char c = m_name.charAt(i);

        if ('-' == c)
        {
          i++;

          c = m_name.charAt(i);
          c = Character.toUpperCase(c);
        }
        else if (0 == i)
        {
          c = Character.toUpperCase(c);
        }

        outBuf.append(c);
      }

      m_setterString = outBuf.toString();
    }

    return m_setterString;
  }
View Full Code Here

     * to <code>DISCONNECTED_STATE</code>.
     ***/
    public POP3()
    {
        setDefaultPort(DEFAULT_PORT);
        __commandBuffer = new StringBuffer();
        __popState = DISCONNECTED_STATE;
        _reader = null;
        __writer = null;
        _replyLines = new Vector();
        _commandSupport_ = new ProtocolCommandSupport(this);
View Full Code Here

     * @return The last server response.
     ***/
    public String getReplyString()
    {
        Enumeration en;
        StringBuffer buffer = new StringBuffer(256);

        en = _replyLines.elements();
        while (en.hasMoreElements())
        {
            buffer.append((String)en.nextElement());
            buffer.append(SocketClient.NETASCII_EOL);
        }

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

TOP

Related Classes of java.lang.StringBuffer

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.