类的用途
java.lang.Long
使用 Long 的包
包
描述
提供对 Java 编程语言的设计至关重要的类。
定义通道,它表示与能够执行 I/O 操作的实体的连接,例如文件和套接字;定义选择器,用于多路复用、非阻塞 I/O 操作。
用于除默认 ISO 之外的日历系统的通用 API。
提供类来打印和解析日期和时间。
使用字段和单位以及日期时间调整器访问日期和时间。
包含集合框架、一些国际化支持类、服务加载器、属性、随机数生成、字符串解析和扫描类、base64 编码和解码、位数组和几个杂项实用程序类。
支持对元素流进行函数式操作的类,例如对集合的 map-reduce 转换。
提供开放数据类型和 Open MBean 描述符类。
提供 Timer MBean 的定义。
孵化功能。 将在未来的版本中删除。
-
Long 在 java.lang 中的用法
修饰符和类型方法描述static Long
将String
解码为Long
。static Long
确定具有指定名称的系统属性的long
值。static Long
确定具有指定名称的系统属性的long
值。static Long
返回具有指定名称的系统属性的long
值。Long.resolveConstantDesc
(MethodHandles.Lookup lookup) 将此实例解析为ConstantDesc
,其结果是实例本身。static Long
Long.valueOf
(long l) 返回代表指定long
值的Long
实例。static Long
返回一个Long
对象,其中包含指定的String
的值。static Long
返回一个Long
对象,其中包含在使用第二个参数给出的基数进行解析时从指定的String
中提取的值。 -
Long 在 java.nio.channels 中的用法
java.nio.channels 中的方法参数,类型参数为 Long修饰符和类型方法描述abstract <A> void
AsynchronousSocketChannel.read
(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) 从此通道读取字节序列到给定缓冲区的子序列中。abstract <A> void
AsynchronousSocketChannel.write
(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) 从给定缓冲区的子序列中将字节序列写入此通道。 -
Long 在 java.time.chrono 中的用法
java.time.chrono 中的方法参数,类型参数为 Long修饰符和类型方法描述AbstractChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) 在解析期间将已解析的ChronoField
值解析为日期。Chronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) 在解析期间将已解析的ChronoField
值解析为日期。HijrahChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) IsoChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) 在解析期间将已解析的ChronoField
值解析为日期。JapaneseChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) MinguoChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) ThaiBuddhistChronology.resolveDate
(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) -
Long 在 java.time.format 中的用法
java.time.format 中的方法参数,类型参数为 Long修饰符和类型方法描述DateTimeFormatterBuilder.appendText
(TemporalField field, Map<Long, String> textLookup) 使用指定的map将日期时间字段的文本附加到格式化程序以提供文本。 -
Long 在 java.time.temporal 中的用法
java.time.temporal 中的方法参数,类型参数为 Long修饰符和类型方法描述default TemporalAccessor
TemporalField.resolve
(Map<TemporalField, Long> fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) 解决此字段以提供更简单的替代或日期。 -
Long 在 java.util 中的用法
修饰符和类型方法描述default void
PrimitiveIterator.OfLong.forEachRemaining
(Consumer<? super Long> action) 对每个剩余元素执行给定的操作,直到处理完所有元素或操作引发异常。default void
Spliterator.OfLong.forEachRemaining
(Consumer<? super Long> action) 在当前线程中按顺序对每个剩余元素执行给定操作,直到处理完所有元素或操作引发异常。default boolean
Spliterator.OfLong.tryAdvance
(Consumer<? super Long> action) 如果存在剩余元素,则对其执行给定的操作,返回true
;否则返回false
。 -
Long 在 java.util.stream 中的用法
返回类型中包含 Long 类型参数的 java.util.stream 中的方法修饰符和类型方法描述LongStream.boxed()
返回一个Stream
由该流的元素组成,每个元素装箱到一个Long
。Collectors.counting()
返回一个Collector
接受类型为T
的元素,它计算输入元素的数量。Collectors.summingLong
(ToLongFunction<? super T> mapper) 返回一个Collector
,它产生应用于输入元素的长值函数的总和。 -
Long 在 javax.management.openmbean 中的用法
javax.management.openmbean 中具有 Long 类型参数的字段修饰符和类型Field描述static final SimpleType<Long>
SimpleType.LONG
SimpleType
实例描述其 Java 类名为java.lang.Long
的值。 -
Long 在 javax.management.timer 中的用法
javax.management.timer 中返回 Long 的方法 -
Long 在 jdk.incubator.vector 中的用法
jdk.incubator.vector 中具有 Long 类型参数的字段修饰符和类型Field描述static final VectorOperators.Conversion<Byte,
Long> VectorOperators.B2L
将byteVal
转换为(long)byteVal
。static final VectorOperators.Conversion<Double,
Long> VectorOperators.D2L
将doubleVal
转换为(long)doubleVal
。static final VectorOperators.Conversion<Float,
Long> VectorOperators.F2L
将floatVal
转换为(long)floatVal
。static final VectorOperators.Conversion<Integer,
Long> VectorOperators.I2L
将intVal
转换为(long)intVal
。static final VectorOperators.Conversion<Long,
Byte> VectorOperators.L2B
将longVal
转换为(byte)longVal
。static final VectorOperators.Conversion<Long,
Double> VectorOperators.L2D
将longVal
转换为(double)longVal
。static final VectorOperators.Conversion<Long,
Float> VectorOperators.L2F
将longVal
转换为(float)longVal
。static final VectorOperators.Conversion<Long,
Integer> VectorOperators.L2I
将longVal
转换为(int)longVal
。static final VectorOperators.Conversion<Long,
Short> VectorOperators.L2S
将longVal
转换为(short)longVal
。static final VectorOperators.Conversion<Double,
Long> VectorOperators.REINTERPRET_D2L
将doubleVal
的位重新解释为long
。static final VectorOperators.Conversion<Long,
Double> VectorOperators.REINTERPRET_L2D
将longVal
的位重新解释为double
。static final VectorOperators.Conversion<Short,
Long> VectorOperators.S2L
将shortVal
转换为(long)shortVal
。static final VectorSpecies<Long>
LongVector.SPECIES_128
代表LongVector
的VectorShape.S_128_BIT
的物种。static final VectorSpecies<Long>
LongVector.SPECIES_256
代表VectorShape.S_256_BIT
的LongVector
的物种。static final VectorSpecies<Long>
LongVector.SPECIES_512
代表LongVector
的VectorShape.S_512_BIT
的物种。static final VectorSpecies<Long>
LongVector.SPECIES_64
代表LongVector
的VectorShape.S_64_BIT
的物种。static final VectorSpecies<Long>
LongVector.SPECIES_MAX
代表LongVector
的VectorShape.S_Max_BIT
的物种。static final VectorSpecies<Long>
LongVector.SPECIES_PREFERRED
LongVector
s 的首选物种。static final VectorOperators.Conversion<Byte,
Long> VectorOperators.ZERO_EXTEND_B2L
零扩展byteVal
到long
。static final VectorOperators.Conversion<Integer,
Long> VectorOperators.ZERO_EXTEND_I2L
零扩展intVal
到long
。static final VectorOperators.Conversion<Short,
Long> VectorOperators.ZERO_EXTEND_S2L
零扩展shortVal
到long
。返回类型中包含 Long 类型参数的 jdk.incubator.vector 中的方法修饰符和类型方法描述abstract VectorMask<Long>
LongVector.compare
(VectorOperators.Comparison op, long e) 根据给定的比较操作,通过将它与输入标量进行比较来测试该向量。final VectorMask<Long>
LongVector.compare
(VectorOperators.Comparison op, long e, VectorMask<Long> m) 根据给定的比较操作,在掩码选择的通道中,通过将其与输入标量进行比较来测试该向量。abstract VectorMask<Long>
LongVector.compare
(VectorOperators.Comparison op, Vector<Long> v) 根据给定的比较操作,通过将此向量与另一个输入向量进行比较来测试此向量。final VectorMask<Long>
LongVector.eq
(long e) 测试此向量是否等于输入标量。final VectorMask<Long>
测试此向量是否等于另一个输入向量。final VectorMask<Long>
LongVector.lt
(long e) 测试此向量是否小于输入标量。final VectorMask<Long>
测试此向量是否小于另一个输入向量。abstract VectorMask<Long>
LongVector.test
(VectorOperators.Test op) 根据给定的操作测试此向量的通道。abstract VectorMask<Long>
LongVector.test
(VectorOperators.Test op, VectorMask<Long> m) 根据给定的操作,测试该向量的选定通道。jdk.incubator.vector 中的方法参数,类型参数为 Long修饰符和类型方法描述final LongVector
LongVector.add
(long e, VectorMask<Long> m) 将此向量添加到输入标量的广播中,选择由掩码控制的车道元素。final LongVector
将此向量添加到第二个输入向量。final LongVector
LongVector.add
(Vector<Long> v, VectorMask<Long> m) 将此向量添加到第二个输入向量,在掩码的控制下选择通道。final LongVector
LongVector.add
(Vector<Long> v, VectorMask<Long> m) 将此向量添加到第二个输入向量,在掩码的控制下选择通道。final LongVector
计算此向量和第二个输入向量的按位逻辑合取 (&
)。final LongVector
LongVector.bitwiseBlend
(long bits, Vector<Long> mask) 在另一个向量的控制下将向量和标量的位混合在一起,该向量提供掩码位。final LongVector
LongVector.bitwiseBlend
(Vector<Long> bits, long mask) 在提供掩码位的标量控制下将两个向量的位混合在一起。final LongVector
LongVector.bitwiseBlend
(Vector<Long> bits, Vector<Long> mask) 在第三个向量的控制下将两个向量的位混合在一起,第三个向量提供掩码位。final LongVector
LongVector.blend
(long e, VectorMask<Long> m) 在掩码控制下用标量值替换此向量的选定通道。abstract LongVector
LongVector.blend
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下,用来自第二个输入向量的相应车道替换此向量的选定车道。abstract LongVector
LongVector.blend
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下,用来自第二个输入向量的相应车道替换此向量的选定车道。static LongVector
LongVector.broadcast
(VectorSpecies<Long> species, long e) 返回给定物种的向量,其中所有车道元素都设置为原始值e
。final VectorMask<Long>
LongVector.compare
(VectorOperators.Comparison op, long e, VectorMask<Long> m) 根据给定的比较操作,在掩码选择的通道中,通过将其与输入标量进行比较来测试该向量。abstract VectorMask<Long>
LongVector.compare
(VectorOperators.Comparison op, Vector<Long> v) 根据给定的比较操作,通过将此向量与另一个输入向量进行比较来测试此向量。abstract LongVector
LongVector.compress
(VectorMask<Long> m) 在特定掩码的控制下压缩此矢量选择车道的车道元素。final LongVector
LongVector.div
(long e, VectorMask<Long> m) 将该向量除以输入标量的广播,选择由掩码控制的车道元素。final LongVector
将此向量除以第二个输入向量。final LongVector
LongVector.div
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下将此向量除以第二个输入向量。final LongVector
LongVector.div
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下将此向量除以第二个输入向量。final VectorMask<Long>
测试此向量是否等于另一个输入向量。abstract LongVector
LongVector.expand
(VectorMask<Long> m) 在特定掩码的控制下扩展此矢量的车道元素。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset) 从偏移量开始的long[]
类型数组加载向量。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset, int[] indexMap, int mapOffset) 使用通过将固定的offset
添加到 index map 的一系列辅助偏移量而获得的索引,收集由long[]
类型数组中的元素组成的新向量。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) 收集一个新向量,该向量由类型为long[]
的数组中的元素组成,在掩码的控制下,并使用通过将固定的offset
添加到来自 index map 的一系列辅助偏移量而获得的索引。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) 收集一个新向量,该向量由类型为long[]
的数组中的元素组成,在掩码的控制下,并使用通过将固定的offset
添加到来自 index map 的一系列辅助偏移量而获得的索引。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset, VectorMask<Long> m) 从long[]
类型的数组中加载向量,从偏移量开始并使用掩码。static LongVector
LongVector.fromArray
(VectorSpecies<Long> species, long[] a, int offset, VectorMask<Long> m) 从long[]
类型的数组中加载向量,从偏移量开始并使用掩码。static LongVector
LongVector.fromMemorySegment
(VectorSpecies<Long> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) static LongVector
LongVector.fromMemorySegment
(VectorSpecies<Long> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Long> m) static LongVector
LongVector.fromMemorySegment
(VectorSpecies<Long> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Long> m) final void
LongVector.intoArray
(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) 将此向量分散到类型为long[]
的数组中,在掩码的控制下,并使用通过将固定的offset
添加到来自 index map 的一系列辅助偏移量而获得的索引。final void
LongVector.intoArray
(long[] a, int offset, VectorMask<Long> m) 将此向量存储到long[]
类型的数组中,从偏移量开始并使用掩码。final void
LongVector.intoMemorySegment
(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Long> m) final LongVector
LongVector.lanewise
(VectorOperators.Binary op, long e, VectorMask<Long> m) 将此向量的车道值与广播标量的值相结合,并选择由掩码控制的车道元素。abstract LongVector
LongVector.lanewise
(VectorOperators.Binary op, Vector<Long> v) 将此向量的对应车道值与第二个输入向量的车道值相结合。abstract LongVector
LongVector.lanewise
(VectorOperators.Binary op, Vector<Long> v, VectorMask<Long> m) 将此向量的相应车道值与第二个输入向量的车道值相结合,并选择由掩码控制的车道元素。abstract LongVector
LongVector.lanewise
(VectorOperators.Binary op, Vector<Long> v, VectorMask<Long> m) 将此向量的相应车道值与第二个输入向量的车道值相结合,并选择由掩码控制的车道元素。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, long e1, long e2, VectorMask<Long> m) 将此向量的车道值与两个广播标量的值相结合,并选择由掩码控制的车道元素。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, long e1, Vector<Long> v2) 将此向量的车道值与另一个向量和广播标量的值组合。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, long e1, Vector<Long> v2, VectorMask<Long> m) 将此向量的车道值与另一个向量和广播标量的值相结合,并选择由掩码控制的车道元素。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, long e1, Vector<Long> v2, VectorMask<Long> m) 将此向量的车道值与另一个向量和广播标量的值相结合,并选择由掩码控制的车道元素。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, Vector<Long> v1, long e2) 将此向量的车道值与另一个向量和广播标量的值组合。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, Vector<Long> v1, long e2, VectorMask<Long> m) 将此向量的车道值与另一个向量和广播标量的值相结合,并选择由掩码控制的车道元素。final LongVector
LongVector.lanewise
(VectorOperators.Ternary op, Vector<Long> v1, long e2, VectorMask<Long> m) 将此向量的车道值与另一个向量和广播标量的值相结合,并选择由掩码控制的车道元素。abstract LongVector
将此向量的相应车道值与第二个和第三个输入向量的车道组合。abstract LongVector
LongVector.lanewise
(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) 将此向量的相应车道值与第二个和第三个输入向量的车道相结合,并选择由掩码控制的车道元素。abstract LongVector
LongVector.lanewise
(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) 将此向量的相应车道值与第二个和第三个输入向量的车道相结合,并选择由掩码控制的车道元素。abstract LongVector
LongVector.lanewise
(VectorOperators.Unary op, VectorMask<Long> m) 对该向量的车道值进行操作,选择由掩码控制的车道元素。final VectorMask<Long>
测试此向量是否小于另一个输入向量。final LongVector
计算此向量和第二个输入向量中的较大者。final LongVector
计算此向量和第二个输入向量中的较小者。final LongVector
LongVector.mul
(long e, VectorMask<Long> m) 将此向量乘以输入标量的广播,选择由掩码控制的车道元素。final LongVector
将此向量乘以第二个输入向量。final LongVector
LongVector.mul
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下将此向量乘以第二个输入向量。final LongVector
LongVector.mul
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下将此向量乘以第二个输入向量。final LongVector
计算此向量和第二个输入向量的按位逻辑析取 (|
)。abstract LongVector
LongVector.rearrange
(VectorShuffle<Long> m) 重新排列此向量的泳道元素,在特定洗牌的控制下选择泳道。abstract LongVector
LongVector.rearrange
(VectorShuffle<Long> s, Vector<Long> v) 重新排列两个向量的通道元素,在特定洗牌的控制下选择通道,使用洗牌中的正常和异常索引来引导数据。abstract LongVector
LongVector.rearrange
(VectorShuffle<Long> s, Vector<Long> v) 重新排列两个向量的通道元素,在特定洗牌的控制下选择通道,使用洗牌中的正常和异常索引来引导数据。abstract LongVector
LongVector.rearrange
(VectorShuffle<Long> s, VectorMask<Long> m) 重新排列此向量的泳道元素,在特定洗牌和遮罩的控制下选择泳道。abstract LongVector
LongVector.rearrange
(VectorShuffle<Long> s, VectorMask<Long> m) 重新排列此向量的泳道元素,在特定洗牌和遮罩的控制下选择泳道。abstract long
LongVector.reduceLanes
(VectorOperators.Associative op, VectorMask<Long> m) 返回从该向量的选定通道中累积的值,由掩码控制。abstract LongVector
LongVector.selectFrom
(Vector<Long> v) 使用存储在该向量通道中的索引值,组装存储在第二个向量v
中的值。abstract LongVector
LongVector.selectFrom
(Vector<Long> s, VectorMask<Long> m) 使用存储在该向量通道中的索引值,在掩码的控制下组装存储在第二个向量中的值。abstract LongVector
LongVector.selectFrom
(Vector<Long> s, VectorMask<Long> m) 使用存储在该向量通道中的索引值,在掩码的控制下组装存储在第二个向量中的值。abstract LongVector
从当前向量中的给定origin
车道开始,并继续(根据需要)进入紧随其后的向量,对相邻车道的一段进行切片。final LongVector
LongVector.slice
(int origin, Vector<Long> w, VectorMask<Long> m) 在掩码的控制下分割一段相邻的车道,从当前向量中给定的origin
车道开始,并继续(根据需要)进入紧随其后的向量。final LongVector
LongVector.slice
(int origin, Vector<Long> w, VectorMask<Long> m) 在掩码的控制下分割一段相邻的车道,从当前向量中给定的origin
车道开始,并继续(根据需要)进入紧随其后的向量。final LongVector
LongVector.sub
(long e, VectorMask<Long> m) 在掩码的控制下从该向量中减去输入标量。final LongVector
从该向量中减去第二个输入向量。final LongVector
LongVector.sub
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下从该向量中减去第二个输入向量。final LongVector
LongVector.sub
(Vector<Long> v, VectorMask<Long> m) 在掩码的控制下从该向量中减去第二个输入向量。abstract VectorMask<Long>
LongVector.test
(VectorOperators.Test op, VectorMask<Long> m) 根据给定的操作,测试该向量的选定通道。abstract LongVector
反转 slice() ,将当前向量作为切片插入另一个“背景”输入向量中,该向量被视为假设的后续slice()
操作的一个或另一个输入。abstract LongVector
LongVector.unslice
(int origin, Vector<Long> w, int part, VectorMask<Long> m) 反转 slice() ,将当前向量作为切片插入(在掩码的控制下)另一个“背景”输入向量中,该向量被视为假设的后续slice()
操作的一个或另一个输入。abstract LongVector
LongVector.unslice
(int origin, Vector<Long> w, int part, VectorMask<Long> m) 反转 slice() ,将当前向量作为切片插入(在掩码的控制下)另一个“背景”输入向量中,该向量被视为假设的后续slice()
操作的一个或另一个输入。static LongVector
LongVector.zero
(VectorSpecies<Long> species) 返回给定物种的向量,其中所有车道元素都设置为零,即默认原始值。