Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public static java.util.stream.DoubleStream toDoubleStream(Object list)
        public static DoubleStream ToDoubleStream(object list)
        {
            if (list == null)
            {
                return(DoubleStream.empty());
            }
            else if (list is SequenceValue)
            {
                throw new System.ArgumentException("Need to implement support for SequenceValue in CompiledConversionUtils.toDoubleStream");
            }
            else if (list is System.Collections.IList)
            {
                return(((System.Collections.IList)list).Select(n => (( Number )n).doubleValue()));
            }
            else if (list.GetType().IsAssignableFrom(typeof(object[])))
            {
                return(java.util.( object[] )list.Select(n => (( Number )n).doubleValue()));
            }
            else if (list is float[])
            {
                float[] array = ( float[] )list;
                return(IntStream.range(0, array.Length).mapToDouble(i => array[i]));
            }
            else if (list is double[])
            {
                return(DoubleStream.of(( double[] )list));
            }
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            throw new System.ArgumentException(format("Can not be converted to stream: %s", list.GetType().FullName));
        }
 public LocalDateDoubleTimeSeries mapValues(System.Func <double, double> mapper)
 {
     ArgChecker.notNull(mapper, "mapper");
     return(createUnsafe(dates_Renamed, DoubleStream.of(values_Renamed).map(mapper).toArray()));
 }
 public DoubleStream values()
 {
     return(DoubleStream.of(values_Renamed));
 }
 public virtual void test_of_stream()
 {
     assertContent(DoubleArray.of(DoubleStream.empty()));
     assertContent(DoubleArray.of(DoubleStream.of(1d, 2d, 3d)), 1d, 2d, 3d);
 }