⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 table.java

📁 用applet实现很多应用小程序
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * Set the data value of the given row and field as an
     * <code>int</code>.
     * @param row the table row to set
     * @param col the column number of the data field to set
     * @param val the value to set
     * @see #canSetInt(String)
     */
    public final void setInt(int row, int col, int val) {
        row = getColumnRow(row, col);
        getColumn(col).setInt(val, row);
    }
    
    // --------------------------------------------------------------
    
    /**
     * Check if the given data field can return primitive <code>long</code>
     * values.
     * @param field the data field to check
     * @return true if the data field can return primitive <code>long</code>
     * values, false otherwise. If true, the {@link #getLong(int, String)}
     * method can be used safely.
     */
    public final boolean canGetLong(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetLong() );
    }
    
    /**
     * Check if the <code>setLong</code> method can safely be used for the
     * given data field.
     * @param field the data field to check
     * @return true if the {@link #setLong(int, String, long)} method can
     * safely be used for the given field, false otherwise.
     */
    public final boolean canSetLong(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canSetLong() );
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>long</code>.
     * @param row the table row to retrieve
     * @param field the data field to retrieve
     * @see #canGetLong(String)
     */
    public final long getLong(int row, String field) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        return getColumn(col).getLong(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>long</code>.
     * @param row the table row to set
     * @param field the data field to set
     * @param val the value to set
     * @see #canSetLong(String)
     */
    public final void setLong(int row, String field, long val) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        getColumn(col).setLong(val, row);
    }

    /**
     * Get the data value at the given row and field as an
     * <code>long</code>.
     * @param row the table row to retrieve
     * @param col the column number of the data field to retrieve
     * @see #canGetLong(String)
     */
    public final long getLong(int row, int col)  {
        row = getColumnRow(row, col);
        return getColumn(col).getLong(row);
    }
    
    /**
     * Set the data value of the given row and field as an
     * <code>long</code>.
     * @param row the table row to set
     * @param col the column number of the data field to set
     * @param val the value to set
     * @see #canSetLong(String)
     */
    public final void setLong(int row, int col, long val) {
        row = getColumnRow(row, col);
        getColumn(col).setLong(val, row);
    }
    
    // --------------------------------------------------------------
    
    /**
     * Check if the given data field can return primitive <code>float</code>
     * values.
     * @param field the data field to check
     * @return true if the data field can return primitive <code>float</code>
     * values, false otherwise. If true, the {@link #getFloat(int, String)}
     * method can be used safely.
     */
    public final boolean canGetFloat(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetFloat() );
    }
    
    /**
     * Check if the <code>setFloat</code> method can safely be used for the
     * given data field.
     * @param field the data field to check
     * @return true if the {@link #setFloat(int, String, float)} method can
     * safely be used for the given field, false otherwise.
     */
    public final boolean canSetFloat(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canSetFloat() );
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>float</code>.
     * @param row the table row to retrieve
     * @param field the data field to retrieve
     * @see #canGetFloat(String)
     */
    public final float getFloat(int row, String field) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        return getColumn(col).getFloat(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>float</code>.
     * @param row the table row to set
     * @param field the data field to set
     * @param val the value to set
     * @see #canSetFloat(String)
     */
    public final void setFloat(int row, String field, float val) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        getColumn(col).setFloat(val, row);   
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>float</code>.
     * @param row the table row to retrieve
     * @param col the column number of the data field to get
     * @see #canGetFloat(String)
     */
    public final float getFloat(int row, int col) {
        row = getColumnRow(row, col);
        return getColumn(col).getFloat(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>float</code>.
     * @param row the table row to set
     * @param col the column number of the data field to set
     * @param val the value to set
     * @see #canSetFloat(String)
     */
    public final void setFloat(int row, int col, float val) {
        row = getColumnRow(row, col);
        getColumn(col).setFloat(val, row);   
    }
    
    // --------------------------------------------------------------
    
    /**
     * Check if the given data field can return primitive <code>double</code>
     * values.
     * @param field the data field to check
     * @return true if the data field can return primitive <code>double</code>
     * values, false otherwise. If true, the {@link #getDouble(int, String)}
     * method can be used safely.
     */
    public final boolean canGetDouble(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetDouble() );
    }
    
    /**
     * Check if the <code>setDouble</code> method can safely be used for the
     * given data field.
     * @param field the data field to check
     * @return true if the {@link #setDouble(int, String, double)} method can
     * safely be used for the given field, false otherwise.
     */
    public final boolean canSetDouble(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canSetDouble() );
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>double</code>.
     * @param row the table row to retrieve
     * @param field the data field to retrieve
     * @see #canGetDouble(String)
     */
    public final double getDouble(int row, String field) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        return getColumn(col).getDouble(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>double</code>.
     * @param row the table row to set
     * @param field the data field to set
     * @param val the value to set
     * @see #canSetDouble(String)
     */
    public final void setDouble(int row, String field, double val) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        getColumn(col).setDouble(val, row);
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>double</code>.
     * @param row the table row to retrieve
     * @param col the column number of the data field to get
     * @see #canGetDouble(String)
     */
    public final double getDouble(int row, int col) {
        row = getColumnRow(row, col);
        return getColumn(col).getDouble(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>double</code>.
     * @param row the table row to set
     * @param col the column number of the data field to set
     * @param val the value to set
     * @see #canSetDouble(String)
     */
    public final void setDouble(int row, int col, double val) {
        row = getColumnRow(row, col);
        getColumn(col).setDouble(val, row);
    }

    // --------------------------------------------------------------
    
    /**
     * Check if the given data field can return primitive <code>boolean</code>
     * values.
     * @param field the data field to check
     * @return true if the data field can return primitive <code>boolean</code>
     * values, false otherwise. If true, the {@link #getBoolean(int, String)}
     * method can be used safely.
     */
    public final boolean canGetBoolean(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetBoolean() );
    }
    
    /**
     * Check if the <code>setBoolean</code> method can safely be used for the
     * given data field.
     * @param field the data field to check
     * @return true if the {@link #setBoolean(int, String, boolean)} method can
     * safely be used for the given field, false otherwise.
     */
    public final boolean canSetBoolean(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canSetBoolean() );
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>boolean</code>.
     * @param row the table row to retrieve
     * @param field the data field to retrieve
     * @see #canGetBoolean(String)
     */
    public final boolean getBoolean(int row, String field) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        return getColumn(col).getBoolean(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>boolean</code>.
     * @param row the table row to set
     * @param field the data field to set
     * @param val the value to set
     * @see #canSetBoolean(String)
     */
    public final void setBoolean(int row, String field, boolean val) {
        int col = getColumnNumber(field);
        row = getColumnRow(row, col);
        getColumn(col).setBoolean(val, row);
    }
    
    /**
     * Get the data value at the given row and field as a
     * <code>boolean</code>.
     * @param row the table row to retrieve
     * @param col the column number of the data field to get
     * @see #canGetBoolean(String)
     */
    public final boolean getBoolean(int row, int col) {
        row = getColumnRow(row, col);
        return getColumn(col).getBoolean(row);
    }
    
    /**
     * Set the data value of the given row and field as a
     * <code>boolean</code>.
     * @param row the table row to set
     * @param col the column number of the data field to set
     * @param val the value to set
     * @see #canSetBoolean(String)
     */
    public final void setBoolean(int row, int col, boolean val) {
        row = getColumnRow(row, col);
        getColumn(col).setBoolean(val, row);
    }
    
    // --------------------------------------------------------------
    
    /**
     * Check if the given data field can return primitive <code>String</code>
     * values.
     * @param field the data field to check
     * @return true if the data field can return primitive <code>String</code>
     * values, false otherwise. If true, the {@link #getString(int, String)}
     * method can be used safely.
     */
    public final boolean canGetString(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetString() );
    }
    
    /**
     * Check if the <code>setString</code> method can safely be used for the
     * given data field.
     * @param field the data field to check
     * @return true if the {@link #setString(int, String, String)} method can
     * safely be used for the given field, false otherwise.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -