001/*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005package sec.geo.utilities;
006
007/**
008 *
009 * @author Michael Deutch
010 */
011public class StringBuilder {
012    private String str=null;
013    public StringBuilder()
014    {
015        str="";
016    }
017    public StringBuilder(String str2)
018    {
019        str=str2;
020    }
021    public void append(Object obj)
022    {
023        if(obj instanceof String)
024        {
025            String str2=(String)obj;
026            str+=str2;
027        }
028        else if (obj instanceof Double)
029        {
030            double d=(Double)obj;
031            str+= Double.toString(d);
032        }
033    }
034    @Override
035    public String toString()
036    {
037        return str;
038    }
039    public void replace(int first, int last, String str2)
040    {
041        String startStr="", endStr="";
042        startStr=str.substring(0,first);
043        endStr=str.substring(last, str.length());
044        str=startStr+str2+endStr;
045    }
046    public int indexOf(String str2)
047    {
048        return str.indexOf(str2);
049    }
050    public int indexOf2(String str2, int index)
051    {
052        return str.indexOf(str2,index);
053    }
054    
055}