jPod PDF library

de.intarsys.pdf.pd
Class AbstractBitFlags

java.lang.Object
  extended by de.intarsys.pdf.pd.AbstractBitFlags
Direct Known Subclasses:
AcroFormFieldFlags, AcroFormSigFlags, AnnotationFlags, FontDescriptorFlags, OutlineItemFlags, PermissionFlags, SubmitFormFlags

public abstract class AbstractBitFlags
extends Object

AbstractBitFlags provides access to an integer containing bit wise flags.

The concrete value is either provided by an associated PDF object along with the access method to the value within the object or by an independent integer value itself.


Constructor Summary
AbstractBitFlags(COSBasedObject object, COSName field)
           
AbstractBitFlags(int value)
           
 
Method Summary
 int getValue()
          By implementing this method the subclass provides the integer which contains the bit flags.
 boolean isSetAnd(int bitMask)
          Checks if all the bits set in the bit mask are also set in the underlying integer.
 boolean isSetOr(int bitMask)
          Checks if one of the bits set in the bit mask are also set in the underlying integer.
 void set(int bitMask, boolean flag)
          All bits in the underlying integer masked by the bit mask are set acording to the flag.
 void setValue(int newValue)
          This method is used to write back the changes made to the bit flags.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBitFlags

public AbstractBitFlags(COSBasedObject object,
                        COSName field)

AbstractBitFlags

public AbstractBitFlags(int value)
Method Detail

getValue

public final int getValue()
By implementing this method the subclass provides the integer which contains the bit flags.

Returns:
the integer containing the bit flags.

isSetAnd

public boolean isSetAnd(int bitMask)
Checks if all the bits set in the bit mask are also set in the underlying integer. A clear bit == 0 and a set bit == 1.

Parameters:
bitMask - a integer containing the bit mask to test
Returns:
true if all bits in the mask are set in the underlying integer

isSetOr

public boolean isSetOr(int bitMask)
Checks if one of the bits set in the bit mask are also set in the underlying integer. A clear bit == 0 and a set bit == 1.

Parameters:
bitMask - a integer containing the bit mask
Returns:
true if one of the bits in the mask are set in the underlying integer

set

public void set(int bitMask,
                boolean flag)
All bits in the underlying integer masked by the bit mask are set acording to the flag. If the flag is true, the bits are set to 1 otherwise the bits are set to 0.

Parameters:
bitMask -
flag -

setValue

public final void setValue(int newValue)
This method is used to write back the changes made to the bit flags.

Parameters:
newValue - the whole integer containing all bit flags

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.