length() private method

private length ( ) : int
return int
示例#1
0
 public virtual string toString()
 {
   StringBuffer stringBuffer = new StringBuffer();
   stringBuffer.append(this.text);
   if (stringBuffer.length() < this.length)
   {
     char[] chArray = new char[this.length - stringBuffer.length()];
     Arrays.fill(chArray, ' ');
     stringBuffer.append(chArray);
   }
   return stringBuffer.toString();
 }
 // Documentation in subclasses because of synchro difference
 public virtual AbstractStringBuilder append(StringBuffer sb)
 {
     if (sb == null)
     return append(new String("null"));
     int len = sb.length();
     ensureCapacityInternal(count + len);
     sb.getChars(0, len, value, count);
     count += len;
     return this;
 }
示例#3
0
        // Documentation in subclasses because of synchro difference
        public virtual AbstractStringBuilder append(StringBuffer sb)
        {
            if (sb == null)
            {
                return(append(new String("null")));
            }
            int len = sb.length();

            ensureCapacityInternal(count + len);
            sb.getChars(0, len, value, count);
            count += len;
            return(this);
        }
示例#4
0
 /*
  * public String(byte[] bytes, int offset, int length, String charsetName) {
  *  if (charsetName == null)
  *      throw new ArgumentNullException("charsetName");
  *  checkBounds(bytes, offset, length);
  *  this.value = StringCoding.decode(charsetName, bytes, offset, length);
  * }
  *
  * public String(byte[] bytes, int offset, int length, Charset charset) {
  *  if (charset == null)
  *      throw new ArgumentNullException("charset");
  *  checkBounds(bytes, offset, length);
  *  this.value =  StringCoding.decode(charset, bytes, offset, length);
  * }
  *
  * public String(byte[] bytes, String charsetName) {
  *  this(bytes, 0, bytes.length, charsetName);
  * }
  *
  * public String(byte[] bytes, Charset charset) {
  *  this(bytes, 0, bytes.length, charset);
  * }
  *
  * public String(byte[] bytes, int offset, int length) {
  *  checkBounds(bytes, offset, length);
  *  this.value = StringCoding.decode(bytes, offset, length);
  * }
  *
  * public String(byte[] bytes) {
  *  this(bytes, 0, bytes.Length);
  * }
  */
 public String(StringBuffer buffer)
 {
     lock (buffer) {
         this.value = Arrays.copyOf(buffer.getValue(), buffer.length());
     }
 }