Browse Source

Refactored HashTable.

master
Chris Cromer 5 years ago
parent
commit
fe61cf4c78
  1. 365
      diagrama.uml
  2. 2
      doc/cl/cromer/estructuras/HashTable.html
  3. 2
      doc/cl/cromer/estructuras/HashTableController.html
  4. 4
      doc/cl/cromer/estructuras/class-use/HashTable.html
  5. 6
      doc/cl/cromer/estructuras/class-use/HashTableController.html
  6. 4
      src/cl/cromer/estructuras/TablaHash.java
  7. 56
      src/cl/cromer/estructuras/TablaHashController.java
  8. 17
      src/cl/cromer/estructuras/code/tablaHash/buscar
  9. 17
      src/cl/cromer/estructuras/code/tablaHash/eliminar
  10. 40
      src/cl/cromer/estructuras/code/tablaHash/insertar
  11. 2
      src/cl/cromer/estructuras/fxml/hashTable.fxml

365
diagrama.uml

@ -3,341 +3,54 @@
<ID>JAVA</ID>
<OriginalElement />
<nodes>
<node x="0.0" y="1179.5">cl.cromer.estructuras.InsercionController</node>
<node x="3097.0" y="1242.5">cl.cromer.estructuras.Grafico.Destacados</node>
<node x="1267.0" y="1179.5">cl.cromer.estructuras.ShellController</node>
<node x="429.0" y="1179.5">cl.cromer.estructuras.QuickController</node>
<node x="5332.99375949254" y="164.0">cl.cromer.estructuras.EnlaceNormal</node>
<node x="4595.666666666667" y="1127.0">cl.cromer.estructuras.HashTableController</node>
<node x="5653.74375949254" y="164.0">cl.cromer.estructuras.EnlaceCircular</node>
<node x="3660.291666666667" y="1148.0">cl.cromer.estructuras.ColaController</node>
<node x="2310.791666666667" y="142.0">cl.cromer.estructuras.Colores</node>
<node x="6062.583333333333" y="568.5">cl.cromer.estructuras.ListaEnlazadaTipos</node>
<node x="4867.916666666667" y="505.5">cl.cromer.estructuras.HashTable</node>
<node x="5626.1441369606" y="0.0">cl.cromer.estructuras.Enlace</node>
<node x="3749.666666666667" y="526.5">cl.cromer.estructuras.Cola</node>
<node x="5661.74375949254" y="515.5">cl.cromer.estructuras.ListaEnlazadaCircular</node>
<node x="5895.833333333333" y="1043.0">cl.cromer.estructuras.MenuController</node>
<node x="1669.0000000000002" y="1179.5">cl.cromer.estructuras.BurbujaController</node>
<node x="5355.74375949254" y="526.0">cl.cromer.estructuras.ListaEnlazada</node>
<node x="2608.0" y="1148.0">cl.cromer.estructuras.PilaController</node>
<node x="835.0" y="1179.5">cl.cromer.estructuras.SeleccionController</node>
<node x="14.5" y="1622.0">cl.cromer.estructuras.Logs</node>
<node x="986.0" y="400.0">cl.cromer.estructuras.Array</node>
<node x="2622.875" y="526.5">cl.cromer.estructuras.Pila</node>
<node x="5000.063474939695" y="164.0">cl.cromer.estructuras.HashItem</node>
<node x="3232.666666666667" y="421.5">cl.cromer.estructuras.Grafico</node>
<node x="1109.5" y="174.5">cl.cromer.estructuras.Array.ParticionarResult</node>
<node x="4091.666666666667" y="547.0">cl.cromer.estructuras.TextFieldLimited</node>
<node x="5192.658333333333" y="1053.5">cl.cromer.estructuras.ListaEnlazdaController</node>
<node x="2089.0" y="1137.5">cl.cromer.estructuras.ArrayController</node>
<node x="4159.666666666667" y="1274.5">cl.cromer.estructuras.TextFieldLimited.StyleableProperties</node>
<node x="0.0" y="1787.0">cl.cromer.estructuras.Main</node>
<node x="200.0" y="227.0">cl.cromer.estructuras.InsercionController</node>
<node x="493.0" y="449.0">cl.cromer.estructuras.Grafico.Destacados</node>
<node x="346.0" y="375.0">cl.cromer.estructuras.ShellController</node>
<node x="366.0" y="301.0">cl.cromer.estructuras.QuickController</node>
<node x="143.0" y="79.0">cl.cromer.estructuras.EnlaceNormal</node>
<node x="0.0" y="79.0">cl.cromer.estructuras.EnlaceCircular</node>
<node x="0.0" y="449.0">cl.cromer.estructuras.ColaController</node>
<node x="283.0" y="523.0">cl.cromer.estructuras.Colores</node>
<node x="397.0" y="227.0">cl.cromer.estructuras.ListaEnlazadaTipos</node>
<node x="94.24999999999987" y="0.0">cl.cromer.estructuras.Enlace</node>
<node x="0.0" y="523.0">cl.cromer.estructuras.TablaHash</node>
<node x="216.0" y="597.0">cl.cromer.estructuras.Cola</node>
<node x="0.0" y="153.0">cl.cromer.estructuras.ListaEnlazadaCircular</node>
<node x="0.0" y="375.0">cl.cromer.estructuras.MenuController</node>
<node x="211.0" y="153.0">cl.cromer.estructuras.TablaHashController</node>
<node x="0.0" y="301.0">cl.cromer.estructuras.BurbujaController</node>
<node x="167.0" y="449.0">cl.cromer.estructuras.ListaEnlazada</node>
<node x="331.0" y="449.0">cl.cromer.estructuras.PilaController</node>
<node x="0.0" y="227.0">cl.cromer.estructuras.SeleccionController</node>
<node x="0.0" y="597.0">cl.cromer.estructuras.Logs</node>
<node x="532.0" y="523.0">cl.cromer.estructuras.Array</node>
<node x="322.0" y="597.0">cl.cromer.estructuras.Pila</node>
<node x="145.0" y="523.0">cl.cromer.estructuras.HashItem</node>
<node x="409.0" y="523.0">cl.cromer.estructuras.Grafico</node>
<node x="188.0" y="301.0">cl.cromer.estructuras.TextFieldLimited</node>
<node x="308.0" y="0.0">cl.cromer.estructuras.ListaEnlazdaController</node>
<node x="174.0" y="375.0">cl.cromer.estructuras.ArrayController</node>
<node x="417.0" y="153.0">cl.cromer.estructuras.TextFieldLimited.StyleableProperties</node>
<node x="108.0" y="597.0">cl.cromer.estructuras.Main</node>
</nodes>
<notes />
<edges>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.TextFieldLimited">
<point x="-164.0" y="-256.5" />
<point x="5356.658333333333" y="923.0" />
<point x="4411.0952380952385" y="923.0" />
<point x="147.42857142857156" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.MenuController" target="cl.cromer.estructuras.ListaEnlazadaTipos">
<point x="0.0" y="-267.0" />
<point x="49.25" y="68.0" />
</edge>
<edge source="cl.cromer.estructuras.PilaController" target="cl.cromer.estructuras.TextFieldLimited">
<point x="195.41666666666652" y="-162.0" />
<point x="3037.916666666667" y="1013.0" />
<point x="4165.380952380952" y="1013.0" />
<point x="-98.28571428571468" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.ListaEnlazadaCircular">
<point x="164.0" y="-256.5" />
<point x="5684.658333333333" y="1023.0" />
<point x="5741.74375949254" y="1023.0" />
<point x="-80.0" y="121.0" />
</edge>
<edge source="cl.cromer.estructuras.InsercionController" target="cl.cromer.estructuras.Colores">
<point x="-136.33333333333348" y="-130.5" />
<point x="68.16666666666652" y="963.0" />
<point x="211.18997029393358" y="963.0" />
<point x="211.18997029393358" y="330.0" />
<point x="2321.333333333333" y="330.0" />
<point x="-115.95833333333348" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.PilaController" target="cl.cromer.estructuras.Colores">
<point x="-195.41666666666652" y="-162.0" />
<point x="2647.083333333334" y="933.0" />
<point x="2545.0858036272666" y="933.0" />
<point x="2545.0858036272666" y="380.0" />
<point x="2447.833333333333" y="380.0" />
<point x="10.541666666666515" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.HashTableController" target="cl.cromer.estructuras.Grafico">
<point x="-229.58333333333303" y="-183.0" />
<point x="4641.583333333334" y="973.0" />
<point x="3595.8589743589746" y="973.0" />
<point x="114.69230769230762" y="215.0" />
</edge>
<edge source="cl.cromer.estructuras.Main" target="cl.cromer.estructuras.Logs">
<point x="0.0" y="-67.5" />
<point x="0.0" y="57.5" />
</edge>
<edge source="cl.cromer.estructuras.SeleccionController" target="cl.cromer.estructuras.Array">
<point x="0.0" y="-130.5" />
<point x="1041.0" y="1013.0" />
<point x="1187.375" y="1013.0" />
<point x="-67.125" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.BurbujaController" target="cl.cromer.estructuras.Array">
<point x="-133.3333333333337" y="-130.5" />
<point x="1735.6666666666665" y="1003.0" />
<point x="1366.375" y="1003.0" />
<point x="111.875" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.ListaEnlazadaTipos">
<point x="295.1999999999998" y="-256.5" />
<point x="5815.858333333333" y="1023.0" />
<point x="6111.833333333333" y="1023.0" />
<point x="-49.25" y="68.0" />
</edge>
<edge source="cl.cromer.estructuras.Array.ParticionarResult" target="cl.cromer.estructuras.Array">
<point x="72.5" y="46.5" />
<point x="1327.0" y="320.0" />
<point x="1388.75" y="320.0" />
<point x="134.25" y="-236.5" />
</edge>
<edge source="cl.cromer.estructuras.Grafico.Destacados" target="cl.cromer.estructuras.Grafico">
<point x="-153.66666666666652" y="-67.5" />
<point x="3173.833333333334" y="983.0" />
<point x="3404.705128205128" y="983.0" />
<point x="-76.46153846153857" y="215.0" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazadaCircular" target="cl.cromer.estructuras.EnlaceCircular">
<point x="-80.0" y="-121.0" />
<point x="5741.74375949254" y="380.0" />
<point x="5762.24375949254" y="380.0" />
<point x="0.0" y="57.0" />
</edge>
<edge source="cl.cromer.estructuras.ShellController" target="cl.cromer.estructuras.Colores">
<point x="127.33333333333326" y="-130.5" />
<point x="1586.3125" y="360.0" />
<point x="2384.583333333333" y="360.0" />
<point x="-52.708333333333485" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.ArrayController" target="cl.cromer.estructuras.Array">
<point x="-207.91666666666652" y="-172.5" />
<point x="2130.583333333334" y="983.0" />
<point x="1455.875" y="983.0" />
<point x="201.375" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.Colores">
<point x="-98.39999999999964" y="-256.5" />
<point x="5422.258333333333" y="913.0" />
<point x="5302.508333333333" y="913.0" />
<point x="5302.508333333333" y="340.0" />
<point x="2532.166666666667" y="340.0" />
<point x="94.875" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.Grafico" target="cl.cromer.estructuras.Colores">
<point x="0.0" y="-215.0" />
<point x="3481.166666666667" y="370.0" />
<point x="2468.916666666667" y="370.0" />
<point x="31.625" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.ArrayController" target="cl.cromer.estructuras.Grafico">
<point x="41.583333333333485" y="-172.5" />
<point x="2380.083333333334" y="943.0" />
<point x="3251.7820512820517" y="943.0" />
<point x="-229.38461538461524" y="215.0" />
</edge>
<edge source="cl.cromer.estructuras.HashTableController" target="cl.cromer.estructuras.TextFieldLimited">
<point x="-45.91666666666697" y="-183.0" />
<point x="4825.25" y="953.0" />
<point x="4361.952380952382" y="953.0" />
<point x="98.28571428571468" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.ColaController" target="cl.cromer.estructuras.TextFieldLimited">
<point x="197.49999999999955" y="-162.0" />
<point x="4094.791666666667" y="1023.0" />
<point x="4214.52380952381" y="1023.0" />
<point x="-49.14285714285688" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazada" target="cl.cromer.estructuras.Enlace">
<point x="71.49999999999977" y="-110.5" />
<point x="5570.24375949254" y="380.0" />
<point x="5557.49375949254" y="380.0" />
<point x="5557.49375949254" y="122.0" />
<point x="5679.3941369606" y="122.0" />
<point x="-17.75" y="46.0" />
</edge>
<edge source="cl.cromer.estructuras.QuickController" target="cl.cromer.estructuras.Array">
<point x="0.0" y="-130.5" />
<point x="622.0" y="993.0" />
<point x="1097.875" y="993.0" />
<point x="-156.625" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.QuickController" target="cl.cromer.estructuras.Colores">
<point x="-128.66666666666652" y="-130.5" />
<point x="493.3333333333335" y="340.0" />
<point x="2342.416666666667" y="340.0" />
<point x="-94.875" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazada" target="cl.cromer.estructuras.EnlaceNormal">
<point x="-71.5" y="-110.5" />
<point x="5427.24375949254" y="380.0" />
<point x="5439.99375949254" y="380.0" />
<point x="0.0" y="57.0" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazadaCircular" target="cl.cromer.estructuras.Enlace">
<point x="80.0" y="-121.0" />
<point x="5901.74375949254" y="380.0" />
<point x="5881.24375949254" y="380.0" />
<point x="5881.24375949254" y="112.0" />
<point x="5750.3941369606" y="112.0" />
<point x="53.25" y="46.0" />
</edge>
<edge source="cl.cromer.estructuras.ColaController" target="cl.cromer.estructuras.Cola">
<point x="-39.500000000000455" y="-162.0" />
<point x="3857.791666666667" y="993.0" />
<point x="3822.416666666667" y="993.0" />
<point x="-72.75" y="110.0" />
</edge>
<edge source="cl.cromer.estructuras.ArrayController" target="cl.cromer.estructuras.TextFieldLimited">
<point x="207.91666666666652" y="-172.5" />
<point x="2546.416666666667" y="1003.0" />
<point x="4116.238095238095" y="1003.0" />
<point x="-147.42857142857156" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.ShellController" target="cl.cromer.estructuras.Array">
<point x="0.0" y="-130.5" />
<point x="1458.0" y="1013.0" />
<point x="1321.625" y="1013.0" />
<point x="67.125" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.ArrayController" target="cl.cromer.estructuras.Colores">
<point x="-41.583333333333485" y="-172.5" />
<point x="2296.916666666667" y="380.0" />
<point x="2426.75" y="380.0" />
<point x="-10.541666666666515" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.EnlaceCircular" target="cl.cromer.estructuras.Enlace">
<point x="0.0" y="-57.0" />
<point x="5762.24375949254" y="122.0" />
<point x="5714.8941369606" y="122.0" />
<point x="17.75" y="46.0" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.Grafico">
<point x="-295.1999999999998" y="-256.5" />
<point x="5225.458333333333" y="943.0" />
<point x="3672.3205128205127" y="943.0" />
<point x="191.1538461538462" y="215.0" />
</edge>
<edge source="cl.cromer.estructuras.ColaController" target="cl.cromer.estructuras.Colores">
<point x="118.49999999999955" y="-162.0" />
<point x="4015.791666666667" y="993.0" />
<point x="4051.166666666667" y="993.0" />
<point x="4051.166666666667" y="360.0" />
<point x="2490.0" y="360.0" />
<point x="52.70833333333303" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.SeleccionController" target="cl.cromer.estructuras.Colores">
<point x="-137.33333333333348" y="-130.5" />
<point x="903.6666666666665" y="963.0" />
<point x="912.6875" y="963.0" />
<point x="912.6875" y="350.0" />
<point x="2363.5" y="350.0" />
<point x="-73.79166666666652" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.ListaEnlazdaController" target="cl.cromer.estructuras.ListaEnlazada">
<point x="32.80000000000018" y="-256.5" />
<point x="5553.458333333333" y="893.0" />
<point x="5427.24375949254" y="893.0" />
<point x="-71.5" y="110.5" />
</edge>
<edge source="cl.cromer.estructuras.PilaController" target="cl.cromer.estructuras.Pila">
<point x="-39.083333333333485" y="-162.0" />
<point x="2803.416666666667" y="933.0" />
<point x="2838.125" y="933.0" />
<point x="71.75" y="110.0" />
</edge>
<edge source="cl.cromer.estructuras.BurbujaController" target="cl.cromer.estructuras.Colores">
<point x="133.33333333333303" y="-130.5" />
<point x="2002.3333333333333" y="370.0" />
<point x="2405.666666666667" y="370.0" />
<point x="-31.625" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.Array" target="cl.cromer.estructuras.Array.ParticionarResult">
<point x="-134.25" y="-236.5" />
<point x="1120.25" y="320.0" />
<point x="1182.0" y="320.0" />
<point x="-72.5" y="46.5" />
</edge>
<edge source="cl.cromer.estructuras.HashTableController" target="cl.cromer.estructuras.HashTable">
<point x="229.58333333333303" y="-183.0" />
<point x="5100.75" y="1023.0" />
<point x="5160.416666666667" y="1023.0" />
<point x="97.5" y="131.0" />
</edge>
<edge source="cl.cromer.estructuras.InsercionController" target="cl.cromer.estructuras.Array">
<point x="-2.8421709430404007E-14" y="-130.5" />
<point x="204.5" y="973.0" />
<point x="1008.375" y="973.0" />
<point x="-246.125" y="236.5" />
</edge>
<edge source="cl.cromer.estructuras.Grafico" target="cl.cromer.estructuras.Grafico.Destacados">
<point x="0.0" y="215.0" />
<point x="153.66666666666652" y="-67.5" />
</edge>
<edge source="cl.cromer.estructuras.ColaController" target="cl.cromer.estructuras.Grafico">
<point x="-118.50000000000045" y="-162.0" />
<point x="3778.791666666667" y="983.0" />
<point x="3557.628205128205" y="983.0" />
<point x="76.46153846153857" y="215.0" />
</edge>
<edge source="cl.cromer.estructuras.HashTable" target="cl.cromer.estructuras.HashItem">
<point x="-97.5" y="-131.0" />
<point x="4965.416666666667" y="380.0" />
<point x="5062.063474939695" y="380.0" />
<point x="-62.0" y="57.0" />
<point x="-2.2737367544323206E-13" y="-14.5" />
<point x="61.49999999999977" y="54.0" />
<point x="113.24999999999987" y="54.0" />
<point x="-19.0" y="14.5" />
</edge>
<edge source="cl.cromer.estructuras.EnlaceNormal" target="cl.cromer.estructuras.Enlace">
<point x="0.0" y="-57.0" />
<point x="5439.99375949254" y="112.0" />
<point x="5643.8941369606" y="112.0" />
<point x="-53.25" y="46.0" />
</edge>
<edge source="cl.cromer.estructuras.TextFieldLimited.StyleableProperties" target="cl.cromer.estructuras.TextFieldLimited">
<point x="104.0" y="-35.5" />
<point x="4471.666666666667" y="1023.0" />
<point x="4312.809523809524" y="1023.0" />
<point x="49.14285714285688" y="89.5" />
</edge>
<edge source="cl.cromer.estructuras.HashTableController" target="cl.cromer.estructuras.Colores">
<point x="45.91666666666697" y="-183.0" />
<point x="4917.083333333334" y="1023.0" />
<point x="4857.416666666667" y="1023.0" />
<point x="4857.416666666667" y="350.0" />
<point x="2511.083333333333" y="350.0" />
<point x="73.79166666666652" y="79.0" />
</edge>
<edge source="cl.cromer.estructuras.PilaController" target="cl.cromer.estructuras.Grafico">
<point x="117.25" y="-162.0" />
<point x="2959.75" y="973.0" />
<point x="3366.4743589743593" y="973.0" />
<point x="-114.69230769230762" y="215.0" />
<point x="0.0" y="-14.5" />
<point x="203.0" y="54.0" />
<point x="151.2499999999999" y="54.0" />
<point x="19.0" y="14.5" />
</edge>
</edges>
<settings layout="Hierarchic Group" zoom="0.2400305576776165" x="3262.5" y="961.0" />
<settings layout="Hierarchic Group" zoom="1.0" x="301.0" y="313.0" />
<SelectedNodes />
<Categories>
<Category>Fields</Category>
<Category>Constructors</Category>
<Category>Methods</Category>
<Category>Properties</Category>
<Category>Inner Classes</Category>
</Categories>
<Categories />
<SCOPE>All</SCOPE>
<VISIBILITY>private</VISIBILITY>
</Diagram>

2
doc/cl/cromer/estructuras/HashTable.html

@ -100,7 +100,7 @@ var activeTableTab = "activeTableTab";
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>cl.cromer.estructuras.HashTable</li>
<li>cl.cromer.estructuras.TablaHash</li>
</ul>
</li>
</ul>

2
doc/cl/cromer/estructuras/HashTableController.html

@ -100,7 +100,7 @@ var activeTableTab = "activeTableTab";
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>cl.cromer.estructuras.HashTableController</li>
<li>cl.cromer.estructuras.TablaHashController</li>
</ul>
</li>
</ul>

4
doc/cl/cromer/estructuras/class-use/HashTable.html

@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc (1.8.0_92) on Sun Jul 03 12:44:00 CLT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Uses of Class cl.cromer.estructuras.HashTable</title>
<title>Uses of Class cl.cromer.estructuras.TablaHash</title>
<meta name="date" content="2016-07-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
@ -70,7 +70,7 @@
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class cl.cromer.estructuras.HashTable" class="title">Uses of Class<br>cl.cromer.estructuras.HashTable</h2>
<h2 title="Uses of Class cl.cromer.estructuras.TablaHash" class="title">Uses of Class<br>cl.cromer.estructuras.TablaHash</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">

6
doc/cl/cromer/estructuras/class-use/HashTableController.html

@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc (1.8.0_92) on Sun Jul 03 12:44:00 CLT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Uses of Class cl.cromer.estructuras.HashTableController</title>
<title>Uses of Class cl.cromer.estructuras.TablaHashController</title>
<meta name="date" content="2016-07-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
@ -70,9 +70,9 @@
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class cl.cromer.estructuras.HashTableController" class="title">Uses of Class<br>cl.cromer.estructuras.HashTableController</h2>
<h2 title="Uses of Class cl.cromer.estructuras.TablaHashController" class="title">Uses of Class<br>cl.cromer.estructuras.TablaHashController</h2>
</div>
<div class="classUseContainer">No usage of cl.cromer.estructuras.HashTableController</div>
<div class="classUseContainer">No usage of cl.cromer.estructuras.TablaHashController</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->

4
src/cl/cromer/estructuras/HashTable.java → src/cl/cromer/estructuras/TablaHash.java

@ -5,7 +5,7 @@ package cl.cromer.estructuras;
*
* @author Chris Cromer
*/
public class HashTable {
public class TablaHash {
/**
* El array donde están todos los elementos de la tabla hash.
*/
@ -26,7 +26,7 @@ public class HashTable {
*
* @param tamano int: El tamaño maximo de la tabla hash.
*/
public HashTable(int tamano) {
public TablaHash(int tamano) {
this.tamano = tamano;
hashArray = new HashItem[tamano];
}

56
src/cl/cromer/estructuras/HashTableController.java → src/cl/cromer/estructuras/TablaHashController.java

@ -12,11 +12,11 @@ import java.util.ResourceBundle;
import java.util.logging.Level;
/**
* Esta clase es para controlar todos la interfaz de HashTable.
* Esta clase es para controlar todos la interfaz de TablaHash.
*
* @author Chris Cromer
*/
public class HashTableController implements Initializable {
public class TablaHashController implements Initializable {
/**
* La caja para ingresar la llave.
*/
@ -30,7 +30,7 @@ public class HashTableController implements Initializable {
private TextFieldLimited valorHashTable;
/**
* Donde poner el contenido de hashTable.
* Donde poner el contenido de tablaHash.
*/
@FXML
private VBox contenidoHashTable;
@ -52,9 +52,9 @@ public class HashTableController implements Initializable {
private ResourceBundle resourceBundle;
/**
* El hashTable usado en la aplicación.
* El tablaHash usado en la aplicación.
*/
private HashTable hashTable;
private TablaHash tablaHash;
/**
* Grafico rectangulos.
@ -81,7 +81,7 @@ public class HashTableController implements Initializable {
}
/**
* Llenar el hashTable con numeros al azar.
* Llenar el tablaHash con numeros al azar.
*/
@FXML
protected void botonLlenar() {
@ -98,8 +98,8 @@ public class HashTableController implements Initializable {
for (int i = 0; i < 10; i++) {
int numero = random.nextInt(rango) + minimo;
while (! hashTable.insertar(palabras.getPalabra(), numero)) {
if (hashTable.size() == 10) {
while (! tablaHash.insertar(palabras.getPalabra(), numero)) {
if (tablaHash.size() == 10) {
break;
}
}
@ -108,12 +108,12 @@ public class HashTableController implements Initializable {
}
/**
* Crear el hashTable de tamaño 10.
* Crear el tablaHash de tamaño 10.
*/
private void initializeHashTable() {
scene = contenidoHashTable.getScene();
grafico = new Grafico(scene);
this.hashTable = new HashTable(10);
this.tablaHash = new TablaHash(10);
}
/**
@ -122,13 +122,13 @@ public class HashTableController implements Initializable {
private void generarGrafico() {
grafico.removerDestacar();
for (int i = 0; i < 10; i++) {
if (hashTable.getIndice(i) != null) {
if (tablaHash.getIndice(i) != null) {
Text text = (Text) scene.lookup("#indice_texto_" + String.valueOf(i));
text.setText(String.valueOf(i));
text = (Text) scene.lookup("#llave_texto_" + String.valueOf(i));
text.setText(hashTable.getIndice(i).getLlave());
text.setText(tablaHash.getIndice(i).getLlave());
text = (Text) scene.lookup("#valor_texto_" + String.valueOf(i));
text.setText(String.valueOf(hashTable.getIndice(i).getValor()));
text.setText(String.valueOf(tablaHash.getIndice(i).getValor()));
}
else {
Text text = (Text) scene.lookup("#indice_texto_" + String.valueOf(i));
@ -142,7 +142,7 @@ public class HashTableController implements Initializable {
}
/**
* Vaciar el hashTable de todos los valores.
* Vaciar el tablaHash de todos los valores.
*/
@FXML
protected void botonVaciar() {
@ -150,12 +150,12 @@ public class HashTableController implements Initializable {
initializeHashTable();
}
hashTable = new HashTable(10);
tablaHash = new TablaHash(10);
generarGrafico();
}
/**
* Insertar un valor al hashTable y mostrar el codigo en la pantalla.
* Insertar un valor al tablaHash y mostrar el codigo en la pantalla.
*/
@FXML
protected void botonInsertar() {
@ -164,20 +164,20 @@ public class HashTableController implements Initializable {
}
// Mostrar el codigo
/*String tipo = (hashTable.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/hashTable" + tipo + "/insertar")).useDelimiter("\\Z").next();
/*String tipo = (tablaHash.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/tablaHash" + tipo + "/insertar")).useDelimiter("\\Z").next();
codigoHashTable.setText(codigoTexto);*/
if (llaveHashTable.getText() != null && ! llaveHashTable.getText().trim().equals("") && valorHashTable.getText() != null && ! valorHashTable.getText().trim().equals("")) {
try {
boolean exito = hashTable.insertar(llaveHashTable.getText().trim(), Integer.valueOf(valorHashTable.getText()));
boolean exito = tablaHash.insertar(llaveHashTable.getText().trim(), Integer.valueOf(valorHashTable.getText()));
if (exito) {
llaveHashTable.setText("");
valorHashTable.setText("");
generarGrafico();
}
else {
if (hashTable.size() == 10) {
if (tablaHash.size() == 10) {
Main.mostrarError(resourceBundle.getString("tablaHashLleno"), resourceBundle);
}
else {
@ -197,7 +197,7 @@ public class HashTableController implements Initializable {
}
/**
* Eliminar un valor del hashTable si existe y mostrar el codigo en la pantalla.
* Eliminar un valor del tablaHash si existe y mostrar el codigo en la pantalla.
*/
@FXML
protected void botonEliminar() {
@ -206,13 +206,13 @@ public class HashTableController implements Initializable {
}
// Mostrar el codigo
/*String tipo = (hashTable.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/hashTable" + tipo + "/eliminar")).useDelimiter("\\Z").next();
/*String tipo = (tablaHash.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/tablaHash" + tipo + "/eliminar")).useDelimiter("\\Z").next();
codigoHashTable.setText(codigoTexto);*/
try {
if (llaveHashTable.getText() != null && ! llaveHashTable.getText().trim().equals("")) {
boolean exito = hashTable.eliminar(llaveHashTable.getText());
boolean exito = tablaHash.eliminar(llaveHashTable.getText());
if (exito) {
llaveHashTable.setText("");
valorHashTable.setText("");
@ -234,7 +234,7 @@ public class HashTableController implements Initializable {
}
/**
* Buscar si existe un elemento en el hashTable y mostrar el codigo en la pantalla
* Buscar si existe un elemento en el tablaHash y mostrar el codigo en la pantalla
* Si existe el valor destacarlo.
*/
@FXML
@ -244,13 +244,13 @@ public class HashTableController implements Initializable {
}
// Mostrar el codigo
/*String tipo = (hashTable.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/hashTable" + tipo + "/buscar")).useDelimiter("\\Z").next();
/*String tipo = (tablaHash.isOrdered()) ? "Ordenado" : "Simple";
String codigoTexto = new Scanner(getClass().getResourceAsStream("/cl/cromer/estructuras/code/tablaHash" + tipo + "/buscar")).useDelimiter("\\Z").next();
codigoHashTable.setText(codigoTexto);*/
try {
if (llaveHashTable.getText() != null && ! llaveHashTable.getText().trim().equals("")) {
HashItem hashItem = hashTable.buscar(llaveHashTable.getText());
HashItem hashItem = tablaHash.buscar(llaveHashTable.getText());
if (hashItem != null) {
generarGrafico();
grafico = new Grafico(scene);

17
src/cl/cromer/estructuras/code/tablaHash/buscar

@ -0,0 +1,17 @@
public class HashItem {
final private String llave;
final private int valor;
public HashItem(String llave, int valor) {
this.llave = llave;
this.valor = valor;
}
public String getLlave() {
return llave;
}
public int getValor() {
return valor;
}
}

17
src/cl/cromer/estructuras/code/tablaHash/eliminar

@ -0,0 +1,17 @@
public class HashItem {
final private String llave;
final private int valor;
public HashItem(String llave, int valor) {
this.llave = llave;
this.valor = valor;
}
public String getLlave() {
return llave;
}
public int getValor() {
return valor;
}
}

40
src/cl/cromer/estructuras/code/tablaHash/insertar

@ -0,0 +1,40 @@
public void insertar(String llave, int valor) {
// Crear un HashItem que contiene la llave y valor.
HashItem hashItem = new HashItem(llave, valor);
int hashIndice = hash(hashItem.getLlave());
int i = 0;
// Buscar un indice vacio.
while (hashArray[hashIndice] != null && hashArray[hashIndice].getLlave() != null && i < tamano) {
if (hashArray[hashIndice].getLlave().equals(llave)) {
//La llave ya existe.
return;
}
hashIndice++;
// Si hashIndice es mayor que el tamaño maximo, hay que empezar desde 0.
hashIndice = hashIndice % tamano;
i++;
}
if (i != 10) {
// Insertar el HashItem en el array.
hashArray[hashIndice] = hashItem;
}
}
public class HashItem {
final private String llave;
final private int valor;
public HashItem(String llave, int valor) {
this.llave = llave;
this.valor = valor;
}
public String getLlave() {
return llave;
}
public int getValor() {
return valor;
}
}

2
src/cl/cromer/estructuras/fxml/hashTable.fxml

@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Text?>
<VBox xmlns:fx="http://javafx.com/fxml/1" prefHeight="768.0" prefWidth="1024.0" spacing="10"
xmlns="http://javafx.com/javafx/8.0.92" fx:controller="cl.cromer.estructuras.HashTableController">
xmlns="http://javafx.com/javafx/8.0.92" fx:controller="cl.cromer.estructuras.TablaHashController">
<fx:include source="menu.fxml"/>
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
<HBox alignment="TOP_CENTER" VBox.vgrow="ALWAYS" spacing="50">

Loading…
Cancel
Save