- Hlavní stránka
- Balíky
- Třídy
- Soubory

# src/cz/neubauer/tomas/hazardanalysis/model/stages/Stage.java

Zobrazit dokumentaci tohoto souboru.

    00001
    00004 package cz.neubauer.tomas.hazardanalysis.model.stages;
    00005
    00006 import java.util.ArrayList;
    00007
    00008 import cz.neubauer.tomas.hazardanalysis.model.dangers.DangerVariant;
    00009
    00015 public class Stage {
    00019         private int id;
    00020
    00024         private String description;
    00025
    00029         private ArrayList<Phase> phases;
    00030
    00041         public Stage(int id, String description, ArrayList<Phase> phases) {
    00042                 this.id = id;
    00043                 this.description = description;
    00044                 this.phases = phases;
    00045         }
    00046
    00056         public Stage(int id, String description) {
    00057                 this.id = id;
    00058                 this.description = description;
    00059                 phases = new ArrayList<Phase>(10);
    00060         }
    00061
    00067         public String getDescription() {
    00068                 return description;
    00069         }
    00070
    00077         public void setDescription(String description) {
    00078                 this.description = description;
    00079         }
    00080
    00086         public ArrayList<Phase> getPhases() {
    00087                 return phases;
    00088         }
    00089
    00096         public void setPhases(ArrayList<Phase> phases) {
    00097                 this.phases = phases;
    00098         }
    00099
    00106         public void addPhase(Phase phase) {
    00107                 phases.add(phase);
    00108         }
    00109
    00117         public Phase getPhase(int index) {
    00118                 return phases.get(index);
    00119         }
    00120
    00128         public void removePhase(int index) {
    00129                 phases.remove(index);
    00130         }
    00131
    00135         public void clear() {
    00136                 phases.clear();
    00137         }
    00138
    00144         public int getId() {
    00145                 return id;
    00146         }
    00147
    00154         public void setId(int id) {
    00155                 this.id = id;
    00156         }
    00157
    00163         public int getPhasesCount() {
    00164                 return phases.size();
    00165         }
    00166
    00173         public ArrayList<DangerVariant> getDangerVariants() {
    00174                 ArrayList<DangerVariant> variants = new ArrayList<DangerVariant>(10);
    00175
    00176                 for (int i = 0; i < getPhasesCount(); i++) {
    00177                         variants.addAll(phases.get(i).getVariants());
    00178                 }
    00179
    00180                 return variants;
    00181         }
    00182 }