Examples of StringBuilder


Examples of java.lang.StringBuilder

   


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("needAllFields: " + mNeedAllFields);
        sb.append(" needNoFields: " + mNeedNoFields);
        sb.append(" fields: " + mFields);
        return sb.toString();
    }
View Full Code Here

Examples of java.lang.StringBuilder

        mChanges = changes;
    }
   
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("changes: " + mChanges);
        sb.append(" mapped fields: " + mMappedFields);
        sb.append(" added fields: " + mAddedFields);
        sb.append(" removed fields: " + mRemovedFields);
        return sb.toString();
    }
View Full Code Here

Examples of java.lang.StringBuilder

            return mCastType;
        }

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(mInputColumn);
            if (mCast) {
                sb.append(" cast to: " + DataType.findTypeName(mCastType));
            }
            return sb.toString();
        }
View Full Code Here

Examples of java.lang.StringBuilder

    public boolean isRich(){
        return getIncome() >= 80000;
    }

    public String getName() {
        StringBuilder name = new StringBuilder();

        // Age
        if (getAge()>=21){
            name.append("old");
        }else{
            name.append("young");
        }

        //Income
        if (isRich()){
            name.append(" rich");
        }

        //Sex
        if (getSex() == Sex.MALE){
            name.append(" man");
        }else{
             name.append(" woman");
        }

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

Examples of java.lang.StringBuilder

        this.totalSplits = totalSplits;
    }

    @Override
    public String toString() {
        StringBuilder st = new StringBuilder();
        st.append("Number of splits :" + wrappedSplits.length+"\n");
        try {
            st.append("Total Length = "+ getLength()+"\n");
            for (int i = 0; i < wrappedSplits.length; i++) {
                st.append("Input split["+i+"]:\n   Length = "+ wrappedSplits[i].getLength()+"\n  Locations:\n");
                for (String location :  wrappedSplits[i].getLocations())
                    st.append("    "+location+"\n");
                st.append("\n-----------------------\n");
          }
        } catch (IOException e) {
          return null;
        } catch (InterruptedException e) {
          return null;
        }
        return st.toString();
    }
View Full Code Here

Examples of java.lang.StringBuilder

  @Override
  public String get(int index)
  {
    index = index * width;
    StringBuilder sb = new StringBuilder();
    sb.append(_elements[index]);

    int left = width;
    ++index;
    while (left>1)
    {
      sb.append(',');
      sb.append(_elements[index]);
      --left; ++index;
    }

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

Examples of java.lang.StringBuilder

    long[] val = (long[])o;

    if (val.length == 0)
      return null;

    StringBuilder sb = new StringBuilder();
    sb.append(val[0]);

    for(int i=1; i<val.length; ++i)
    {
      sb.append(',');
      sb.append(val[i]);
    }
    return sb.toString();
  }
View Full Code Here

Examples of java.lang.StringBuilder

        // Get the response
        BufferedReader rd = new BufferedReader
                (new InputStreamReader(response.getEntity().getContent()));

        StringBuilder builder = new StringBuilder();
        String line = "";
        while ((line = rd.readLine()) != null) {
            builder.append(line);
        }

        Assert.assertNotNull(response);
        Assert.assertEquals("Got " + builder.toString(), 200, response.getStatusLine().getStatusCode());
    }
View Full Code Here

Examples of java.lang.StringBuilder

        // Get the response
        BufferedReader rd = new BufferedReader
                (new InputStreamReader(response.getEntity().getContent()));

        StringBuilder builder = new StringBuilder();
        String line = "";
        while ((line = rd.readLine()) != null) {
            builder.append(line);
        }

        Assert.assertNotNull(response);
        Assert.assertEquals("Got " + builder.toString(), 200, response.getStatusLine().getStatusCode());
    }
View Full Code Here

Examples of java.lang.StringBuilder

        this.totalSplits = totalSplits;
    }

    @Override
    public String toString() {
        StringBuilder st = new StringBuilder();
        st.append("Number of splits :" + wrappedSplits.length+"\n");
        try {
            st.append("Total Length = "+ getLength()+"\n");
            for (int i = 0; i < wrappedSplits.length; i++) {
                st.append("Input split["+i+"]:\n   Length = "+ wrappedSplits[i].getLength()+"\n  Locations:\n");
                for (String location :  wrappedSplits[i].getLocations())
                    st.append("    "+location+"\n");
                st.append("\n-----------------------\n");
          }
        } catch (IOException e) {
          return null;
        } catch (InterruptedException e) {
          return null;
        }
        return st.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.