private static PredicateTable <TValue> CreatePredicateTable(Func <TValue, bool>[] predicates) { if (predicates == null || predicates.Length == 0) { throw new ArgumentException("No predicates provided."); } var table = new PredicateTable <TValue>(); for (int i = 0; i < predicates.Length; i++) { table.AddPredicate(i.ToString(), predicates[i]); } return(table); }
private static PredicateTable <TValue> CreateValuesPredicateTable(TValue[] values, IEqualityComparer <TValue> comparer = null) { if (values == null || values.Length == 0) { throw new ArgumentException("No values provided."); } if (comparer == null) { comparer = EqualityComparer <TValue> .Default; } var table = new PredicateTable <TValue>(); for (int i = 0; i < values.Length; i++) { table.AddCompare(i.ToString(), values[i], comparer); } return(table); }
public PredicateTable(PredicateTable <TValue> other) { _table = new Dictionary <string, PredicateEdgeBase <TValue> >(other._table); }
public ORegex(string pattern, ORegexOptions options, PredicateTable <TValue> table) { _fa = Compiler.Build(pattern, table, options); Options = options; Pattern = pattern; }
public ORegex(string pattern, PredicateTable <TValue> table) : this(pattern, ORegexOptions.None, table) { }