Overloads the left shift operator to provide an easy way to add
components to a menu.<p>

@param self a JMenu
@param str  a String to be added to the menu.
@return same menu, after the value was added to it.
@since 1.6.4
347952
public static JMenu leftShift(JMenu self, String str) {
        self.add(str);
        return self;
    }
561455
public boolean setExpr(String str){
		Loc loc=new Loc();
		loc.v=0;
		int num1,num2,op;
		num1=chn2Num(str,loc);
		if(num1<0)
			return false;
		op=chn2Op(str,loc);
		if(op<0)
			return false;
		num2=chn2Num(str,loc);
		if(num2<0)
			return false;
		if(!this.checkSuffix(str, loc))
			return false;
		this.num1=num1;
		this.num2=num2;
		this.op=op;
		return true;
	}
225273
public static List<String> toList(CharSequence self) {
        String s = self.toString();
        int size = s.length();
        List<String> answer = new ArrayList<String>(size);
        for (int i = 0; i < size; i++) {
            answer.add(s.substring(i, i + 1));
        }
        return answer;
    }
868035
public static String plus(CharSequence left, Object value) {
        return left + DefaultGroovyMethods.toString(value);
    }
58554
public T add(String str) {
    requireNonNull(str, JVM_OPTION_NOT_NULL_ERROR_MESSAGE);
    String value = str.trim();
    if (isInvalidOption(value)) {
      throw new IllegalArgumentException("a JVM option can't be empty and must start with '-'");
    }
    checkMandatoryOptionOverwrite(value);
    options.add(value);

    return castThis();
  }
239651
public static String insert(final String str, final String c, final int pos) {
    if (str.length() < pos) { return str; }
    return str.substring(0, pos - 1) + c + str.substring(pos);
  }
677645
public ByteBuffer append(String str) {
        if (str != null)
            return append(DocWriter.getISOBytes(str));
        return this;
    }
1092201
public SpanManager insert(int offset, String str){
		sb.insert(offset, str);
		adjustLists( offset, str.length() );
		
		if( calculateSrcPositions ) for( int i=0; i<str.length(); i++ ) ib.add( offset, -1 );
		
		return this;
	}
	
	/**
	 * Replaces the content between s.getStart() (included) and s.getEnd() (excluded) with
	 * a String
	 */
	public SpanManager replace(Span s, String str){	return replace( s.getStart(), s.getEnd(), str); }
	
	/**
	 * Replaces the content between start (included) and end (excluded) with a String
	 */
	public SpanManager replace(int start, int end, String str){
		sb.replace(start, end, str);
		
		if( calculateSrcPositions ){
			for( int i=0; i<end-start; i++) ib.remove( start );
			for( int i=0; i<str.length(); i++) ib.add( start, -1 );
		}
		
		adjustLists(start, str.length()-(end-start) );
		return this;
	}
	
	public int indexOf(String str){ return this.indexOf(str, 0); }
	public int indexOf(String str, int fromIndex){ return sb.indexOf(str, fromIndex); }
	public int indexOf(String str, Span s){	return indexOf(str, s.getStart(), s.getEnd() ); }
	
	public int indexOf(String str, int fromIndex, int toIndex){
		int result = sb.indexOf(str, fromIndex);
		if( result >= toIndex ) return -1 ;
		return result;
	}
	
	public String substring(int start){
	    if (start < 0) {
	        start = 0;
	    }
	    return this.sb.substring(start);
	}
	
	public String substring(int start, int end){
	    if (start < 0) {
	        start = 0;
	    }
	    if (start > end) {
	        return "";
	    }
	
	    return sb.substring(start, end);
	}
	
	public String substring( Span s ) {
	    if (s.getStart() < s.getEnd()) {
	        return sb.substring( s.getStart(), s.getEnd() );
	    }
	    else {
	        return "";
	    }
	}
	
	/**
	 * <font color="#ff0000">This function is not implemented !!!</font>
	 */
	public CharSequence subSequence(int start, int end){
		//TODO Implementieren
		System.err.println("CharSequence subSequence(int start, int end)\nSorry, not Implemented");
		sb.charAt(-1); //causes an error
		return null;
	}
	
	public int length(){
		return sb.length();
	}
	
	public SpanManager setCharAt(int index, char c){
		sb.setCharAt( index, c );
		if( calculateSrcPositions ) ib.set( index, -1 );
		return this;
	}
	
	public char charAt(int index){
		return sb.charAt(index);
	}
	
	@Override
    public String toString(){
		return sb.toString();
	}
	
	/**
	 * Returnes some information about the content of the SpanManager an it�s manages
	 * Spans
	 */
	public String info(){
		StringBuilder result = new StringBuilder();
		
		result.append("\n-=SPANMANAGER=----------------------------------------------------------------\n");
				
		result.append("TEXT:");
		result.append( "\""+ sb.toString() + "\"");
		result.append("\n");		
			
		result.append("\nMANAGED SPAN LISTS:");
		if( managedLists.isEmpty() )
			result.append(" NONE\n");
		else{	
			result.append("\n");
			for( int k=0; k<managedLists.size(); k++ ){
				List<Span> sl = managedLists.get(k);
				result.append("{");
				if( sl.size() != 0 ){
					for( int i=1; i<sl.size()-1; i++ ) result.append(sl.get(i)+", ");
					result.append(sl.get( sl.size()-1));
				}
				result.append("}\n");
			}
		}
		
		result.append("------------------------------------------------------------------------------");
		
		return result.toString();
	}	
}
1085574
public JMenu addMenu(JMenuBar menuBar, String strAction, int iLocation)
    {
        JMenu menu = null;
        Application application = BaseApplet.getSharedInstance().getApplication();
        ResourceBundle oldResources = application.getResourceBundle();
        application.getResources(null, true);

        if (iLocation == JBaseToolbar.BEFORE_HELP)
            menuBar.add(menu = new JMenu(application.getString(strAction)), menuBar.getComponentCount() - 1);
        else
            menuBar.add(menu = new JMenu(application.getString(strAction)));
        menu.setMnemonic(menu.getText().charAt(0));

        if (oldResources != null)
            application.setResourceBundle(oldResources);
        menu.setOpaque(false);

        return menu;
    }
927430
private ValFrame scalar_op_frame(final String str, Frame fr) {
    Frame res = new MRTask() {
      @Override
      public void map(Chunk[] chks, NewChunk[] cress) {
        BufferedString vstr = new BufferedString();
        for (int c = 0; c < chks.length; c++) {
          Chunk chk = chks[c];
          NewChunk cres = cress[c];
          Vec vec = chk.vec();
          // String Vectors: apply str_op as BufferedStrings to all elements
          if (vec.isString()) {
            final BufferedString conStr = new BufferedString(str);
            for (int i = 0; i < chk._len; i++)
              cres.addNum(str_op(conStr, chk.atStr(vstr, i)));
          } else if (vec.isCategorical()) {
            // categorical Vectors: convert string to domain value; apply op (not
            // str_op).  Not sure what the "right" behavior here is, can
            // easily argue that should instead apply str_op to the categorical
            // string domain value - except that this whole operation only
            // makes sense for EQ/NE, and is much faster when just comparing
            // doubles vs comparing strings.
            final double d = (double) ArrayUtils.find(vec.domain(), str);
            for (int i = 0; i < chk._len; i++)
              cres.addNum(op(d, chk.atd(i)));
          } else { // mixing string and numeric
            final double d = op(1, 2); // false or true only
            for (int i = 0; i < chk._len; i++)
              cres.addNum(d);
          }
        }
      }
    }.doAll(fr.numCols(), Vec.T_NUM, fr).outputFrame(fr._names, null);
    return new ValFrame(res);
  }
334487
public void add(String str) {
        String[] tmp;

        if (size == data.length) {
            tmp = new String[data.length + GROW];
            System.arraycopy(data, 0, tmp, 0, data.length);
            data = tmp;
        }
        data[size] = str;
        size++;
    }
1180521
public static CharSequence ltrim(CharSequence str)
	{
		int len;
		int i;

		if(str == null || (len = str.length()) <= 0)
			return "";
		for(i=0;i<len;i++)
			if(!Character.isWhitespace(str.charAt(i)))
				break;
		if(i>=len)
			return "";
		return str.subSequence(i, len);
	}
334733
function (str) {
      var index = this.html.indexOf(str, this.currentChar) + str.length;
      if (index === -1)
        this.currentChar = this.html.length;
      this.currentChar = index;
    }
802837
public static JMenu leftShift(JMenu self, Component component) {
        self.add(component);
        return self;
    }
716283
public static JToolBar leftShift(JToolBar self, Action action) {
        self.add(action);
        return self;
    }
679388
public String _append(String str) {
	if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
	arr[offset + size] = str;
	size++;
	return str;
    }
395330
public static String andWith(final String str, final String boolString) {
    if (Strings.isEmpty(str)) { return null; }
    if (Strings.isEmpty(boolString)) { return str; }
    if (str.length() < boolString.length()) { return str; }
    final StringBuilder buffer = new StringBuilder(str);
    for (int i = 0; i < buffer.length(); i++) {
      if (boolString.charAt(i) == '0') {
        buffer.setCharAt(i, '0');
      }
    }
    return buffer.toString();
  }