1:迭代

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
// itar:Iterate elements of array,操作顺序迭代数组
//1.定义一个数组
String[] strings = new String[];
//2.输入itar后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键快速进行光标切换
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
}

// ritar:Iterate elements of array in reverse order,反转迭代数组
String[] strings = new String[];
//输入ritar后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键进行光标快速切换
for (int i = strings.length - 1; i >= 0; i--) {
String string = strings[i];

}

// iter:Iterate (for each..in),ForEach迭代
List<String> stringList = new ArrayList<>();
// 输入iter后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键进行光标快速切换
for (String s : stringList) {

}

// fori:Create iteration loop,含下标的普通迭代
//输入fori后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键进行光标快速切换
for (int i = 0; i < ; i++) {

}

// itli:Iterate elements of java.util.List,List迭代
List<String> stringList = new ArrayList<>();
//输入itli后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键进行光标快速切换
for (int i = 0; i < stringList.size(); i++) {
String s = stringList.get(i);

}

// itco:Iterate elements of java.util.Collection,iterator迭代
List<String> stringList = new ArrayList<>();
//输入itco后会有提示,按`Enter`确认后会自动输出以下内容,默认是按`Tab`键进行光标快速切换
for (Iterator<String> iterator = stringList.iterator(); iterator.hasNext(); ) {
String next = iterator.next();

}

2:define (定义)

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
// St
String

// thr
throw new

// psf
public static final

// prsf
private static final

// psfi
public static final int

// psfs
public static final String

// geti:Inserts singleton method getInstance
public static $CLASS_NAME$ getInstance() {
return ;
}

// ifn:Inserts if null statement
if ($VAR$ == null) {

}

// inn:Inserts if not null statement
if ($VAR$ != null) {

}

// inst:Checks object type with instanceof and down-casts it
if ($EXPR$ instanceof $TYPE$) {
$TYPE$ $VAR1$ = ($TYPE$)$EXPR$;
$END$
}

// lazy:Performs lazy initialization
if ($VAR$ == null) {
$VAR$ = new $TYPE$();
}

// lst:Fetches last element of an array
// mn:Sets lesser value to a variable
// mx:Sets greater value to a variable
// toar:Stores elements of java.util.Collection into array

3:main

1
2
// psvm
public static void main(String[] args) {}

4:print (打印)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// sout:Prints a string to System.out
System.out.println();

// souf:Prints a formatted string to System.out
System.out.printf("");

// serr:Prints a string to System.err
System.err.println("");

// soutm:Prints current class and method names to System.out
System.out.println("className.methodName");

// soutv:Prints a value to System.out
System.out.println("variable name = " + variable value);

// soutp:Prints method parameter names and values to System.out
System.out.println("parameter name = [" + parameter value + "]");

5:Maven

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!-- dep:dependency -->
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
</dependency>


<!-- pl:plugin -->
<plugin>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
</plugin>


<!-- repo:repository -->
<repository>
<id></id>
<name></name>
<url></url>
</repository>

6:SQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!-- col:new column definition -->
$col$ $type$ $null$$END$

<!-- ins:insert rows into a table -->
insert into $table$ ($columns$) values ($END$);

<!-- sel:select all rows from a table -->
select * from $table$$END$;

<!-- selc:select the number of specific rows in a table -->
select count(*) from $table$ $alias$ where $alias$.$END$;

<!-- selw:select specific rows from a table -->
select * from $table$ $alias$ where $alias$.$END$;

<!-- tab:new table definition -->
create table $table$ (
$col$ $type$ $null$$END$
);
upd:update values in a table

update $table_name$ set $col$ = $value$ where $END$;