Subversion Repositories eFlore/Applications.del

Rev

Rev 1001 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1001 Rev 1003
Line 116... Line 116...
116
		return proposition;
116
		return proposition;
117
	}
117
	}
Line 118... Line 118...
118
	
118
	
119
	public int getTotalCommentaires() {
119
	public int getTotalCommentaires() {
120
		int nbCommentaires = 0;
-
 
121
		for (Iterator<Commentaire> iterator = listeCommentaires.iterator(); iterator.hasNext();) {
-
 
122
			nbCommentaires++;
120
		int nbCommentaires = 0;
123
			Commentaire commentaire = (Commentaire) iterator.next();
121
		for (Commentaire commentaire : listeCommentaires) {
124
			nbCommentaires += commentaire.getTotalCommentaires();
122
			chargerNbCommentairesRecursivement(nbCommentaires, commentaire);
125
		}
-
 
126
		
123
		}
127
		return nbCommentaires;
124
		return nbCommentaires;
-
 
125
	}
-
 
126
 
-
 
127
	private void chargerNbCommentairesRecursivement(int nbCommentaires, Commentaire commentaire) {
-
 
128
		nbCommentaires ++;
-
 
129
		for (Commentaire commentaireFils: commentaire.getListeCommentaires()) {
-
 
130
			chargerNbCommentairesRecursivement(nbCommentaires, commentaireFils);
-
 
131
		}
128
	}
132
	}