public Feature(String line,Map cpStr2Int,Map lbStr2Int){
  StringTokenizer strTok=new StringTokenizer(line," \t\r\n");
  int len=strTok.countTokens();
  String strIdStr=strTok.nextToken();
  int idx=Integer.parseInt(strTok.nextToken());
  float val=1;
  double wgt=Double.parseDouble(strTok.nextToken());
  StringTokenizer strIdTok=new StringTokenizer(strIdStr,"_");
  String prefix=strIdTok.nextToken();
  if (prefix.compareToIgnoreCase("e1") == 0) {
    Integer yInt=(Integer)lbStr2Int.get(strIdTok.nextToken());
    Integer ypInt=(Integer)lbStr2Int.get(strIdTok.nextToken());
    if (yInt != null && ypInt != null) {
      eFeature1Init(yInt.intValue(),ypInt.intValue());
    }
  }
 else   if (prefix.compareToIgnoreCase("s1") == 0) {
    Integer yInt=(Integer)lbStr2Int.get(strIdTok.nextToken());
    Integer cpInt=(Integer)cpStr2Int.get(strIdTok.nextToken());
    if (yInt != null && cpInt != null) {
      sFeature1Init(yInt.intValue(),cpInt.intValue());
    }
  }
  this.idx=idx;
  this.val=val;
  this.wgt=wgt;
}

public Feature ( String line , Map cpStr2Int , Map lbStr2Int ) { StringTokenizer strTok = new StringTokenizer ( line , " \t\r\n" ) ; int len = strTok . countTokens ( ) ; String strIdStr = strTok . nextToken ( ) ; int idx = Integer . parseInt ( strTok . nextToken ( ) ) ; float val = 1 ; double wgt = Double . parseDouble ( strTok . nextToken ( ) ) ; StringTokenizer strIdTok = new StringTokenizer ( strIdStr , "_" ) ; String prefix = strIdTok . nextToken ( ) ; if ( prefix . compareToIgnoreCase ( "e1" ) == 0 ) { Integer yInt = ( Integer ) lbStr2Int . get ( strIdTok . nextToken ( ) ) ; Integer ypInt = ( Integer ) lbStr2Int . get ( strIdTok . nextToken ( ) ) ; if ( yInt != null && ypInt != null ) { eFeature1Init ( yInt . intValue ( ) , ypInt . intValue ( ) ) ; } } else if ( prefix . compareToIgnoreCase ( "s1" ) == 0 ) { Integer yInt = ( Integer ) lbStr2Int . get ( strIdTok . nextToken ( ) ) ; Integer cpInt = ( Integer ) cpStr2Int . get ( strIdTok . nextToken ( ) ) ; if ( yInt != null && cpInt != null ) { sFeature1Init ( yInt . intValue ( ) , cpInt . intValue ( ) ) ; } } this . idx = idx ; this . val = val ; this . wgt = wgt ; }
instantiates a new feature .
