类java.lang.Boolean源码实例Demo

下面列出了怎么用java.lang.Boolean的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码2 项目: dragonwell8_jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码3 项目: jdk8u60   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码4 项目: openjdk-jdk8u-backup   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码5 项目: Bytecoder   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码6 项目: openjdk-jdk9   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码7 项目: jdk8u-jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码8 项目: Java8CN   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码9 项目: hottub   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码10 项目: openjdk-8-source   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码11 项目: xDrip   文件: BgReadingMessage.java
public BgReadingMessage(Long timestamp, Double time_since_sensor_started, Double raw_data, Double filtered_data, Double age_adjusted_raw_value, Boolean calibration_flag, Double calculated_value, Double filtered_calculated_value, Double calculated_value_slope, Double a, Double b, Double c, Double ra, Double rb, Double rc, String uuid, String calibration_uuid, String sensor_uuid, Boolean ignoreforstats, Double raw_calculated, Boolean hide_slope, String noise, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.timestamp = timestamp;
  this.time_since_sensor_started = time_since_sensor_started;
  this.raw_data = raw_data;
  this.filtered_data = filtered_data;
  this.age_adjusted_raw_value = age_adjusted_raw_value;
  this.calibration_flag = calibration_flag;
  this.calculated_value = calculated_value;
  this.filtered_calculated_value = filtered_calculated_value;
  this.calculated_value_slope = calculated_value_slope;
  this.a = a;
  this.b = b;
  this.c = c;
  this.ra = ra;
  this.rb = rb;
  this.rc = rc;
  this.uuid = uuid;
  this.calibration_uuid = calibration_uuid;
  this.sensor_uuid = sensor_uuid;
  this.ignoreforstats = ignoreforstats;
  this.raw_calculated = raw_calculated;
  this.hide_slope = hide_slope;
  this.noise = noise;
}
 
源代码12 项目: xDrip   文件: BgReadingMessage.java
public BgReadingMessage(Long timestamp, Double time_since_sensor_started, Double raw_data, Double filtered_data, Double age_adjusted_raw_value, Boolean calibration_flag, Double calculated_value, Double filtered_calculated_value, Double calculated_value_slope, Double a, Double b, Double c, Double ra, Double rb, Double rc, String uuid, String calibration_uuid, String sensor_uuid, Boolean ignoreforstats, Double raw_calculated, Boolean hide_slope, String noise, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.timestamp = timestamp;
  this.time_since_sensor_started = time_since_sensor_started;
  this.raw_data = raw_data;
  this.filtered_data = filtered_data;
  this.age_adjusted_raw_value = age_adjusted_raw_value;
  this.calibration_flag = calibration_flag;
  this.calculated_value = calculated_value;
  this.filtered_calculated_value = filtered_calculated_value;
  this.calculated_value_slope = calculated_value_slope;
  this.a = a;
  this.b = b;
  this.c = c;
  this.ra = ra;
  this.rb = rb;
  this.rc = rc;
  this.uuid = uuid;
  this.calibration_uuid = calibration_uuid;
  this.sensor_uuid = sensor_uuid;
  this.ignoreforstats = ignoreforstats;
  this.raw_calculated = raw_calculated;
  this.hide_slope = hide_slope;
  this.noise = noise;
}
 
源代码13 项目: xDrip-plus   文件: BgReadingMessage.java
public BgReadingMessage(Long timestamp, Double time_since_sensor_started, Double raw_data, Double filtered_data, Double age_adjusted_raw_value, Boolean calibration_flag, Double calculated_value, Double filtered_calculated_value, Double calculated_value_slope, Double a, Double b, Double c, Double ra, Double rb, Double rc, String uuid, String calibration_uuid, String sensor_uuid, Boolean ignoreforstats, Double raw_calculated, Boolean hide_slope, String noise, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.timestamp = timestamp;
  this.time_since_sensor_started = time_since_sensor_started;
  this.raw_data = raw_data;
  this.filtered_data = filtered_data;
  this.age_adjusted_raw_value = age_adjusted_raw_value;
  this.calibration_flag = calibration_flag;
  this.calculated_value = calculated_value;
  this.filtered_calculated_value = filtered_calculated_value;
  this.calculated_value_slope = calculated_value_slope;
  this.a = a;
  this.b = b;
  this.c = c;
  this.ra = ra;
  this.rb = rb;
  this.rc = rc;
  this.uuid = uuid;
  this.calibration_uuid = calibration_uuid;
  this.sensor_uuid = sensor_uuid;
  this.ignoreforstats = ignoreforstats;
  this.raw_calculated = raw_calculated;
  this.hide_slope = hide_slope;
  this.noise = noise;
}
 
源代码14 项目: xDrip-plus   文件: BgReadingMessage.java
public BgReadingMessage(Long timestamp, Double time_since_sensor_started, Double raw_data, Double filtered_data, Double age_adjusted_raw_value, Boolean calibration_flag, Double calculated_value, Double filtered_calculated_value, Double calculated_value_slope, Double a, Double b, Double c, Double ra, Double rb, Double rc, String uuid, String calibration_uuid, String sensor_uuid, Boolean ignoreforstats, Double raw_calculated, Boolean hide_slope, String noise, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.timestamp = timestamp;
  this.time_since_sensor_started = time_since_sensor_started;
  this.raw_data = raw_data;
  this.filtered_data = filtered_data;
  this.age_adjusted_raw_value = age_adjusted_raw_value;
  this.calibration_flag = calibration_flag;
  this.calculated_value = calculated_value;
  this.filtered_calculated_value = filtered_calculated_value;
  this.calculated_value_slope = calculated_value_slope;
  this.a = a;
  this.b = b;
  this.c = c;
  this.ra = ra;
  this.rb = rb;
  this.rc = rc;
  this.uuid = uuid;
  this.calibration_uuid = calibration_uuid;
  this.sensor_uuid = sensor_uuid;
  this.ignoreforstats = ignoreforstats;
  this.raw_calculated = raw_calculated;
  this.hide_slope = hide_slope;
  this.noise = noise;
}
 
源代码15 项目: jdk8u-dev-jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码16 项目: jdk8u_jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a check box.
 *
 * @param checkBox  a <code>JCheckBox</code> object
 */
public DefaultCellEditor(final JCheckBox checkBox) {
    editorComponent = checkBox;
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            boolean selected = false;
            if (value instanceof Boolean) {
                selected = ((Boolean)value).booleanValue();
            }
            else if (value instanceof String) {
                selected = value.equals("true");
            }
            checkBox.setSelected(selected);
        }

        public Object getCellEditorValue() {
            return Boolean.valueOf(checkBox.isSelected());
        }
    };
    checkBox.addActionListener(delegate);
    checkBox.setRequestFocusEnabled(false);
}
 
源代码17 项目: jdk1.8-source-analysis   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
源代码18 项目: dragonwell8_jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsConstructor mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsConstructor object = new BoxedTypesMethodsConstructor(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码20 项目: TencentKona-8   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
源代码21 项目: sundrio   文件: WildcardRefBuilder.java
public WildcardRefBuilder(WildcardRef instance,Boolean validationEnabled){
        this.fluent = this; 
        this.withBoundKind(instance.getBoundKind()); 
        this.withBounds(instance.getBounds()); 
        this.withAttributes(instance.getAttributes()); 
        this.validationEnabled = validationEnabled; 
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsFactoryMethod mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsFactoryMethod object = BoxedTypesMethodsFactoryMethod.create(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码23 项目: openjdk-jdk8u   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsFactoryMethodIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsFactoryMethodIgnoreNull object = BoxedTypesMethodsFactoryMethodIgnoreNull.create(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码25 项目: netbeans   文件: AnnotationTypesNode.java
/** General setter */
private void setProperty(String property, Object value) {
    if (property.equals(AnnotationTypes.PROP_BACKGROUND_DRAWING))
        AnnotationTypes.getTypes().setBackgroundDrawing((Boolean)value);
    if (property.equals(AnnotationTypes.PROP_BACKGROUND_GLYPH_ALPHA))
        AnnotationTypes.getTypes().setBackgroundGlyphAlpha(((Integer)value).intValue());
    if (property.equals(AnnotationTypes.PROP_COMBINE_GLYPHS))
        AnnotationTypes.getTypes().setCombineGlyphs((Boolean)value);
    if (property.equals(AnnotationTypes.PROP_GLYPHS_OVER_LINE_NUMBERS))
        AnnotationTypes.getTypes().setGlyphsOverLineNumbers((Boolean)value);
    if (property.equals(AnnotationTypes.PROP_SHOW_GLYPH_GUTTER))
        AnnotationTypes.getTypes().setShowGlyphGutter((Boolean)value);
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsFactoryMethod mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsFactoryMethod object = BoxedTypesMethodsFactoryMethod.create(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码27 项目: monasca-thresh   文件: StatsdMetricConsumer.java
@SuppressWarnings("unchecked")
void parseConfig(Map<?, ?> conf) {
  if (conf.containsKey(Config.TOPOLOGY_NAME)) {
    topologyName = (String) conf.get(Config.TOPOLOGY_NAME);
  }

  if (conf.containsKey(STATSD_HOST)) {
    statsdHost = (String) conf.get(STATSD_HOST);
  }

  if (conf.containsKey(STATSD_PORT)) {
    statsdPort = ((Number) conf.get(STATSD_PORT)).intValue();
  }

  if (conf.containsKey(STATSD_DIMENSIONS)) {
    statsdDimensions = mapToJsonStr((Map<String, String>) conf
        .get(STATSD_DIMENSIONS));
    if (!isValidJSON(statsdDimensions)) {
      logger.error("Ignoring dimensions element invalid JSON ({})",
          new Object[] { statsdDimensions });
      // You get default dimensions
      statsdDimensions = monascaStatsdDimPrefix + defaultDimensions;
    }
    else {
      statsdDimensions = monascaStatsdDimPrefix + statsdDimensions;
    }
  }

  if (conf.containsKey(STATSD_WHITELIST)) {
    whiteList = (List<String>) conf.get(STATSD_WHITELIST);
  }

  if (conf.containsKey(STATSD_METRICMAP)) {
    metricMap = (Map<String, String>) conf.get(STATSD_METRICMAP);
  }

  if (conf.containsKey(STATSD_DEBUGMETRICS)) {
    debugMetrics = (Boolean) conf.get(STATSD_DEBUGMETRICS);
  }
}
 
源代码28 项目: Bytecoder   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox<?> comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
源代码29 项目: openjdk-jdk9   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox<?> comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
源代码30 项目: jdk8u-jdk   文件: DefaultCellEditor.java
/**
 * Constructs a <code>DefaultCellEditor</code> object that uses a
 * combo box.
 *
 * @param comboBox  a <code>JComboBox</code> object
 */
public DefaultCellEditor(final JComboBox comboBox) {
    editorComponent = comboBox;
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    delegate = new EditorDelegate() {
        public void setValue(Object value) {
            comboBox.setSelectedItem(value);
        }

        public Object getCellEditorValue() {
            return comboBox.getSelectedItem();
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            if (anEvent instanceof MouseEvent) {
                MouseEvent e = (MouseEvent)anEvent;
                return e.getID() != MouseEvent.MOUSE_DRAGGED;
            }
            return true;
        }
        public boolean stopCellEditing() {
            if (comboBox.isEditable()) {
                // Commit edited value.
                comboBox.actionPerformed(new ActionEvent(
                                 DefaultCellEditor.this, 0, ""));
            }
            return super.stopCellEditing();
        }
    };
    comboBox.addActionListener(delegate);
}
 
 类所在包
 类方法
 同包方法