/// <summary>
 /// Visits the tree node
 /// </summary>
 /// <param name="node">The tree node of type T</param>
 public override void Visit(T node)
 {
     if (_featureExtractor.HasFeature(node))
     {
         object value = _featureExtractor.ExtractValue(node);
         this._values.Add(value);
     }
 }
Exemple #2
0
 /// <summary>
 /// Visits the tree node
 /// </summary>
 /// <param name="node">The tree node</param>
 public override void Visit(T node)
 {
     if (_featureExtractor.HasFeature(node))
     {
         var featureValue = _featureExtractor.ExtractValue(node);
         var feature      = new TreeNodeFeature(_featureName, featureValue);
         node.AddFeature(feature);
     }
 }
Exemple #3
0
        /// <summary>
        /// Whether the tree node matches the filter
        /// </summary>
        /// <param name="node">The tree node of type T</param>
        /// <returns>
        /// true, if the node matches, otherwise false
        /// </returns>
        protected override bool AcceptNode(T node)
        {
            if (!_valueExtractor.HasFeature(node))
            {
                return(false);
            }

            object value = _valueExtractor.ExtractValue(node);

            return(value.Equals(_comparisonValue));
        }
Exemple #4
0
        /// <summary>
        /// The accept node implementation
        /// </summary>
        /// <param name="node">The tree node</param>
        /// <returns>
        /// true, if the node matches, otherwise false
        /// </returns>
        protected override bool AcceptNode(T node)
        {
            if (!_featureValueExtractor.HasFeature(node))
            {
                return(false);
            }

            object  featureValue = _featureValueExtractor.ExtractValue(node);
            decimal decimalValue = Convert.ToDecimal(featureValue);

            return(ComparisonFunc(decimalValue, _threshold));
        }
 /// <summary>
 /// The visit implementation
 /// </summary>
 /// <param name="node">The tree node</param>
 public override void Visit(T node)
 {
     if (_featureValueExtractor.HasFeature(node))
     {
         this.FoundValue = true;
         object  featureValue = _featureValueExtractor.ExtractValue(node);
         decimal decimalValue = Convert.ToDecimal(featureValue);
         if (decimalValue > Maximum)
         {
             this.Maximum = decimalValue;
         }
     }
 }