/** * For binary fields, return the current state. * Gets the state of the target bit. * @param True is this field is true. */ public boolean getState() { if (this.getData() == null) return m_bTrueIfNull; int fieldValue = (int)this.getValue(); boolean returnValue = false; if ((fieldValue & (1 << m_iBitNumber)) != 0) returnValue = true; if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch) { this(); this.init(converter, iBitNumber, trueIfMatch, false); } /**
/** * For binary fields, set the current state. * Sets the target bit to the state. * @param state The state to set this field. * @param bDisplayOption Display changed fields if true. * @param iMoveMode The move mode. * @return The error code (or NORMAL_RETURN). */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { int iFieldValue = (int)this.getValue(); if (!m_bTrueIfMatch) bState = !bState; // Do opposite operation if (bState) iFieldValue |= (1 << m_iBitNumber); // Set the bit else iFieldValue &= ~(1 << m_iBitNumber); // Clear the bit return this.setValue(iFieldValue, bDisplayOption, iMoveMode); } /**
dayConverter = new FieldDescConverter(dayConverter, strWeek.substring(0, 1)); int sBitPosition = this.getBitDayOfWeek(calendar); dayConverter = new BitConverter(dayConverter, sBitPosition, false, true); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = dayConverter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc);
dayConverter = new FieldDescConverter(dayConverter, strWeek.substring(0, 1)); int sBitPosition = this.getBitDayOfWeek(calendar); dayConverter = new BitConverter(dayConverter, sBitPosition, false, true); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = dayConverter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc);
dayConverter = new BitConverter(dayConverter, sBitPosition, false, true); ScreenLoc location = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = dayConverter.setupDefaultView(location, targetScreen, ScreenConstants.DISPLAY_FIELD_DESC);
/** * For binary fields, set the current state. * Sets the target bit to the state. * @param state The state to set this field. * @param bDisplayOption Display changed fields if true. * @param iMoveMode The move mode. * @return The error code (or NORMAL_RETURN). */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { int iFieldValue = (int)this.getValue(); if (!m_bTrueIfMatch) bState = !bState; // Do opposite operation if (bState) iFieldValue |= (1 << m_iBitNumber); // Set the bit else iFieldValue &= ~(1 << m_iBitNumber); // Clear the bit return this.setValue(iFieldValue, bDisplayOption, iMoveMode); } /**
/** * For binary fields, return the current state. * Gets the state of the target bit. * @param True is this field is true. */ public boolean getState() { if (this.getData() == null) return m_bTrueIfNull; int fieldValue = (int)this.getValue(); boolean returnValue = false; if ((fieldValue & (1 << m_iBitNumber)) != 0) returnValue = true; if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch, boolean bTrueIfNull) { this(); this.init(converter, iBitNumber, trueIfMatch, bTrueIfNull); } /**
dayConverter = new BitConverter(dayConverter, sBitPosition, false, true); ScreenLoc location = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = dayConverter.setupDefaultView(location, targetScreen, ScreenConstants.DISPLAY_FIELD_DESC);
/** * For binary fields, set the current state. * Sets the target bit to the state. * @param state The state to set this field. * @param bDisplayOption Display changed fields if true. * @param iMoveMode The move mode. * @return The error code (or NORMAL_RETURN). */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { int iFieldValue = (int)this.getValue(); if (!m_bTrueIfMatch) bState = !bState; // Do opposite operation if (bState) iFieldValue |= (1 << m_iBitNumber); // Set the bit else iFieldValue &= ~(1 << m_iBitNumber); // Clear the bit return this.setValue(iFieldValue, bDisplayOption, iMoveMode); } /**
/** * For binary fields, return the current state. * Gets the state of the target bit. * @param True is this field is true. */ public boolean getState() { if (this.getData() == null) return m_bTrueIfNull; int fieldValue = (int)this.getValue(); boolean returnValue = false; if ((fieldValue & (1 << m_iBitNumber)) != 0) returnValue = true; if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch) { this(); this.init(converter, iBitNumber, trueIfMatch, false); } /**
int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = dayConverter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc);
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch, boolean bTrueIfNull) { this(); this.init(converter, iBitNumber, trueIfMatch, bTrueIfNull); } /**
int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = (ScreenField)dayConverter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc);
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch) { this(); this.init(converter, iBitNumber, trueIfMatch, false); } /**
int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST_CHECKBOX, ScreenConstants.DONT_SET_ANCHOR); screenField = (ScreenField)dayConverter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc);
/** * Constructor. * @param converter The field to set the bit in (Should be a NumberField). * @param iBitNumber The bit number to set with this converter (0 = L.O. bit). * @param trueIfMatch Return true if this bit is on (if this variable is true). */ public BitConverter(Converter converter, int iBitNumber, boolean trueIfMatch, boolean bTrueIfNull) { this(); this.init(converter, iBitNumber, trueIfMatch, bTrueIfNull); } /**