Sign in to follow this  
Followers 0
Mikkel

Count saved Objects

2 posts in this topic

Hello,

I need help. is there a given funciton to get the count of stored objects?

I wrote my own method, but it's very slow for much objects.

private int countSavedObjects()
{
    count = 0;
    MyData testobj = null;
    Iterator myIterator = root.intKeyIndex.iterator();
    // iterate through all objects
    while (myIterator.hasNext()) 
    {
        testobj = (MyData) myIterator.next();
    	count++;
    }
    return count
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0