|
||
|
|
absolute value of |
|
|
maximum of |
|
|
minimum of |
Note 1: |
||
|
|
sine of |
|
|
cosine of |
|
|
tangent of |
Note 2: Angles are expressed in radians. Use |
||
|
|
exponential (e |
|
|
natural log (loge |
|
|
raise |
|
|
round |
|
|
random number in [0, 1) |
|
|
square root of |
|
|
value of e (constant) |
|
|
value of π (constant) |
|
||
|
|
create a string with the same value as |
|
|
create a string that represents the same sequence of characters as |
|
|
string length |
|
|
|
|
|
|
|
|
does string contain |
|
|
does string start with |
|
|
does string end with |
|
|
index of first occurrence of |
|
|
index of first occurrence of |
|
|
this string with |
|
|
string comparison |
|
|
result of changing |
|
|
strings between occurrences of |
|
|
is this string’s value the same as |
|
||
|
|
create output stream from |
|
|
print |
|
|
print |
|
|
print a newline |
|
|
print the arguments to standard output, as specified by the format string |
Note: For |
|
||
|
|
create input stream from |
methods for reading individual tokens |
||
|
|
is input stream empty (or only whitespace)? |
|
|
read a token, convert it to an |
|
|
read a token, convert it to a |
|
|
read a token, convert it to a |
|
|
read a token and return it as a |
methods for reading characters |
||
|
|
does input stream have any remaining characters? |
|
|
read a character from input stream and return it |
methods for reading lines from standard input |
||
|
|
does input stream have a next line? |
|
|
read the rest of the line and return it as a |
methods for reading the rest of standard input |
||
|
|
read all remaining tokens and return them as an |
|
|
read all remaining tokens and return them as a |
|
|
read all remaining tokens and return them as a |
|
|
read all remaining tokens and return them as a |
|
|
read all remaining lines and return them as a |
|
|
read the rest of the input and return it as a |
Note 1: For Note 2: A token is a maximal sequence of non-whitespace characters. Note 3: Before reading a token, any leading whitespace is discarded. Note 4: Analogous methods are available for reading values of type Note 5: Each method that reads input throws a run-time exception if it cannot read in the next value, either because there is no more input or because the input does not match the expected type. |
|
||
|
|
create a new |
drawing commands |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
control commands |
||
|
|
reset x-scale to ( |
|
|
reset y-scale to ( |
|
|
set pen radius to |
|
|
set pen color to |
|
|
set text font to |
|
|
set canvas size to |
|
|
enable double buffering |
|
|
disable double buffering |
|
|
copy the offscreen canvas to the onscreen canvas |
|
|
clear the canvas to color |
|
|
pause |
|
|
save to a |
Note 1: For Note 2: Methods with the same names but no arguments reset to the default values. |
|
||
|
|
play the given |
|
|
play the given sound wave |
|
|
play sample for 1/44,100 second |
|
|
save to a |
|
|
read from a |
|
||
|
|
create a new stopwatch and start it running |
|
|
return the elapsed time since creation, in seconds |
|
||
|
|
create a picture from a file |
|
|
create a blank |
|
|
return the width of the picture |
|
|
return the height of the picture |
|
|
return the color of pixel ( |
|
|
set the color of pixel ( |
|
|
display the picture in a window |
|
|
save the picture to a file |
|
||
|
|
set the seed for reproducible results |
|
|
integer between |
|
|
floating-point number between |
|
|
|
|
|
Gaussian, mean |
|
|
Gaussian, mean |
|
|
|
|
|
randomly shuffle the array |
|
||
|
|
read a one-dimensional array of |
|
|
read a two-dimensional array of |
|
|
print a one-dimensional array of |
|
|
print a two-dimensional array of |
Note 1. Note 2. Note 3. Methods for |
|
||
|
|
largest value |
|
|
smallest value |
|
|
average |
|
|
sample variance |
|
|
sample standard deviation |
|
|
median |
|
|
plot points at |
|
|
plot lines connecting points at |
|
|
plot bars to points at |
Note: Overloaded implementations are included for all numeric types. |
|
||
|
|
create an empty stack |
|
|
is the stack empty? |
|
|
number of items in the stack |
|
|
insert an item onto the stack |
|
|
return and remove the item that was inserted most recently |
|
||
|
|
create an empty queue |
|
|
is the queue empty? |
|
|
number of items in the queue |
|
|
insert an item into the queue |
|
|
return and remove the item that was inserted least recently |
|
||
|
|
create an empty set |
|
|
is the set empty? |
|
|
number of elements in the set |
|
|
add |
|
|
remove |
|
|
is |
|
||
|
|
create an empty symbol table |
|
|
associate |
|
|
value associated with |
|
|
remove |
|
|
is there a value paired with |
|
|
number of key–value pairs |
|
|
all keys in sorted order |
|
|
minimum key |
|
|
maximum key |
|
|
number of keys less than |
|
|
|
|
|
largest key less than or equal to |
|
|
smallest key greater than or equal to |
|
||
|
|
create an empty graph |
|
|
create graph from a file |
|
|
add edge |
|
|
number of vertices |
|
|
number of edges |
|
|
vertices in the graph |
|
|
neighbors of |
|
|
number of neighbors of |
|
|
is |
|
|
is |