public static int[][] getDomainMapping(String colName, String[] modelDom, String[] colDom, boolean logNonExactMapping) {
    int emap[] = new int[modelDom.length];
    boolean bmap[] = new boolean[modelDom.length];
    HashMap<String,Integer> md = new HashMap<String, Integer>((int) ((colDom.length/0.75f)+1));
    for( int i = 0; i < colDom.length; i++) md.put(colDom[i], i);
    for( int i = 0; i < modelDom.length; i++) {
      Integer I = md.get(modelDom[i]);
      if (I == null && logNonExactMapping)
        Log.warn(Sys.SCORM, "Domain mapping: target domain contains the factor '"+modelDom[i]+"' which DOES NOT appear in input domain " + (colName!=null?"(column: " + colName+")":""));
      if (I!=null) {
        emap[i] = I;
        bmap[i] = true;
      }
    }
    if (logNonExactMapping) { // Inform about additional values in column domain which do not appear in model domain
      for (int i=0; i<colDom.length; i++) {
        boolean found = false;
        for (int j=0; j<emap.length; j++)
          if (emap[j]==i) { found=true; break; }
        if (!found)
          Log.warn(Sys.SCORM, "Domain mapping: target domain DOES NOT contain the factor '"+colDom[i]+"' which appears in input domain "+ (colName!=null?"(column: " + colName+")":""));
      }
    }

    // produce packed values
    int[][] res = Utils.pack(emap, bmap);
    // Sort values in numeric order to support binary search in TransfVec
    Utils.sortWith(res[0], res[1]);
    return res;
  }
public static int [ ] [ ] getDomainMapping ( String colName , String [ ] modelDom , String [ ] colDom , boolean logNonExactMapping ) { int emap [ ] = new int [ modelDom . length ] ; boolean bmap [ ] = new boolean [ modelDom . length ] ; HashMap < String , Integer > md = new HashMap < String , Integer > ( ( int ) ( ( colDom . length / 0.75f ) + 1 ) ) ; for ( int i = 0 ; i < colDom . length ; i ++ ) md . put ( colDom [ i ] , i ) ; for ( int i = 0 ; i < modelDom . length ; i ++ ) { Integer I = md . get ( modelDom [ i ] ) ; if ( I == null && logNonExactMapping ) Log . warn ( Sys . SCORM , "Domain mapping: target domain contains the factor '" + modelDom [ i ] + "' which DOES NOT appear in input domain " + ( colName != null ? "(column: " + colName + ")" : "" ) ) ; if ( I != null ) { emap [ i ] = I ; bmap [ i ] = true ; } } if ( logNonExactMapping ) { for ( int i = 0 ; i < colDom . length ; i ++ ) { boolean found = false ; for ( int j = 0 ; j < emap . length ; j ++ ) if ( emap [ j ] == i ) { found = true ; break ; } if ( ! found ) Log . warn ( Sys . SCORM , "Domain mapping: target domain DOES NOT contain the factor '" + colDom [ i ] + "' which appears in input domain " + ( colName != null ? "(column: " + colName + ")" : "" ) ) ; } } int [ ] [ ] res = Utils . pack ( emap , bmap ) ; Utils . sortWith ( res [ 0 ] , res [ 1 ] ) ; return res ; }
Returns a mapping for given column according to given <code>modelDom</code>.
In this case, <code>modelDom</code> is

@param colName name of column which is mapped, can be null.
@param modelDom
@param logNonExactMapping
@return