KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cve > core > elementLDL > InsiemeElementiCve


1 package cve.core.elementLDL;
2
3 import java.util.*;
4
5 public class InsiemeElementiCve implements IInsiemeElementiCve{
6     private Vector insiemeCve;
7     private String JavaDoc ambiente;
8     
9     public InsiemeElementiCve(){
10         insiemeCve=new Vector();
11         
12     }
13     
14     public String JavaDoc getAmbiente() {
15         return ambiente;
16     }
17         
18     public void setAmbiente(String JavaDoc nome) {
19         ambiente=nome;
20     }
21     
22     public IElementoCve getElemento(int index){
23         IElementoCve ele;
24         if (index<insiemeCve.capacity()){
25             ele=(IElementoCve)insiemeCve.elementAt(index);
26             return ele;
27         }
28         else return ele=null;
29     }
30     
31     public void addElemento(IElementoCve ele){
32         insiemeCve.add(ele);
33     }
34     
35     public boolean removeElemento(IElementoCve ele){
36         return insiemeCve.remove(ele);
37     }
38     
39     public int getCardinalita(){
40         return insiemeCve.size();
41     }
42         
43         public Collection getAll(){
44         return insiemeCve;
45     }
46 }
47
Popular Tags