input
stringlengths
10
828
output
stringlengths
5
107
public void set arete point2 d double a point2 d double b deb a fin b dist point2 d double distance a get x a get y b get x b get y
change the segment
public boolean contains point2 d double p teste si le point p est dans l arete if deb equals p fin equals p return true return false todo on ne teste que s il est une borne et s il est dessus
test if the point is on the segment
public double try cout int a int b double dist double tmp dist dist distance get point a get point a 1 distance get point b get point b 1 tmp dist distance get point a get point b distance get point a 1 get point b 1 return tmp dist dist
simulates the weight of a new graphe if the swap done
protected file chooz file jfile chooser file chooz new jfile chooser int return val file chooz show open dialog null if return val jfile chooser approve option dir file chooz get selected file system out println vous avez voulu ouvrir dir get absolute path return dir
open a window to choose a file to open a file
public void print system out println s
prints in the system
public void add our object obj env put obj get name obj
adds a new object to the environment
public void append string str cp add str
to append a target to the end of the classpath
public our object remove string name throws job not terminated exception our object o our object env get name if o get thread id 1 env remove name return o throw new job not terminated exception o get thread id
removes an our object from the environment and returns it
public void copy our object our object o this obj o obj this type o type thread id 1
copies the our object in parameter to this
public void prepend string str linked hash set tmp new linked hash set tmp add str tmp add all cp cp tmp
to prepend a target to the begining of the classpath
public string to string url urls string buffer tmp new string buffer try urls to url if urls length 0 tmp append urls 0 get path for int i 1 i urls length i tmp append tmp append urls i get path else tmp append catch malformed urlexception e system err println probleme d url dans le classpath return tmp to string
constructs a string representation of this classpath
private void show prompt system out print prompt on veut ne pas aller la ligne
displays the prompt
private string get string try return input read line catch ioexception e system err println erreur de lecture du flot return null
returns the input string
private void listening while stop show prompt string s get string if s equals ignore case quit system out println goodbye try input close catch ioexception e system err println erreur de fermeture du flot stop else sa analyse s sa get pool kill pool
the function listening to the keyboard
public string to string string buffer buff new string buffer iterator i env values iterator while i has next buff append i next n return buff to string
returns a string representation of the environment
public void launch string tokenizer args system out println contenu de l environnement system out print syntax analyse get env system out println
it displays the content of the environment
public void help help show title system out println affichage du contenu de l environnement
shows the help of the command
public void help help show title system out println set nom expression ajoute un symbole et sa definition dans l environnement
shows the help of the command
public map get map return env
returns a the map representation of the environment
public void help help show title system out println unset nom retire le symbole nom et sa d finition de l environnement
shows the help of the command
public void set thread id int id thread id id
sets the identity of the thread which using it to id
public void help help show title system out println eval expression value expression sans afficher sa valeur
shows the help of the command
public int size return env size
returns the size of the environment
public void help help show title system out println print expression value expression et affiche sa valeur
shows the help of the command
public void launch string tokenizer args throws error command line exception if args has more elements get package resolver add args next token else throw new error command line exception absence de nom d import
it makes the import of a class
public void help help show title system out println import nom de paquetage importe toutes les classes du paquetage nom de paquetage
shows the help of the command
public void help help show title system out println load archiv jap chargement d un environnement pr alablement sauvegard dans le fichier archiv jap
shows the help of the command
public void launch string tokenizer args throws error command line exception string token if args has more elements token args next token else throw new error command line exception absence de valeur pour le classpath set classpath token concat get classpath get classpath prepend token
this function prepends a new path to the classpath
public void help help show title system out println include nom de fichier lit et ex cute les commandes contenues dans le fichier nom de fichier
shows the help of the command
public void help help show title system out println prepend classpath path ajout du chemin path au d but du classpath
shows the help of the command
public void launch string tokenizer args throws error command line exception string token if args has more elements token args next token else throw new error command line exception absence de valeur pour le classpath get classpath append token
this function appends a new path to the classpath
public void help help show title system out println save archiv jap sauvegarde de l environnement actuel dans le fichier archiv jap
shows the help of the command
public void launch string tokenizer args system out println get classpath
it print in the output stream the classpath
public void help help show title system out println append classpath path ajout du chemin path la fin du classpath
shows the help of the command
public void help help show title system out println print classpath affichage du classpath
shows the help of the command
private our thread add thread if active threads size inactive threads size thread max activated threads our thread ot new our thread activated threads ot start active threads add ot return ot return null
adds a thread to the pool
public void help help show title system out println fg ne pas rendre la main tant qu un processus l ger donn n a pas termin son travail system out println t par exemple system out println fg 123 attend que le processus l ger 123 ait termin avant que l utilisateur ne puisse taper la commande suivante
shows the help of the command
public void set thread string origin throws error command line exception this origin origin string tokenizer args new string tokenizer origin string token if args has more elements token args next token else throw new error command line exception absence de commande this func token this args args set thread priority func
this function changes the command to launch
public void launch string tokenizer args iterator i pool get active threads iterator while i has next system out println our thread i next
it prints working jobs
private our thread get free thread throws exception synchronized jeton our thread ot null int inactive size inactive threads size if inactive size 0 ot our thread inactive threads remove inactive size 1 active threads add ot jeton notify return ot ot add thread if ot null jeton notify return ot while inactive threads size 0 try jeton wait 1000 catch interrupted exception e inactive size inactive threads size ot our thread inactive threads remove inactive size 1 active threads add ot jeton notify return ot
this function returns a sleeping thread
public void help help show title system out println jobs affiche la liste des processus l gers en cours d execution
shows the help of the command
public string to string if get obj null return get name get string type null return get name get string type get obj to string
returns a string representation of this our object
public void launch string args throws error command line exception our thread t try t get free thread t set thread args t start thread catch exception e system out println mewde
this function launches a command line through a thread
public void help help show title system out println nice id priorit changer la priorit du processus l ger id system out println exemple system out println nice 123 3 fixe 3 la priorit du processus l ger 123
shows the help of the command
public string to string return num thread origin get priority
this function returns a string representation of this thread
public boolean has target return has target
tells if this object needs target
public void help help show title system out println search help
shows the help of the command
private string get string type string s obj get class get name split n accepte pas le caractere int i if i s last index of 1 s s substring i 1 return s
returns the type of the our object in a string
public void kill pool iterator iactive pool get active threads iterator iterator iinactive pool get inactive threads iterator while iactive has next our thread ot our thread iactive next ot kill while iinactive has next our thread ot our thread iinactive next ot kill
this function kill the pool
public class load class string name throws class not found exception class r try r get parent load class name catch class not found exception c try return pr resolve import name catch illegal argument exception e r find class name if r null resolve class r else try r new urlclass loader get classpath to url load class name catch malformed urlexception e1 system err println probleme d url dans le classpath catch class not found exception e1 system err println classe name introuvable return r
returns the class named name
public void help help show title system out println pu field fixe la valeur d un champs d un objet system out println exemple system out println put field x a 5 fixe 5 la valeur du champs de nom x de l objet contenu dans la variable a
shows the help of the command
private void init iterator i syntax analyse get env get map values iterator while i has next our object o our object i next if o get thread id num thread o set thread id 1 synchronized pool get jeton array list active threads pool get active threads int id active threads index of this if id 1 our thread ot our thread active threads remove id pool get inactive threads add ot pool get jeton notify go false
initialise a thread
public void help help show title system out println get field r cup re la valeur du champs d un objet system out println exemple system out println get field x a r cup re la valeur du champs de nom x de l objet contenu dans la variable a
shows the help of the command
public void start thread go true
this function makes the thread working
public void help help show title system out println put field s fixe la valeur d un champs statique d un objet system out println exemple system out println put field s x point 5 fixe 5 la valeur du champs statique de nom x contenu dans la classe point
shows the help of the command
public void help help show title system out println appel de constructeur system out println texemple system out println new 1 integer 3 system out println t cr ation d un objet de type integer avec appel du constructeur integer 3 system out println t l op rateur new appelle un constructeur entre les crochets le nombre de param tres
shows the help of the command
public boolean is running return go
tests if this thread is working
public void help help show title system out println get field s r cup re la valeur d un champs statique d un objet system out println exemple system out println get field s x point r cup re la valeur du champs statique de nom x contenu dans la classe point
shows the help of the command
public void kill kill true
tells the thread to die
protected class find class string name throws class not found exception try file f new file name data input stream is new data input stream new file input stream f byte tab new byte int f length is read fully tab is close return define class name tab 0 tab length catch ioexception c try return new urlclass loader get classpath to url load class name catch malformed urlexception e1 system err println probleme d url dans le classpath throw new class not found exception
searchs the class named name
public void help help show title system out println appel de m thode normale system out println texemple system out println call 1 permet d appeler une m thode non statique un seul param tre ce qui suit imm diatement l op rateur est le nom de la m thode puis la cible de l appel ensuite viennent les param tres dans l ordre
shows the help of the command
public void help help show title system out println appel de m thode statique system out println texemple system out println call s 3 permet d appeler une m thode statique l appel a trois param tres ce qui suit imm diatement l op rateur est le nom de la classe contenant la m thode puis le nom de la m thode ensuite viennent les param tres dans l ordre
shows the help of the command
public void add file url url int depth tree model add child url get path depth
add a file to the tree
public void add file url url int depth default bounded range model model int thread indice tree files add file url depth pane files add url url model depth thread indice
add a file to all the specific components
protected int number argument string s int start s index of if start 1 return 1 string f s substring 0 start if syntax analyse is operator f operator op syntax analyse get operators syntax analyse get index of operator f if op has target return new integer s substring start 1 s length 1 int value 1 return new integer s substring start 1 s length 1 int value
returns the number of argument of the command s
public void set url string s url value get editor set item s
sets the url
public panel bar get panel bar return bar
returns the panel bar
public boolean has string string s for int i 0 i this get item count i if s equals this get item at i return true return false
returns wether or not the string already exists
public void add url url url default bounded range model bounded model int depth int thread indice if depth 0 model init model add file new info file url bounded model thread indice
initialisation of the table
public void reset with default mutable tree node new root if root null root remove all children set root new root root new root last inserted node new root
resets the width of the tree
public panel tree files get panel tree files return tree files
returns the tree panel
public void add child string new child int depth default mutable tree node child new default mutable tree node new child if last inserted node null depth 0 tree node tab nodes last inserted node get path int i for i tab nodes length 1 i depth 1 i insert node into child tab nodes i else reset with child last inserted node child
add a child to the tree
public void add file info file file list add file fire table rows inserted get row count get row count
add a file to the table model
public void init int old size get row count list clear fire table rows deleted 0 old size
initialisation of the model
public void insert node into default mutable tree node new child tree node parent int indice parent get child count insert node into new child mutable tree node parent indice
insert a node into the tree
public panel files load get panel files load return pane files
returns the table panel
public void set constraints int gridx int gridy int gridwidth int gridheight int weightx int weighty int fill int anchor this gridx gridx this gridy gridy this gridwidth gridwidth this gridheight gridheight this weightx weightx this weighty weighty this fill fill this anchor anchor
sets the constraints
public void get links buffered reader in string s array list tmp list new array list while true if look for open tag in 1 break tmp list add get tags and attributes in get link attributes tmp list
sets the links
public panel url panel new jpanel panel add new jlabel url string s http www igm univ mlv fr jcervell hoover index html field new jtext field s 27 panel add field
creates an url panel
protected void set txt string s field set text s
sets the text in the field
public int look for open tag buffered reader in int c 1 try while c in read 1 c open return c catch ioexception e system err println in out exception return c
looking for an opening tag
protected void set dir file f directory f
sets the directory
public jframe create frame config frame config new jframe parametres de telechargement panel config pc new panel config frame config get content pane add pc get panel frame config pack frame config set resizable false frame config set default close operation window constants dispose on close return frame config
creates the frame containing the configuration panel
public string get tags and attributes buffered reader in string s null try string buffer strbuf new string buffer max size int c current size 0 while c in read 1 c close 0 current size max size strbuf insert current size char c current size if c 1 s new string strbuf return s else return null catch ioexception e system err println htmlparser get tags and attributes return s
get the tags and attributes
public url get url return panel url get url
return the choosen url
public void get link attributes array list tmp string s result for iterator it tmp iterator it has next s string it next if is link s if result get specific attribute s null add string url result
sets the link attributes
public file get dir return panel rep get rep
return the destination directory
public array list get urllist return attributes
returns the list of urls
public int get deep return panel deep get value
return the choosen deepness
public string get expr return panel expr get expr
return the choosen regurlar expression
protected void add string url string url name try attributes add new url urlinfo check url current url url name catch malformed urlexception e system err println my htmldocument add string url malformed urlexception
add a string to the attributes
public void start super start id
starting method of the thread
private method get unuse method me1 method me2 int plus proche1 0 int plus proche2 0 class cl1 me1 get parameter types class cl2 me2 get parameter types if cl1 length 0 return null for int i 0 i cl1 length i int level1 level to object cl1 i int level2 level to object cl2 i if level1 level2 plus proche2 else if level1 level2 plus proche1 if plus proche1 plus proche2 return me1 else if plus proche1 plus proche2 return me2 return null
this function finds the method which is not enough specified
public void analyse string line string tokenizer args new string tokenizer line if args has more elements string token args next token if token starts with system out println action else system out println commentaire
analyse the command line
private int level to object class c int i 0 class tmp c while tmp null tmp tmp get superclass i return i
this function the level to the class object for the class c in
public string get type return get urlname substring get urlname last index of get urlname last index of
returns the type of the file
public void set url url url todo donner la possibilit de donner le nom comme a this url url
sets the name of the file
public string get urlname return url get path
returns the path of the url of the file
public string get urlpath return url to string
returns a string representation of the url of the file
public string get urlfile name return urlinfo get urlfile name url
returns the name of the file