Class NumberStream

java.lang.Object
java.lang.Number
com.stuypulse.stuylib.streams.numbers.NumberStream
All Implemented Interfaces:
IStream, Serializable, DoubleSupplier

public class NumberStream extends Number implements IStream
A number which reads from a streams.

Useful for filtering streams (including SmartNumbers) and converting them back into Numbers.

See Also:
  • Constructor Details

    • NumberStream

      public NumberStream(IStream stream)
      Create a number stream given a stream
      Parameters:
      stream - IStream to return through number classes
  • Method Details

    • get

      public double get()
      Specified by:
      get in interface IStream
      Returns:
      value from stream
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
      Returns:
      value from stream
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
      Returns:
      value from stream as float
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
      Returns:
      value from stream as integer
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
      Returns:
      value from stream as long