Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.LinkedList;
  3. import java.util.List;
  4. import java.util.Scanner;
  5.  
  6. class Processo {
  7. private int tempo;
  8. private String nome;
  9.  
  10. public Processo(String nome, int tempo){
  11. this.nome = nome;
  12. this.tempo = tempo;
  13. }
  14. public String getNome(){
  15. return this.nome;
  16. }
  17. public int getTempo(){
  18. return this.tempo;
  19. }
  20. public void setTempo(int tempo){
  21. this.tempo = tempo;
  22. }
  23.  
  24. }
  25.  
  26.  
  27. class Fila{
  28. public List<Processo> processos = new LinkedList<Processo>();
  29. public int executando;
  30.  
  31. public void insere(Processo p) {
  32. this.processos.add(p);
  33. this.executando ++;
  34. }
  35. public void remove(Processo p){
  36. this.processos.remove(p);
  37. this.executando --;
  38. }
  39. public void listar(){
  40. for(Processo p : this.processos){
  41. System.out.print(p.getNome());
  42. System.out.print("\n");
  43. System.out.print("Tempo:"+p.getTempo());
  44. System.out.print("\n");
  45.  
  46. System.out.print("\n--\n");
  47.  
  48. }
  49. System.out.print(this.executando+" Processos Em Running\n----------------------------\n");
  50. }
  51. public void executar(){
  52. //Por fazer
  53. }
  54.  
  55. }
  56.  
  57.  
  58. public class FilaSimples{
  59.  
  60. public static void main(String[] args) {
  61. Scanner ler = new Scanner(System.in);
  62. Fila fila = new Fila();
  63. while(true){
  64.  
  65. //por fazer
  66.  
  67.  
  68. }
  69.  
  70.  
  71. }
  72.  
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement