View Javadoc
1   /*
2    * Copyright (C) 2010, Google Inc. and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  
11  package org.eclipse.jgit.notes;
12  
13  import java.io.IOException;
14  import java.util.Iterator;
15  
16  import org.eclipse.jgit.lib.AnyObjectId;
17  import org.eclipse.jgit.lib.ObjectId;
18  import org.eclipse.jgit.lib.ObjectInserter;
19  import org.eclipse.jgit.lib.ObjectReader;
20  
21  /**
22   * A tree that stores note objects.
23   *
24   * @see FanoutBucket
25   * @see LeafBucket
26   */
27  abstract class NoteBucket {
28  	abstract Note getNote(AnyObjectId objId, ObjectReader reader)
29  			throws IOException;
30  
31  	abstract Iterator<Note> iterator(AnyObjectId objId, ObjectReader reader)
32  			throws IOException;
33  
34  	abstract int estimateSize(AnyObjectId noteOn, ObjectReader or)
35  			throws IOException;
36  
37  	abstract InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData,
38  			ObjectReader reader) throws IOException;
39  
40  	abstract ObjectId writeTree(ObjectInserter inserter) throws IOException;
41  
42  	abstract ObjectId getTreeId();
43  }