- java.lang.Object
-
- java.lang.Enum<Alignment>
-
- de.ibapl.jnhw.common.memory.layout.Alignment
-
- All Implemented Interfaces:
Serializable,Comparable<Alignment>
public enum Alignment extends Enum<Alignment>
- Author:
- aploese
-
-
Field Summary
Fields Modifier and Type Field Description static Alignment__ALIGN_OF_DOUBLEstatic Alignment__ALIGN_OF_FLOATstatic Alignment__ALIGN_OF_INT16_Tstatic Alignment__ALIGN_OF_INT32_Tstatic Alignment__ALIGN_OF_INT64_Tstatic Alignment__ALIGN_OF_INT8_Tstatic Alignment__ALIGN_OF_INTPTR_Tstatic Alignment__ALIGN_OF_LONGstatic Alignment__ALIGN_OF_LONG_DOUBLEstatic Alignment__ALIGN_OF_POINTERstatic Alignment__ALIGN_OF_STRUCT_DOUBLEstatic Alignment__ALIGN_OF_STRUCT_FLOATstatic Alignment__ALIGN_OF_STRUCT_INT16_Tstatic Alignment__ALIGN_OF_STRUCT_INT32_Tstatic Alignment__ALIGN_OF_STRUCT_INT64_Tstatic Alignment__ALIGN_OF_STRUCT_INT8_Tstatic Alignment__ALIGN_OF_STRUCT_INTPTR_Tstatic Alignment__ALIGN_OF_STRUCT_LONGstatic Alignment__ALIGN_OF_STRUCT_LONG_DOUBLEstatic Alignment__ALIGN_OF_STRUCT_POINTERstatic Alignment__BIGGEST_ALIGNMENT__intalignof
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AlignmentcalcElementAlignmentInStruct(Alignment structAlignment, Alignment dataTypeAlignment)calculate the alignment of a field in a structure - the smalles alignment wins.longdoAlignment(long unaligned)AT_X enumn members will override this, it is basically an unsigned fivision by zero so there ip potential to optimize..static AlignmentfromAlignof(int alignof)static Alignmentmax(Alignment a1, Alignment a2)static Alignmentmin(Alignment a1, Alignment a2)static AlignmentvalueOf(String name)Returns the enum constant of this type with the specified name.static Alignment[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Field Detail
-
alignof
public final int alignof
-
__ALIGN_OF_LONG
public static final Alignment __ALIGN_OF_LONG
-
__ALIGN_OF_STRUCT_LONG
public static final Alignment __ALIGN_OF_STRUCT_LONG
-
__ALIGN_OF_POINTER
public static final Alignment __ALIGN_OF_POINTER
-
__ALIGN_OF_STRUCT_POINTER
public static final Alignment __ALIGN_OF_STRUCT_POINTER
-
__ALIGN_OF_INT8_T
public static final Alignment __ALIGN_OF_INT8_T
-
__ALIGN_OF_STRUCT_INT8_T
public static final Alignment __ALIGN_OF_STRUCT_INT8_T
-
__ALIGN_OF_INT16_T
public static final Alignment __ALIGN_OF_INT16_T
-
__ALIGN_OF_STRUCT_INT16_T
public static final Alignment __ALIGN_OF_STRUCT_INT16_T
-
__ALIGN_OF_INT32_T
public static final Alignment __ALIGN_OF_INT32_T
-
__ALIGN_OF_STRUCT_INT32_T
public static final Alignment __ALIGN_OF_STRUCT_INT32_T
-
__ALIGN_OF_INT64_T
public static final Alignment __ALIGN_OF_INT64_T
-
__ALIGN_OF_STRUCT_INT64_T
public static final Alignment __ALIGN_OF_STRUCT_INT64_T
-
__ALIGN_OF_INTPTR_T
public static final Alignment __ALIGN_OF_INTPTR_T
-
__ALIGN_OF_STRUCT_INTPTR_T
public static final Alignment __ALIGN_OF_STRUCT_INTPTR_T
-
__ALIGN_OF_FLOAT
public static final Alignment __ALIGN_OF_FLOAT
-
__ALIGN_OF_STRUCT_FLOAT
public static final Alignment __ALIGN_OF_STRUCT_FLOAT
-
__ALIGN_OF_DOUBLE
public static final Alignment __ALIGN_OF_DOUBLE
-
__ALIGN_OF_STRUCT_DOUBLE
public static final Alignment __ALIGN_OF_STRUCT_DOUBLE
-
__ALIGN_OF_LONG_DOUBLE
public static final Alignment __ALIGN_OF_LONG_DOUBLE
-
__ALIGN_OF_STRUCT_LONG_DOUBLE
public static final Alignment __ALIGN_OF_STRUCT_LONG_DOUBLE
-
-
Method Detail
-
values
public static Alignment[] 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 (Alignment c : Alignment.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Alignment 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 nameNullPointerException- if the argument is null
-
doAlignment
public long doAlignment(long unaligned)
AT_X enumn members will override this, it is basically an unsigned fivision by zero so there ip potential to optimize..- Parameters:
unaligned-- Returns:
-
fromAlignof
public static Alignment fromAlignof(int alignof)
-
-