欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

IDEA生成for循环的快捷键

程序员文章站 2024-03-23 17:59:16
...

1、itar 生成array for代码块

for (int i = 0; i < fileStatuses.length; i++) {
    FileStatus fileStatus = fileStatuses[i];
    
}

2、itco 生成Collection迭代

for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {
    Object next =  iterator.next();
    
}

3、iten 生成enumeration遍历

while (enumeration.hasMoreElements()) {
    Object nextElement =  enumeration.nextElement();
    
}

4、iter 生成增强forxun

for (FileStatus fileStatus : fileStatuses) {
    
}

5、itit  生成iterator 迭代

while (iterator.hasNext()) {
    Object next =  iterator.next();
    
}

6、itli 生成List的遍历

for (int i = 0; i < list.size(); i++) {
    Object o =  list.get(i);
    
}

7、ittok 生成String token遍历

for (StringTokenizer stringTokenizer = new StringTokenizer(); stringTokenizer.hasMoreTokens(); ) {
    String s = stringTokenizer.nextToken();
    
}

8、itve 生成Vector数组迭代

for (int i = 0; i < vector.size(); i++) {
    Object elementAt =  vector.elementAt(i);

}

9、itaws 生成Axis2 web service调用

try {
    MyServiceStub stub = new MyServiceStub();
    stub.sayHelloWorldFrom();
} catch (Exception ex) {
    ex.printStackTrace();
}

10、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();
}