@Override public boolean equals(Object obj){
  if (!(obj instanceof FeatureDefinition))   return false;
  FeatureDefinition other=(FeatureDefinition)obj;
  if (featureWeights == null) {
    if (other.featureWeights != null)     return false;
  }
 else {
    if (other.featureWeights == null)     return false;
    if (featureWeights.length != other.featureWeights.length)     return false;
    for (int i=0; i < featureWeights.length; i++) {
      if (featureWeights[i] != other.featureWeights[i])       return false;
    }
    assert floatWeightFuncts != null;
    assert other.floatWeightFuncts != null;
    if (floatWeightFuncts.length != other.floatWeightFuncts.length)     return false;
    for (int i=0; i < floatWeightFuncts.length; i++) {
      if (floatWeightFuncts[i] == null) {
        if (other.floatWeightFuncts[i] != null)         return false;
      }
 else {
        if (other.floatWeightFuncts[i] == null)         return false;
        if (!floatWeightFuncts[i].equals(other.floatWeightFuncts[i]))         return false;
      }
    }
  }
  return featureEquals(other);
}

@ Override public boolean equals ( Object obj ) { if ( ! ( obj instanceof FeatureDefinition ) ) return false ; FeatureDefinition other = ( FeatureDefinition ) obj ; if ( featureWeights == null ) { if ( other . featureWeights != null ) return false ; } else { if ( other . featureWeights == null ) return false ; if ( featureWeights . length != other . featureWeights . length ) return false ; for ( int i = 0 ; i < featureWeights . length ; i ++ ) { if ( featureWeights [ i ] != other . featureWeights [ i ] ) return false ; } assert floatWeightFuncts != null ; assert other . floatWeightFuncts != null ; if ( floatWeightFuncts . length != other . floatWeightFuncts . length ) return false ; for ( int i = 0 ; i < floatWeightFuncts . length ; i ++ ) { if ( floatWeightFuncts [ i ] == null ) { if ( other . floatWeightFuncts [ i ] != null ) return false ; } else { if ( other . floatWeightFuncts [ i ] == null ) return false ; if ( ! floatWeightFuncts [ i ] . equals ( other . floatWeightFuncts [ i ] ) ) return false ; } } } return featureEquals ( other ) ; }
determine whether two feature definitions are equal , regarding both the actual feature definitions and the weights . the comparison of weights will succeed if both have no weights or if both have exactly the same weights
