Created the tree types that can be chosen.

This commit is contained in:
Chris Cromer 2016-07-03 15:57:56 -04:00
parent 788db3dbb9
commit a8b2b34be4
1 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,82 @@
package cl.cromer.estructuras;
/**
* Esta clase contiene los tipos de arboles.
*
* @author Chris Cromer
*/
final public class ArbolTipos {
/**
* Tipo general.
*/
static final public int GENERAL = 0;
/**
* Tipo binario.
*/
static final public int BINARIO = 1;
/**
* Tipo busqueda binaria.
*/
static final public int BUSQUEDA_BINARIA = 2;
/**
* Tipo AVL.
*/
static final public int AVL = 3;
/**
* Tipo rojo-negro.
*/
static final public int ROJO_NEGRO = 4;
/**
* Tipo B-Tree.
*/
static final public int B_TREE = 5;
/**
* El tipo elegido.
*/
final private int tipo;
/**
* Inicilizar el tipo de arbol.
*
* @param tipo int: El tipo de lista enlazada, {@value #GENERAL}, {@value #BINARIO}, {@value #BUSQUEDA_BINARIA}, {@value #AVL}, {@value #ROJO_NEGRO} o {@value #B_TREE}
*/
public ArbolTipos(int tipo) {
switch (tipo) {
case GENERAL:
this.tipo = GENERAL;
break;
case BINARIO:
this.tipo = BINARIO;
break;
case BUSQUEDA_BINARIA:
this.tipo = BUSQUEDA_BINARIA;
break;
case AVL:
this.tipo = AVL;
break;
case ROJO_NEGRO:
this.tipo = ROJO_NEGRO;
break;
case B_TREE:
this.tipo = B_TREE;
break;
default:
this.tipo = GENERAL;
}
}
/**
* Devolver el tipo de arbol.
*
* @return int: El tipo.
*/
public int getTipo() {
return tipo;
}
}