Originariamente inviato da angelo85ct
questa è la mia classe:

public class movimenti{
public int id;
public char tipoper;
public float valuta;

public movimenti(int id, char tipoper, float valuta){
this.id=id;
this.tipoper=tipoper;
this.valuta=valuta;
}

public void stampa1(){
System.out.println(this.id+" - "+this.tipoper+" "+this.valuta);
}



public String toString(){
return "ID: [" + id + "]\toperazione: " + tipoper+"\t"+valuta; }
È un obbrobrio ..... inizia a mettere i campi come 'private' e a mettere degli appositi metodi 'getter'. Inizia anche a seguire le convenzioni di denominazione. Io avrei creato una classe Movimento (nota, M maiuscola).

Originariamente inviato da angelo85ct
questa invece è la funzione relativa al caricamento dei dati nella linkedlist:
float valuta=0;
int id=0;
String nome, cognome;
boolean trovato=true;
LinkedList pippo = new LinkedList();
//metodo per la lettura del secondo file
char tipoper='x';
try{
BufferedReader tex=new BufferedReader(new FileReader("movimenti.txt"));
StringTokenizer cl=new StringTokenizer(tex.readLine(), " ");//separa tra gli spazi
while (cl.hasMoreTokens()){
StringTokenizer cl1=new StringTokenizer(cl.nextToken(), ";");
if(cl1.hasMoreTokens()==true)
id=Integer.parseInt(cl1.nextToken());
if(cl1.hasMoreTokens()==true)
tipoper=cl1.nextToken().charAt(0);
if(cl1.hasMoreTokens()==true)
valuta=Float.parseFloat(cl1.nextToken());
movimenti t=new movimenti(id,tipoper,valuta);
t.stampa1();
pippo.add(t);
}
}
catch(FileNotFoundException e)
{trovato=false;}
catch(IOException e)
{System.out.println ("Errore lettura file "); }
if (!trovato)
System.out.println("FILE clienti.txt NON TROVATO");
else
System.out.println("\nFILE clienti.txt CARICATO CON SUCCESSO \n\n");
Iterator g =pippo.iterator();
while(g.hasNext()){
System.out.println(((movimenti)g.next()).toString( ));
}
Più o meno idem come sopra .....

Ecco un esempio ma proprio abbozzato:

codice:
LinkedList movimenti = new LinkedList();

....

Iterator it = movimenti.iterator ();
float tot = 0.0f;

while (it.hasNext ())
{
    Movimento m = (Movimento) it.next ();

    if (m.getId () == ......)
    {
        tot += m.getValuta ();
    }
}
Una cosa del genere. E magari inizia anche ad usare i "generics" (esistono da almeno 3 anni in Java).