MCPcopy
hub / github.com/java-decompiler/jd-gui / add

Method add

app/src/main/java/org/jd/gui/model/history/History.java:18–61  ·  view source on GitHub ↗
(URI uri)

Source from the content-addressed store, hash-verified

16 protected ArrayList<URI> forward = new ArrayList<>();
17
18 public void add(URI uri) {
19 if (current == null) {
20 // Init history
21 forward.clear();
22 current = uri;
23 return;
24 }
25
26 if (current.equals(uri)) {
27 // Already stored -> Nothing to do
28 return;
29 }
30
31 if (uri.getPath().toString().equals(current.getPath().toString())) {
32 if ((uri.getFragment() == null) && (uri.getQuery() == null)) {
33 // Ignore
34 } else if ((current.getFragment() == null) && (current.getQuery() == null)) {
35 // Replace current URI
36 current = uri;
37 } else {
38 // Store URI
39 forward.clear();
40 backward.add(current);
41 current = uri;
42 }
43 return;
44 }
45
46 if (uri.toString().startsWith(current.toString())) {
47 // Replace current URI
48 current = uri;
49 return;
50 }
51
52 if (current.toString().startsWith(uri.toString())) {
53 // Parent URI -> Nothing to do
54 return;
55 }
56
57 // Store URI
58 forward.clear();
59 backward.add(current);
60 current = uri;
61 }
62
63 public URI backward() {
64 if (! backward.isEmpty()) {

Callers 15

initStringsMethod · 0.45
makeMethod · 0.45
populateTreeNodeMethod · 0.45
makeMethod · 0.45
populateTreeNodeMethod · 0.45
makeMethod · 0.45
ImagePageMethod · 0.45
makeMethod · 0.45
makeMethod · 0.45
makeMethod · 0.45
populateTreeNodeMethod · 0.45
makeMethod · 0.45

Calls 4

clearMethod · 0.80
toStringMethod · 0.80
getPathMethod · 0.65
equalsMethod · 0.45

Tested by 1

initStringsMethod · 0.36