/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { ExtractRangeFilter listener = new ExtractRangeFilter(); listener.init(null, m_iStartFieldSeq, m_fldStart, m_iEndFieldSeq, m_fldEnd, m_iPadfldEnd); return listener; } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshal the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { int iStartFieldSeq = daIn.readInt(); int iEndFieldSeq = daIn.readInt(); BaseField fldStart = this.readField(daIn, (BaseField)m_fldStart); BaseField fldEnd = this.readField(daIn, (BaseField)m_fldEnd); int iPadfldEnd = daIn.readInt(); this.init(null, iStartFieldSeq, fldStart, iEndFieldSeq, fldEnd, iPadfldEnd); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave (if there is a slave)
/** * Create a popup control using this record. */ public ScreenComponent createTourHeaderPopup(ScreenLoc itsLocation, ComponentParent parentScreen, Converter converter, int iDisplayFieldDesc, BaseField fldDepartureDate, BaseField fldStartDate, BaseField fldEndDate, BaseField fldTourType) { Date dateTarget = new Date(); long ltargetDate = (long)dateTarget.getTime(); if ((long)fldDepartureDate.getValue() != 0) if ((long)fldDepartureDate.getValue() < ltargetDate) ltargetDate = (long)fldDepartureDate.getValue(); fldStartDate.setValue(ltargetDate); Calendar nextYear = Calendar.getInstance(); nextYear.add(Calendar.YEAR, 1); nextYear.set(Calendar.HOUR_OF_DAY, 0); nextYear.set(Calendar.MINUTE, 0); nextYear.set(Calendar.SECOND, 0); nextYear.set(Calendar.MILLISECOND, 0); ltargetDate = nextYear.getTime().getTime(); fldEndDate.setValue(Math.max(ltargetDate, (long)fldDepartureDate.getValue())); FileListener fileBehavior = new ExtractRangeFilter(TourHeader.START_DATE, fldStartDate, TourHeader.END_DATE, fldEndDate, ExtractRangeFilter.PAD_DEFAULT); this.addListener(fileBehavior); this.setKeyArea(TourHeader.DESC_SORT_KEY); ScreenComponent screenField = BaseField.createScreenComponent(ScreenModel.POPUP_BOX, itsLocation, parentScreen, converter, iDisplayFieldDesc, null); this.removeListener(fileBehavior, true); return screenField; } /**
/** * Constructor. * @param iFieldSeq The field in this record to compare to the range. * @param fldStart The range starts at this field's value. * @param iPadfldEnd Should I pad the end string field with high characters? */ public ExtractRangeFilter(String startFieldName, BaseField fldStart, int iPadfldEnd) { this(); this.init(null, startFieldName, fldStart, null, null, iPadfldEnd); } /**
bDontSkip2 = this.fieldCompare(this.getOwner().getField(m_iEndFieldSeq), m_fldStart, GREATER_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList); BaseField pfldHigh = m_fldEnd; if (m_iPadfldEnd != DONT_PAD_END_FIELD) bDontSkip = this.fieldCompare(this.getOwner().getField(m_iStartFieldSeq), pfldHigh, LESS_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList); if (m_iPadfldEnd != DONT_PAD_END_FIELD)
/** * Create a popup control using this record. */ public ScreenComponent createTourHeaderPopup(ScreenLoc itsLocation, ComponentParent parentScreen, Converter converter, int iDisplayFieldDesc, BaseField fldDepartureDate, BaseField fldStartDate, BaseField fldEndDate, BaseField fldTourType) { Date dateTarget = new Date(); long ltargetDate = (long)dateTarget.getTime(); if ((long)fldDepartureDate.getValue() != 0) if ((long)fldDepartureDate.getValue() < ltargetDate) ltargetDate = (long)fldDepartureDate.getValue(); fldStartDate.setValue(ltargetDate); Calendar nextYear = Calendar.getInstance(); nextYear.add(Calendar.YEAR, 1); nextYear.set(Calendar.HOUR_OF_DAY, 0); nextYear.set(Calendar.MINUTE, 0); nextYear.set(Calendar.SECOND, 0); nextYear.set(Calendar.MILLISECOND, 0); ltargetDate = nextYear.getTime().getTime(); fldEndDate.setValue(Math.max(ltargetDate, (long)fldDepartureDate.getValue())); FileListener fileBehavior = new ExtractRangeFilter(TourHeader.START_DATE, fldStartDate, TourHeader.END_DATE, fldEndDate, ExtractRangeFilter.PAD_DEFAULT); this.addListener(fileBehavior); this.setKeyArea(TourHeader.DESC_SORT_KEY); ScreenComponent screenField = BaseField.createScreenComponent(ScreenModel.POPUP_BOX, itsLocation, parentScreen, converter, iDisplayFieldDesc, null); this.removeListener(fileBehavior, true); return screenField; } /**
/** * Constructor (using the default pad). * @param iFieldSeq The field in this record to compare to the range. * @param fldStart The range starts at this field's value. */ public ExtractRangeFilter(int iFieldSeq, BaseField fldStart) { this(); this.init(null, iFieldSeq, fldStart, -1, null, PAD_DEFAULT); } /**
bDontSkip2 = this.fieldCompare(this.getOwner().getField(m_iEndFieldSeq), m_fldStart, GREATER_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList); BaseField pfldHigh = m_fldEnd; if (m_iPadfldEnd != DONT_PAD_END_FIELD) bDontSkip = this.fieldCompare(this.getOwner().getField(m_iStartFieldSeq), pfldHigh, LESS_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList); if (m_iPadfldEnd != DONT_PAD_END_FIELD)
/** * Add behaviors to this session. */ public void addListeners() { super.addListeners(); this.getMainRecord().addListener(new ExtractRangeFilter(Product.DESC_SORT, this.getScreenRecord().getField(ProductScreenRecord.DESCRIPTION))); } /**
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { ExtractRangeFilter listener = new ExtractRangeFilter(); listener.init(null, m_iStartFieldSeq, m_fldStart, m_iEndFieldSeq, m_fldEnd, m_iPadfldEnd); return listener; } /**
/** * Constructor (using the default pad). * @param iFieldSeq The field in this record to compare to the range. * @param fldStart The range starts at this field's value. */ public ExtractRangeFilter(String startFieldName, BaseField fldStart) { this(); this.init(null, startFieldName, fldStart, null, null, PAD_DEFAULT); } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshal the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { int iStartFieldSeq = daIn.readInt(); int iEndFieldSeq = daIn.readInt(); BaseField fldStart = this.readField(daIn, (BaseField)m_fldStart); BaseField fldEnd = this.readField(daIn, (BaseField)m_fldEnd); int iPadfldEnd = daIn.readInt(); this.init(null, iStartFieldSeq, fldStart, iEndFieldSeq, fldEnd, iPadfldEnd); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
if (!m_fldStart.isNull()) BaseField endField = this.getOwner().getField(endFieldName); bDontSkip2 = this.fieldCompare(endField, m_fldStart, GREATER_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList); if (!m_fldEnd.isNull()) BaseField startField = this.getOwner().getField(startFieldName); bDontSkip = this.fieldCompare(startField, pfldHigh, LESS_THAN_EQUAL, strbFilter, bIncludeFileName, vParamList);
this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave (if there is a slave)
/** * Add behaviors to this session. */ public void addListeners() { super.addListeners(); this.getMainRecord().addListener(new ExtractRangeFilter(Product.DESC_SORT, this.getScreenRecord().getField(ProductScreenRecord.DESCRIPTION))); } /**
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { ExtractRangeFilter listener = new ExtractRangeFilter(); listener.init(null, startFieldName, m_fldStart, endFieldName, m_fldEnd, m_iPadfldEnd); return listener; } /**
/** * Constructor. * @param iFieldSeq The field in this record to compare to the range. * @param fldStart The range starts at this field's value. * @param iPadfldEnd Should I pad the end string field with high characters? */ public ExtractRangeFilter(int iFieldSeq, BaseField fldStart, int iPadfldEnd) { this(); this.init(null, iFieldSeq, fldStart, -1, null, iPadfldEnd); } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshal the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { String startFieldName = daIn.readUTF(); if (ProxyConstants.NULL.equals(startFieldName)) startFieldName = null; String endFieldName = daIn.readUTF(); if (ProxyConstants.NULL.equals(endFieldName)) endFieldName = null; BaseField fldStart = this.readField(daIn, (BaseField)m_fldStart); BaseField fldEnd = this.readField(daIn, (BaseField)m_fldEnd); int iPadfldEnd = daIn.readInt(); this.init(null, startFieldName, fldStart, endFieldName, fldEnd, iPadfldEnd); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave (if there is a slave)