Tags » Iterator

How to refresh the Iterator from the Managed Bean in ADF Mobile applciation.

When we want to programmatically refresh the Iterator “addressBookResultIterator” the was added in the AMX Page Bindings section from the Managed bean, we need to use the below code – 47 more words

ADF Mobile

Iterator & Iterable [Java]

Iterator (Interface)

在介绍java.util.Iterator前,先看一个例子。我们要访问一个数组的方式是使用索引(array[i]),而要访问一个链表中的一个节点,则是需要从链表的头开始不断查找(node.next)。以上两种方法客户必须事先知道集合的内部结构,访问代码和集合本身是紧密耦合的,无妨将访问逻辑从集合类和客户端代码中分离出来,每一种集合对应一种遍历方法,客户端代码无法复用。更为糟糕的是,如果以后想把ArrayList更换为LinkedList,则远离的客户端必须全部重写。 175 more words

Java

Java集合类 [1]

Java集合类将会分成四个部分进行总结,首先从全局的角度来了解Java集合类中各个接口和实现类之间的关系,然后根据继和实现的顺序,我们从上到下开始逐步探索Java集合类。

Java

Finite sequence generators in Java 8

… and introducing default methods.

Last time we looked at generators, and more specifically those generating an infinite sequence. We saw that there were several ways to achieve this: 1,018 more words

Functional Programming

HashMap in collection

HashMap :

HashMap class uses a hashtable to implement Map interface.HashMap using put() to store key/value pair.

Example :


package com.pkjavacode.com;

import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;

public class HashMapExample {

public static void main(String[] args) {
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(1, "Pradeep");
map.put(2, "Bharat");
map.put(3, "Amit");
map.put(4, "Rahul");
Iterator itr = map.entrySet().iterator();
while (itr.hasNext()) {
Map.Entry<Integer, String> me = (Map.Entry<Integer, String>) itr
.next();
System.out.print("" + me.getKey());
System.out.println(" " + me.getValue());
}

}

}

… 7 more words
Java

Generators with Java 8

Today we’ll look at creating generators. In simple terms, a generator is a function which returns the next value in a sequence. Unlike an iterator, it generates the next value when needed, rather than returning the next item of a pre-generated collection. 1,038 more words

Functional Programming