org.apache.hive.common.util
Enum HiveStringUtils.TraditionalBinaryPrefix

java.lang.Object
  extended by java.lang.Enum<HiveStringUtils.TraditionalBinaryPrefix>
      extended by org.apache.hive.common.util.HiveStringUtils.TraditionalBinaryPrefix
All Implemented Interfaces:
Serializable, Comparable<HiveStringUtils.TraditionalBinaryPrefix>
Enclosing class:
HiveStringUtils

public static enum HiveStringUtils.TraditionalBinaryPrefix
extends Enum<HiveStringUtils.TraditionalBinaryPrefix>

The traditional binary prefixes, kilo, mega, ..., exa, which can be represented by a 64-bit integer. TraditionalBinaryPrefix symbol are case insensitive.


Enum Constant Summary
EXA
           
GIGA
           
KILO
           
MEGA
           
PETA
           
TERA
           
 
Field Summary
 char symbol
           
 long value
           
 
Method Summary
static long string2long(String s)
          Convert a string to long.
static HiveStringUtils.TraditionalBinaryPrefix valueOf(char symbol)
           
static HiveStringUtils.TraditionalBinaryPrefix valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HiveStringUtils.TraditionalBinaryPrefix[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

KILO

public static final HiveStringUtils.TraditionalBinaryPrefix KILO

MEGA

public static final HiveStringUtils.TraditionalBinaryPrefix MEGA

GIGA

public static final HiveStringUtils.TraditionalBinaryPrefix GIGA

TERA

public static final HiveStringUtils.TraditionalBinaryPrefix TERA

PETA

public static final HiveStringUtils.TraditionalBinaryPrefix PETA

EXA

public static final HiveStringUtils.TraditionalBinaryPrefix EXA
Field Detail

value

public final long value

symbol

public final char symbol
Method Detail

values

public static HiveStringUtils.TraditionalBinaryPrefix[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HiveStringUtils.TraditionalBinaryPrefix c : HiveStringUtils.TraditionalBinaryPrefix.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HiveStringUtils.TraditionalBinaryPrefix valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

valueOf

public static HiveStringUtils.TraditionalBinaryPrefix valueOf(char symbol)
Returns:
The TraditionalBinaryPrefix object corresponding to the symbol.

string2long

public static long string2long(String s)
Convert a string to long. The input string is first be trimmed and then it is parsed with traditional binary prefix. For example, "-1230k" will be converted to -1230 * 1024 = -1259520; "891g" will be converted to 891 * 1024^3 = 956703965184;

Parameters:
s - input string
Returns:
a long value represented by the input string.


Copyright © 2013 The Apache Software Foundation