1 package cve.core.elementEEL; 2 3 import java.util.*; 4 5 11 public class EnvironmentEEL implements IEnvironmentEEL 12 { 13 private Vector insiemeUnit; 14 private String description; 15 private int currentUnit=0; 16 17 20 public EnvironmentEEL(){ 21 insiemeUnit=new Vector(); 22 } 23 24 28 public IUnit getUnit(int index){ 29 IUnit ele; 30 if (index<insiemeUnit.size()){ 31 ele=(IUnit)insiemeUnit.elementAt(index); 32 currentUnit=index; 33 return ele; 34 } 35 else return ele=null; 36 } 37 38 41 public IUnit getNextUnit(){ 42 currentUnit++; 43 return getUnit(currentUnit); 44 } 45 46 49 public IUnit getCurrentUnit(){ 50 return getUnit(currentUnit); 51 } 52 53 57 public void addUnit(IUnit ele){ 58 insiemeUnit.add(ele); 59 } 60 61 65 public boolean removeUnit(IUnit ele){ 66 return insiemeUnit.remove(ele); 67 } 68 69 72 public int getCardinalita(){ 73 return insiemeUnit.size(); 74 } 75 76 79 public Collection getAllUnit(){ 80 return insiemeUnit; 81 } 82 83 86 public String getDescription(){ 87 return description; 88 } 89 90 93 public void setDescription(String description){ 94 this.description=description; 95 } 96 97 } 98 99 100 101 102 | Popular Tags |