Long.getLong

Long.getLong

Class Overview | Class Members | This Package | All Packages

Syntax 1
public static Long getLong( String nm )
Parameters
nm
property name.
Returns
the Long value of the property.
Description
Determines the long value of the system property with the specified name.

The first argument is treated as the name of a system property. System properties are accessible through getProperty and , a method defined by the System class. The string value of this property is then interpreted as a long value and a Long object representing this value is returned. Details of possible numeric formats can be found with the definition of getProperty.

If there is no property with the specified name, or if the property does not have the correct numeric format, then null is returned.

See Also
getProperty, getProperty



Syntax 2
public static Long getLong( String nm, long val )
Parameters
nm
property name.
val
default value.
Returns
the Long value of the property.
Description
Determines the long value of the system property with the specified name.

The first argument is treated as the name of a system property. System properties are accessible through getProperty and , a method defined by the System class. The string value of this property is then interpreted as a long value and a Long object representing this value is returned. Details of possible numeric formats can be found with the definition of getProperty.

If there is no property with the specified name, or if the property does not have the correct numeric format, then a Long object that represents the value of the second argument is returned.

See Also
getProperty, getProperty



Syntax 3
public static Long getLong( String nm, Long val )
Parameters
nm
the property name.
val
the default Long value.
Returns
the long value of the property.
Description
Determines the long value of the system property with the specified name.

The first argument is treated as the name of a system property. System properties are accessible through getProperty and , a method defined by the System class. The string value of this property is then interpreted as a long value and a Long object representing this value is returned.

If the property value begins with "0x" or "#", not followed by a minus sign, the rest of it is parsed as a hexadecimal integer exactly as for the method Long.valueOf with radix 16.

If the property value begins with "0", then it is parsed as an octal integer exactly as for the method Long.valueOf with radix 8.

Otherwise the property value is parsed as a decimal integer exactly as for the method Long.valueOf with radix 10.

Note that, in every case, neither L nor l is permitted to appear at the end of the string.

The second argument is the default value. If there is no property of the specified name, or if the property does not have the correct numeric format, then the second argument is returned.

See Also
valueOf, getProperty, getProperty