Package kala.compress.harmony.unpack200
Class SegmentOptions
- java.lang.Object
-
- kala.compress.harmony.unpack200.SegmentOptions
-
public class SegmentOptions extends java.lang.ObjectStores the combinations of bit flags that can be used in the segment header options. Whilst this could be defined inSegment, it's cleaner to pull it out into a separate class, not least because methods can then be used to determine the semantic meaning of the flags. In languages with a pre-processor, these may be defined by macros that do bitflag manipulation instead.
-
-
Field Summary
Fields Modifier and Type Field Description private static intDEFLATE_HINTprivate static intHAVE_ALL_CODE_FLAGSprivate static intHAVE_CLASS_FLAGS_HIprivate static intHAVE_CODE_FLAGS_HIprivate static intHAVE_CP_NUMBERSprivate static intHAVE_FIELD_FLAGS_HIprivate static intHAVE_FILE_HEADERSprivate static intHAVE_FILE_MODTIMEprivate static intHAVE_FILE_OPTIONSprivate static intHAVE_FILE_SIZE_HIprivate static intHAVE_METHOD_FLAGS_HIprivate static intHAVE_SPECIAL_FORMATSprivate intoptionsprivate static intUNUSEDThe bit flags that are defined as unused by the specification; specifically, every bit above bit 13 and bit 3.
-
Constructor Summary
Constructors Constructor Description SegmentOptions(int options)Creates a new segment options with the given integer value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasAllCodeFlags()booleanhasArchiveFileCounts()booleanhasClassFlagsHi()booleanhasCodeFlagsHi()booleanhasCPNumberCounts()booleanhasFieldFlagsHi()booleanhasFileModtime()booleanhasFileOptions()booleanhasFileSizeHi()booleanhasMethodFlagsHi()booleanhasSpecialFormats()booleanshouldDeflate()
-
-
-
Field Detail
-
DEFLATE_HINT
private static final int DEFLATE_HINT
- See Also:
- Constant Field Values
-
HAVE_ALL_CODE_FLAGS
private static final int HAVE_ALL_CODE_FLAGS
- See Also:
- Constant Field Values
-
HAVE_CLASS_FLAGS_HI
private static final int HAVE_CLASS_FLAGS_HI
- See Also:
- Constant Field Values
-
HAVE_CODE_FLAGS_HI
private static final int HAVE_CODE_FLAGS_HI
- See Also:
- Constant Field Values
-
HAVE_CP_NUMBERS
private static final int HAVE_CP_NUMBERS
- See Also:
- Constant Field Values
-
HAVE_FIELD_FLAGS_HI
private static final int HAVE_FIELD_FLAGS_HI
- See Also:
- Constant Field Values
-
HAVE_FILE_HEADERS
private static final int HAVE_FILE_HEADERS
- See Also:
- Constant Field Values
-
HAVE_FILE_MODTIME
private static final int HAVE_FILE_MODTIME
- See Also:
- Constant Field Values
-
HAVE_FILE_OPTIONS
private static final int HAVE_FILE_OPTIONS
- See Also:
- Constant Field Values
-
HAVE_FILE_SIZE_HI
private static final int HAVE_FILE_SIZE_HI
- See Also:
- Constant Field Values
-
HAVE_METHOD_FLAGS_HI
private static final int HAVE_METHOD_FLAGS_HI
- See Also:
- Constant Field Values
-
HAVE_SPECIAL_FORMATS
private static final int HAVE_SPECIAL_FORMATS
- See Also:
- Constant Field Values
-
UNUSED
private static final int UNUSED
The bit flags that are defined as unused by the specification; specifically, every bit above bit 13 and bit 3.- See Also:
- Constant Field Values
-
options
private final int options
-
-
Constructor Detail
-
SegmentOptions
public SegmentOptions(int options) throws Pack200ExceptionCreates a new segment options with the given integer value.- Parameters:
options- the integer value to use as the flags- Throws:
Pack200Exception- if an unused bit (bit 3 or bit 13+) is non-zero
-
-
Method Detail
-
hasAllCodeFlags
public boolean hasAllCodeFlags()
-
hasArchiveFileCounts
public boolean hasArchiveFileCounts()
-
hasClassFlagsHi
public boolean hasClassFlagsHi()
-
hasCodeFlagsHi
public boolean hasCodeFlagsHi()
-
hasCPNumberCounts
public boolean hasCPNumberCounts()
-
hasFieldFlagsHi
public boolean hasFieldFlagsHi()
-
hasFileModtime
public boolean hasFileModtime()
-
hasFileOptions
public boolean hasFileOptions()
-
hasFileSizeHi
public boolean hasFileSizeHi()
-
hasMethodFlagsHi
public boolean hasMethodFlagsHi()
-
hasSpecialFormats
public boolean hasSpecialFormats()
-
shouldDeflate
public boolean shouldDeflate()
-
-