Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Scanner;
- class Processo {
- private int tempo;
- private String nome;
- public Processo(String nome, int tempo){
- this.nome = nome;
- this.tempo = tempo;
- }
- public String getNome(){
- return this.nome;
- }
- public int getTempo(){
- return this.tempo;
- }
- public void setTempo(int tempo){
- this.tempo = tempo;
- }
- }
- class Fila{
- public List<Processo> processos = new LinkedList<Processo>();
- public int executando;
- public void insere(Processo p) {
- this.processos.add(p);
- this.executando ++;
- }
- public void remove(Processo p){
- this.processos.remove(p);
- this.executando --;
- }
- public void listar(){
- for(Processo p : this.processos){
- System.out.print(p.getNome());
- System.out.print("\n");
- System.out.print("Tempo:"+p.getTempo());
- System.out.print("\n");
- System.out.print("\n--\n");
- }
- System.out.print(this.executando+" Processos Em Running\n----------------------------\n");
- }
- public void executar(){
- //Por fazer
- }
- }
- public class FilaSimples{
- public static void main(String[] args) {
- Scanner ler = new Scanner(System.in);
- Fila fila = new Fila();
- while(true){
- //por fazer
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement