-
Notifications
You must be signed in to change notification settings - Fork 587
/
mutableObjectPrimitiveMap.stg
145 lines (105 loc) · 4.01 KB
/
mutableObjectPrimitiveMap.stg
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import "copyrightAndOthers.stg"
targetPath() ::= "org/eclipse/collections/api/map/primitive"
fileName(primitive) ::= "MutableObject<primitive.name>Map"
class(primitive) ::= <<
<body(primitive.type, primitive.name)>
>>
body(type, name) ::= <<
<copyrightAndOthers()>
package org.eclipse.collections.api.map.primitive;
import org.eclipse.collections.api.block.function.primitive.<name>Function;
import org.eclipse.collections.api.block.function.primitive.<name>Function0;
import org.eclipse.collections.api.block.function.primitive.<name>To<name>Function;
import org.eclipse.collections.api.block.function.primitive.<name>ToObjectFunction;
import org.eclipse.collections.api.block.predicate.primitive.<name>Predicate;
import org.eclipse.collections.api.block.procedure.primitive.<name>Procedure;
import org.eclipse.collections.api.block.predicate.primitive.Object<name>Predicate;
import org.eclipse.collections.api.collection.MutableCollection;
import org.eclipse.collections.api.collection.primitive.Mutable<name>Collection;
import org.eclipse.collections.api.iterator.Mutable<name>Iterator;
import org.eclipse.collections.api.tuple.primitive.Object<name>Pair;
/**
* This file was automatically generated from template file mutableObjectPrimitiveMap.stg.
*
* @since 3.0.
*/
public interface MutableObject<name>Map\<K> extends Object<name>Map\<K>
{
@Override
Mutable<name>Iterator <type>Iterator();
void clear();
void put(K key, <type> value);
/**
* This method allows MutableObject<name>Map the ability to add an element in the form of Object<name>Pair\<K>.
*
* @see #put(Object, <type>)
* @since 9.1.0
*/
default void putPair(Object<name>Pair\<K> keyValuePair)
{
this.put(keyValuePair.getOne(), keyValuePair.getTwo());
}
void putAll(Object<name>Map\<? extends K> map);
void removeKey(K key);
void remove(Object key);
<type> removeKeyIfAbsent(K key, <type> value);
<type> getIfAbsentPut(K key, <type> value);
<type> getIfAbsentPut(K key, <name>Function0 function);
<type> getIfAbsentPutWithKey(K key, <name>Function\<? super K> function);
\<P> <type> getIfAbsentPutWith(K key, <name>Function\<? super P> function, P parameter);
<type> updateValue(K key, <type> initialValueIfAbsent, <name>To<name>Function function);
<if(!primitive.booleanPrimitive)><(flipUniqueValues.(name))(name)><endif>
@Override
MutableObject<name>Map\<K> select(Object<name>Predicate\<? super K> predicate);
@Override
MutableObject<name>Map\<K> reject(Object<name>Predicate\<? super K> predicate);
@Override
Mutable<name>Collection select(<name>Predicate predicate);
@Override
Mutable<name>Collection reject(<name>Predicate predicate);
/**
* @since 9.0.
*/
default MutableObject<name>Map\<K> tap(<name>Procedure procedure)
{
this.forEach(procedure);
return this;
}
@Override
\<V> MutableCollection\<V> collect(<name>ToObjectFunction\<? extends V> function);
MutableObject<name>Map\<K> withKeyValue(K key, <type> value);
MutableObject<name>Map\<K> withoutKey(K key);
MutableObject<name>Map\<K> withoutAllKeys(Iterable\<? extends K> keys);
MutableObject<name>Map\<K> asUnmodifiable();
MutableObject<name>Map\<K> asSynchronized();
<(arithmeticMethods.(type))(type)>
}
>>
arithmeticMethods ::= [
"byte": "allMethods",
"short": "allMethods",
"char": "allMethods",
"int": "allMethods",
"long": "allMethods",
"float": "allMethods",
"double": "allMethods",
"boolean": "noMethods"
]
allMethods(type) ::= <<
<type> addToValue(K key, <type> toBeAdded);
>>
noMethods(type) ::= ""
flipUniqueValues ::= [
"Byte": "flipUniqueValues",
"Short": "flipUniqueValues",
"Char": "flipUniqueValues",
"Int": "flipUniqueValues",
"Long": "flipUniqueValues",
"Float": "flipUniqueValues",
"Double": "flipUniqueValues",
"Boolean": "noMethods"
]
flipUniqueValues(name) ::= <<
@Override
Mutable<name>ObjectMap\<K> flipUniqueValues();
>>