protected override IEnumerable <long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { if (myIndex is ISonesRangeIndex) { //use the range funtionality foreach (var aVertexID in ((ISonesRangeIndex)myIndex).GreaterThan(myIComparable, true)) { yield return(aVertexID); } } else { //stupid, but works foreach (var aVertexIDSet in myIndex.Keys().Where(key => key.CompareTo(myIComparable) >= 0).Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return(aVertexID); } } } yield break; }
/// <summary> /// Extract the values corresponding to the range /// </summary> /// <param name="myIndex">The interesting index</param> /// <param name="myConstant">The inderesting range</param> /// <returns>An enumerable of vertexIDs</returns> private IEnumerable <long> GetValues(ISonesIndex myIndex, RangeLiteralExpression myConstant) { if (myIndex is ISonesRangeIndex) { //use the range funtionality foreach (var aVertexID in ((ISonesRangeIndex)myIndex) .Between(myConstant.Lower, myConstant.Upper, myConstant.IncludeBorders, myConstant.IncludeBorders)) { yield return(aVertexID); } } else { //stupid, but works if (myConstant.IncludeBorders) { foreach (var aVertexIDSet in myIndex.Keys() .Where(key => (key.CompareTo(myConstant.Lower) >= 0) && (key.CompareTo(myConstant.Upper) <= 0)) .Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return(aVertexID); } } } else { foreach (var aVertexIDSet in myIndex.Keys() .Where(key => (key.CompareTo(myConstant.Lower) > 0) && (key.CompareTo(myConstant.Upper) < 0)) .Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return(aVertexID); } } } } yield break; }
protected override IEnumerable <long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { foreach (var aVertexIDSet in myIndex.Keys().Where(key => key.CompareTo(myIComparable) != 0).Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return(aVertexID); } } yield break; }
protected override IEnumerable <long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { var regexpression = new Regex((String)myIComparable); List <long> ids = new List <long>(); foreach (var key in myIndex.Keys()) { if (regexpression.IsMatch((String)key)) { ids.AddRange(myIndex[key]); } } return(ids); }
/// <summary> /// Extract the values corresponding to the range /// </summary> /// <param name="myIndex">The interesting index</param> /// <param name="myConstant">The inderesting range</param> /// <returns>An enumerable of vertexIDs</returns> private IEnumerable<long> GetValues(ISonesIndex myIndex, RangeLiteralExpression myConstant) { if (myIndex is ISonesRangeIndex) { //use the range funtionality foreach (var aVertexID in ((ISonesRangeIndex)myIndex) .Between(myConstant.Lower, myConstant.Upper, myConstant.IncludeBorders, myConstant.IncludeBorders)) { yield return aVertexID; } } else { //stupid, but works if (myConstant.IncludeBorders) { foreach (var aVertexIDSet in myIndex.Keys() .Where(key => (key.CompareTo(myConstant.Lower) >= 0) && (key.CompareTo(myConstant.Upper) <= 0)) .Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return aVertexID; } } } else { foreach (var aVertexIDSet in myIndex.Keys() .Where(key => (key.CompareTo(myConstant.Lower) > 0) && (key.CompareTo(myConstant.Upper) < 0)) .Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return aVertexID; } } } } yield break; }
protected override IEnumerable<long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { if (myIndex is ISonesRangeIndex) { //use the range funtionality foreach (var aVertexID in ((ISonesRangeIndex)myIndex).LowerThan(myIComparable, true)) { yield return aVertexID; } } else { //stupid, but works foreach (var aVertexIDSet in myIndex.Keys().Where(key => key.CompareTo(myIComparable) <= 0).Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return aVertexID; } } } yield break; }
protected override IEnumerable<long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { var regexpression = new Regex((String)myIComparable); List<long> ids = new List<long>(); foreach (var key in myIndex.Keys()) { if (regexpression.IsMatch((String)key)) { ids.AddRange(myIndex[key]); } } return ids; }
protected override IEnumerable<long> GetValues(ISonesIndex myIndex, IComparable myIComparable) { foreach (var aVertexIDSet in myIndex.Keys().Where(key => key.CompareTo(myIComparable) != 0).Select(key => myIndex[key])) { foreach (var aVertexID in aVertexIDSet) { yield return aVertexID; } } yield break; }