private Target createTarget(Element domElement){
  FeatureDefinition featDef=this.featureDefinition;
  int numFeatures=featDef.getNumberOfFeatures();
  int numByteFeatures=featDef.getNumberOfByteFeatures();
  int numShortFeatures=featDef.getNumberOfShortFeatures();
  int numContiniousFeatures=featDef.getNumberOfContinuousFeatures();
  byte[] byteFeatures=new byte[numByteFeatures];
  short[] shortFeatures=new short[numShortFeatures];
  float[] floatFeatures=new float[numContiniousFeatures];
  int byteCount=0;
  int shortCount=0;
  int floatCount=0;
  for (int i=0; i < numFeatures; i++) {
    String featName=featDef.getFeatureName(i);
    String featValue="0";
    if (featDef.isByteFeature(featName) || featDef.isShortFeature(featName)) {
      if (domElement.hasAttribute(featName)) {
        featValue=domElement.getAttribute(featName);
      }
      boolean hasFeature=featDef.hasFeatureValue(featName,featValue);
      if (!hasFeature)       featValue="0";
      if (featDef.isByteFeature(i)) {
        byteFeatures[byteCount++]=featDef.getFeatureValueAsByte(i,featValue);
      }
 else       if (featDef.isShortFeature(i)) {
        shortFeatures[shortCount++]=featDef.getFeatureValueAsShort(i,featValue);
      }
    }
 else {
      if (domElement.hasAttribute("meaning")) {
        featValue=domElement.getAttribute("meaning");
      }
      floatFeatures[floatCount++]=getMeaningScaleValue(featName,featValue);
    }
  }
  FeatureVector newFV=featDef.toFeatureVector(0,byteFeatures,shortFeatures,floatFeatures);
  String name="0";
  if (domElement.hasAttribute("name")) {
    name=domElement.getAttribute("name");
  }
  Target newTarget=new Target(name,domElement);
  newTarget.setFeatureVector(newFV);
  return newTarget;
}

private Target createTarget ( Element domElement ) { FeatureDefinition featDef = this . featureDefinition ; int numFeatures = featDef . getNumberOfFeatures ( ) ; int numByteFeatures = featDef . getNumberOfByteFeatures ( ) ; int numShortFeatures = featDef . getNumberOfShortFeatures ( ) ; int numContiniousFeatures = featDef . getNumberOfContinuousFeatures ( ) ; byte [ ] byteFeatures = new byte [ numByteFeatures ] ; short [ ] shortFeatures = new short [ numShortFeatures ] ; float [ ] floatFeatures = new float [ numContiniousFeatures ] ; int byteCount = 0 ; int shortCount = 0 ; int floatCount = 0 ; for ( int i = 0 ; i < numFeatures ; i ++ ) { String featName = featDef . getFeatureName ( i ) ; String featValue = "0" ; if ( featDef . isByteFeature ( featName ) || featDef . isShortFeature ( featName ) ) { if ( domElement . hasAttribute ( featName ) ) { featValue = domElement . getAttribute ( featName ) ; } boolean hasFeature = featDef . hasFeatureValue ( featName , featValue ) ; if ( ! hasFeature ) featValue = "0" ; if ( featDef . isByteFeature ( i ) ) { byteFeatures [ byteCount ++ ] = featDef . getFeatureValueAsByte ( i , featValue ) ; } else if ( featDef . isShortFeature ( i ) ) { shortFeatures [ shortCount ++ ] = featDef . getFeatureValueAsShort ( i , featValue ) ; } } else { if ( domElement . hasAttribute ( "meaning" ) ) { featValue = domElement . getAttribute ( "meaning" ) ; } floatFeatures [ floatCount ++ ] = getMeaningScaleValue ( featName , featValue ) ; } } FeatureVector newFV = featDef . toFeatureVector ( 0 , byteFeatures , shortFeatures , floatFeatures ) ; String name = "0" ; if ( domElement . hasAttribute ( "name" ) ) { name = domElement . getAttribute ( "name" ) ; } Target newTarget = new Target ( name , domElement ) ; newTarget . setFeatureVector ( newFV ) ; return newTarget ; }
create target from xml request
