-
Notifications
You must be signed in to change notification settings - Fork 586
/
mutablePrimitivePrimitiveMap.stg
109 lines (76 loc) · 3.07 KB
/
mutablePrimitivePrimitiveMap.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
import "copyright.stg"
skipBooleanKeys() ::= "true"
hasTwoPrimitives() ::= "true"
targetPath() ::= "org/eclipse/collections/api/map/primitive"
fileName(primitive1, primitive2, sameTwoPrimitives) ::= "Mutable<primitive1.name><primitive2.name>Map"
class(primitive1, primitive2, sameTwoPrimitives) ::= <<
<body(primitive1.type, primitive2.type, primitive1.name, primitive2.name)>
>>
body(type1, type2, name1, name2) ::= <<
<copyright()>
package org.eclipse.collections.api.map.primitive;
import org.eclipse.collections.api.<name1>Iterable;
<if(!sameTwoPrimitives)>import org.eclipse.collections.api.block.function.primitive.<name1>To<name2>Function;<endif>
import org.eclipse.collections.api.block.function.primitive.<name2>Function;
import org.eclipse.collections.api.block.function.primitive.<name2>Function0;
import org.eclipse.collections.api.block.function.primitive.<name2>To<name2>Function;
import org.eclipse.collections.api.block.predicate.primitive.<name1><name2>Predicate;
/**
* This file was automatically generated from template file mutablePrimitivePrimitiveMap.stg.
*
* @since 3.0.
*/
public interface Mutable<name1><name2>Map extends <name1><name2>Map, Mutable<name2>ValuesMap
{
void put(<type1> key, <type2> value);
void putAll(<name1><name2>Map map);
void removeKey(<type1> key);
void remove(<type1> key);
<type2> removeKeyIfAbsent(<type1> key, <type2> value);
<type2> getIfAbsentPut(<type1> key, <type2> value);
<type2> getIfAbsentPut(<type1> key, <name2>Function0 function);
<type2> getIfAbsentPutWithKey(<type1> key, <name1>To<name2>Function function);
\<P> <type2> getIfAbsentPutWith(<type1> key, <name2>Function\<? super P> function, P parameter);
<type2> updateValue(<type1> key, <type2> initialValueIfAbsent, <name2>To<name2>Function function);
<(flipUniqueValues.(name2))(name1, name2)>
@Override
Mutable<name1><name2>Map select(<name1><name2>Predicate predicate);
@Override
Mutable<name1><name2>Map reject(<name1><name2>Predicate predicate);
Mutable<name1><name2>Map withKeyValue(<type1> key, <type2> value);
Mutable<name1><name2>Map withoutKey(<type1> key);
Mutable<name1><name2>Map withoutAllKeys(<name1>Iterable keys);
Mutable<name1><name2>Map asUnmodifiable();
Mutable<name1><name2>Map asSynchronized();
<(arithmeticMethods.(type2))(type1, type2)>
}
>>
arithmeticMethods ::= [
"byte": "allMethods",
"short": "allMethods",
"char": "allMethods",
"int": "allMethods",
"long": "allMethods",
"float": "allMethods",
"double": "allMethods",
"boolean": "noMethods"
]
allMethods(type1, type2) ::= <<
<\n>
<type2> addToValue(<type1> key, <type2> toBeAdded);
>>
noMethods(type1, type2) ::= ""
flipUniqueValues ::= [
"Byte": "flipUniqueValues",
"Short": "flipUniqueValues",
"Char": "flipUniqueValues",
"Int": "flipUniqueValues",
"Long": "flipUniqueValues",
"Float": "flipUniqueValues",
"Double": "flipUniqueValues",
"Boolean": "noMethods"
]
flipUniqueValues(name1, name2) ::= <<
@Override
Mutable<name2><name1>Map flipUniqueValues();
>>