Summary: Methods | Inherited Methods | [Expand All]
public class

# DictIterator

extends Object
implements AutoCloseable

java.lang.Object
↳ | com.pdftron.sdf.DictIterator

Known Direct Subclasses NameTreeIterator, NumberTreeIterator
NameTreeIterator | NameTreeIterator is used to traverse key/value pairs in a NameTree.
NumberTreeIterator | NumberTreeIterator is used to traverse key/value pairs in a NumberTree.

## Class Overview

DictIterator is used to traverse key/value pairs in a dictionary. For example a DictIterator can be used to print out all the entries in a given Obj dictionary as follows: `DictIterator itr = dict.getDictIterator(); while (itr.hasCurrent()) { Obj key = itr.key(); cout << key.getName() << endl; Obj value = itr.value(); // ... itr.next()` }

## Summary

Public Methods
long | __GetHandle()
void | close() Frees the native memory of the object.
void | destroy() Frees the native memory of the object.
boolean | hasCurrent() Checks if the current iterator is valid.
boolean | hasNext() Checks if the current iterator is valid.
Obj | key() Get the key of the current dictionary entry
void | next() Advances the iterator to the next element of the collection.
Obj | value() Get the value of the current dictionary entry

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## Public Methods

#### public long __GetHandle ()

#### public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public void destroy ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public boolean hasCurrent ()

Checks if the current iterator is valid.

##### Returns

- true if the current iterator is valid and not the end of the collection

##### Throws

PDFNetException |

#### public boolean hasNext ()

Checks if the current iterator is valid.

##### Returns

- true if the current iterator is valid and not the end of the collection Deprecated, prefer hasCurrent()

##### Throws

PDFNetException |

#### public Obj key ()

Get the key of the current dictionary entry

##### Returns

- the key of the current dictionary entry.

##### Throws

PDFNetException |

#### public void next ()

Advances the iterator to the next element of the collection.

##### Throws

PDFNetException |

#### public Obj value ()

Get the value of the current dictionary entry

##### Returns

- the value of the current dictionary entry.

##### Throws

PDFNetException |