-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntries.java
131 lines (109 loc) · 3.8 KB
/
Entries.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package arclibrary.utils.entries;
import arc.struct.*;
@SuppressWarnings("unused")
public class Entries {
//region creation
public static IntFloatMap.Entry intFloatEntry(int key, float value) {
IntFloatMap.Entry entry = new IntFloatMap.Entry();
entry.key = key;
entry.value = value;
return entry;
}
public static IntIntMap.Entry intIntEntry(int key, int value) {
IntIntMap.Entry entry = new IntIntMap.Entry();
entry.key = key;
entry.value = value;
return entry;
}
public static <V> IntMap.Entry<V> intEntry(int key, V value) {
IntMap.Entry<V> entry = new IntMap.Entry<>();
entry.key = key;
entry.value = value;
return entry;
}
public static <V> LongMap.Entry<V> longEntry(long key, V value) {
LongMap.Entry<V> entry = new LongMap.Entry<>();
entry.key = key;
entry.value = value;
return entry;
}
public static <K> ObjectFloatMap.Entry<K> objectFloatEntry(K key, float value) {
ObjectFloatMap.Entry<K> entry = new ObjectFloatMap.Entry<>();
entry.key = key;
entry.value = value;
return entry;
}
public static <K> ObjectIntMap.Entry<K> objectIntEntry(K key, int value) {
ObjectIntMap.Entry<K> entry = new ObjectIntMap.Entry<>();
entry.key = key;
entry.value = value;
return entry;
}
public static <K, V> ObjectMap.Entry<K, V> objectEntry(K key, V value) {
ObjectMap.Entry<K, V> entry = new ObjectMap.Entry<>();
entry.key = key;
entry.value = value;
return entry;
}
//endregion
//region copy
public static IntFloatMap.Entry copy(IntFloatMap.Entry entry) {
return intFloatEntry(entry.key, entry.value);
}
public static IntIntMap.Entry copy(IntIntMap.Entry entry) {
return intIntEntry(entry.key, entry.value);
}
public static <V> IntMap.Entry<V> copy(IntMap.Entry<V> entry) {
return intEntry(entry.key, entry.value);
}
public static <V> LongMap.Entry<V> copy(LongMap.Entry<V> entry) {
return longEntry(entry.key, entry.value);
}
public static <K> ObjectFloatMap.Entry<K> copy(ObjectFloatMap.Entry<K> entry) {
return objectFloatEntry(entry.key, entry.value);
}
public static <K> ObjectIntMap.Entry<K> copy(ObjectIntMap.Entry<K> entry) {
return objectIntEntry(entry.key, entry.value);
}
public static <K, V> ObjectMap.Entry<K, V> copy(ObjectMap.Entry<K, V> entry) {
return objectEntry(entry.key, entry.value);
}
//endregion
//region set
public static IntFloatMap.Entry set(IntFloatMap.Entry entry, int key, float value) {
entry.key = key;
entry.value = value;
return entry;
}
public static IntIntMap.Entry set(IntIntMap.Entry entry, int key, int value) {
entry.key = key;
entry.value = value;
return entry;
}
public static <V> IntMap.Entry<V> set(IntMap.Entry<V> entry, int key, V value) {
entry.key = key;
entry.value = value;
return entry;
}
public static <V> LongMap.Entry<V> set(LongMap.Entry<V> entry, long key, V value) {
entry.key = key;
entry.value = value;
return entry;
}
public static <K> ObjectFloatMap.Entry<K> set(ObjectFloatMap.Entry<K> entry, K key, float value) {
entry.key = key;
entry.value = value;
return entry;
}
public static <K> ObjectIntMap.Entry<K> set(ObjectIntMap.Entry<K> entry, K key, int value) {
entry.key = key;
entry.value = value;
return entry;
}
public static <K, V> ObjectMap.Entry<K, V> set(ObjectMap.Entry<K, V> entry, K key, V value) {
entry.key = key;
entry.value = value;
return entry;
}
//endregion
}