code: public static Vec categoricalToInt(final Vec src) {
      if( src.isInt() && (src.domain()==null || src.domain().length == 0)) return copyOver(src, Vec.T_NUM, null);
      if( !src.isCategorical() ) throw new IllegalArgumentException("categoricalToInt conversion only works on categorical columns.");
      // check if the 1st lvl of the domain can be parsed as int
      boolean useDomain=false;
      Vec newVec = copyOver(src, Vec.T_NUM, null);
      try {
        Integer.parseInt(src.domain()[0]);
        useDomain=true;
      } catch (NumberFormatException e) {
        // makeCopy and return...
      }
      if( useDomain ) {
        new MRTask() {
          @Override public void map(Chunk c) {
            for (int i=0;i<c._len;++i)
              if( !c.isNA(i) )
                c.set(i, Integer.parseInt(src.domain()[(int)c.at8(i)]));
          }
        }.doAll(newVec);
      }
      return newVec;
    }
docs: Create a new {@link Vec} of numeric values from a categorical {@link Vec}.
  
  If the first value in the domain of the src Vec is a stringified ints,
  then it will use those ints. Otherwise, it will use the raw enumeration level mapping.
  If the domain is stringified ints, then all of the domain must be able to be parsed as
  an int. If it cannot be parsed as such, a NumberFormatException will be caught and
  rethrown as an H2OIllegalArgumentException that declares the illegal domain value.
  Otherwise, the this pointer is copied to a new Vec whose domain is null.
  
  The magic of this method should be eliminated. It should just use enumeration level
  maps. If the user wants domains to be used, call categoricalDomainsToNumeric().
  PUBDEV-2209
  
  @param src a categorical {@link Vec}
  @return a numeric {@link Vec}