Example #1
0
        public static PrimitiveLongSet AsSet(PrimitiveLongSet set)
        {
            PrimitiveLongSet      result   = Primitive.LongSet(set.Size());
            PrimitiveLongIterator iterator = set.GetEnumerator();

            while (iterator.HasNext())
            {
                result.Add(iterator.Next());
            }
            return(result);
        }
Example #2
0
 /// <summary>
 /// Convert primitive set into a plain old java <seealso cref="System.Collections.Generic.ISet<object>"/>, boxing each long.
 /// </summary>
 /// <param name="set"> <seealso cref="PrimitiveLongSet"/> set of primitive values. </param>
 /// <returns> a <seealso cref="System.Collections.Generic.ISet<object>"/> containing all items. </returns>
 public static ISet <long> ToSet(PrimitiveLongSet set)
 {
     return(ToSet(set.GetEnumerator()));
 }