if ( termMap != null && termMap.size() != numberOfTerms ) throw new IllegalArgumentException( "The size of the term map (" + termMap.size() + ") is not equal to the number of terms (" + numberOfTerms + ")" );
if ( prefixMap != null && prefixMap.size() != numberOfTerms ) throw new IllegalArgumentException( "The size of the prefix map (" + prefixMap.size() + ") is not equal to the number of terms (" + numberOfTerms + ")" );
final Payload payload = (Payload)( properties.containsKey( Index.PropertyKeys.PAYLOADCLASS ) ? Class.forName( properties.getString( Index.PropertyKeys.PAYLOADCLASS ) ).newInstance() : null );
final Coding frequencyCoding = flags.get( Component.FREQUENCIES );
final Coding pointerCoding = flags.get( Component.POINTERS );
final Coding countCoding = flags.get( Component.COUNTS );
final Coding positionCoding = flags.get( Component.POSITIONS );
if ( countCoding == null && positionCoding != null ) throw new IllegalArgumentException( "Index " + basename + " has positions but no counts (this can't happen)" );
// Load document sizes if forced to do so, or if the pointer/position compression methods make it necessary.
IntList sizes = null;