This project has retired. For details please refer to its Attic page.
Clownfish::HashIterator – C API Documentation
Apache Lucy™

Clownfish::HashIterator

parcel Clownfish
class variable CFISH_HASHITERATOR
struct symbol cfish_HashIterator
class nickname cfish_HashIter
header file Clownfish/HashIterator.h

Name

Clownfish::HashIterator – Hashtable Iterator.

Functions

new
cfish_HashIterator* // incremented
cfish_HashIter_new(
    cfish_Hash *hash
);

Return a HashIterator for hash.

init
cfish_HashIterator*
cfish_HashIter_init(
    cfish_HashIterator *self,
    cfish_Hash *hash
);

Initialize a HashIterator for hash.

Methods

Next
bool
cfish_HashIter_Next(
    cfish_HashIterator *self
);

Advance the iterator to the next key-value pair.

Returns: true if there’s another key-value pair, false if the iterator is exhausted.

Get_Key
cfish_String*
cfish_HashIter_Get_Key(
    cfish_HashIterator *self
);

Return the key of the current key-value pair. It’s not allowed to call this method before Next() was called for the first time or after the iterator was exhausted.

Get_Value
cfish_Obj*
cfish_HashIter_Get_Value(
    cfish_HashIterator *self
);

Return the value of the current key-value pair. It’s not allowed to call this method before Next() was called for the first time or after the iterator was exhausted.

Inheritance

Clownfish::HashIterator is a Clownfish::Obj.