1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.fnmatch;
12
13 import java.util.List;
14
15 import org.eclipse.jgit.internal.JGitText;
16
17 abstract class AbstractHead implements Head {
18 private List<Head> newHeads = null;
19
20 private final boolean star;
21
22
23
24
25
26
27
28
29 protected abstract boolean matches(char c);
30
31 AbstractHead(boolean star) {
32 this.star = star;
33 }
34
35
36
37
38
39
40
41
42 public final void setNewHeads(List<Head> newHeads) {
43 if (this.newHeads != null)
44 throw new IllegalStateException(JGitText.get().propertyIsAlreadyNonNull);
45 this.newHeads = newHeads;
46 }
47
48
49 @Override
50 public List<Head> getNextHeads(char c) {
51 if (matches(c)) {
52 return newHeads;
53 }
54 return FileNameMatcher.EMPTY_HEAD_LIST;
55 }
56
57 boolean isStar() {
58 return star;
59 }
60 }