%\bigskip
%\noindent \textbf{Java Misc Class Methods}
\section{Java Misc Class Methods}

Methods of the \texttt{Area} class:
\begin{verbatim}
Rectangle getBounds(), exclusiveOr, intersect,
add, subtract, contains(PDD)
\end{verbatim}

Methods of the \texttt{Scanner} class:
\begin{verbatim}
TYPEs:  BigDecimal, BigInteger,
        Int, Double, Line

Scanner(String),
hasNext(), hasNext(String pattern),
hasNextTYPE(),
String next(), next(String pattern),
skip(pattern),
useDelimiter(pattern), useRadix(int)
\end{verbatim}

BigInteger also has:
\begin{verbatim}
testBit, setBit, shiftLeft, mod,
remainder, xor (and friends), bitCount,
bitLength, clearBit, flipBit, gcd,
getLowestSetBit, isProbablyPrime(int)
pow, negate, abs, and signum
\end{verbatim}

File input, Regular Expressions:
\lstset{language=Java}
\begin{lstlisting}
 class Scan {
    Scanner fin;
    private void run() {
        try {
            fin = new Scanner(
                  new File("test.in"));
        } catch(Exception e) {
            System.exit(2);
        }
        while(fin.hasNextInt()) {
            System.out.println(
		fin.nextInt());
        }
    }
     static void main(String[] args) {
        new Scan().run();
        String s1 = "Hello World";
        System.out.println( // false
		s1.matches("o"));
        System.out.println( // true
		s1.matches("^.*o.*$"));
        System.out.println(
		s1.replaceAll("([A-Z])",
                              "O\'$1"));
        s1.toLowerCase();
        String[] splits = s1.split("");
        System.out.println(splits.length);
        for(String s : splits)
            System.out.println("|"+s+"|");
    }
}
\end{lstlisting}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "ref-doc"
%%% End:
