}, {
"attribute" : "全タイプ",
"name" : "ココカラミライヘ!",
- "difficulty" : "MASTER+",
+ "difficulty" : "ⓁMASTER+",
"level" : 30,
"notes" : 843,
- "albumType" : "Not-implemented"
+ "albumType" : "ALBUM A"
}, {
"attribute" : "全タイプ",
"name" : "ココカラミライヘ!",
"level" : 30,
"notes" : 996,
"albumType" : "ALBUM C"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ココカラミライヘ!",
+ "difficulty" : "MASTER+",
+ "level" : 30,
+ "notes" : 844,
+ "albumType" : "ALBUM A"
+ }, {
+ "attribute" : "キュート",
+ "name" : "まほうのまくら",
+ "difficulty" : "DEBUT",
+ "level" : 7,
+ "notes" : 85,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "まほうのまくら",
+ "difficulty" : "REGULAR",
+ "level" : 12,
+ "notes" : 144,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "まほうのまくら",
+ "difficulty" : "PRO",
+ "level" : 17,
+ "notes" : 299,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "まほうのまくら",
+ "difficulty" : "MASTER",
+ "level" : 26,
+ "notes" : 496,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "まほうのまくら",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 803,
+ "albumType" : "Not-implemented"
+ }, {
+ "attribute" : "パッション",
+ "name" : "14平米にスーベニア",
+ "difficulty" : "LIGHT",
+ "level" : 5,
+ "notes" : 108,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "パッション",
+ "name" : "14平米にスーベニア",
+ "difficulty" : "TRICK",
+ "level" : 16,
+ "notes" : 372,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "キラッ!満開スマイル",
+ "difficulty" : "LIGHT",
+ "level" : 7,
+ "notes" : 161,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "キラッ!満開スマイル",
+ "difficulty" : "TRICK",
+ "level" : 17,
+ "notes" : 409,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "Packing Her Favorite",
+ "difficulty" : "DEBUT",
+ "level" : 8,
+ "notes" : 135,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "Packing Her Favorite",
+ "difficulty" : "REGULAR",
+ "level" : 13,
+ "notes" : 231,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "Packing Her Favorite",
+ "difficulty" : "PRO",
+ "level" : 17,
+ "notes" : 361,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "Packing Her Favorite",
+ "difficulty" : "MASTER",
+ "level" : 25,
+ "notes" : 598,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "メモリーブロッサム",
+ "difficulty" : "DEBUT",
+ "level" : 6,
+ "notes" : 93,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "メモリーブロッサム",
+ "difficulty" : "REGULAR",
+ "level" : 12,
+ "notes" : 183,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "メモリーブロッサム",
+ "difficulty" : "PRO",
+ "level" : 16,
+ "notes" : 323,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "メモリーブロッサム",
+ "difficulty" : "MASTER",
+ "level" : 25,
+ "notes" : 491,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "キュート",
+ "name" : "メモリーブロッサム",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 730,
+ "albumType" : "Not-implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "サラバ、愛しき悲しみたちよ",
+ "difficulty" : "DEBUT",
+ "level" : 7,
+ "notes" : 96,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "サラバ、愛しき悲しみたちよ",
+ "difficulty" : "REGULAR",
+ "level" : 13,
+ "notes" : 179,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "サラバ、愛しき悲しみたちよ",
+ "difficulty" : "PRO",
+ "level" : 16,
+ "notes" : 402,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "サラバ、愛しき悲しみたちよ",
+ "difficulty" : "MASTER",
+ "level" : 25,
+ "notes" : 628,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "サラバ、愛しき悲しみたちよ",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 992,
+ "albumType" : "Always"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ピンキージョーンズ",
+ "difficulty" : "DEBUT",
+ "level" : 8,
+ "notes" : 124,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ピンキージョーンズ",
+ "difficulty" : "REGULAR",
+ "level" : 13,
+ "notes" : 191,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ピンキージョーンズ",
+ "difficulty" : "PRO",
+ "level" : 18,
+ "notes" : 406,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ピンキージョーンズ",
+ "difficulty" : "MASTER",
+ "level" : 25,
+ "notes" : 605,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "ピンキージョーンズ",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 946,
+ "albumType" : "Always"
} ]
}
\ No newline at end of file
import java.io.IOException;
import java.net.InetAddress;
-import java.net.SocketException;
-import java.net.UnknownHostException;
import java.util.Date;
import java.util.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * JST(日本標準時)を <a href="https://www.nict.go.jp/">情報通信研究機構</a> から取得するユーティリティクラスです
+ * <p>
+ * @author hizum
+ *
+ * @version 4.0.0
+ */
public class JST {
// Logger
// private constructor
private JST() { /* do nothing */ }
- public static Date JSTNow() {
+ /**
+ * フィールド {@link #SERVER_NAME} で指定されているサーバーから時刻を取得し、そのまま {@link Date} 型に変換して返却します。
+ * <p>
+ * @return 日本標準時
+ * @throws IOException 日本標準時取得時に入出力エラーが起こった場合
+ */
+ public static Date JSTNow() throws IOException {
NTPUDPClient client = new NTPUDPClient();
- InetAddress address = null;
- try {
- address = InetAddress.getByName(SERVER_NAME);
- } catch (UnknownHostException e) {
- // TODO 自動生成された catch ブロック
- e.printStackTrace();
- }
- try {
- client.open();
- } catch (SocketException e) {
- // TODO 自動生成された catch ブロック
- e.printStackTrace();
- }
- TimeInfo info = null;
- try {
- info = client.getTime(Objects.requireNonNull(address));
- } catch (IOException e) {
- // TODO 自動生成された catch ブロック
- e.printStackTrace();
- }
- NtpV3Packet packet = Objects.requireNonNull(info).getMessage();
+ InetAddress address = InetAddress.getByName(SERVER_NAME);
+ client.open();
+ TimeInfo info = client.getTime(Objects.requireNonNull(address));
info.computeDetails();
LOG.debug("NTPClient: {}", client);
LOG.debug("NetAddress: {}", address);
LOG.debug("Time info: {}", info);
+ return validate(info);
+ }
+
+ /**
+ * 渡された引数から独自にオフセットを計算し、取得した情報との加重平均を取って返します。
+ * <p>
+ * 基本は取得オフセットと同じ値になることが予想されます。
+ * @param info サーバーから取得した情報
+ * @param packet サーバーから取得した情報のパケット
+ * @return
+ */
+ private static Date validate(TimeInfo info) {
+ final NtpV3Packet packet = info.getMessage();
long t1 = packet.getOriginateTimeStamp().getTime();
long t2 = packet.getReceiveTimeStamp().getTime();
long t3 = packet.getTransmitTimeStamp().getTime();