MCPcopy Create free account
hub / github.com/Neop/mudmap2 / push

Method push

src/main/java/mudmap2/backend/WorldFileList.java:76–94  ·  view source on GitHub ↗

Add entry. Removes previous occurencies of the same file. @param entry entry to add

(WorldFileEntry entry)

Source from the content-addressed store, hash-verified

74 * @param entry entry to add
75 */
76 public static void push(WorldFileEntry entry){
77 if(entry != null){
78 // remove equal entries
79 LinkedList<WorldFileEntry> toBeRemoved = new LinkedList<>();
80
81 for(WorldFileEntry it: worldFileHistory){
82 if(it.getFile().equals(entry.getFile())){
83 toBeRemoved.push(it);
84 }
85 }
86
87 for(WorldFileEntry it: toBeRemoved){
88 worldFileHistory.remove(it);
89 }
90
91 // insert entry
92 worldFileHistory.push(entry);
93 }
94 }
95
96 /**
97 * Get entry by file

Callers 14

testPushMethod · 0.95
testGetMethod · 0.95
testGetEntriesMethod · 0.95
testWriteMethod · 0.95
saveMethod · 0.95
createTabMethod · 0.95
readListJSONMethod · 0.95
readWorldListMethod · 0.95
setMetaMethod · 0.80
pushPositionMethod · 0.80
popPositionMethod · 0.80
restorePositionMethod · 0.80

Calls 2

removeMethod · 0.65
getFileMethod · 0.45

Tested by 4

testPushMethod · 0.76
testGetMethod · 0.76
testGetEntriesMethod · 0.76
testWriteMethod · 0.76