About this Wiki The purpose of this Wiki is to provide information and guidance regarding the use of the iCal4j Java library. Users are encouraged to document their experiences with iCal4j here. Consult the User's Guide for information on using the wiki software. Introduction iCal4j is a Java API that provides support for the iCalendar specification as defined in RFC2445. This support includes a P
IOException の catch に何を書いていいか分かりません><! はじめに 順番が前後しますが、今回は Java の特徴のひとつである例外機構についてです。 今回の範囲 223 ページ 〜 250 ページ 前回はこちら Effective Java 読書会 12 日目 「スレッド・セーフってなによ!!」 - IT戦記 Java の例外 throw 可能なオブジェクト Throwable インタフェースを実装したもの Exception を継承しない Throwable は基本的に使わない チェック例外 メソッドの実装者が「呼び出し元が回復可能」だと考えている例外 ちゃんと「なぜ、例外だったのか」理由が提供されるべき 呼び出し元は try catch で囲むか throws 宣言を書く必要がある Exception を継承していて RuntimeException を継承していな
enum basics - しげるメモで基本的なことをおさらいしたので、私がよく使ってるenum関係のパターンをいくつか。 ステートパターンをenumで enumを使うようになってまず一番変わったのが、 private static final int SOME_STATE = 1; みたいな典型的なアンチパターンを書かなくなりました。これはステートパターンを非常に書きやすくなったためだと思います。 よくこんなコード書いてます。本当はもうちょっとロック処理とかを書かないとだめですが、ステート部分は大抵こんな感じです。 public class Lifecycle { // 初期状態はINITIALに固定 private State state = State.INITIAL; // 外側に公開する状態遷移メソッド public void start() { state = state.st
はじめに 今日読んだところ 143 ページ〜 159 ページ 前回はこちら Effective Java 読書会 7 日目 「PECS! PECS! PECS!」 - IT戦記 int 定数とか使わない 型安全じゃないから enum 使う enum Hoge { FOO, BAR; } 簡単 メソッドも持てる enum Hoge { FOO, BAR; void a() { /* (snip) */ } } で、以下のように使う Hoge.FOO.a(); シングルトンも 最近の Java では enum でやるらしい! switch 文の代わりに固有メソッド enum Hoge { FOO { void a() { /*snip*/ } }, BAR { void a() { /*snip*/ } }; abstract void a(); } 以下のコードが // これはダメ swit
Lang Overview Download Users guide Release History Javadoc Javadoc Archive Development Building Mailing Lists Issue Tracking Proposal Developer guide Source Repository Project Documentation Project Information About Summary Team Source Code Management Issue Management Mailing Lists Dependency Information Dependency Management Dependencies Dependency Convergence CI Management Distribution Managemen
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く