The King's Museum

ソフトウェアエンジニアのブログ。

2016-05-09から1日間の記事一覧

【Effective Java】項目32:ビットフィールドの代わりに EnumSet を使用する

ビットフィールド 列挙型を集合として用いる場合、旧来は以下の方法が使われました。 public class Text { public static final int STYLE_BOLD = 1 << 0; // 1 public static final int STYLE_ITALIC = 1 << 1; // 2 public static final int STYLE_UNDERLI…

(c) The King's Museum