12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package cache;
- /**
- *
- * @author Juninho Carlos
- */
- public class BlocoRedundancia{
- private PalavrasRedundancia[] palavras;
-
- public BlocoRedundancia(){
- this.palavras = new PalavrasRedundancia[32];
- for(int i = 0 ; i < 32; i++){
- this.palavras[i] = new PalavrasRedundancia();
- }
- }
-
- public void leituraEspecialNoBloco(int tag){
- for(int i = 0; i < 32; i++){
- this.palavras[i].leituraEspecial(tag);
- }
- }
-
- public PalavrasRedundancia getPalavra(int index){
- return this.palavras[index];
- }
-
- public PalavrasRedundancia[] getPalavras(){
- return this.palavras;
- }
-
- public int getTagFromAWord(int palavra){
- return this.palavras[palavra].getTag();
- }
-
- public void writeAWord(int palavra,int tag){
- this.palavras[palavra].writeAWord(tag);
- }
- @Override
- public String toString() {
- String s = "";
- int i = 0;
- for (PalavrasRedundancia palavra : palavras) {
- s += i + " - " + palavra.isValid()+ " "+ palavra.getTag()+"\n";
- i++;
- }
- return s; //To change body of generated methods, choose Tools | Templates.
- }
-
- }
|