public class Program extends javax.swing.JApplet implements java.awt.event.ActionListener, Assertions, Curses, Files, Maths, Miscellaneous, Multimedia, TextInputOutput
Modifier and Type | Field and Description |
---|---|
static String[] |
ANSI_COLORS |
String[] |
arguments |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ANSI_BG_DEFAULT_COLOR, ANSI_BLACK, ANSI_BLACK_BG, ANSI_BLINK_FAST, ANSI_BLINK_SLOW, ANSI_BLUE, ANSI_BLUE_BG, ANSI_BOLD, ANSI_CLEAR_LINE_AFTER, ANSI_CLEAR_LINE_ALL, ANSI_CLEAR_LINE_BEFORE, ANSI_CLEAR_SCREEN_AFTER, ANSI_CLEAR_SCREEN_ALL, ANSI_CLEAR_SCREEN_BEFORE, ANSI_CURSOR_BACK, ANSI_CURSOR_DOWN, ANSI_CURSOR_FORWARD, ANSI_CURSOR_HIDE, ANSI_CURSOR_MOVE_TO, ANSI_CURSOR_NEXT_LINE, ANSI_CURSOR_PREV_LINE, ANSI_CURSOR_RESTORE_POS, ANSI_CURSOR_SAVE_POS, ANSI_CURSOR_SHOW, ANSI_CURSOR_UP, ANSI_CYAN, ANSI_CYAN_BG, ANSI_DOWN, ANSI_FAINT, ANSI_GREEN, ANSI_GREEN_BG, ANSI_ITALIC, ANSI_LEFT, ANSI_NEGATIVE, ANSI_PURPLE, ANSI_PURPLE_BG, ANSI_RED, ANSI_RED_BG, ANSI_RESET, ANSI_RIGHT, ANSI_SCROLL_DOWN, ANSI_SCROLL_UP, ANSI_TEXT_DEFAULT_COLOR, ANSI_UNDERLINE, ANSI_UP, ANSI_WHITE, ANSI_WHITE_BG, ANSI_YELLOW, ANSI_YELLOW_BG
Constructor and Description |
---|
Program() |
Modifier and Type | Method and Description |
---|---|
double |
abs(double nb)
Retourne la valeur absolue de l'entier nb.
|
float |
abs(float nb)
Retourne la valeur absolue de l'entier nb.
|
int |
abs(int nb)
Retourne la valeur absolue de l'entier nb.
|
long |
abs(long nb)
Retourne la valeur absolue de l'entier nb.
|
double |
acos(double a)
Returns the arc cosine of a value; the returned angle is in the range 0.0
through pi.
|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
addButton(Image img,
String label)
Ajoute un bouton étiqueté avec un texte en bas de l'image.
|
void |
addButton(TransparentImage img,
String label)
Ajoute un bouton étiqueté avec un texte en bas de l'image.
|
void |
addZone(Image img,
String name,
int x,
int y,
int w,
int h) |
void |
addZone(TransparentImage img,
String name,
int x,
int y,
int w,
int h) |
double |
asin(double a)
Returns the arc sine of a value; the returned angle is in the range -pi/2
through pi/2.
|
void |
assertArrayEquals( Object[] expected,
Object[] tested)
Vérifie que les tableaux passés en paramètre sont égaux, c'est-à-dire
qu'ils ont le même contenu (ie. array1[i] == array2[i] pour i compris
dans [0..length(array1)]).
|
void |
assertArrayEquals( Object expected,
Object tested) |
void |
assertArrayNotEquals( Object[] expected,
Object[] tested)
Vérifie que les tableaux passés en paramètre ne sont pas égaux,
c'est-à-dire qu'ils n'ont le même contenu (ie. il existe au moins un
i compris dans [0..length(expected)]) pour lequel expected[i] !
|
void |
assertArrayNotEquals( Object o1,
Object o2) |
void |
assertEquals( Object expected,
Object tested)
Vérifie que les deux paramètres sont égaux et lève une
AssertionException si ce n'est pas le cas. |
void |
assertFalse( Boolean b)
Vérifie que le booléen passé en paramètre est faux (false) et
lève une
AssertionException si ce n'est pas le cas. |
void |
assertGreaterThan( Comparable expected,
Comparable tested)
Vérifie que la valeur testée est strictement supérieure à la valeur
attendue.
|
void |
assertGreaterThanOrEqual( Comparable expected,
Comparable tested)
Vérifie que la valeur testée est strictement supérieure ou égale à la
valeur attendue.
|
void |
assertLessThan( Comparable expected,
Comparable tested)
Vérifie que la valeur testée est strictement inférieure à la valeur
attendue.
|
void |
assertLessThanOrEqual( Comparable expected,
Comparable tested)
Vérifie que la valeur testée est strictement inférieure ou égale à la
valeur attendue.
|
void |
assertNotEquals( Object expected,
Object tested)
Vérifie que les deux paramètres sont différents et lève une
AssertionException si ce n'est pas le cas. |
void |
assertTrue( Boolean b)
Vérifie que le booléen passé en paramètre est vrai (true) et
lève une
AssertionException si ce n'est pas le cas. |
double |
atan(double a)
Returns the arc tangent of a value; the returned angle is in the range
-pi/2 through pi/2.
|
double |
atan2(double y,
double x)
Returns the angle theta from the conversion of rectangular coordinates
(x, y) to polar coordinates (r, theta).
|
void |
automaticRefresh(Image img,
boolean value) |
void |
automaticRefresh(TransparentImage img,
boolean value) |
void |
background( String color)
Défini la couleur de l'affichage du fond du texte.
|
void |
backward()
Déplace le curseur vers la gauche.
|
void |
backward(int n)
Déplace le curseur de n cases vers la gauche.
|
double |
cbrt(double a)
Returns the cube root of a double value.
|
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.
|
void |
changeButton(Image img,
String oldlabel,
String newlabel)
Modifie le texte affiché sur un des boutons d'une image.
|
void |
changeButton(TransparentImage img,
String oldlabel,
String newlabel)
Modifie le texte affiché sur un des boutons d'une image.
|
char |
charAt( String s,
int idx)
Retourne le caractère de la chaîne
s situé à l'indice
idx . |
int |
charToInt(char c)
Convertit un chiffre (caractère décimal donc de 0 à 9 inclus) vers sa
valeur numérique (entière!).
|
void |
clearBOL()
Efface la ligne depuis le début de la ligne jusqu'au curseur.
|
void |
clearEOL()
Efface la ligne depuis la position jusqu'à la fin de la ligne.
|
void |
clearLine()
Efface l'ensemble du contenu de la ligne courante.
|
void |
clearScreen()
Efface l'ensemble de l'écran et repositionne le curseur en (1, 1).
|
void |
close(Image img) |
void |
close(TransparentImage img) |
int |
columnCount(CSVFile table) |
int |
columnCount(CSVFile table,
int idxLine) |
int |
compare( String s1,
String s2)
Compare deux chaînes de caractères selon l'ordre lexicographique (ie.
|
Image |
copyAndResize(Image img,
String name,
int width,
int height) |
TransparentImage |
copyAndResize(TransparentImage img,
String name,
int width,
int height) |
double |
copySign(double magnitude,
double sign)
Returns the first floating-point argument with the sign of the second
floating-point argument.
|
float |
copySign(float magnitude,
float sign)
Returns the first floating-point argument with the sign of the second
floating-point argument.
|
Image |
copySubset(Image img,
String name,
int x,
int y,
int width,
int height) |
TransparentImage |
copySubset(TransparentImage img,
String name,
int x,
int y,
int width,
int height) |
double |
cos(double a)
Returns the trigonometric cosine of an angle.
|
double |
cosh(double x)
Returns the hyperbolic cosine of a double value.
|
void |
curp()
Restaure la position sauvegardée du curseur (CUrsor Restore Position).
|
void |
cursor(int line,
int column)
Positionne le curseur aux coordonnées (line, column).
|
void |
cusp()
Sauvegarde la position courante du curseur (CUrsor Save Position).
|
void |
delay(long milliseconds) |
void |
down()
Déplace le curseur vers le haut.
|
void |
down(int n)
Déplace le curseur de n lignes vers le bas.
|
void |
drawImage(Image img,
Image pip,
int x,
int y) |
void |
drawImage(Image img,
Image pip,
int x,
int y,
boolean addZone) |
void |
drawImage(TransparentImage img,
TransparentImage pip,
int x,
int y) |
void |
drawImage(TransparentImage img,
TransparentImage pip,
int x,
int y,
boolean addZone) |
void |
drawLine(Image img,
int x1,
int y1,
int x2,
int y2) |
void |
drawLine(TransparentImage img,
int x1,
int y1,
int x2,
int y2) |
void |
drawOval(Image img,
int x,
int y,
int w,
int h) |
void |
drawOval(TransparentImage img,
int x,
int y,
int w,
int h) |
void |
drawRect(Image img,
int x,
int y,
int w,
int h) |
void |
drawRect(TransparentImage img,
int x,
int y,
int w,
int h) |
void |
drawString(Image img,
String text,
int x,
int y) |
void |
drawString(TransparentImage img,
String text,
int x,
int y) |
void |
enableKeyTypedInConsole(boolean on)
Active (true) ou désactive (false) la possibilité de capturer les
touches manipulées par l'utilisateur.
|
boolean |
equals( String s1,
String s2)
Test l'égalité de deux chaînes de caractères.
|
void |
error( String message) |
double |
exp(double a)
Returns Euler's number e raised to the power of a double value.
|
double |
expm1(double x)
Returns ex -1.
|
void |
fill(Image img) |
void |
fill(Image img,
extensions.RGBColor color) |
void |
fill(Image img,
int color) |
void |
fill(TransparentImage img) |
void |
fill(TransparentImage img,
extensions.RGBColor color) |
void |
fill(TransparentImage img,
int color) |
void |
fillOval(Image img,
int x,
int y,
int w,
int h) |
void |
fillOval(TransparentImage img,
int x,
int y,
int w,
int h) |
void |
fillRect(Image img,
int x,
int y,
int w,
int h) |
void |
fillRect(TransparentImage img,
int x,
int y,
int w,
int h) |
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.
|
void |
forward()
Déplace le curseur vers la droite.
|
void |
forward(int n)
Déplace le curseur de n cases vers la droite.
|
int |
get(Image img,
int line,
int column) |
int |
get(TransparentImage img,
int line,
int column) |
String[] |
getAllFilesFromCurrentDirectory() |
String[] |
getAllFilesFromDirectory( String directory) |
String[] |
getAllFontNames() |
String |
getCell(CSVFile table,
int idxLine,
int idxColumn) |
int |
getColumns(Image img) |
int |
getColumns(TransparentImage img) |
int |
getExponent(double d)
Returns the unbiased exponent used in the representation of a double.
|
int |
getExponent(float f)
Returns the unbiased exponent used in the representation of a float.
|
int |
getGridColumns(Image img) |
int |
getGridColumns(TransparentImage img) |
int |
getGridLines(Image img) |
int |
getGridLines(TransparentImage img) |
int |
getHeight(Image img)
Retourne la hauteur en nombre de pixels de l'image.
|
int |
getHeight(TransparentImage img)
Retourne la hauteur en nombre de pixels de l'image.
|
int |
getLines(Image img) |
int |
getLines(TransparentImage img) |
String |
getName(Image img)
Retourne le nom associé à cette image.
|
String |
getName(TransparentImage img)
Retourne le nom associé à cette image.
|
int |
getStringLength(Image img,
String text) |
int |
getStringLength(TransparentImage img,
String text) |
long |
getTime()
Cette fonction permet de mesurer le temps qui s'écoule.
|
int |
getWidth(Image img)
Retourne la largeur en nombre de pixels de l'image.
|
int |
getWidth(TransparentImage img)
Retourne la largeur en nombre de pixels de l'image.
|
void |
hide()
Masque le curseur.
|
void |
hide(Image img) |
void |
hide(TransparentImage img) |
void |
hideTextField(Image img) |
double |
hypot(double x,
double y)
Returns sqrt(x2 +y2) without intermediate overflow or underflow.
|
double |
IEEEremainder(double f1,
double f2)
Computes the remainder operation on two arguments as prescribed by the
IEEE 754 standard.
|
int |
length( Object tab)
Retourne la taille (ie. le nombre de cases) du tableau
tab . |
int |
length( Object tab,
int dim)
Retourne la taille (ie. le nombre de cases) de la dimension
dim
du tableau tab . |
int |
length( String s)
Retourne le nombre de caractères que contient une chaîne de caractères.
|
CSVFile |
loadCSV( String filename) |
CSVFile |
loadCSV( String filename,
char separator) |
double |
log(double a)
Returns the natural logarithm (base e) of a double value.
|
double |
log10(double a)
Returns the base 10 logarithm of a double value.
|
double |
log1p(double x)
Returns the natural logarithm of the sum of the argument and 1.
|
static void |
main( String[] args) |
double |
max(double a,
double b)
Returns the greater of two double values.
|
float |
max(float a,
float b)
Returns the greater of two float values.
|
int |
max(int a,
int b)
Returns the greater of two int values.
|
long |
max(long a,
long b)
Returns the greater of two long values.
|
double |
min(double a,
double b)
Returns the smaller of two double values.
|
float |
min(float a,
float b)
Returns the smaller of two float values.
|
int |
min(int a,
int b)
Returns the smaller of two int values.
|
long |
min(long a,
long b)
Returns the smaller of two long values.
|
void |
mouseEvent( String name,
int x,
int y,
int button,
String event) |
extensions.File |
newFile( String filename) |
Image |
newImage(int width,
int height)
Crée une nouvelle image vide de width pixels en largeur et height
pixels en hauteur.
|
Image |
newImage( String filename)
Crée une nouvelle image avec un nom donné à partir d'un fichier.
|
Image |
newImage( String name,
int width,
int height)
Crée une nouvelle image vide de width pixels en largeur et height
pixels en hauteur.
|
Image |
newImage( String name,
String filename)
Crée une nouvelle image avec un nom donné à partir d'un fichier.
|
Sound |
newSound( String url)
Crée un nouveau son à partir d'un nom de fichier (absolu ou relatif).
|
TransparentImage |
newTransparentImage(int width,
int height) |
TransparentImage |
newTransparentImage( String filename) |
TransparentImage |
newTransparentImage( String name,
int width,
int height) |
TransparentImage |
newTransparentImage( String name,
String filename) |
double |
nextAfter(double start,
double direction)
Returns the floating-point number adjacent to the first argument in the
direction of the second argument.
|
float |
nextAfter(float start,
double direction)
Returns the floating-point number adjacent to the first argument in the
direction of the second argument.
|
double |
nextUp(double d)
Returns the floating-point value adjacent to d in the direction of
positive infinity.
|
float |
nextUp(float f)
Returns the floating-point value adjacent to f in the direction of
positive infinity.
|
void |
play(Sound s)
Joue le son passé en paramètre.
|
void |
play(Sound s,
boolean background) |
void |
playContinuously(Sound s) |
void |
playMP3( String url,
boolean background) |
void |
playSound( String url)
Primitive permettant de jouer un son (mp3, wav, au).
|
void |
playSound( String url,
boolean background)
Primitive permettant de jouer un son (mp3, wav, au) en déterminant
si il doit être exécuté en tâche de fond ou pas.
|
double |
pow(double base,
double exponent)
Retourne la puissance réelle (
double ) d'un réel (double ). |
void |
print(boolean b)
Affiche une valeur booléenne.
|
void |
print(char c)
Affiche un caractère ou d'une expression de même type.
|
void |
print(double d)
Affiche la valeur d'un réel (double précision) ou d'une expression de
même type.
|
void |
print(float f)
Affiche la valeur d'un réel (simple précision) ou d'une expression de
même type.
|
void |
print(int i)
Affiche la valeur d'un entier ou d'une expression de même type.
|
void |
print(long l)
Affiche la valeur d'un entier long ou d'une expression de même type.
|
void |
print( Object o) |
void |
print( String s)
Affiche une chaîne de caractères ou une expression donnant une chaîne de
caractères.
|
void |
println()
Force un saut de ligne sur le terminal.
|
void |
println(boolean b)
Affiche une valeur booléenne, puis passe à la ligne.
|
void |
println(char c)
Affiche un caractère ou d'une expression de même type, puis passe à la
ligne.
|
void |
println(double d)
Affiche la valeur d'un réel (double précision) ou d'une expression de
même type, puis passe à la ligne.
|
void |
println(float f)
Affiche la valeur d'un réel (simple précision) ou d'une expression de
même type, puis passe à la ligne.
|
void |
println(int i)
Affiche la valeur d'un entier ou d'une expression de même type, puis
passe à la ligne.
|
void |
println(long l)
Affiche la valeur d'un entier long ou d'une expression de même type, puis
passe à la ligne.
|
void |
println( Object o) |
void |
println( String s)
Affiche une chaîne de caractères ou une expression donnant une chaîne
puis passe à la ligne.
|
double |
random()
Retourne un réel tiré aléatoirement dans l'intervalle [0.0, 1.0[.
|
String |
randomANSIColor()
Cette fonction retourne aléatoirement une chaîne de caractère
représentant une couleur (parmi les couleurs définies dans le
tableau ANSI_COLORS).
|
extensions.RGBColor |
randomColor()
Cette primitive tire aléatoirement une couleur RGB.
|
int |
read(extensions.File file) |
char |
readChar()
Demande la saisie d'un caractère.
|
char |
readChar(long timeout)
Demande la saisie en un temps limité d'un caractère.
|
double |
readDouble()
Demande la saisie d'une valeur réelle (double précision).
|
double |
readDouble(long timeout)
Demande la saisie en un temps limité d'une valeur réelle (double précision).
|
float |
readFloat()
Demande la saisie d'une valeur réelle (simple précision).
|
float |
readFloat(long timeout)
Demande la saisie en un temps limité d'une valeur réelle (simple précision).
|
int |
readInt()
Demande la saisie d'une valeur entière.
|
int |
readInt(long timeout)
Demande la saisie en un temps limité d'une valeur entière.
|
String |
readLine(extensions.File file) |
long |
readLong()
Demande la saisie d'une valeur entière 'long'.
|
long |
readLong(long timeout)
Demande la saisie en un temps limité d'une valeur entière 'long'.
|
String |
readString()
Demande la saisie d'une chaîne de caractères.
|
String |
readString(long timeout)
Demande la saisie en un temps limité d'une chaîne de caractères.
|
boolean |
ready(extensions.File file) |
void |
refresh(Image img) |
void |
refresh(TransparentImage img) |
void |
removeAllButtons(Image img)
Supprimer tous les boutons de l'image.
|
void |
removeAllButtons(TransparentImage img)
Supprimer tous les boutons de l'image.
|
void |
removeAllZone(Image img) |
void |
removeAllZone(TransparentImage img) |
void |
removeButton(Image img,
String label)
Supprime le bouton portant un certain label dans l'image passée en
paramètre.
|
void |
removeButton(TransparentImage img,
String label)
Supprime le bouton portant un certain label dans l'image passée en
paramètre.
|
void |
removeZone(Image img,
String name) |
void |
removeZone(TransparentImage img,
String name) |
void |
reset()
Réinitialise la console (utile lorsque vous jouez avec les
couleurs du texte !).
|
int |
rgb(int r,
int g,
int b) |
extensions.RGBColor |
rgbColor(int r,
int g,
int b) |
double |
rint(double a)
Returns the double value that is closest in value to the argument and is
equal to a mathematical integer.
|
long |
round(double a)
Returns the closest long to the argument.
|
int |
round(float a)
Returns the closest int to the argument.
|
int |
rowCount(CSVFile table) |
void |
saveCSV( String[][] content,
String filename) |
void |
saveCSV( String[][] content,
String filename,
char separator) |
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.
|
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.
|
void |
set(Image img,
int line,
int column) |
void |
set(Image img,
int line,
int column,
extensions.RGBColor color) |
void |
set(Image img,
int line,
int column,
Image picture) |
void |
set(Image img,
int line,
int column,
int color) |
void |
set(TransparentImage img,
int line,
int column) |
void |
set(TransparentImage img,
int line,
int column,
extensions.RGBColor color) |
void |
set(TransparentImage img,
int line,
int column,
int color) |
void |
set(TransparentImage img,
int line,
int column,
TransparentImage picture) |
void |
setColor(Image img,
extensions.RGBColor color) |
void |
setColor(Image img,
int r,
int g,
int b) |
void |
setColor(TransparentImage img,
extensions.RGBColor color) |
void |
setColor(TransparentImage img,
int r,
int g,
int b) |
void |
setFocus(Image img,
boolean onImage) |
void |
setFocus(TransparentImage img,
boolean onImage) |
void |
setGrid(Image img,
int lines,
int columns) |
void |
setGrid(TransparentImage img,
int lines,
int columns) |
void |
setMessage(Image img,
String label) |
void |
setMessage(TransparentImage img,
String label) |
void |
setName(Image img,
String name)
Permet de donner un nom à une image.
|
void |
setName(TransparentImage img,
String name)
Permet de donner un nom à une image.
|
void |
setNewFont(Image img,
String name,
String kind,
int size) |
void |
setNewFont(TransparentImage img,
String name,
String kind,
int size) |
void |
setStroke(Image img,
double width) |
void |
setStroke(TransparentImage img,
double width) |
void |
setText(Image img,
String text) |
void |
setText(TransparentImage img,
String text) |
void |
show()
Affiche le curseur.
|
void |
show(Image img) |
void |
show(TransparentImage img) |
void |
showTextField(Image img) |
double |
signum(double d)
Returns the signum function of the argument; zero if the argument is
zero, 1.0 if the argument is greater than zero, -1.0 if the argument is
less than zero.
|
float |
signum(float f)
Returns the signum function of the argument; zero if the argument is
zero, 1.0f if the argument is greater than zero, -1.0f if the argument is
less than zero.
|
double |
sin(double a)
Returns the trigonometric sine of an angle.
|
double |
sinh(double x)
Returns the hyperbolic sine of a double value.
|
double |
sqrt(double number)
Retourne la racine carrée (positive) d'un nombre réel.
|
void |
startAutoUpdate(long tickDuration) |
void |
stop(Sound s)
Arrête la lecture du son
sound (pour peu qu'il soit actuellement
en train d'être joué !). |
void |
stopAutoUpdate() |
double |
stringToDouble( String s)
Convertit une chaîne de caractère supposée représenter un réel vers sa
valeur numérique.
|
int |
stringToInt( String s)
Convertit une chaîne de caractère supposée représenter un entier vers sa
valeur numérique.
|
String |
substring( String s,
int start,
int end)
Retourne une sous-chaîne copiée dans la chaîne
s à partir de
l'indice start inclus à l'indice end exclus. |
double |
tan(double a)
Returns the trigonometric tangent of an angle.
|
double |
tanh(double x)
Returns the hyperbolic tangent of a double value.
|
void |
text( String color)
Défini la couleur de l'affichage du texte.
|
String |
toLowerCase( String s)
Transforme l'ensemble des caractères d'une chaîne en minuscules (enfin,
si tous les caractères sont des lettres !).
|
String |
toUpperCase( String s)
Transforme l'ensemble des caractères d'une chaîne en majuscules (enfin,
si tous les caractères sont des lettres !).
|
void |
up()
Déplace le curseur vers le haut.
|
void |
up(int n)
Déplace le curseur de n lignes vers le haut.
|
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, isValidateRoot, newAudioClip, play, resize, resize, setStub, showStatus, start, stop
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public void reset()
Curses
public void show()
Curses
public void hide()
Curses
public void up(int n)
Curses
public void down(int n)
Curses
public void forward(int n)
Curses
public void backward(int n)
Curses
public void up()
Curses
public void down()
Curses
public void forward()
Curses
public void backward()
Curses
public void cusp()
Curses
public void curp()
Curses
public void cursor(int line, int column)
Curses
public void clearEOL()
Curses
public void clearBOL()
Curses
public void clearLine()
Curses
public void clearScreen()
Curses
clearScreen
in interface Curses
public void text( String color)
Curses
public String randomANSIColor()
Curses
randomANSIColor
in interface Curses
public void background( String color)
Curses
background
in interface Curses
color
- une des couleurs définies dans le tableau ANSI_COLORS.public String[] getAllFilesFromDirectory( String directory)
getAllFilesFromDirectory
in interface Files
public String[] getAllFilesFromCurrentDirectory()
getAllFilesFromCurrentDirectory
in interface Files
public void delay(long milliseconds)
delay
in interface Multimedia
public Sound newSound( String url)
Multimedia
newSound
in interface Multimedia
url
- Le nom du fichier que l'on souhaite charger.public void play(Sound s)
Multimedia
play
in interface Multimedia
play
in class java.applet.Applet
s
- Le son que l'on souhaite jouer.public void play(Sound s, boolean background)
public void playContinuously(Sound s)
public void stop(Sound s)
Multimedia
sound
(pour peu qu'il soit actuellement
en train d'être joué !).stop
in interface Multimedia
s
- Le son que l'on souhaite arrêter.public void playMP3( String url, boolean background)
public void playSound( String url, boolean background)
Multimedia
background
est à vrai, le son est joué en tâche de fond (ie.
ne bloque le flux d'exécution). Sinon, le flux est bloqué jusqu'à
que le son soit entièrement joué.playSound
in interface Multimedia
url
- Le nom du fichier contenant le son à jouer.public void playSound( String url)
Multimedia
playSound
in interface Multimedia
url
- Le nom du fichier contenant le son à jouer.public Image newImage( String name, String filename)
Multimedia
newImage
in interface Multimedia
name
- Le nom que l'on souhaite donner à l'image.filename
- Le nom du fichier que l'on souhaite charger.public TransparentImage newTransparentImage( String name, String filename)
public Image newImage( String filename)
Multimedia
newImage
in interface Multimedia
filename
- Le nom du fichier que l'on souhaite charger.public TransparentImage newTransparentImage( String filename)
public Image newImage( String name, int width, int height)
Multimedia
newImage
in interface Multimedia
name
- Le nom que vous souhaitez donner à l'image.width
- Le nombre de pixels en largeur de l'image.height
- Le nombre de pixels en hauteur de l'image.public void showTextField(Image img)
public void hideTextField(Image img)
public TransparentImage newTransparentImage( String name, int width, int height)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void mouseEvent( String name, int x, int y, int button, String event)
public int getHeight(Image img)
Multimedia
getHeight
in interface Multimedia
img
- l'image dont on souhaite connaître la hauteur.public int getHeight(TransparentImage img)
Multimedia
getHeight
in interface Multimedia
img
- l'image dont on souhaite connaître la hauteur.public int getWidth(Image img)
Multimedia
getWidth
in interface Multimedia
img
- l'image dont on souhaite connaître la largeur.public int getWidth(TransparentImage img)
Multimedia
getWidth
in interface Multimedia
img
- l'image dont on souhaite connaître la largeur.public void setName(Image img, String name)
Multimedia
setName
in interface Multimedia
img
- l'image que l'on souhaite nommer.name
- le nom que l'on souhaite utiliser pour désigner cette image.public void setName(TransparentImage img, String name)
Multimedia
setName
in interface Multimedia
img
- l'image que l'on souhaite nommer.name
- le nom que l'on souhaite utiliser pour désigner cette image.public String getName(Image img)
Multimedia
getName
in interface Multimedia
img
- l'image dont on souhaite connaître le nom.public String getName(TransparentImage img)
Multimedia
getName
in interface Multimedia
img
- l'image dont on souhaite connaître le nom.public Image newImage(int width, int height)
Multimedia
newImage
in interface Multimedia
width
- Le nombre de pixels en largeur de l'image.height
- Le nombre de pixels en hauteur de l'image.public TransparentImage newTransparentImage(int width, int height)
public extensions.RGBColor randomColor()
Multimedia
randomColor
in interface Multimedia
public void addButton(Image img, String label)
Multimedia
addButton
in interface Multimedia
img
- L'image à laquelle on souhaite ajouter un bouton.label
- Le texte qui apparaîtra sur le bouton.public void addButton(TransparentImage img, String label)
Multimedia
addButton
in interface Multimedia
img
- L'image à laquelle on souhaite ajouter un bouton.label
- Le texte qui apparaîtra sur le bouton.public void removeButton(Image img, String label)
Multimedia
removeButton
in interface Multimedia
img
- L'image dont on souhaite retirer l'un des boutons.label
- Le texte du bouton que l'on souhaite supprimer.public void removeButton(TransparentImage img, String label)
Multimedia
removeButton
in interface Multimedia
img
- L'image dont on souhaite retirer l'un des boutons.label
- Le texte du bouton que l'on souhaite supprimer.public void removeAllButtons(Image img)
Multimedia
removeAllButtons
in interface Multimedia
img
- L'image dont on souhaite supprimé tous les boutons.public void removeAllButtons(TransparentImage img)
Multimedia
removeAllButtons
in interface Multimedia
img
- L'image dont on souhaite supprimé tous les boutons.public void changeButton(Image img, String oldlabel, String newlabel)
Multimedia
changeButton
in interface Multimedia
img
- L'image dont on souhaite modifier l'un des boutons.oldlabel
- Le texte actuel du bouton.newlabel
- Le nouveau texte du bouton.public void changeButton(TransparentImage img, String oldlabel, String newlabel)
Multimedia
changeButton
in interface Multimedia
img
- L'image dont on souhaite modifier l'un des boutons.oldlabel
- Le texte actuel du bouton.newlabel
- Le nouveau texte du bouton.public void setMessage(Image img, String label)
setMessage
in interface Multimedia
public void setMessage(TransparentImage img, String label)
setMessage
in interface Multimedia
public void setText(Image img, String text)
setText
in interface Multimedia
public void setText(TransparentImage img, String text)
setText
in interface Multimedia
public void setGrid(Image img, int lines, int columns)
setGrid
in interface Multimedia
public void setGrid(TransparentImage img, int lines, int columns)
setGrid
in interface Multimedia
public int getLines(Image img)
getLines
in interface Multimedia
public int getLines(TransparentImage img)
getLines
in interface Multimedia
public int getColumns(Image img)
getColumns
in interface Multimedia
public int getColumns(TransparentImage img)
getColumns
in interface Multimedia
public int getGridLines(Image img)
getGridLines
in interface Multimedia
public int getGridLines(TransparentImage img)
getGridLines
in interface Multimedia
public int getGridColumns(Image img)
getGridColumns
in interface Multimedia
public int getGridColumns(TransparentImage img)
getGridColumns
in interface Multimedia
public int get(Image img, int line, int column)
get
in interface Multimedia
public int get(TransparentImage img, int line, int column)
get
in interface Multimedia
public void automaticRefresh(Image img, boolean value)
public void automaticRefresh(TransparentImage img, boolean value)
public void refresh(Image img)
public void refresh(TransparentImage img)
public void set(Image img, int line, int column, int color)
set
in interface Multimedia
public void set(TransparentImage img, int line, int column, int color)
set
in interface Multimedia
public void set(Image img, int line, int column, extensions.RGBColor color)
set
in interface Multimedia
public void set(TransparentImage img, int line, int column, extensions.RGBColor color)
set
in interface Multimedia
public void set(Image img, int line, int column)
set
in interface Multimedia
public void set(TransparentImage img, int line, int column)
set
in interface Multimedia
public void fill(Image img)
fill
in interface Multimedia
public void fill(TransparentImage img)
fill
in interface Multimedia
public void fill(Image img, int color)
fill
in interface Multimedia
public void fill(TransparentImage img, int color)
fill
in interface Multimedia
public void fill(Image img, extensions.RGBColor color)
fill
in interface Multimedia
public void fill(TransparentImage img, extensions.RGBColor color)
fill
in interface Multimedia
public void set(Image img, int line, int column, Image picture)
set
in interface Multimedia
public void set(TransparentImage img, int line, int column, TransparentImage picture)
set
in interface Multimedia
public void show(Image img)
show
in interface Multimedia
show
in class java.awt.Component
public void show(TransparentImage img)
show
in interface Multimedia
show
in class java.awt.Component
public void hide(Image img)
hide
in interface Multimedia
public void hide(TransparentImage img)
hide
in interface Multimedia
public void close(Image img)
close
in interface Multimedia
public void close(TransparentImage img)
close
in interface Multimedia
public String[] getAllFontNames()
getAllFontNames
in interface Multimedia
public Image copyAndResize(Image img, String name, int width, int height)
copyAndResize
in interface Multimedia
public TransparentImage copyAndResize(TransparentImage img, String name, int width, int height)
copyAndResize
in interface Multimedia
public Image copySubset(Image img, String name, int x, int y, int width, int height)
copySubset
in interface Multimedia
public TransparentImage copySubset(TransparentImage img, String name, int x, int y, int width, int height)
copySubset
in interface Multimedia
public void drawOval(Image img, int x, int y, int w, int h)
drawOval
in interface Multimedia
public void drawOval(TransparentImage img, int x, int y, int w, int h)
drawOval
in interface Multimedia
public void fillOval(Image img, int x, int y, int w, int h)
fillOval
in interface Multimedia
public void fillOval(TransparentImage img, int x, int y, int w, int h)
fillOval
in interface Multimedia
public void drawRect(Image img, int x, int y, int w, int h)
drawRect
in interface Multimedia
public void drawRect(TransparentImage img, int x, int y, int w, int h)
drawRect
in interface Multimedia
public void fillRect(Image img, int x, int y, int w, int h)
fillRect
in interface Multimedia
public void fillRect(TransparentImage img, int x, int y, int w, int h)
fillRect
in interface Multimedia
public void drawLine(Image img, int x1, int y1, int x2, int y2)
drawLine
in interface Multimedia
public void drawLine(TransparentImage img, int x1, int y1, int x2, int y2)
drawLine
in interface Multimedia
public int getStringLength(Image img, String text)
getStringLength
in interface Multimedia
public int getStringLength(TransparentImage img, String text)
getStringLength
in interface Multimedia
public void drawString(Image img, String text, int x, int y)
drawString
in interface Multimedia
public void drawString(TransparentImage img, String text, int x, int y)
drawString
in interface Multimedia
public void drawImage(Image img, Image pip, int x, int y)
drawImage
in interface Multimedia
public void drawImage(TransparentImage img, TransparentImage pip, int x, int y)
drawImage
in interface Multimedia
public void drawImage(Image img, Image pip, int x, int y, boolean addZone)
public void drawImage(TransparentImage img, TransparentImage pip, int x, int y, boolean addZone)
public void setFocus(Image img, boolean onImage)
setFocus
in interface Multimedia
public void setFocus(TransparentImage img, boolean onImage)
setFocus
in interface Multimedia
public void setStroke(Image img, double width)
setStroke
in interface Multimedia
public void setStroke(TransparentImage img, double width)
setStroke
in interface Multimedia
public void setColor(Image img, extensions.RGBColor color)
setColor
in interface Multimedia
public void setColor(TransparentImage img, extensions.RGBColor color)
setColor
in interface Multimedia
public void setColor(Image img, int r, int g, int b)
setColor
in interface Multimedia
public void setColor(TransparentImage img, int r, int g, int b)
setColor
in interface Multimedia
public int rgb(int r, int g, int b)
rgb
in interface Multimedia
public extensions.RGBColor rgbColor(int r, int g, int b)
rgbColor
in interface Multimedia
public void setNewFont(TransparentImage img, String name, String kind, int size)
setNewFont
in interface Multimedia
public void setNewFont(Image img, String name, String kind, int size)
setNewFont
in interface Multimedia
public void addZone(Image img, String name, int x, int y, int w, int h)
addZone
in interface Multimedia
public void addZone(TransparentImage img, String name, int x, int y, int w, int h)
addZone
in interface Multimedia
public void removeZone(Image img, String name)
removeZone
in interface Multimedia
public void removeZone(TransparentImage img, String name)
removeZone
in interface Multimedia
public void removeAllZone(Image img)
removeAllZone
in interface Multimedia
public void removeAllZone(TransparentImage img)
removeAllZone
in interface Multimedia
public void startAutoUpdate(long tickDuration)
public void stopAutoUpdate()
public long getTime()
getTime
in interface Multimedia
public int read(extensions.File file)
public CSVFile loadCSV( String filename, char separator)
public int columnCount(CSVFile table)
columnCount
in interface Files
public int columnCount(CSVFile table, int idxLine)
columnCount
in interface Files
public String getCell(CSVFile table, int idxLine, int idxColumn)
public void saveCSV( String[][] content, String filename, char separator)
public void saveCSV( String[][] content, String filename)
public double random()
Maths
Retourne un réel tiré aléatoirement dans l'intervalle [0.0, 1.0[. La séquence des tirages est regénérée à chaque exécution du programme et donc non reproductible. La distribution des tirages suit une loi uniforme entre 0 et 1.
Il est possible de translater ce nombre réel dans un intervalle entier en
multipliant le nombre obtenu et en forçant le type à {code int}.
Exemple: pour tirer un nombre entre 1 et 6 (un dé à 6 faces), il suffit
d'écrire
int de = (int) (random()*6) + 1;La fonction
random()
retourne un nombre dans [0.0, 1.0[
qui multiplié par 6 se trouve projeté dans l'intervalle [0.0, 6.0[. Le
forçage vers le type entier (via l'opérateur de cast (int)
transforme le réel en un entier compris entre 0 et 5 (inclus), et le
décalage de 1 donne un nombre compris entre 1 et 6.
public int abs(int nb)
Maths
public long abs(long nb)
Maths
public float abs(float nb)
Maths
public double abs(double nb)
Maths
public double pow(double base, double exponent)
Maths
double
) d'un réel (double
).
La méthode de calcule utilise, soit les fonctions mathématiques
logarithme
et exponentielle
, soit La formule de
l'exponentiation entière (en fonction du type des arguments).public double sqrt(double number)
Maths
NaN
est retournée (Dans ce
cas le programme se poursuit car ce n'est pas une erreur fatale).public double acos(double a)
Maths
public double asin(double a)
Maths
public double atan(double a)
Maths
public double atan2(double y, double x)
Maths
public double cbrt(double a)
Maths
public double ceil(double a)
Maths
public double copySign(double magnitude, double sign)
Maths
public float copySign(float magnitude, float sign)
Maths
public double cos(double a)
Maths
public double cosh(double x)
Maths
public double exp(double a)
Maths
public double expm1(double x)
Maths
public double floor(double a)
Maths
public int getExponent(double d)
Maths
getExponent
in interface Maths
public int getExponent(float f)
Maths
getExponent
in interface Maths
public double hypot(double x, double y)
Maths
public double IEEEremainder(double f1, double f2)
Maths
IEEEremainder
in interface Maths
public double log(double a)
Maths
public double log10(double a)
Maths
public double log1p(double x)
Maths
public double max(double a, double b)
Maths
public float max(float a, float b)
Maths
public int max(int a, int b)
Maths
public long max(long a, long b)
Maths
public double min(double a, double b)
Maths
public float min(float a, float b)
Maths
public int min(int a, int b)
Maths
public long min(long a, long b)
Maths
public double nextAfter(double start, double direction)
Maths
public float nextAfter(float start, double direction)
Maths
public double nextUp(double d)
Maths
public float nextUp(float f)
Maths
public double rint(double a)
Maths
public long round(double a)
Maths
public int round(float a)
Maths
public double scalb(double d, int scaleFactor)
Maths
public float scalb(float f, int scaleFactor)
Maths
public double signum(double d)
Maths
public float signum(float f)
Maths
public double sin(double a)
Maths
public double sinh(double x)
Maths
public double tan(double a)
Maths
public double tanh(double x)
Maths
public int stringToInt( String s)
Maths
-
. Si la chaîne ne suit pas cette règle une erreur
NumberFormatException
est générée et le programme s'interrompt.stringToInt
in interface Maths
s
- La représentation du nombre entier (chaîne de caractères).public double stringToDouble( String s)
Maths
NumberFormatException
est générée et le programme
s'interrompt.NullPointerException
est générée et le programme s'interrompt.stringToDouble
in interface Maths
s
- La représentation du nombre entier (chaîne de caractères).public int charToInt(char c)
Maths
Convertit un chiffre (caractère décimal donc de 0 à 9 inclus) vers sa
valeur numérique (entière!).
Si le caractère n'est pas un chiffre, une erreur RuntimeException
est générée et le programme s'interrompt.
Exemple: charToInt('3')
retournera la valeur 3.
public boolean equals( String s1, String s2)
Miscellaneous
Test l'égalité de deux chaînes de caractères. Attention, le langage Java est sensible à la casse (ie. à la différence entre une lettre minuscule et une lettre majuscule).
Note:L'écriture if (s1 == s2)
, bien que ne provoquant pas
d'erreur de compilation peut donner un résultat contraire à l'intuition
(cela revient à comparer les contenants et pas les contenus ...).
equals
in interface Miscellaneous
s1
- la première chaîne à comparer.s2
- la deuxième chaîne à comparer.true
si s1
et s2
sont identiques et
false
sinon.public String toUpperCase( String s)
Miscellaneous
s
n'est
pas modifié sauf explicitement par une écriture de la forme s = toUpperCase(s) ;
.toUpperCase
in interface Miscellaneous
s
- la chaîne à transformer en majuscules.public String toLowerCase( String s)
Miscellaneous
s
n'est
pas modifié sauf explicitement par une écriture de la forme s = toLowerCase(s) ;
.toLowerCase
in interface Miscellaneous
s
- la chaîne à transformer en minuscules.public int compare( String s1, String s2)
Miscellaneous
s1
se place après la chaîne s2
selon l'ordre lexicographique,
s1
se place avant la chaîne s2
selon l'ordre lexicographique.
compare
in interface Miscellaneous
s1
- la première chaîne à comparer.s2
- la deuxième chaîne à comparer.public int length( String s)
Miscellaneous
length
in interface Miscellaneous
s
- la chaîne de caractères dont on souhaite connaître le nombre de
caractères.s
(et 0 si
s
est la chaîne vide).public String substring( String s, int start, int end)
Miscellaneous
Retourne une sous-chaîne copiée dans la chaîne s
à partir de
l'indice start
inclus à l'indice end
exclus. Attention,
le premier caractère de la chaîne se trouve à l'indice 0 (et donc, le
dernier indice valide est la longueur de la chaîne moins un !).
Si l'un des paramètres fournis est négatif ou supérieur à la longueur de
la chaîne d'origine, une erreur StringIndexOutOfBoundsException
se produit et le programme s'interrompt.
Exemple: substring("ABCDEF", 2, 4)
calculera "CDE"
.
Exemple: substring("ABCDEF", 2, 6)
calculera "CDE"
.
Exemple: substring("ABCDEF", 2, 7)
provoquera une erreur.
note: Même si substring("ABCDEF", 2, 3)
retourne
"C"
, le résultat a pour type chaîne de caractère et non
caractère. La fonction Miscellaneous.charAt( String, int)
fournit un résultat de type
caractère.
substring
in interface Miscellaneous
s
- la chaîne dont on souhaite copier une partie.start
- l'indice de début d'extraction (inclus).end
- l'indice de fin d'extraction (exclus).s
contenant les caractères situés
entre les indices start
et end-1
.public char charAt( String s, int idx)
Miscellaneous
Retourne le caractère de la chaîne s
situé à l'indice
idx
. Attention, le premier caractère d'une chaîne se trouve à
l'indice 0 !
Si la position fournie est négative ou supérieure ou égale à la taille de
la chaîne, une erreur StringIndexOutOfBoundsException
se
produit.
Exemple: charAt("ABCDEF", 1
fournira la valeur 'B'
(de
type caractère (ie. char
).
charAt
in interface Miscellaneous
s
- la chaîne dont on souhaite copier un caractère.idx
- l'indice du caractère que l'on souhaite copier.idx
dans la chaîne
s
.public int length( Object tab)
Miscellaneous
tab
. Cette
fonction ne peut s'appliquer que sur les tableaux à une dimension ...
mais accepte tous les types manipulés en S1 (byte, short, int, long,
float, double, boolean, char, String, ainsi que les types définis dans
les extensions).length
in interface Miscellaneous
tab
- le tableau dont on souhaite connaître le nombre de cases.tab
.public int length( Object tab, int dim)
Miscellaneous
dim
du tableau tab
. Cette fonction peut s'appliquer à tous les types
manipulés en S1 (byte, short, int, long, float, double, boolean, char,
String, ainsi que les types définis dans les extensions).length
in interface Miscellaneous
tab
- le tableau dont on souhaite connaître le nombre de cases.dim
- la dimension dont on souhaite connaître le nombre de cases.dim
du tableau
tab
.public void print( Object o)
public void print( String s)
TextInputOutput
print
in interface TextInputOutput
s
- La chaîne à afficher.public void print(int i)
TextInputOutput
print
in interface TextInputOutput
i
- La valeur entière à afficher.public void print(long l)
TextInputOutput
print
in interface TextInputOutput
l
- La valeur de type 'long' à afficher.public void print(float f)
TextInputOutput
print
in interface TextInputOutput
f
- la valeur réelle à afficher.public void print(double d)
TextInputOutput
print
in interface TextInputOutput
d
- la valeur réelle (double précision) à afficher.public void print(char c)
TextInputOutput
print
in interface TextInputOutput
c
- le caractère à afficher.public void print(boolean b)
TextInputOutput
print
in interface TextInputOutput
b
- l'expression booléenne à afficher.public void println()
TextInputOutput
println
in interface TextInputOutput
public void println( Object o)
public void println( String s)
TextInputOutput
println
in interface TextInputOutput
s
- La chaîne à afficher.public void println(int i)
TextInputOutput
println
in interface TextInputOutput
i
- La valeur de type entier à afficher.public void println(long l)
TextInputOutput
println
in interface TextInputOutput
l
- La valeur de type entier long à afficher.public void println(float f)
TextInputOutput
println
in interface TextInputOutput
f
- la valeur réelle à afficher.public void println(double d)
TextInputOutput
println
in interface TextInputOutput
d
- la valeur réelle (double précision) à afficher.public void println(char c)
TextInputOutput
println
in interface TextInputOutput
c
- le caractère à afficher.public void println(boolean b)
TextInputOutput
println
in interface TextInputOutput
b
- l'expression booléenne à afficher.public int readInt()
TextInputOutput
int i = readInt()
.readInt
in interface TextInputOutput
public long readLong()
TextInputOutput
i = readLong()
.readLong
in interface TextInputOutput
public float readFloat()
TextInputOutput
float i = readFloat()
. le format de saisie supporte une mantisse
signée et éventuellement un point décimal et un exposant (entier signé).
Quelques exemples de valeurs saisies:
3.14, -2.71, -3.5E-06.readFloat
in interface TextInputOutput
public double readDouble()
TextInputOutput
double i = readDouble()
. le format de saisie supporte une
mantisse signée et éventuellement un point décimal et un exposant (entier
signé).
Quelques exemples de valeurs saisies:
3.14, -2.71, -3.5E-06.readDouble
in interface TextInputOutput
public String readString()
TextInputOutput
readString
in interface TextInputOutput
public char readChar()
TextInputOutput
readChar
in interface TextInputOutput
public String readString(long timeout)
TextInputOutput
readString
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic int readInt(long timeout)
TextInputOutput
int i = readInt(5000)
.readInt
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic long readLong(long timeout)
TextInputOutput
i = readLong()
.readLong
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic float readFloat(long timeout)
TextInputOutput
float i = readFloat()
. Le format de saisie supporte une mantisse
signée et éventuellement un point décimal et un exposant (entier signé).
Quelques exemples de valeurs saisies:
3.14, -2.71, -3.5E-06.readFloat
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic double readDouble(long timeout)
TextInputOutput
double i = readDouble()
. le format de saisie supporte une
mantisse signée et éventuellement un point décimal et un exposant (entier
signé).
Quelques exemples de valeurs saisies:
3.14, -2.71, -3.5E-06.readDouble
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic char readChar(long timeout)
TextInputOutput
readChar
in interface TextInputOutput
timeout
- Le nombre de millisecondes dont dispose l'utilisateur
pour effectuer sa saisiepublic void enableKeyTypedInConsole(boolean on)
Curses
enableKeyTypedInConsole
in interface Curses
on
- activation de la capture (true) ou désactivation (false).public void assertEquals( Object expected, Object tested)
Assertions
AssertionException
si ce n'est pas le cas. Cette fonction un peu
'magique' permet de comparer des informations de même type. Il est ainsi
possible d'appeler cette fonction avec les différents types que nous
utilisons couramment: int, double, char, boolean,
String.assertEquals
in interface Assertions
expected
- attendu le résultat que l'on souhaiterait avoir.tested
- obtenu la valeur retournée par l'expression testée.public void assertArrayEquals( Object expected, Object tested)
public void assertArrayEquals( Object[] expected, Object[] tested)
Assertions
assertArrayEquals
in interface Assertions
expected
- attendu le résultat que l'on souhaiterait avoir.tested
- obtenu la valeur retournée par l'expression testée.public void assertArrayNotEquals( Object o1, Object o2)
public void assertArrayNotEquals( Object[] expected, Object[] tested)
Assertions
assertArrayNotEquals
in interface Assertions
expected
- attendu le résultat que l'on souhaiterait avoir.public void assertNotEquals( Object expected, Object tested)
Assertions
AssertionException
si ce n'est pas le cas. Cette fonction un peu
'magique' permet de comparer des informations de même type. Il est ainsi
possible d'appeler cette fonction avec les différents types que nous
utilisons couramment: int, double, char,
boolean, String.assertNotEquals
in interface Assertions
expected
- attendu le résultat que l'on souhaiterait avoir.tested
- obtenu la valeur retournée par l'expression testée.public void assertTrue( Boolean b)
Assertions
AssertionException
si ce n'est pas le cas.assertTrue
in interface Assertions
b
- le booléen devant être vrai (true).public void assertFalse( Boolean b)
Assertions
AssertionException
si ce n'est pas le cas.assertFalse
in interface Assertions
b
- le booléen devant être faux (false).public void assertGreaterThan( Comparable expected, Comparable tested)
Assertions
assertGreaterThan
in interface Assertions
expected
- la valeur attenduetested
- la valeur testéepublic void assertGreaterThanOrEqual( Comparable expected, Comparable tested)
Assertions
assertGreaterThanOrEqual
in interface Assertions
expected
- la valeur attenduetested
- la valeur testéepublic void assertLessThan( Comparable expected, Comparable tested)
Assertions
assertLessThan
in interface Assertions
expected
- la valeur attenduetested
- la valeur testéepublic void assertLessThanOrEqual( Comparable expected, Comparable tested)
Assertions
assertLessThanOrEqual
in interface Assertions
expected
- la valeur attenduetested
- la valeur testéepublic void error( String message)
public static void main( String[] args)