Intellij idea 快捷鍵(1)--生成for迴圈程式碼塊
阿新 • • 發佈:2019-01-07
使用Intellij idea 時,想要快捷生成for迴圈程式碼塊
itar 生成array for程式碼塊
for (int i = 0; i < array.length; i++) {
= array[i];
}
itco 生成Collection迭代
for (Iterator<String> iterator = locationUrl.iterator(); iterator.hasNext(); ) { String next = iterator.next(); }
iten 生成enumeration遍歷
while (enumeration.hasMoreElements()) {
Object nextElement = enumeration.nextElement();
}
iter 生成增強forxun
for (String s : locationUrl) {
}
itit 生成iterator 迭代
itli 生成List的遍歷while (iterator.hasNext()) { Object next = iterator.next(); }
for (int i = 0; i < locationUrl.size(); i++) {
String s = locationUrl.get(i);
}
ittok 生成String token遍歷
for (StringTokenizer stringTokenizer = new StringTokenizer(TVSOU_URL); stringTokenizer.hasMoreTokens(); ) { String s = stringTokenizer.nextToken(); }
itve 生成Vector陣列迭代
for (int i = 0; i < vector.size(); i++) {
Object elementAt = vector.elementAt(i);
}
另外兩個和迴圈無關,只是方便建立
itaws 生成Axis2 web service呼叫
try {
MyServiceStub stub = new MyServiceStub();
stub.sayHelloWorldFrom();
} catch (Exception ex) {
ex.printStackTrace();
}
itws 生成 Axis web service呼叫
try {
MyServiceLocator locator = new MyServiceLocator();
Activator service = locator.get();
// If authorization is required
//((MyService_Soap_BindingStub)service).setUsername("user3");
//((MyService_Soap_BindingStub)service).setPassword("pass3");
// invoke business method
service.businessMethod();
} catch (javax.xml.rpc.ServiceException ex) {
ex.printStackTrace();
} catch (java.rmi.RemoteException ex) {
ex.printStackTrace();
}
具體如圖: