private final int getPackageCount( String packageName )
    {
        if ( packageName == null )
        {
            return 0;
        }

        int count = 0;
        int index = 0;

        while ( true )
        {
            index = packageName.indexOf( '.', index );

            if ( index == -1 )
            {
                break;
            }
            ++index;
            ++count;
        }

        //need to increment this by one
        ++count;

        return count;
    }