Problème lecture ArrayList à 3 dimensions
Bonjour à tous,
J'ai créé une collection de type ArrayList à 3 dimensions dans laquelle j'ajoute des valeurs ... jusqu'ici tout va bien aucun problème pour les ajouter, en revanche pour faire l'effet inverse c'est à dire les récupérer et bien impossible ... Je sais pas comment on fait.
Je vous post mon code afin que vous puissiez comprendre mon erreur :
Etaoe 1 : Je récupère le contenu de mes données stockées dans un fichier XML
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
private ArrayList<Object[]> array = new ArrayList<Object[]>();
public void visitElement_roomtype(Element element) {
// <roomtype>
// element.getValue();
NamedNodeMap attrs = element.getAttributes();
for (int i = 0; i < attrs.getLength(); i++) {
org.w3c.dom.Attr attr = (org.w3c.dom.Attr) attrs.item(i);
if (attr.getName().equals("id")) {
Id = attr.getValue();
}
if (attr.getName().equals("name")) {
Name = attr.getValue();
}
if (attr.getName().equals("rate")) {
Rate = attr.getValue();
}
}
Object[] arr0 = {Id, Name, Rate};
array.add(arr0);
}
public <E> ArrayList<E> getList(){
return (ArrayList<E>) array;
} |
Etape 2 : Je récupère dans une autre classe ma collection pour afficher les valeurs dans une jComboBox et c'est là le problème
Code:
1 2 3 4 5 6 7 8 9 10 11
|
public static void LoadData(){
ListType = ScanRoomType.getList();
/** REMPLIT LA LISTE DES ID DES TYPES DE CHAMBRE */
for (Iterator<ArrayList<ArrayList<String>>> iterator = ListType.iterator(); iterator.hasNext();) {
ArrayList<ArrayList<String>> next = iterator.next();
}
} |
Je vous remercie d'avance à tous pour votre aide.