2010年4月22日 星期四

Map to Iterator

1. Map have the basic put(key, value) and get (key) basic method
2. you can using the iterator of entry to iterator it

{{{
NavigableMap nm = r.getFamilyMap(Bytes.toBytes("data"));
byte[] value = nm.get(Bytes.toBytes("2"));

String valueStr = Bytes.toString(value);
System.out.println("Get: Qualify:value is " + "2" + ":" + valueStr);

// using iterator
Iterator< entry > it = nm.entrySet().iterator();
while (it.hasNext()) {
Entry pairs = it.next();
System.out.println(Bytes.toString(pairs.getKey()) + " = " + Bytes.toString(pairs.getValue()));

}

}}}

沒有留言:

張貼留言