View Javadoc

1   /**
2    * 
3    */
4   package org.treetank.bucket.interfaces;
5   
6   /**
7    * Interface denoting all buckets holding references to other buckets.
8    * The references are represented by the keys of the serialized storage.
9    * 
10   * @author Sebastian Graf, University of Konstanz
11   * 
12   */
13  public interface IReferenceBucket extends IBucket {
14  
15      /** Guaranteed Indirect Offset from any ReferenceBucket. */
16      public static int GUARANTEED_INDIRECT_OFFSET = 0;
17  
18      /**
19       * Getting the keys of the referenced buckets.
20       * 
21       * @return the keys for the referenced buckets.
22       */
23      long[] getReferenceKeys();
24  
25      /**
26       * Setting one key of a bucket to be referenced from this bucket.
27       * 
28       * @param pIndex
29       *            offset of the key to be referenced
30       * @param pKey
31       *            the key of the bucket to be referenced
32       */
33      void setReferenceKey(int pIndex, long pKey);
34  
35      /**
36       * Getting the HashValues mapped to the references guarding the integrity of the referenced buckets.
37       * 
38       * @return an array of checksums from the referenced buckets
39       */
40      byte[][] getReferenceHashs();
41  
42      /**
43       * Setting the hash of a referenced bucket to this bucket.
44       * 
45       * @param pIndex
46       *            where the hash should be applied to
47       * @param pHash
48       *            to be stored in
49       */
50      void setReferenceHash(int pIndex, byte[] pHash);
51  
52  }