/** * 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 { BaseField field = new ShortField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
/** * Initialize class fields. */ public void init(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { super.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * Set this field to the maximum or minimum value. * @param iAreaDesc END_SELECT_KEY means set to largest value, others mean smallest. */ public void setToLimit(int iAreaDesc) // Set this field to the largest or smallest value { // By default compare as ASCII strings Short tempshort = MIN; // Lowest value if (iAreaDesc == DBConstants.END_SELECT_KEY) tempshort = MAX; // Highest value this.doSetData(tempshort, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); } /**
/** * Move the physical binary data to this SQL parameter row. * @param statement The SQL prepare statement. * @param iType the type of SQL statement. * @param iParamColumn The column in the prepared statement to set the data. * @exception SQLException From SQL calls. */ public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException { if (this.isNull()) { if ((this.isNullable()) && (iType != DBConstants.SQL_SELECT_TYPE)) statement.setNull(iParamColumn, Types.INTEGER); else statement.setInt(iParamColumn, NAN); } else statement.setShort(iParamColumn, (short)this.getValue()); } /**
/** * Compare field to this and return < > or = (-,+,0). * @return The compare value. */ public int compareTo(Field field) { if (field instanceof BaseField) if (!this.isSameType((BaseField)field)) return super.compareTo(field); short short1 = Short.MIN_VALUE, short2 = Short.MAX_VALUE; Short tempShort = (Short)this.getData(); // Get the physical data if (tempShort != null) short1 = tempShort.shortValue(); tempShort = (Short)field.getData(); // Get the physical data if (tempShort != null) short2 = tempShort.shortValue(); if (short1 == short2) return 0; if (short1 < short2) return -1; else return 1; } /**
/** * Get the Value of this field as a double. * @return The value of this field. */ public double getValue() { // Get this field's value Short shortField = (Short)this.getData(); // Get the physical data if (shortField == null) return 0; return (double)shortField.shortValue(); } /*
/** * Move the physical binary data to this SQL parameter row. * @param statement The SQL prepare statement. * @param iType the type of SQL statement. * @param iParamColumn The column in the prepared statement to set the data. * @exception SQLException From SQL calls. */ public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException { if (this.isNull()) { if ((this.isNullable()) && (iType != DBConstants.SQL_SELECT_TYPE)) statement.setNull(iParamColumn, Types.INTEGER); else statement.setInt(iParamColumn, NAN); } else statement.setShort(iParamColumn, (short)this.getValue()); } /**
/** * Compare field to this and return < > or = (-,+,0). * @return The compare value. */ public int compareTo(Field field) { if (field instanceof BaseField) if (!this.isSameType((BaseField)field)) return super.compareTo(field); short short1 = Short.MIN_VALUE, short2 = Short.MAX_VALUE; Short tempShort = (Short)this.getData(); // Get the physical data if (tempShort != null) short1 = tempShort.shortValue(); tempShort = (Short)field.getData(); // Get the physical data if (tempShort != null) short2 = tempShort.shortValue(); if (short1 == short2) return 0; if (short1 < short2) return -1; else return 1; } /**
/** * Get the Value of this field as a double. * @return The value of this field. */ public double getValue() { // Get this field's value Short shortField = (Short)this.getData(); // Get the physical data if (shortField == null) return 0; return (double)shortField.shortValue(); } /*
/** * 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 { BaseField field = new ShortField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
/** * Initialize class fields. */ public void init(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { super.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * Move the physical binary data to this SQL parameter row. * @param statement The SQL prepare statement. * @param iType the type of SQL statement. * @param iParamColumn The column in the prepared statement to set the data. * @exception SQLException From SQL calls. */ public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException { if (this.isNull()) { if ((this.isNullable()) && (iType != DBConstants.SQL_SELECT_TYPE)) statement.setNull(iParamColumn, Types.INTEGER); else statement.setInt(iParamColumn, NAN); } else statement.setShort(iParamColumn, (short)this.getValue()); } /**
/** * Compare field to this and return < > or = (-,+,0). * @return The compare value. */ public int compareTo(Field field) { if (field instanceof BaseField) if (!this.isSameType((BaseField)field)) return super.compareTo(field); short short1 = Short.MIN_VALUE, short2 = Short.MAX_VALUE; Short tempShort = (Short)this.getData(); // Get the physical data if (tempShort != null) short1 = tempShort.shortValue(); tempShort = (Short)field.getData(); // Get the physical data if (tempShort != null) short2 = tempShort.shortValue(); if (short1 == short2) return 0; if (short1 < short2) return -1; else return 1; } /**
/** * Get the Value of this field as a double. * @return The value of this field. */ public double getValue() { // Get this field's value Short shortField = (Short)this.getData(); // Get the physical data if (shortField == null) return 0; return (double)shortField.shortValue(); } /*
/** * Set this field to the maximum or minimum value. * @param iAreaDesc END_SELECT_KEY means set to largest value, others mean smallest. */ public void setToLimit(int iAreaDesc) // Set this field to the largest or smallest value { // By default compare as ASCII strings Short tempshort = MIN; // Lowest value if (iAreaDesc == DBConstants.END_SELECT_KEY) tempshort = MAX; // Highest value this.doSetData(tempshort, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); } /**
/** * 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 { BaseField field = new ShortField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
/** * Initialize class fields. */ public void init(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { super.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * Write the physical data in this field to a stream file. * @param daOut Output stream to add this field to. * @param bFixedLength If false (default) be sure to get the length from the stream. * @return boolean Success? */ public boolean write(DataOutputStream daOut, boolean bFixedLength) { try { Short shData = (Short)this.getData(); short sData; if (shData == null) sData = NAN; else sData = shData.shortValue(); daOut.writeShort(sData); return true; } catch (IOException ex) { ex.printStackTrace(); return false; } } /**
/** * Set this field to the maximum or minimum value. * @param iAreaDesc END_SELECT_KEY means set to largest value, others mean smallest. */ public void setToLimit(int iAreaDesc) // Set this field to the largest or smallest value { // By default compare as ASCII strings Short tempshort = MIN; // Lowest value if (iAreaDesc == DBConstants.END_SELECT_KEY) tempshort = MAX; // Highest value this.doSetData(tempshort, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); } /**
field = new ShortField(this, BK_SUB_SCREEN, 2, null, new Short((short)0)); if (iFieldSeq == 1) field = new IntegerField(this, BK_HDR_CUR_BK, 6, null, null); if (iFieldSeq == 2) field = new ShortField(this, OLD_PAX, 2, null, null); if (iFieldSeq == 3) field = new ShortField(this, OLD_SINGLE, 2, null, null); if (iFieldSeq == 4) field = new ShortField(this, OLD_DOUBLE, 2, null, null); if (iFieldSeq == 5) field = new ShortField(this, OLD_TRIPLE, 2, null, null); if (iFieldSeq == 6) field = new ShortField(this, OLD_QUAD, 2, null, null); if (iFieldSeq == 7) field = new IntegerField(this, OLD_TOUR_NO, 6, null, null); field = new StringField(this, OLD_TOUR_STATUS, 2, null, null); if (iFieldSeq == 9) field = new ShortField(this, OLD_ACTION_TYPE, 2, null, null); if (iFieldSeq == 10) field = new DateField(this, OLD_ACTION_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 11) field = new ShortField(this, OLD_MIN_TO_OP, 2, null, null); if (iFieldSeq == 12) field = new DoubleField(this, OLD_BK_NET_PRICE, 10, null, null); field = new DoubleField(this, BK_SAVE_QUAD_COST, 10, null, null); if (iFieldSeq == 18) field = new ShortField(this, OLD_FOC, 2, null, null);