-
Notifications
You must be signed in to change notification settings - Fork 597
/
primitiveList.stg
108 lines (86 loc) · 2.42 KB
/
primitiveList.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 "copyrightAndOthers.stg"
import "primitiveEquals.stg"
import "primitiveHashCode.stg"
import "primitiveAPI.stg"
import "primitiveLiteral.stg"
targetPath() ::= "org/eclipse/collections/api/list/primitive"
fileName(primitive) ::= "<primitive.name>List"
class(primitive) ::= <<
<body(primitive.type, primitive.name)>
>>
body(type, name) ::= <<
<copyrightAndOthers()>
package org.eclipse.collections.api.list.primitive;
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.list.ListIterable;
import org.eclipse.collections.api.ordered.primitive.Reversible<name>Iterable;
/**
* This file was automatically generated from template file primitiveList.stg.
*
* @since 3.0.
*/
public interface <name>List extends Reversible<name>Iterable
{
<type> get(int index);
<(arithmeticMethods.(type))(name, type)>
int lastIndexOf(<type> value);
<sharedAPI(fileName(primitive), name)>
/**
* @since 9.0.
*/
@Override
default <name>List tap(<name>Procedure procedure)
{
this.forEach(procedure);
return this;
}
@Override
\<V> ListIterable\<V> collect(<name>ToObjectFunction\<? extends V> function);
/**
* Follows the same general contract as {@link java.util.List#equals(Object)}.
*/
@Override
boolean equals(Object o);
/**
* Follows the same general contract as {@link java.util.List#hashCode()}.
*/
@Override
int hashCode();
/**
* Returns an immutable copy of this list. If the list is immutable, it returns itself.
*/
Immutable<name>List toImmutable();
/**
* @since 6.0.
*/
@Override
<name>List distinct();
/**
* @since 5.0.
*/
@Override
<name>List toReversed();
/**
* @see java.util.List#subList(int fromIndex, int toIndex)
* @since 5.0.
*/
<name>List subList(int fromIndex, int toIndex);
}
>>
arithmeticMethods ::= [
"byte": "allMethods",
"short": "allMethods",
"char": "allMethods",
"int": "allMethods",
"long": "allMethods",
"float": "allMethods",
"double": "allMethods",
"boolean": "noMethods"
]
allMethods(name, type) ::=<<
<wideType.(type)> dotProduct(<name>List list);
int binarySearch(<type> value);
>>
noMethods(name, type) ::= ""