code: private Long getDatatypeIndex(Datatype datatype,
  			boolean useNullAsDefaultDatatype) throws EXIException {
  		if (datatype.equals(BuiltIn.getDefaultDatatype())
  				&& useNullAsDefaultDatatype) {
  			return null;
  		}
  		int datatypeIndex = listOfSimpleDatatypes.indexOf(datatype);
  		if (datatypeIndex < 0) {
  			throw new EXIException("Can't find datatype: " + datatype);
  		}
  		return Long.valueOf(datatypeIndex);
  	}
docs: Get a datatype index from a Datatype instance using the
  listOfSimpleDatatypes, or null if this is the default datatype and
  {@code useNullAsDefaultDatatype} is true.
  
  @param datatype
  The datatype to get the index from.
  @param useNullAsDefaultDatatype
  Tells is it should return null for the built-in default
  datatype.
  @return The index of the datatype.
  @throws EXIException
  if the datatype can't be found in listOfSimpleDatatypes.