This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = Authentication; | |
// @Constructor | |
function Authentication(name) { | |
this._name = name; | |
}; | |
Authentication.prototype._login = function(loginId, password) { | |
throw new Error("not implemented"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.maruyama.helloandroid5; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.support.v7.app.AppCompatActivity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.tksmaru.playgound; | |
import java.lang.reflect.Constructor; | |
public class ActiveClassWithReflection { | |
private enum ErrorType { | |
LESS_MONEY("less.money", UserException.class), | |
NO_STOCK("no.stock", ShopException.class), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Field; | |
public class ReflectionTest { | |
public static void main(String[] args) throws Exception { | |
Mizuno mizuno = new Mizuno(); | |
System.out.println("リフレクション前 : " + mizuno.talk()); // … | |
Class<? extends Mizuno> clazz = mizuno.getClass(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JDK 1.4 style | |
List oldList = new ArrayList(); | |
oldList.add(Integer.valueOf(1)); | |
int oldNumber = ((Integer) oldList.get(0)).intValue(); | |
// JDK 1.5 over | |
List<Integer> newList = new ArrayList<Integer>(); | |
newList.add(1); | |
int modernNumber = newList.get(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double count = 0; | |
10.times { | |
count += 0.1 | |
} | |
print count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InterfaceTest { | |
public static void main(String[] args) { | |
// 基底クラスで型を宣言 | |
CoreSysMember member = new Ohta(); | |
//CoreSysMember member = new ItashikiPro(); | |
System.out.println(member.getName()); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group='commons-lang', module='commons-lang', version='2.6') | |
import org.apache.commons.lang.StringUtils; | |
assert ! StringUtils.isAlpha("2"); // false | |
assert StringUtils.isAlpha("a"); // true | |
assert ! StringUtils.isAlpha("あ"); // true…だと…? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
/** | |
* 引数が継承関係にあるオーバーロードメソッドの実験 | |
*/ | |
public class InterfaceTest { | |
/** Collection を要求する */ | |
public static <T> void doSomething(Collection<T> collection) { | |
System.out.println("1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class CollectionUtils { | |
/** | |
* Listを指定したサイズ毎に分割します。 | |
* | |
* @param origin 分割元のList |
NewerOlder