2016-06-23 21:31:27 -04:00
|
|
|
package cl.cromer.estructuras;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Esta clase contiene los tipos de array.
|
2016-06-29 00:33:19 -04:00
|
|
|
*
|
2016-06-26 13:25:51 -04:00
|
|
|
* @author Chris Cromer
|
2016-06-23 21:31:27 -04:00
|
|
|
*/
|
|
|
|
final public class ArrayTipos {
|
2016-07-03 11:28:26 -04:00
|
|
|
/**
|
|
|
|
* Tipo de array simple.
|
|
|
|
*/
|
|
|
|
static final public int SIMPLE = 0;
|
2016-06-23 21:31:27 -04:00
|
|
|
|
2016-07-03 11:28:26 -04:00
|
|
|
/**
|
|
|
|
* Tipo de array ordenado.
|
|
|
|
*/
|
|
|
|
static final public int ORDENADO = 1;
|
2016-06-23 21:31:27 -04:00
|
|
|
|
2016-07-03 11:28:26 -04:00
|
|
|
/**
|
|
|
|
* El tipo que está elegido.
|
|
|
|
*/
|
|
|
|
final private int tipo;
|
2016-06-23 21:31:27 -04:00
|
|
|
|
2016-07-03 11:28:26 -04:00
|
|
|
/**
|
|
|
|
* Inicilizar el tipo.
|
|
|
|
*
|
|
|
|
* @param tipo int: Tipo de array, {@value #SIMPLE} o {@value #ORDENADO}
|
|
|
|
*/
|
|
|
|
public ArrayTipos(int tipo) {
|
|
|
|
switch (tipo) {
|
|
|
|
case SIMPLE:
|
|
|
|
this.tipo = SIMPLE;
|
|
|
|
break;
|
|
|
|
case ORDENADO:
|
|
|
|
this.tipo = ORDENADO;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
this.tipo = SIMPLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Devolver el tipo.
|
|
|
|
*
|
|
|
|
* @return int: El tipo de array.
|
|
|
|
*/
|
|
|
|
public int getTipo() {
|
|
|
|
return tipo;
|
|
|
|
}
|
2016-06-23 21:31:27 -04:00
|
|
|
}
|