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 /** A note bucket that has been loaded into the process. */
14 abstract class InMemoryNoteBucket extends NoteBucket {
15 /**
16 * Number of leading digits that leads to this bucket in the note path.
17 *
18 * This is counted in terms of hex digits, not raw bytes. Each bucket level
19 * is typically 2 higher than its parent, placing about 256 items in each
20 * level of the tree.
21 */
22 final int prefixLen;
23
24 /**
25 * Chain of non-note tree entries found at this path in the tree.
26 *
27 * During parsing of a note tree into the in-memory representation,
28 * {@link NoteParser} keeps track of all non-note tree entries and stores
29 * them here as a sorted linked list. That list can be merged back with the
30 * note data that is held by the subclass, allowing the tree to be
31 * recreated.
32 */
33 NonNoteEntry nonNotes;
34
35 InMemoryNoteBucket(int prefixLen) {
36 this.prefixLen = prefixLen;
37 }
38
39 abstract InMemoryNoteBucket append(Note note);
40 }