package Procesos;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import Archivos.GestorArchivo;
import java.io.FileInputStream;
abstract class Horario{
	private FileInputStream inputStream;
	private String[][] excell;
	public int posicion[][];
        private GestorArchivo gestor;
	
	public Horario() {
                GestorArchivo gestor = new GestorArchivo();
		this.posicion = new int [10][10];
		this.excell = null;
	}

   protected void xlsxToArray(FileInputStream input) {
       //el input ingresado, se obtiene de la clase GestorArchivo
       
       
       inputStream = input;
       XSSFRow row;
       XSSFCell cell;
       try {
           XSSFWorkbook workbook = new XSSFWorkbook(inputStream);

           // get sheet number
           int sheetCn = workbook.getNumberOfSheets();

           for (int cn = 0; cn < sheetCn; cn++) {

               // get 0th sheet data
               XSSFSheet sheet = workbook.getSheetAt(cn);

               // get number of rows from sheet
               int rows = sheet.getPhysicalNumberOfRows();

               // get number of cell from row
               int cells = sheet.getRow(cn).getPhysicalNumberOfCells();

               excell = new String[rows][cells];
     
               for (int r = 0; r < rows; r++) {
                   row = sheet.getRow(r); // bring row
                   if (row != null) {
                       for (int c = 0; c < cells; c++) {
                           cell = row.getCell(c);

                           if (cell != null) {

                               switch (cell.getCellType()) {

                               case XSSFCell.CELL_TYPE_FORMULA:
                                   excell[r][c] = cell.getCellFormula();
                                   break;

                               case XSSFCell.CELL_TYPE_NUMERIC:
                                   excell[r][c] = ""
                                        + cell.getNumericCellValue();
                                   break;

                               case XSSFCell.CELL_TYPE_STRING:
                                   excell[r][c] = ""
                                        + cell.getStringCellValue();
                                   break;

                               case XSSFCell.CELL_TYPE_BLANK:
                                  excell[r][c] = "[BLANK]";
                                  break;

                               case XSSFCell.CELL_TYPE_ERROR:
                                  excell[r][c] = ""+cell.getErrorCellValue();
                                break;
                            default:
                               }
                        }
                    }
                }
            }
               
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
  }
   
   protected String tomarCelda (int x, int y) {
	   return excell [y][x];
   }
   
   protected void ocurrencias(String palabraBuscada) { // guarda las posiciones de las ocurrencias de la busqueda.
	   int count=0;
	   	for(int y = 6 ; y<(this.excell.length);y++) {
	   		for(int x=1;x<(this.excell[0].length);x++) {
	   			if (this.tomarCelda(x,y).contains(palabraBuscada)) {
	   				count++;
	   				this.posicion[count][count]=x;
	   				this.posicion[count][count+1]=y;
	   			}
	   		}
	   	}
   }
   public void imprimirPosicion() {
	   for (int y=0;y<this.posicion.length;y++) {
		   for(int x=0;x<this.posicion.length;x++) {
			   if(this.posicion[x][y]!=0) {
				   System.out.println(x+":"+y+"::"+this.posicion[x][y]);
			   }
		   }
	   }
   }
   
   public void devolverCeldas() {
	   
   }

   
   
}
@@ -267,16 +267,17 @@
 Stream;%0A
+%0A
 abstract
@@ -292,16 +292,18 @@
 orario%7B%0A
+%09%0A
 %09private
@@ -335,21 +335,23 @@
 eam;%0A%09pr
-ivate
+otected
  String%5B
@@ -366,38 +366,8 @@
 ll;%0A
-%09public int posicion%5B%5D%5B%5D;%0A    
     
@@ -426,24 +426,16 @@
         
-   
-     
 GestorAr
@@ -474,44 +474,8 @@
 ();%0A
-%09%09this.posicion = new int %5B10%5D%5B10%5D;%0A
 %09%09th
@@ -2969,738 +2969,7 @@
   %7D%0A
-   %0A   protected void ocurrencias(String palabraBuscada) %7B // guarda las posiciones de las ocurrencias de la busqueda.%0A%09   int count=0;%0A%09   %09for(int y = 6 ; y%3C(this.excell.length);y++) %7B%0A%09   %09%09for(int x=1;x%3C(this.excell%5B0%5D.length);x++) %7B%0A%09   %09%09%09if (this.tomarCelda(x,y).contains(palabraBuscada)) %7B%0A%09   %09%09%09%09count++;%0A%09   %09%09%09%09this.posicion%5Bcount%5D%5Bcount%5D=x;%0A%09   %09%09%09%09this.posicion%5Bcount%5D%5Bcount+1%5D=y;%0A%09   %09%09%09%7D%0A%09   %09%09%7D%0A%09   %09%7D%0A   %7D%0A   public void imprimirPosicion() %7B%0A%09   for (int y=0;y%3Cthis.posicion.length;y++) %7B%0A%09%09   for(int x=0;x%3Cthis.posicion.length;x++) %7B%0A%09%09%09   if(this.posicion%5Bx%5D%5By%5D!=0) %7B%0A%09%09%09%09   System.out.println(x+%22:%22+y+%22::%22+this.posicion%5Bx%5D%5By%5D);%0A%09%09%09   %7D%0A%09%09   %7D%0A%09   %7D%0A   %7D%0A   %0A   public void devolverCeldas() %7B%0A%09   %0A   %7D%0A%0A   %0A   
 %0A%7D
+%0A

Update Horario.java