org.jmythapi.protocol.response
Interface IFlagGroup<E extends Enum<E> & IFlag>

Type Parameters:
E - the enumeration constant describing all possible flags.
All Superinterfaces:
Cloneable, IGroup<E>, IVersionable
All Known Subinterfaces:
IProgramAudioProperties, IProgramFlags, IProgramRecordingDupInType, IProgramRecordingDupMethodType, IProgramSubtitleType, IProgramVideoProperties, IRemoteEncoderFlags, ISleepStatus
All Known Implementing Classes:
AFlagGroup, ProgramAudioProperties, ProgramFlags, ProgramRecordingDupInType, ProgramRecordingDupMethodType, ProgramSubtitleType, ProgramVideoProperties, RemoteEncoderFlags, SleepStatus

public interface IFlagGroup<E extends Enum<E> & IFlag>
extends IGroup<E>

A flag group.

This interface represents a flag group. The value of a flag group is a single integer value, which can be accessed using IGroup.longValue(). How this value can be interpreted, depends on the available flags of the flag group. Depending on the current protocol-version of the flag group, different flags may be available with different flag values.

In a flag group multiple flags can be active at the same time.

See IGroup.longValue() for the current value of the group.
See IGroup.getGroupClass() for the enum class defining all possible flags.
See getSupportedFlags() for all flags that are available for the current protocol version.
See getActiveFlags() for all currently active flags.

To test if a specific flag is currently active, isSet(Enum) can be used.

Usage Example:


    // a flag group
    IProgramFlags flags = recording.getProgramFlags();
    
    // testing if a flag is set
    boolean hasBookmark = flags.isSet(Flags.FL_BOOKMARK);
    if(hasBookmark) {
       // do something ...
    } 
  


Method Summary
 EnumSet<E> getActiveFlags()
          Gets all currently active flags of this group.
 EnumMap<E,Boolean> getFlagMap()
          Gets a map with all flags and their isSet status.
 EnumSet<E> getInactiveFlags()
          Gets all currently inactive flags of this group.
 EnumSet<E> getSupportedFlags()
          Gets all possible flags of this flag group.
 boolean isSet(E flag)
          Checks if the given flag is actually set.
 
Methods inherited from interface org.jmythapi.protocol.response.IGroup
getGroupClass, longValue
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 

Method Detail

getSupportedFlags

EnumSet<E> getSupportedFlags()
Gets all possible flags of this flag group.

Returns:
all possible flags

getActiveFlags

EnumSet<E> getActiveFlags()
Gets all currently active flags of this group.

Returns:
all active flags.

getInactiveFlags

EnumSet<E> getInactiveFlags()
Gets all currently inactive flags of this group.

Returns:
all inactive flags.

getFlagMap

EnumMap<E,Boolean> getFlagMap()
Gets a map with all flags and their isSet status.

Returns:
a map with all flags and boolean value indicating if a given flag is set.

isSet

boolean isSet(E flag)
Checks if the given flag is actually set.

Parameters:
flag - the flag to check
Returns:
true if the flag is currently set.


Copyright © 2008-2013. All Rights Reserved.