/** * Get the Value of this field as a double. * For a boolean, return 0 for false 1 for true. * @return The value of this field. */ public double getValue() { // Get this field's value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField == null) return 0; boolean bValue = bField.booleanValue(); if (bValue == false) return 0; else return 1; } /**
/** * Get the Value of this field as a double. * For a boolean, return 0 for false 1 for true. * @return The value of this field. */ public double getValue() { // Get this field's value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField == null) return 0; boolean bValue = bField.booleanValue(); if (bValue == false) return 0; else return 1; } /**
/** * Get the Value of this field as a double. * For a boolean, return 0 for false 1 for true. * @return The value of this field. */ public double getValue() { // Get this field's value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField == null) return 0; boolean bValue = bField.booleanValue(); if (bValue == false) return 0; else return 1; } /**
/** * 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 { Boolean boData = (Boolean)this.getData(); boolean bData; if (boData == null) bData = Boolean.FALSE.booleanValue(); // HACK else bData = boData.booleanValue(); daOut.writeBoolean(bData); return true; } catch (IOException ex) { ex.printStackTrace(); return false; } } }
/** * 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 { Boolean boData = (Boolean)this.getData(); boolean bData; if (boData == null) bData = Boolean.FALSE.booleanValue(); // HACK else bData = boData.booleanValue(); daOut.writeBoolean(bData); return true; } catch (IOException ex) { ex.printStackTrace(); return false; } } }
/** * 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 { Boolean boData = (Boolean)this.getData(); boolean bData; if (boData == null) bData = Boolean.FALSE.booleanValue(); // HACK else bData = boData.booleanValue(); daOut.writeBoolean(bData); return true; } catch (IOException ex) { ex.printStackTrace(); return false; } } }
/** * Retrieve (in string format) from this field. * This method is used for SQL calls (ie., WHERE Id=5 AND Name="Don") * @return String the ' = "Don"' portion. * @param strSeekSign The sign in the comparison. * @param strCompare Use the current field values or plug in a '?' * @param bComparison true if this is a comparison, otherwise this is an assignment statement. */ public String getSQLFilter(String strSeekSign, String strCompare, boolean bComparison) { if (strCompare == null) { // Use the current field value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField != null) { boolean bValue = bField.booleanValue(); if (bValue == false) strCompare = SQLFALSE; else strCompare = SQLTRUE; } } return super.getSQLFilter(strSeekSign, strCompare, bComparison); } /**
/** * Retrieve (in string format) from this field. * This method is used for SQL calls (ie., WHERE Id=5 AND Name="Don") * @return String the ' = "Don"' portion. * @param strSeekSign The sign in the comparison. * @param strCompare Use the current field values or plug in a '?' * @param bComparison true if this is a comparison, otherwise this is an assignment statement. */ public String getSQLFilter(String strSeekSign, String strCompare, boolean bComparison) { if (strCompare == null) { // Use the current field value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField != null) { boolean bValue = bField.booleanValue(); if (bValue == false) strCompare = SQLFALSE; else strCompare = SQLTRUE; } } return super.getSQLFilter(strSeekSign, strCompare, bComparison); } /**
/** * Retrieve (in string format) from this field. * This method is used for SQL calls (ie., WHERE Id=5 AND Name="Don") * @return String the ' = "Don"' portion. * @param strSeekSign The sign in the comparison. * @param strCompare Use the current field values or plug in a '?' * @param bComparison true if this is a comparison, otherwise this is an assignment statement. */ public String getSQLFilter(String strSeekSign, String strCompare, boolean bComparison) { if (strCompare == null) { // Use the current field value Boolean bField = (Boolean)this.getData(); // Get the physical data if (bField != null) { boolean bValue = bField.booleanValue(); if (bValue == false) strCompare = SQLFALSE; else strCompare = SQLTRUE; } } return super.getSQLFilter(strSeekSign, strCompare, bComparison); } /**