haXe API Documentation
Back | Index
extern class haxe.EnumFlags<T>
Available in flash8, neko, js, flash, php, cpp, cs, java
A typed interface for bit flags. This is not a real object, only a typed interface for an actual Int. Each flag can be tested/set with the corresponding enum value. Up to 32 flags can be stored that way.
inline function has(v : T) : Bool
Check if the bitflag has the corresponding enum set. This will be compiled as a single bit & mask != 0 in case the enum value is directly passed to the method.
inline function init() : Void
Initialize the bitflags (set it to 0)
inline function set(v : T) : Void
Set the bitflag for the corresponding enum value.
inline function toInt() : Int
Convert the typed bitflag into the corresponding int value (this is a no-op, it doesn't have any impact on speed).
inline function unset(v : T) : Void
Unset the bitflag for the corresponding enum value.
static inline function ofInt<T>(i : Int) : EnumFlags<T>
Convert a integer bitflag into a typed one (this is a no-op, it doesn't have any impact on speed).
Back | Index