public final class PrimitiveType extends Object implements Type
Modifier and Type | Field and Description |
---|---|
private ProgramElementName |
arrayElementName |
private Literal |
defaultValue |
static PrimitiveType |
JAVA_BIGINT |
static PrimitiveType |
JAVA_BOOLEAN |
static PrimitiveType |
JAVA_BYTE |
static PrimitiveType |
JAVA_CHAR |
static PrimitiveType |
JAVA_DOUBLE |
static PrimitiveType |
JAVA_FLOAT |
static PrimitiveType |
JAVA_FREE_ADT |
static PrimitiveType |
JAVA_INT |
static PrimitiveType |
JAVA_LOCSET |
static PrimitiveType |
JAVA_LONG |
static PrimitiveType |
JAVA_MAP |
static PrimitiveType |
JAVA_REAL |
static PrimitiveType |
JAVA_SEQ |
static PrimitiveType |
JAVA_SHORT |
private static Map<Name,PrimitiveType> |
ldtMap |
private Name |
ldtName |
private String |
name |
static PrimitiveType |
PROGRAM_SV |
private static Map<String,PrimitiveType> |
typeMap |
Modifier | Constructor and Description |
---|---|
private |
PrimitiveType(String name,
Literal defaultValue,
Name ldtName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
ProgramElementName |
getArrayElementName()
Returns the specific name of this primitive type used
in array types.
|
Name |
getCorrespondingLDTName()
Gets the name of the LDT corresponding to this primitive type.
|
Literal |
getDefaultValue()
returns the default value of the given type
according to JLS ???4.5.5
ATTENTION: usually for byte and short this should be (byte) 0
(rsp.
|
String |
getFullName()
Returns the name of type.
|
String |
getName()
Returns the name of this type.
|
static PrimitiveType |
getPrimitiveType(String name) |
static PrimitiveType |
getPrimitiveTypeByLDT(Name ldtName) |
int |
hashCode() |
boolean |
isArithmeticType()
Returns true if this is an integer or floating point type.
|
boolean |
isIntegerType()
Returns whether this is a Java type which translates to int in DL.
|
String |
toString()
Returns the name of type.
|
private static final Map<String,PrimitiveType> typeMap
private static final Map<Name,PrimitiveType> ldtMap
public static final PrimitiveType JAVA_BYTE
public static final PrimitiveType JAVA_SHORT
public static final PrimitiveType JAVA_INT
public static final PrimitiveType JAVA_CHAR
public static final PrimitiveType JAVA_LONG
public static final PrimitiveType JAVA_BIGINT
public static final PrimitiveType JAVA_FLOAT
public static final PrimitiveType JAVA_DOUBLE
public static final PrimitiveType JAVA_REAL
public static final PrimitiveType JAVA_BOOLEAN
public static final PrimitiveType JAVA_LOCSET
public static final PrimitiveType JAVA_SEQ
public static final PrimitiveType JAVA_FREE_ADT
public static final PrimitiveType JAVA_MAP
public static final PrimitiveType PROGRAM_SV
private ProgramElementName arrayElementName
private final String name
private final Literal defaultValue
private final Name ldtName
public static PrimitiveType getPrimitiveType(String name)
public static PrimitiveType getPrimitiveTypeByLDT(Name ldtName)
public String getName()
getName
in interface NamedModelElement
public Literal getDefaultValue()
getDefaultValue
in interface Type
public String getFullName()
getFullName
in interface ProgramModelElement
public String toString()
public ProgramElementName getArrayElementName()
public boolean isIntegerType()
public boolean isArithmeticType()
public Name getCorrespondingLDTName()