private static int getOrdering ( int categoryOrder ) { final int index = ( categoryOrder & CATEGORY_MASK ) >> CATEGORY_SHIFT ; if ( index < 0 || index >= sCategoryToOrder . length ) { throw new IllegalArgumentException ( "order does not contain a valid category." ) ; } return ( sCategoryToOrder [ index ] << CATEGORY_SHIFT ) | ( categoryOrder & USER_MASK ) ; }
Returns the ordering across all items . This will grab the category from the upper bits find out how to order the category with respect to other categories and combine it with the lower bits .