共変、反変、不変広い型から狭い型の導出を考えたときに、共変とは合わせて広い型から狭い型へ変わること、反変とは逆に狭い型から広い型へ変わること、不変とは型が変わらないことを指す。 共変戻り値型 (Covariant Return Type) とは?オブジェクト志向言語に... 続きを読む
Welcome to the JavaMail API project! This project hosts the downloads and source code for the JavaMail API reference implementation. The JavaMail reference implementation is licensed under the Common Development and Distribution License (CDDL... 続きを読む
Listクラス リストは各要素がコレクション内で明示的な位置を持っているコレクションです。List内の各オブジェクトの位置はオブジェクトの追加順序によって決定できます。オブジェクトをリストに編成しているコレクションクラスはListインターフェイスを実装し... 続きを読む
I’m using java.util.concurrent.BlockingQueue in a very simple producer-consumer scenario. E.g. this pseudo code depicts the consumer part: class QueueConsumer implements Runnable { @Override public void run() { while(true) { try { ComplexObj... 続きを読む
I have a single thread producer which creates some task objects which are then added into an ArrayBlockingQueue (which is of fixed size). I also start a multi-threaded consumer. This is build as a fixed thread pool (Executors.newFixedThreadPo... 続きを読む
next()でのタイムアウトをサポートするイテレータを作ってみました。通常のjava.util.Iteratorのラッパーとして使え、追加のAPIである「next (long timeout, TimeUnit unit)」を使うことで、タイムアウト指定ありの次要素取得が可能です。 タイムアウト有りの場... 続きを読む
JavaEEServlet3.0から、HttpServletRequest#getParts()というメソッドが追加され、ついにJavaEE標準でファイルアップロードが使えるようになりました。JSFと連携する方法を調査したので、過程と結論をメモしておきます。 @MultipartConfigアノテーションの付い... 続きを読む
Beautiful concurrencyappeared in Beautiful code, ed Greg Wilson, O’Reilly 2007Simon Peyton Jones, Microsoft Research, CambridgeMay 1, 2007Adapted for the School of Haskell by persmission of the author and the publisher of the book by Bartosz... 続きを読む
Java | 00:40 | Java言語のチェック例外は本当にGood Partなのか?というエントリーを読んで自分の考え方を簡単にまとめておこうと思う。まず、チェック例外自体はJavaの『あまり良くない仕様』とみるのが体勢であると思う。自分もどちらかといえば、『なるべく... 続きを読む
[Introduction]Concurrent version of HashMap was laregely used in the multiple thread programming. But most of them based on JDK, how about other alternative?Today we will compare Click Cliff version of NonBlockingHashMap vs JDK ConcurrentHash... 続きを読む
タイトルは元エントリを改変させて頂きました。 動的型とか静的型の話の前に「作者の気持ち」を考えろ Java6は公式アップデートの終了した古いJavaです。 その古いAPIのみを対象としてJavaを批判するのはいささかフェアでない様に思われます。 現在最新のstable... 続きを読む
Or, how to chase one's tail without throwing up. Introduction Tail-calling is an old idea; see the MIT “Lambda the Ultimate” papers. It is usually treated as an optimization. If A calls B calls C, and the last action of B is to call C, then... 続きを読む
README.md MCP(Multi Core Parser) Java framework for multicore-aware log parsing Download Binary http://www.jumperz.net/tools/mcp.jar Build ant build Run cat YOUR_TEXT_FILE | java -cp output/mcp.jar net.jumperz.app.MCP.MCP YOUR_CLASS_NAME ( No... 続きを読む
What you may be thinking of is Set<Type> set = Collections.newSetFromMap(new ConcurrentHashMap<Type, Boolean>()); This supports concurrent updates and reads. Its Iterator won't throw ConcurrentModicationException. where as Set<Type> set = Col... 続きを読む
レベル: 上級Brian Goetz (brian@quiotix.com), Principal Consultant, Quiotix 2006年 4月 18日Java™ 5.0は、Java言語におけるノンブロッキング・アルゴリズムの開発を初めて可能にしました。java.util.concurrentパッケージは、この機能を広範囲にわたって活... 続きを読む
Monday, July 26, 2010 A Retrospective on SEDA I keep bumping into references online to my PhD thesis work on the Staged Event-Driven Architecture, or SEDA. I thought this had been long forgotten, but I guess not. It's been about 10 years sinc... 続きを読む
new StringBuilder("")というコードを見たけど、引数に""入れたほうがいい理由ってなんかあるんだろうか。自分はいつもnew StringBuilder()だけだからなんか気になる 続きを読む
HawtDispatch: The libdispatch style API for Java and ScalaHawtDispatch is a small ( less than 100k ) thread pooling and NIO handling framework API modeled after the libdispatch API that Apple created to power the Grand Central Dispatch (GCD) ... 続きを読む
JDSL is the Data Structures Library in Java. It is a collection of Java interfaces and classes that implement fundamental data structures and algorithms. More about JDSL. JDSL is being developed at the Center for Geometric Computing, Departme... 続きを読む
What do you think of this article? Did it help you? Found a mistake? Feedback and suggestions here Compared to a pure Java method call, calling a user-written native method usually has a significant overhead. The reasons for this are as much ... 続きを読む