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
| /**
* Ma HashMap static
*/
private static HashMap<String, NoeudAffiche> noeudArbo;
/**
* Renvoie la liste des clés de ma HashMap sous forme de tableau de String.
* @return la liste des clés de ma HashMap sous forme de tableau de String.
*/
public static final String[] LISTE_TYPE_NOEUDS_DYNAMIQUE;
static {
noeudArbo = new HashMap<String, NoeudAffiche>()
noeudArbo.put("String 1", new NoeudAffiche("String 1"));
noeudArbo.put("String 2", new NoeudAffiche("String 2"));
noeudArbo.put("String 3", new NoeudAffiche("String 3"));
noeudArbo.put("String 4", new NoeudAffiche("String 4"));
noeudArbo.put("String 5", new NoeudAffiche("String 5"));
noeudArbo.put("String 6", new NoeudAffiche("String 6"));
noeudArbo.put("String 7", new NoeudAffiche("String 7"));
noeudArbo.put("String 8", new NoeudAffiche("String 8"));
noeudArbo.put("String 9", new NoeudAffiche("String 9"));
noeudArbo.put("String 10", new NoeudAffiche("String 10"));
// initialisation de la liste :
LISTE_TYPE_NOEUDS_DYNAMIQUE = noeudArbo.keySet().toArray(new String[0]);
} |
Partager