elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Temas
Páginas: [1]
1  Programación / Java / ayuda plis, quebrando me el coco buscando por que esta mal en: 14 Noviembre 2009, 15:32 pm
Código:
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Vector;


public class Validador {
    Archivo archivo;
    
    Vector regiones;
    Vector agencias;
    Vector presupuestos;
    Vector presdags;
    
    public Validador() throws FileNotFoundException, IOException{
        try{
            this.archivo=new Archivo();
            this.regiones=new Vector();
            this.agencias=new Vector();

            this.getRegiones();
            this.getAgencias();
           /*AQUI ERROR*/ :-X
Código:
  
           /*AQUI EL ERROR*/
            this.presupuestos=this.archivo.getPresupuestos("Presupuestos");

            //MODIFICAR
            this.presdags=this.archivo.getPresdag("PRESDAG_INNOVACION2009_2008_V1");

        }catch(Exception e){
            System.out.println("********************error**********************");
            e.printStackTrace();
        }
     }
            
      
    public static void main(String[] args) throws FileNotFoundException, IOException {
        
        Validador principal =new Validador();



        System.out.println("********************REGIONES**********************");
        principal.MostrarRegiones();
        System.out.println("********************AGENCIAS**********************");
        principal.MostrarAgencias();
        System.out.println("********************Presupuesto**********************");
        principal.MostrarPresupuestos();
        System.out.println("********************PRESDAG**********************");
        principal.MostrarPresdag();
        
    }
    
    public void MostrarRegiones(){
        for(int i=0;i<this.regiones.size();i++){
            System.out.println(((Region)(this.regiones.elementAt(i))).obtenerRegion()+" "+((Region)this.regiones.elementAt(i)).obtenerNombre());
        }
    }
    public void MostrarAgencias(){
        for(int i=0;i<this.agencias.size();i++){
            System.out.println(((Agencia)this.agencias.elementAt(i)).obtenerNombre());
        }
    }
    
    public void MostrarPresupuestos(){
        for(int i=0;i<this.presupuestos.size();i++){
            System.out.println(((Presupuesto)this.presupuestos.elementAt(i)).obtenerAño()+"   "+((Presupuesto)this.presupuestos.elementAt(i)).obtenerMonto()+" "+((Presupuesto)this.presupuestos.elementAt(i)).obtenerAgencia());
        }
    }
    public void MostrarPresdag(){
        for(int i=0;i<this.presdags.size();i++){
            System.out.println(((Presdag)this.presdags.elementAt(i)).obtenerNumeroProyecto()+" ; "+((Presdag)this.presdags.elementAt(i)).obtenerDescripcionProyecto()+" "+((Presdag)this.presdags.elementAt(i)).obtenerNombreAgencia()+" ; "+((Presdag)this.presdags.elementAt(i)).obtenerAnoPresupuesto()+" ; "+((Presdag)this.presdags.elementAt(i)).obtenerNombreRegion()+" ; "+((Presdag)this.presdags.elementAt(i)).obtenerGastos()+" ; "+((Presdag)this.presdags.elementAt(i)).obtenerFecha());
        }
    }


    private void getAgencias(){
        this.agencias.add(new Agencia("Innovacion Nacional"));
        this.agencias.add(new Agencia("Educacion Nacional"));
        this.agencias.add(new Agencia("Mineria Norte"));
        this.agencias.add(new Agencia("Fomento y Desarrollo"));
        this.agencias.add(new Agencia("Planificacion Nacional"));
    }
    /******************************************************/
    
    private void getRegiones() {
        this.regiones.add(new Region("I", "TARAPACA"));
        this.regiones.add(new Region("II", "ANTOFAGASTA"));
        this.regiones.add(new Region("III", "ATACAMA"));
        this.regiones.add(new Region("IV", "COQUIMBO"));
        this.regiones.add(new Region("V", "VALPARAISO"));
        this.regiones.add(new Region("VI", "LIBERTADOR GENERAL BERNARDO O'HIGGINS"));
        this.regiones.add(new Region("VII", "MAULE"));
        this.regiones.add(new Region("VIII", "BIO - BIO"));
        this.regiones.add(new Region("IX", "LA ARAUCANIA"));
        this.regiones.add(new Region("X", "LOS LAGOS"));
        this.regiones.add(new Region("XI", "AYSEN DEL GENERAL CARLOS IBAÑEZ DEL CAMPO"));
        this.regiones.add(new Region("XII", "MAGALLANES Y LA ANTARTICA CHILENA"));
        this.regiones.add(new Region("XIII", "METROPOLITANA"));
        this.regiones.add(new Region("XIV", "LOS RIOS"));
        this.regiones.add(new Region("XV", "ARICA Y PARINACOTA"));
    }


}

Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines