Java Abridged Documentation Table of Contentsacase/classes/fall13/UA0101-006/notes/exam... ·...

32
Java Abridged Documentation Table of Contents Java Abridged Documentation................................................................................................................................. 1 Appendix A: System (java.lang.System) Library.................................................................................................... 1 Appendix B: Math (java.lang.Math) Library........................................................................................................... 2 Appendix C: Array (java.util.Arrays) Library......................................................................................................... 4 Appendix D: Primitive Wrappers.............................................................................................................................8 D1.1: Integer Class Methods............................................................................................................................... 8 D1.2: Double Class Methods............................................................................................................................ 10 Appendix E: String Class Methods........................................................................................................................ 10 Appendix F: Random Class Methods.................................................................................................................... 13 Appendix G: Input/Output Classes........................................................................................................................ 14 G1.1: Scanner Class.......................................................................................................................................... 14 G1.2: PrintWriter Class..................................................................................................................................... 16 G1.3: File Class................................................................................................................................................. 17 Appendix H: Graphical User Interface Classes..................................................................................................... 19 H1.1: Layout Managers..................................................................................................................................... 19 H1.1.1: BorderLayout Class......................................................................................................................... 19 H1.1.2: GridLayout Class............................................................................................................................. 20 H1.1.3: FlowLayout Class............................................................................................................................ 21 H1.2: Event Listeners........................................................................................................................................ 21 H1.2.1: ActionListener Interface.................................................................................................................. 21 H1.2.2: MouseListener Interface.................................................................................................................. 22 H1.2.3: MouseMotionListener Interface...................................................................................................... 22 H1.3: Color Class.............................................................................................................................................. 22 H1.4: ImageIcon Class...................................................................................................................................... 23 H1.5: Component Class.................................................................................................................................... 24 H1.6: Container Class....................................................................................................................................... 30 Appendix A: System (java.lang.System) Library Field Summary static PrintStream err The "standard" error output stream. static InputStream in The "standard" input stream. static PrintStream out The "standard" output stream. Method Summary static void arraycopy (Object src, int srcPos, Object dest, int destPos, int length) Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. static String clearProperty (String key) Removes the system property indicated by the specified key. 1

Transcript of Java Abridged Documentation Table of Contentsacase/classes/fall13/UA0101-006/notes/exam... ·...

  • Java Abridged Documentation

    Table of ContentsJava Abridged Documentation.................................................................................................................................1Appendix A: System (java.lang.System) Library.................................................................................................... 1Appendix B: Math (java.lang.Math) Library...........................................................................................................2Appendix C: Array (java.util.Arrays) Library......................................................................................................... 4Appendix D: Primitive Wrappers.............................................................................................................................8

    D1.1: Integer Class Methods...............................................................................................................................8D1.2: Double Class Methods............................................................................................................................ 10

    Appendix E: String Class Methods........................................................................................................................10Appendix F: Random Class Methods.................................................................................................................... 13Appendix G: Input/Output Classes........................................................................................................................ 14

    G1.1: Scanner Class.......................................................................................................................................... 14G1.2: PrintWriter Class..................................................................................................................................... 16G1.3: File Class.................................................................................................................................................17

    Appendix H: Graphical User Interface Classes..................................................................................................... 19H1.1: Layout Managers.....................................................................................................................................19

    H1.1.1: BorderLayout Class......................................................................................................................... 19H1.1.2: GridLayout Class.............................................................................................................................20H1.1.3: FlowLayout Class............................................................................................................................21

    H1.2: Event Listeners........................................................................................................................................21H1.2.1: ActionListener Interface.................................................................................................................. 21H1.2.2: MouseListener Interface..................................................................................................................22H1.2.3: MouseMotionListener Interface...................................................................................................... 22

    H1.3: Color Class.............................................................................................................................................. 22H1.4: ImageIcon Class...................................................................................................................................... 23H1.5: Component Class.................................................................................................................................... 24H1.6: Container Class....................................................................................................................................... 30

    Appendix A: System (java.lang.System) LibraryField Summary

    static PrintStream err The "standard" error output stream.

    static InputStream in The "standard" input stream.

    static PrintStream out The "standard" output stream.

    Method Summary

    static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.

    static String clearProperty(String key) Removes the system property indicated by the specified key.

    1

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#clearProperty(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#arraycopy(java.lang.Object,%20int,%20java.lang.Object,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#outhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#inhttp://docs.oracle.com/javase/6/docs/api/java/io/InputStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#errhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintStream.html

  • static Console console() Returns the unique Console object associated with the current Java virtual machine, if any.

    static long currentTimeMillis() Returns the current time in milliseconds.

    static void exit(int status) Terminates the currently running Java Virtual Machine.

    static void gc() Runs the garbage collector.

    staticProperties

    getProperties() Determines the current system properties.

    static String getProperty(String key) Gets the system property indicated by the specified key.

    static String getProperty(String key, String def) Gets the system property indicated by the specified key.

    staticSecurityManager

    getSecurityManager() Gets the system security interface.

    static void load(String filename) Loads a code file with the specified filename from the local file system as a dynamic library.

    static void loadLibrary(String libname) Loads the system library specified by the libname argument.

    static long nanoTime() Returns the current value of the most precise available system timer, in nanoseconds.

    static void setErr(PrintStream err) Reassigns the "standard" error output stream.

    static void setIn(InputStream in) Reassigns the "standard" input stream.

    static void setOut(PrintStream out) Reassigns the "standard" output stream.

    static void setProperties(Properties props) Sets the system properties to the Properties argument.

    static String setProperty(String key, String value) Sets the system property indicated by the specified key.

    static void setSecurityManager(SecurityManager s) Sets the System security.

    Appendix B: Math (java.lang.Math) LibraryField Summary

    staticdouble

    E The double value that is closer than any other to e, the base of the natural logarithms.

    staticdouble

    PI The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.

    Method Summarystatic double abs(double a)

    Returns the absolute value of a double value.static float abs(float a)

    Returns the absolute value of a float value.static int abs(int a)

    Returns the absolute value of an int value.

    2

    http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#abs(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#abs(float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#abs(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#PIhttp://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#Ehttp://docs.oracle.com/javase/6/docs/api/java/lang/SecurityManager.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setSecurityManager(java.lang.SecurityManager)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/util/Properties.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setProperties(java.util.Properties)http://docs.oracle.com/javase/6/docs/api/java/io/PrintStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setOut(java.io.PrintStream)http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setIn(java.io.InputStream)http://docs.oracle.com/javase/6/docs/api/java/io/PrintStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setErr(java.io.PrintStream)http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#nanoTime()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#loadLibrary(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#load(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getSecurityManager()http://docs.oracle.com/javase/6/docs/api/java/lang/SecurityManager.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperty(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperty(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties()http://docs.oracle.com/javase/6/docs/api/java/util/Properties.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#gc()http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#exit(int)http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#currentTimeMillis()http://docs.oracle.com/javase/6/docs/api/java/io/Console.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#console()http://docs.oracle.com/javase/6/docs/api/java/io/Console.html

  • static long abs(long a) Returns the absolute value of a long value.

    static double acos(double a) Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.

    static double asin(double a) Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2.

    static double atan(double a) Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.

    static double atan2(double y, double x) Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).

    static double cbrt(double a) Returns the cube root of a double value.

    static double ceil(double a) Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.

    static double cos(double a) Returns the trigonometric cosine of an angle.

    static double cosh(double x) Returns the hyperbolic cosine of a double value.

    static double exp(double a) Returns Euler's number e raised to the power of a double value.

    static double expm1(double x) Returns ex -1.

    static double floor(double a) Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.

    static int getExponent(double d) Returns the unbiased exponent used in the representation of a double.

    static int getExponent(float f) Returns the unbiased exponent used in the representation of a float.

    static double hypot(double x, double y) Returns sqrt(x2 +y2) without intermediate overflow or underflow.

    static double log(double a) Returns the natural logarithm (base e) of a double value.

    static double log10(double a) Returns the base 10 logarithm of a double value.

    static double log1p(double x) Returns the natural logarithm of the sum of the argument and 1.

    static double max(double a, double b) Returns the greater of two double values.

    static float max(float a, float b) Returns the greater of two float values.

    static int max(int a, int b) Returns the greater of two int values.

    static long max(long a, long b) Returns the greater of two long values.

    static double min(double a, double b) Returns the smaller of two double values.

    static float min(float a, float b) Returns the smaller of two float values.

    3

    http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#min(float,%20float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#min(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#max(long,%20long)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#max(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#max(float,%20float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#max(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#log1p(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#log10(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#log(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#hypot(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#getExponent(float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#getExponent(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#floor(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#expm1(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#exp(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#cosh(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#cos(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#ceil(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#cbrt(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#atan2(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#atan(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#asin(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#acos(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#abs(long)

  • static int min(int a, int b) Returns the smaller of two int values.

    static long min(long a, long b) Returns the smaller of two long values.

    static double nextAfter(double start, double direction) Returns the floating-point number adjacent to the first argument in the direction of the second argument.

    static float nextAfter(float start, double direction) Returns the floating-point number adjacent to the first argument in the direction of the second argument.

    static double nextUp(double d) Returns the floating-point value adjacent to d in the direction of positive infinity.

    static float nextUp(float f) Returns the floating-point value adjacent to f in the direction of positive infinity.

    static double pow(double a, double b) Returns the value of the first argument raised to the power of the second argument.

    static double random() Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.

    static double rint(double a) Returns the double value that is closest in value to the argument and is equal to a mathematical integer.

    static long round(double a) Returns the closest long to the argument.

    static int round(float a) Returns the closest int to the argument.

    static double scalb(double d, int scaleFactor) Return d × 2scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set.

    static float scalb(float f, int scaleFactor) Return f × 2scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set.

    static double sin(double a) Returns the trigonometric sine of an angle.

    static double sinh(double x) Returns the hyperbolic sine of a double value.

    static double sqrt(double a) Returns the correctly rounded positive square root of a double value.

    static double tan(double a) Returns the trigonometric tangent of an angle.

    static double tanh(double x) Returns the hyperbolic tangent of a double value.

    static double toDegrees(double angrad) Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

    static double toRadians(double angdeg) Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

    Appendix C: Array (java.util.Arrays) LibraryMethod Summary

    static List

    asList(T... a) Returns a fixed-size list backed by the specified array.

    static int binarySearch(byte[] a, byte key) Searches the specified array of bytes for the specified value using the binary search algorithm.

    4

    http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#binarySearch(byte[],%20byte)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#asList(T...)http://docs.oracle.com/javase/6/docs/api/java/util/List.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#toRadians(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#toDegrees(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#tanh(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#tan(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#sqrt(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#sinh(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#sin(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#scalb(float,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#scalb(double,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#round(float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#round(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#rint(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#random()http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#pow(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#nextUp(float)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#nextUp(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#nextAfter(float,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#nextAfter(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#min(long,%20long)http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#min(int,%20int)

  • static int binarySearch(byte[] a, int fromIndex, int toIndex, byte key) Searches a range of the specified array of bytes for the specified value using the binary search algorithm.

    static int binarySearch(char[] a, char key) Searches the specified array of chars for the specified value using the binary search algorithm.

    static int binarySearch(char[] a, int fromIndex, int toIndex, char key) Searches a range of the specified array of chars for the specified value using the binary search algorithm.

    static int binarySearch(double[] a, double key) Searches the specified array of doubles for the specified value using the binary search algorithm.

    static int binarySearch(double[] a, int fromIndex, int toIndex, double key) Searches a range of the specified array of doubles for the specified value using the binary search algorithm.

    static int binarySearch(float[] a, float key) Searches the specified array of floats for the specified value using the binary search algorithm.

    static int binarySearch(float[] a, int fromIndex, int toIndex, float key) Searches a range of the specified array of floats for the specified value using the binary search algorithm.

    static int binarySearch(int[] a, int key) Searches the specified array of ints for the specified value using the binary search algorithm.

    static int binarySearch(int[] a, int fromIndex, int toIndex, int key) Searches a range of the specified array of ints for the specified value using the binary search algorithm.

    static int binarySearch(long[] a, int fromIndex, int toIndex, long key) Searches a range of the specified array of longs for the specified value using the binary search algorithm.

    static int binarySearch(long[] a, long key) Searches the specified array of longs for the specified value using the binary search algorithm.

    static int binarySearch(Object[] a, int fromIndex, int toIndex, Object key) Searches a range of the specified array for the specified object using the binary search algorithm.

    static int binarySearch(Object[] a, Object key) Searches the specified array for the specified object using the binary search algorithm.

    static int

    binarySearch(T[] a, int fromIndex, int toIndex, T key, Comparator

  • static T[]

    copyOf(T[] original, int newLength) Copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length.

    static T[]

    copyOf(U[] original, int newLength, Class

  • Assigns the specified char value to each element of the specified array of chars.static void fill(char[] a, int fromIndex, int toIndex, char val)

    Assigns the specified char value to each element of the specified range of the specified array of chars.static void fill(double[] a, double val)

    Assigns the specified double value to each element of the specified array of doubles.static void fill(double[] a, int fromIndex, int toIndex, double val)

    Assigns the specified double value to each element of the specified range of the specified array of doubles.static void fill(float[] a, float val)

    Assigns the specified float value to each element of the specified array of floats.static void fill(float[] a, int fromIndex, int toIndex, float val)

    Assigns the specified float value to each element of the specified range of the specified array of floats.static void fill(int[] a, int val)

    Assigns the specified int value to each element of the specified array of ints.static void fill(int[] a, int fromIndex, int toIndex, int val)

    Assigns the specified int value to each element of the specified range of the specified array of ints.static void fill(long[] a, int fromIndex, int toIndex, long val)

    Assigns the specified long value to each element of the specified range of the specified array of longs.static void fill(long[] a, long val)

    Assigns the specified long value to each element of the specified array of longs.static void fill(Object[] a, int fromIndex, int toIndex, Object val)

    Assigns the specified Object reference to each element of the specified range of the specified array of Objects.

    static void fill(Object[] a, Object val) Assigns the specified Object reference to each element of the specified array of Objects.

    static void sort(byte[] a) Sorts the specified array of bytes into ascending numerical order.

    static void sort(byte[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of bytes into ascending numerical order.

    static void sort(char[] a) Sorts the specified array of chars into ascending numerical order.

    static void sort(char[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of chars into ascending numerical order.

    static void sort(double[] a) Sorts the specified array of doubles into ascending numerical order.

    static void sort(double[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of doubles into ascending numerical order.

    static void sort(float[] a) Sorts the specified array of floats into ascending numerical order.

    static void sort(float[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of floats into ascending numerical order.

    static void sort(int[] a) Sorts the specified array of ints into ascending numerical order.

    static void sort(int[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of ints into ascending numerical order.

    static void sort(long[] a) Sorts the specified array of longs into ascending numerical order.

    static void sort(long[] a, int fromIndex, int toIndex) Sorts the specified range of the specified array of longs into ascending numerical order.

    static void sort(Object[] a) Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.

    static void sort(Object[] a, int fromIndex, int toIndex)

    7

    http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(java.lang.Object[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(java.lang.Object[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(long[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(long[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(int[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(int[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(float[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(float[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(double[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(double[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(char[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(char[])http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(byte[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(byte[])http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(java.lang.Object[],%20java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(java.lang.Object[],%20int,%20int,%20java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(long[],%20long)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(long[],%20int,%20int,%20long)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(int[],%20int,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(int[],%20int)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(float[],%20int,%20int,%20float)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(float[],%20float)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(double[],%20int,%20int,%20double)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(double[],%20double)http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#fill(char[],%20int,%20int,%20char)

  • Sorts the specified range of the specified array of objects into ascending order, according to the natural ordering of its elements.

    static void

    sort(T[] a, Comparator

  • Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value.

    int intValue() Returns the value of this Integer as an int.

    long longValue() Returns the value of this Integer as a long.

    static int lowestOneBit(int i) Returns an int value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specified int value.

    static int numberOfLeadingZeros(int i) Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified int value.

    static int numberOfTrailingZeros(int i) Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified int value.

    static int parseInt(String s) Parses the string argument as a signed decimal integer.

    static int parseInt(String s, int radix) Parses the string argument as a signed integer in the radix specified by the second argument.

    static int reverse(int i) Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified int value.

    static int reverseBytes(int i) Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified int value.

    static int rotateLeft(int i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified intvalue left by the specified number of bits.

    static int rotateRight(int i, int distance) Returns the value obtained by rotating the two's complement binary representation of the specified intvalue right by the specified number of bits.

    static String toBinaryString(int i) Returns a string representation of the integer argument as an unsigned integer in base 2.

    static String toHexString(int i) Returns a string representation of the integer argument as an unsigned integer in base 16.

    static String toOctalString(int i) Returns a string representation of the integer argument as an unsigned integer in base 8.

    String toString() Returns a String object representing this Integer's value.

    static String toString(int i) Returns a String object representing the specified integer.

    static String toString(int i, int radix) Returns a string representation of the first argument in the radix specified by the second argument.

    staticInteger

    valueOf(int i) Returns a Integer instance representing the specified int value.

    staticInteger

    valueOf(String s) Returns an Integer object holding the value of the specified String.

    staticInteger

    valueOf(String s, int radix) Returns an Integer object holding the value extracted from the specified String when parsed with the radix given by the second argument.

    9

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#valueOf(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toString(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toString(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toString()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toOctalString(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toHexString(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#toBinaryString(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#rotateRight(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#rotateLeft(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#reverseBytes(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#reverse(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#numberOfTrailingZeros(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#numberOfLeadingZeros(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#lowestOneBit(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#longValue()http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#intValue()

  • D1.2: Double Class MethodsMethod Summary

    byte byteValue() Returns the value of this Double as a byte (by casting to a byte).

    static int compare(double d1, double d2) Compares the two specified double values.

    int compareTo(Double anotherDouble) Compares two Double objects numerically.

    double doubleValue() Returns the double value of this Double object.

    boolean equals(Object obj) Compares this object against the specified object.

    float floatValue() Returns the float value of this Double object.

    int intValue() Returns the value of this Double as an int (by casting to type int).

    boolean isInfinite() Returns true if this Double value is infinitely large in magnitude, false otherwise.

    static boolean isInfinite(double v) Returns true if the specified number is infinitely large in magnitude, false otherwise.

    boolean isNaN() Returns true if this Double value is a Not-a-Number (NaN), false otherwise.

    static boolean isNaN(double v) Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise.

    static double longBitsToDouble(long bits) Returns the double value corresponding to a given bit representation.

    long longValue() Returns the value of this Double as a long (by casting to type long).

    static double parseDouble(String s) Returns a new double initialized to the value represented by the specified String, as performed by thevalueOf method of class Double.

    static String toHexString(double d) Returns a hexadecimal string representation of the double argument.

    String toString() Returns a string representation of this Double object.

    static String toString(double d) Returns a string representation of the double argument.

    static Double valueOf(double d) Returns a Double instance representing the specified double value.

    static Double valueOf(String s) Returns a Double object holding the double value represented by the argument string s.

    Appendix E: String Class MethodsMethod Summary

    char charAt(int index) Returns the char value at the specified index.

    int codePointAt(int index) Returns the character (Unicode code point) at the specified index.

    10

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#codePointAt(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#charAt(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#valueOf(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#valueOf(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#toString(double)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#toString()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#toHexString(double)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#parseDouble(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#longValue()http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#longBitsToDouble(long)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#isNaN(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#isNaN()http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#isInfinite(double)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#isInfinite()http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#intValue()http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#floatValue()http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#equals(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#doubleValue()http://docs.oracle.com/javase/6/docs/api/java/lang/Double.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#compareTo(java.lang.Double)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#compare(double,%20double)http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#byteValue()

  • int codePointBefore(int index) Returns the character (Unicode code point) before the specified index.

    int codePointCount(int beginIndex, int endIndex) Returns the number of Unicode code points in the specified text range of this String.

    int compareTo(String anotherString) Compares two strings lexicographically.

    int compareToIgnoreCase(String str) Compares two strings lexicographically, ignoring case differences.

    String concat(String str) Concatenates the specified string to the end of this string.

    boolean contains(CharSequence s) Returns true if and only if this string contains the specified sequence of char values.

    boolean contentEquals(CharSequence cs) Compares this string to the specified CharSequence.

    boolean contentEquals(StringBuffer sb) Compares this string to the specified StringBuffer.

    staticString

    copyValueOf(char[] data) Returns a String that represents the character sequence in the array specified.

    staticString

    copyValueOf(char[] data, int offset, int count) Returns a String that represents the character sequence in the array specified.

    boolean endsWith(String suffix) Tests if this string ends with the specified suffix.

    boolean equals(Object anObject) Compares this string to the specified object.

    boolean equalsIgnoreCase(String anotherString) Compares this String to another String, ignoring case considerations.

    staticString

    format(String format, Object... args) Returns a formatted string using the specified format string and arguments.

    byte[] getBytes() Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.

    byte[] getBytes(Charset charset) Encodes this String into a sequence of bytes using the given charset, storing the result into a new byte array.

    byte[] getBytes(String charsetName) Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.

    void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Copies characters from this string into the destination character array.

    int indexOf(int ch) Returns the index within this string of the first occurrence of the specified character.

    int indexOf(int ch, int fromIndex) Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.

    int indexOf(String str) Returns the index within this string of the first occurrence of the specified substring.

    int indexOf(String str, int fromIndex) Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

    boolean isEmpty() Returns true if, and only if, length() is 0.

    int lastIndexOf(int ch) Returns the index within this string of the last occurrence of the specified character.

    11

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#lastIndexOf(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#length()http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#isEmpty()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#indexOf(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#indexOf(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#indexOf(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#indexOf(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#getChars(int,%20int,%20char[],%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#getBytes(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.htmlhttp://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#getBytes(java.nio.charset.Charset)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#getBytes()http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#format(java.lang.String,%20java.lang.Object...)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#equalsIgnoreCase(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#equals(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#endsWith(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#copyValueOf(char[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#copyValueOf(char[])http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/StringBuffer.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#contentEquals(java.lang.StringBuffer)http://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#contentEquals(java.lang.CharSequence)http://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#concat(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#compareToIgnoreCase(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#compareTo(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#codePointCount(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#codePointBefore(int)

  • int lastIndexOf(int ch, int fromIndex) Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.

    int lastIndexOf(String str) Returns the index within this string of the rightmost occurrence of the specified substring.

    int lastIndexOf(String str, int fromIndex) Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index.

    int length() Returns the length of this string.

    boolean matches(String regex) Tells whether or not this string matches the given regular expression.

    int offsetByCodePoints(int index, int codePointOffset) Returns the index within this String that is offset from the given index by codePointOffset code points.

    boolean regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len) Tests if two string regions are equal.

    boolean regionMatches(int toffset, String other, int ooffset, int len) Tests if two string regions are equal.

    String replace(char oldChar, char newChar) Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.

    String replace(CharSequence target, CharSequence replacement) Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.

    String replaceAll(String regex, String replacement) Replaces each substring of this string that matches the given regular expression with the given replacement.

    String replaceFirst(String regex, String replacement) Replaces the first substring of this string that matches the given regular expression with the given replacement.

    String[] split(String regex) Splits this string around matches of the given regular expression.

    String[] split(String regex, int limit) Splits this string around matches of the given regular expression.

    boolean startsWith(String prefix) Tests if this string starts with the specified prefix.

    boolean startsWith(String prefix, int toffset) Tests if the substring of this string beginning at the specified index starts with the specified prefix.

    CharSequence

    subSequence(int beginIndex, int endIndex) Returns a new character sequence that is a subsequence of this sequence.

    String substring(int beginIndex) Returns a new string that is a substring of this string.

    String substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string.

    char[] toCharArray() Converts this string to a new character array.

    String toLowerCase() Converts all of the characters in this String to lower case using the rules of the default locale.

    String toString() This object (which is already a string!) is itself returned.

    String toUpperCase() Converts all of the characters in this String to upper case using the rules of the default locale.

    String trim()

    12

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#trim()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toUpperCase()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toString()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toLowerCase()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toCharArray()http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#subSequence(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sumhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sumhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sumhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceFirst(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sumhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replace(java.lang.CharSequence,%20java.lang.CharSequence)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replace(char,%20char)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#regionMatches(int,%20java.lang.String,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#regionMatches(boolean,%20int,%20java.lang.String,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#offsetByCodePoints(int,%20int)http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sumhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#matches(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#length()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#lastIndexOf(java.lang.String,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#lastIndexOf(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#lastIndexOf(int,%20int)

  • Returns a copy of the string, with leading and trailing whitespace omitted.staticString

    valueOf(boolean b) Returns the string representation of the boolean argument.

    staticString

    valueOf(char c) Returns the string representation of the char argument.

    staticString

    valueOf(char[] data) Returns the string representation of the char array argument.

    staticString

    valueOf(char[] data, int offset, int count) Returns the string representation of a specific subarray of the char array argument.

    staticString

    valueOf(double d) Returns the string representation of the double argument.

    staticString

    valueOf(float f) Returns the string representation of the float argument.

    staticString

    valueOf(int i) Returns the string representation of the int argument.

    staticString

    valueOf(long l) Returns the string representation of the long argument.

    staticString

    valueOf(Object obj) Returns the string representation of the Object argument.

    Appendix F: Random Class MethodsMethod Summaryprotected int

    next(int bits) Generates the next pseudorandom number.

    boolean nextBoolean() Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.

    void nextBytes(byte[] bytes) Generates random bytes and places them into a user-supplied byte array.

    double nextDouble() Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.

    float nextFloat() Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.

    double nextGaussian() Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

    int nextInt() Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.

    int nextInt(int n) Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

    long nextLong() Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.

    void setSeed(long seed) Sets the seed of this random number generator using a single long seed.

    13

    http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#setSeed(long)http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextLong()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextInt(int)http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextInt()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextGaussian()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextFloat()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextDouble()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextBytes(byte[])http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextBoolean()http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#next(int)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(long)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(float)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(double)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(char[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(char[])http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(char)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#valueOf(boolean)http://docs.oracle.com/javase/6/docs/api/java/lang/String.html

  • Appendix G: Input/Output Classes

    G1.1: Scanner ClassConstructor SummaryScanner(File source) Constructs a new Scanner that produces values scanned from the specified file.Scanner(InputStream source) Constructs a new Scanner that produces values scanned from the specified input stream.Scanner(InputStream source, String charsetName) Constructs a new Scanner that produces values scanned from the specified input stream.

    Method Summary void close()

    Closes this scanner.Pattern delimiter()

    Returns the Pattern this Scanner is currently using to match delimiters.String findInLine(Pattern pattern)

    Attempts to find the next occurrence of the specified pattern ignoring delimiters.String findInLine(String pattern)

    Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters.boolean hasNext()

    Returns true if this scanner has another token in its input.boolean hasNext(Pattern pattern)

    Returns true if the next complete token matches the specified pattern.boolean hasNext(String pattern)

    Returns true if the next token matches the pattern constructed from the specified string.boolean hasNextBoolean()

    Returns true if the next token in this scanner's input can be interpreted as a boolean value using a case insensitive pattern created from the string "true|false".

    boolean hasNextByte() Returns true if the next token in this scanner's input can be interpreted as a byte value in the default radix using the nextByte() method.

    boolean hasNextByte(int radix) Returns true if the next token in this scanner's input can be interpreted as a byte value in the specified radix using the nextByte() method.

    boolean hasNextDouble() Returns true if the next token in this scanner's input can be interpreted as a double value using thenextDouble() method.

    boolean hasNextFloat() Returns true if the next token in this scanner's input can be interpreted as a float value using thenextFloat() method.

    boolean hasNextInt() Returns true if the next token in this scanner's input can be interpreted as an int value in the default radix using the nextInt() method.

    boolean hasNextInt(int radix) Returns true if the next token in this scanner's input can be interpreted as an int value in the specified radix using the nextInt() method.

    boolean hasNextLine() Returns true if there is another line in the input of this scanner.

    14

    http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextLine()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextInt()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextInt(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextInt()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextInt()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextFloat()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextFloat()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextDouble()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextDouble()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextByte()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextByte(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextByte()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextByte()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextBoolean()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNext(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNext(java.util.regex.Pattern)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNext()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#findInLine(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#findInLine(java.util.regex.Pattern)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#delimiter()http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#close()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/InputStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#Scanner(java.io.InputStream,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#Scanner(java.io.InputStream)http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#Scanner(java.io.File)

  • boolean hasNextLong() Returns true if the next token in this scanner's input can be interpreted as a long value in the default radix using the nextLong() method.

    boolean hasNextLong(int radix) Returns true if the next token in this scanner's input can be interpreted as a long value in the specified radix using the nextLong() method.

    IOException ioException() Returns the IOException last thrown by this Scanner's underlying Readable.

    MatchResult match() Returns the match result of the last scanning operation performed by this scanner.

    String next() Finds and returns the next complete token from this scanner.

    String next(Pattern pattern) Returns the next token if it matches the specified pattern.

    String next(String pattern) Returns the next token if it matches the pattern constructed from the specified string.

    boolean nextBoolean() Scans the next token of the input into a boolean value and returns that value.

    byte nextByte() Scans the next token of the input as a byte.

    byte nextByte(int radix) Scans the next token of the input as a byte.

    double nextDouble() Scans the next token of the input as a double.

    float nextFloat() Scans the next token of the input as a float.

    int nextInt() Scans the next token of the input as an int.

    int nextInt(int radix) Scans the next token of the input as an int.

    String nextLine() Advances this scanner past the current line and returns the input that was skipped.

    long nextLong() Scans the next token of the input as a long.

    long nextLong(int radix) Scans the next token of the input as a long.

    int radix() Returns this scanner's default radix.

    void remove() The remove operation is not supported by this implementation of Iterator.

    Scanner reset() Resets this scanner.

    Scanner skip(Pattern pattern) Skips input that matches the specified pattern, ignoring delimiters.

    Scanner skip(String pattern) Skips input that matches a pattern constructed from the specified string.

    String toString() Returns the string representation of this Scanner.

    Scanner useDelimiter(Pattern pattern) Sets this scanner's delimiting pattern to the specified pattern.

    Scanner useDelimiter(String pattern)

    15

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#useDelimiter(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#useDelimiter(java.util.regex.Pattern)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#toString()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#skip(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#skip(java.util.regex.Pattern)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#reset()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#remove()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#radix()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextLong(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextLong()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextLine()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextInt(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextInt()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextFloat()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextDouble()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextByte(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextByte()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextBoolean()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#next(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#next(java.util.regex.Pattern)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#next()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#match()http://docs.oracle.com/javase/6/docs/api/java/util/regex/MatchResult.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#ioException()http://docs.oracle.com/javase/6/docs/api/java/io/IOException.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextLong()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextLong(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#nextLong()http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#hasNextLong()

  • Sets this scanner's delimiting pattern to a pattern constructed from the specified String.Scanner useRadix(int radix)

    Sets this scanner's default radix to the specified radix.

    G1.2: PrintWriter ClassConstructor SummaryPrintWriter(File file) Creates a new PrintWriter, without automatic line flushing, with the specified file.

    Method SummaryPrintWriter append(char c)

    Appends the specified character to this writer.PrintWriter append(CharSequence csq)

    Appends the specified character sequence to this writer.PrintWriter append(CharSequence csq, int start, int end)

    Appends a subsequence of the specified character sequence to this writer. boolean checkError()

    Flushes the stream if it's not closed and checks its error state.protected

    voidclearError() Clears the error state of this stream.

    void close() Closes the stream and releases any system resources associated with it.

    void flush() Flushes the stream.

    PrintWriter format(String format, Object... args) Writes a formatted string to this writer using the specified format string and arguments.

    void print(boolean b) Prints a boolean value.

    void print(char c) Prints a character.

    void print(char[] s) Prints an array of characters.

    void print(double d) Prints a double-precision floating-point number.

    void print(float f) Prints a floating-point number.

    void print(int i) Prints an integer.

    void print(long l) Prints a long integer.

    void print(Object obj) Prints an object.

    void print(String s) Prints a string.

    PrintWriter printf(String format, Object... args) A convenience method to write a formatted string to this writer using the specified format string and arguments.

    void println() Terminates the current line by writing the line separator string.

    16

    http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println()http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#printf(java.lang.String,%20java.lang.Object...)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(long)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(int)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(float)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(double)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(char[])http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(char)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#print(boolean)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#format(java.lang.String,%20java.lang.Object...)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#flush()http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#close()http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#clearError()http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#checkError()http://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#append(java.lang.CharSequence,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/CharSequence.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#append(java.lang.CharSequence)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#append(char)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#PrintWriter(java.io.File)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#useRadix(int)http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html

  • void println(boolean x) Prints a boolean value and then terminates the line.

    void println(char x) Prints a character and then terminates the line.

    void println(char[] x) Prints an array of characters and then terminates the line.

    void println(double x) Prints a double-precision floating-point number and then terminates the line.

    void println(float x) Prints a floating-point number and then terminates the line.

    void println(int x) Prints an integer and then terminates the line.

    void println(long x) Prints a long integer and then terminates the line.

    void println(Object x) Prints an Object and then terminates the line.

    void println(String x) Prints a String and then terminates the line.

    protectedvoid

    setError() Indicates that an error has occurred.

    void write(char[] buf) Writes an array of characters.

    void write(char[] buf, int off, int len) Writes A Portion of an array of characters.

    void write(int c) Writes a single character.

    void write(String s) Writes a string.

    void write(String s, int off, int len) Writes a portion of a string.

    G1.3: File ClassConstructor SummaryFile(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname.File(URI uri) Creates a new File instance by converting the given file: URI into an abstract pathname.

    Method Summaryboolean canExecute()

    Tests whether the application can execute the file denoted by this abstract pathname.boolean canRead()

    Tests whether the application can read the file denoted by this abstract pathname.boolean canWrite()

    Tests whether the application can modify the file denoted by this abstract pathname.boolean createNewFile()

    Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist.

    staticFile

    createTempFile(String prefix, String suffix) Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its

    17

    http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#createNewFile()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#canWrite()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#canRead()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#canExecute()http://docs.oracle.com/javase/6/docs/api/java/net/URI.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#File(java.net.URI)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#File(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#write(java.lang.String,%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#write(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#write(int)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#write(char[],%20int,%20int)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#write(char[])http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#setError()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(java.lang.String)http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(long)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(int)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(float)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(double)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(char[])http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(char)http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#println(boolean)

  • name.staticFile

    createTempFile(String prefix, String suffix, File directory) Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name.

    boolean delete() Deletes the file or directory denoted by this abstract pathname.

    void deleteOnExit() Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates.

    boolean equals(Object obj) Tests this abstract pathname for equality with the given object.

    boolean exists() Tests whether the file or directory denoted by this abstract pathname exists.

    File getAbsoluteFile() Returns the absolute form of this abstract pathname.

    String getAbsolutePath() Returns the absolute pathname string of this abstract pathname.

    File getCanonicalFile() Returns the canonical form of this abstract pathname.

    String getCanonicalPath() Returns the canonical pathname string of this abstract pathname.

    long getFreeSpace() Returns the number of unallocated bytes in the partition named by this abstract path name.

    String getName() Returns the name of the file or directory denoted by this abstract pathname.

    String getParent() Returns the pathname string of this abstract pathname's parent, or null if this pathname does not name a parent directory.

    File getParentFile() Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory.

    String getPath() Converts this abstract pathname into a pathname string.

    long getTotalSpace() Returns the size of the partition named by this abstract pathname.

    long getUsableSpace() Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname.

    boolean isDirectory() Tests whether the file denoted by this abstract pathname is a directory.

    boolean isFile() Tests whether the file denoted by this abstract pathname is a normal file.

    boolean isHidden() Tests whether the file named by this abstract pathname is a hidden file.

    long lastModified() Returns the time that the file denoted by this abstract pathname was last modified.

    long length() Returns the length of the file denoted by this abstract pathname.

    String[] list() Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname.

    String[] list(FilenameFilter filter) Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.

    18

    http://docs.oracle.com/javase/6/docs/api/java/io/FilenameFilter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#list(java.io.FilenameFilter)http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#list()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#length()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#lastModified()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#isHidden()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#isFile()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#isDirectory()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#partNamehttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getUsableSpace()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#partNamehttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getTotalSpace()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#getPath()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getParentFile()http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getParent()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getName()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#partNamehttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getFreeSpace()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#getCanonicalPath()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getCanonicalFile()http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getAbsolutePath()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#getAbsoluteFile()http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#exists()http://docs.oracle.com/javase/6/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#equals(java.lang.Object)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#deleteOnExit()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#delete()http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)http://docs.oracle.com/javase/6/docs/api/java/io/File.html

  • File[] listFiles() Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.

    File[] listFiles(FileFilter filter) Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.

    File[] listFiles(FilenameFilter filter) Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.

    staticFile[]

    listRoots() List the available filesystem roots.

    boolean mkdir() Creates the directory named by this abstract pathname.

    boolean mkdirs() Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.

    boolean renameTo(File dest) Renames the file denoted by this abstract pathname.

    boolean setExecutable(boolean executable) A convenience method to set the owner's execute permission for this abstract pathname.

    boolean setExecutable(boolean executable, boolean ownerOnly) Sets the owner's or everybody's execute permission for this abstract pathname.

    boolean setLastModified(long time) Sets the last-modified time of the file or directory named by this abstract pathname.

    boolean setReadable(boolean readable) A convenience method to set the owner's read permission for this abstract pathname.

    boolean setReadable(boolean readable, boolean ownerOnly) Sets the owner's or everybody's read permission for this abstract pathname.

    boolean setReadOnly() Marks the file or directory named by this abstract pathname so that only read operations are allowed.

    boolean setWritable(boolean writable) A convenience method to set the owner's write permission for this abstract pathname.

    boolean setWritable(boolean writable, boolean ownerOnly) Sets the owner's or everybody's write permission for this abstract pathname.

    String toString() Returns the pathname string of this abstract pathname.

    URI toURI() Constructs a file: URI that represents this abstract pathname.

    Appendix H: Graphical User Interface Classes

    H1.1: Layout Managers

    H1.1.1: BorderLayout ClassField Summarystatic String CENTER

    The center layout constraint (middle of container).static String EAST

    The east layout constraint (right side of container).static String NORTH

    The north layout constraint (top of container).

    19

    http://docs.oracle.com/javase/6/docs/api/java/awt/BorderLayout.html#NORTHhttp://docs.oracle.com/javase/6/docs/api/java/awt/BorderLayout.html#EASThttp://docs.oracle.com/javase/6/docs/api/java/awt/BorderLayout.html#CENTERhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#toURI()http://docs.oracle.com/javase/6/docs/api/java/net/URI.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#toString()http://docs.oracle.com/javase/6/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#setWritable(boolean,%20boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setWritable(boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setReadOnly()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setReadable(boolean,%20boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setReadable(boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setLastModified(long)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setExecutable(boolean,%20boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#setExecutable(boolean)http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#renameTo(java.io.File)http://docs.oracle.com/javase/6/docs/api/java/io/File.html#mkdirs()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#mkdir()http://docs.oracle.com/javase/6/docs/api/java/io/File.html#listRoots()http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/FilenameFilter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles(java.io.FilenameFilter)http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/FileFilter.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles(java.io.FileFilter)http://docs.oracle.com/javase/6/docs/api/java/io/File.htmlhttp://docs.o