Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Because GCJ/GIJ Classpath doesn't support StringBuffer.indexOf, we have
     * to have a replacement that uses Strings instead.
     * @param buffer The StringBuffer to find in
     * @param string The String to find
     * @return The index of the string or -1 if it wasn't found
     */
    public static int getStringBufferIndexOf(StringBuffer buffer, String string) {
        return buffer.toString().indexOf(string);
    }

    /**
     * Because GCJ/GIJ Classpath doesn't support StringBuffer.indexOf, we have
     * to have a replacement that uses Strings instead.
     * @param buffer The StringBuffer to find in
     * @param string The String to find
     * @param fromIndex The char index to search from
     * @return The index of the string or -1 if it wasn't found
     */
    public static int getStringBufferIndexOf(StringBuffer buffer, String string, int fromIndex) {
        return buffer.toString().indexOf(string, fromIndex);
    }
}