LoginSignup
3
3

More than 5 years have passed since last update.

ClojureからJavaの「staticのネストしたクラス」を使用する

Last updated at Posted at 2014-10-18

タイトルがルー語みたい(´・ω・`)

今後もハマりそうなのでメモ

使用したいのはこいつ↓
http://docs.oracle.com/javase/jp/7/api/java/nio/channels/FileChannel.MapMode.html

FileChannel.MapMode.PRIVATE

前提

xxx.clj
(ns xxx-clj.core
  (:import [java.nio.channels FileChannel]))

ダメパティーン

FileChannel/MapMode/PRIVATE
. (FileChannel/MapMode) PRIVATE`

イケるパティーン

java.nio.channels.FileChannel$MapMode/PRIVATE

こうすれば短く書ける

xxx.clj
(ns xxx-clj.core
  (:import [java.nio.channels FileChannel$MapMode]))

(FileChannel$MapMode/PRIVATE)

終わりに

クラスファイルが「親クラス$子クラス.class」になっていることを知っていれば
躓かないんでしょうね。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3