public ScaleLevel level ( int minMarkers , int maxMarkers ) { Iterator < ScaleLevel > iterator = scale . iterator ( min , max ) ; ScaleLevel level = iterator . next ( ) ; ScaleLevel prev = null ; while ( iterator . hasNext ( ) && minMarkers > level . count ( min , max ) ) { prev = level ; level = iterator . next ( ) ; } if ( maxMarkers < level . count ( min , max ) ) { return prev ; } else { return level ; } }
Returns minimum level where number of markers is not less that minMarkers and less than maxMarkers . If both cannot be met maxMarkers is stronger .