Package org.apache.sysds.common

# Enum Class Types.ValueType

java.lang.Object
java.lang.Enum<Types.ValueType>
org.apache.sysds.common.Types.ValueType

All Implemented Interfaces:
  `Serializable`, `Comparable<Types.ValueType>`, `Constable`

Enclosing interface:
  Types

public static enum Types.ValueType extends Enum<Types.ValueType>
Value types (int, double, string, boolean, unknown).

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`BOOLEAN`
`CHARACTER`
`FP32`
`FP64`
`HASH32`
`HASH64`
`INT32`
`INT64`
`STRING`
`UINT4`
`UINT8`
`UNKNOWN`

## Method Summary

Modifier and Type
Method
Description
`static Types.ValueType`
`fromExternalString(String value)`
Parse an external string representation to the internal Enum ValueTypes supported.
`static Types.ValueType`
`getHighestCommonType(Types.ValueType a, Types.ValueType b)`
Get the highest common type that both ValueTypes can be contained in.
`static Types.ValueType`
`getHighestCommonTypeSafe(Types.ValueType a, Types.ValueType b)`
Get the highest common type, where if one inout is UNKNOWN return the other.
`boolean`
`isFP()`
`boolean`
`isNumeric()`
Get if the ValueType is a numeric value.
`boolean`
`isPseudoNumeric()`
If the value is pseudoNumeric, meaning that we can translate it to a number
`static boolean`
`isSameTypeString(Types.ValueType vt1, Types.ValueType vt2)`
Given two ValueTypes, would they both print and eternalize similarly.
`boolean`
`isUnknown()`
Helper method to detect Unknown ValueTypes.
`String`
`toExternalString()`
Convert the internal Enum to an externalizable String, the string indicate how the toString version of a value type acts.
`static Types.ValueType`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static Types.ValueType[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

### Methods inherited from class java.lang.Enum

`compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### UINT4

public static final Types.ValueType UINT4

### UINT8

public static final Types.ValueType UINT8

### FP32

public static final Types.ValueType FP32

### FP64

public static final Types.ValueType FP64

### INT32

public static final Types.ValueType INT32

### INT64

public static final Types.ValueType INT64

### BOOLEAN

public static final Types.ValueType BOOLEAN

### STRING

public static final Types.ValueType STRING

### UNKNOWN

public static final Types.ValueType UNKNOWN

### HASH64

public static final Types.ValueType HASH64

### HASH32

public static final Types.ValueType HASH32

### CHARACTER

public static final Types.ValueType CHARACTER

## Method Details

### values

public static Types.ValueType[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

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

### valueOf

public static Types.ValueType valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
  `NullPointerException` - if the argument is null

### isNumeric

public boolean isNumeric()
Get if the ValueType is a numeric value.

Returns:
  If it is numeric.

### isFP

public boolean isFP()

### isUnknown

public boolean isUnknown()
Helper method to detect Unknown ValueTypes.

Returns:
  If the valuetype is Unknown

### isPseudoNumeric

public boolean isPseudoNumeric()
If the value is pseudoNumeric, meaning that we can translate it to a number

Returns:
  If the number is indirectly numeric

### toExternalString

public String toExternalString()
Convert the internal Enum to an externalizable String, the string indicate how the toString version of a value type acts.

Returns:
  A capitalized string of the ValueType.

### fromExternalString

public static Types.ValueType fromExternalString(String value)
Parse an external string representation to the internal Enum ValueTypes supported.

Parameters:
  `value` - The String to parse
Returns:
  The internal Enum of the given string
Throws:
  `DMLRuntimeException` - In case the given string is unsupported or invalid.

### isSameTypeString

public static boolean isSameTypeString(Types.ValueType vt1, Types.ValueType vt2)
Given two ValueTypes, would they both print and eternalize similarly.

Parameters:
  `vt1` - The first ValueType to compare
  `vt2` - The second ValueType to compare
Returns:
  If they behave similarly.

### getHighestCommonTypeSafe

public static Types.ValueType getHighestCommonTypeSafe(Types.ValueType a, Types.ValueType b)
Get the highest common type, where if one inout is UNKNOWN return the other.

For instance:

Character and String returns String

INT32 and String returns String

INT32 and FP32 returns FP32

INT32 and INT64 returns INT64

Parameters:
  `a` - First value type to analyze
  `b` - Second Value type to analyze
Returns:
  The highest common value

### getHighestCommonType

public static Types.ValueType getHighestCommonType(Types.ValueType a, Types.ValueType b)
Get the highest common type that both ValueTypes can be contained in.

For instance:

Character and String returns String

INT32 and String returns String

INT32 and FP32 returns FP32

INT32 and INT64 returns INT64

Parameters:
  `a` - First ValueType
  `b` - Second ValueType
Returns:
  The common highest type to represent both
Throws:
  `DMLRuntimeException` - If any input is UNKNOWN.