hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
db2b4c692320ff26c3e56547ade1d366f5a1d18d
1,274
package ru.obolensk.afff.beetle.request; import java.io.IOException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.net.QuotedPrintableCodec; import ru.obolensk.afff.beetle.protocol.ContentTransferEncoding; import static ru.obolensk.afff.beetle.protocol.ContentTransferEncoding.BASE64; import static ru.obolensk.afff.beetle.protocol.ContentTransferEncoding.QUOTED_PRINTABLE; /** * Created by Afff on 04.09.2017. */ class ContentDecoder { private static final Base64 base64Codec = new Base64(); private static final QuotedPrintableCodec quotedPrintableCodec = new QuotedPrintableCodec(); @Nonnull static String decode(@Nonnull final String content, @Nullable final String transferEncoding) throws IOException { final ContentTransferEncoding encoding = ContentTransferEncoding.getByName(transferEncoding); if (encoding == BASE64) { return new String(base64Codec.decode(content)); } else if (encoding == QUOTED_PRINTABLE) { try { return quotedPrintableCodec.decode(content); } catch (DecoderException e) { throw new IOException(e.getMessage(), e); } } else { return content; } } }
31.85
114
0.785714
8204e2b967d30ea357cf971d6f7779c9dddb9c1b
4,431
package es.ucm.abd.practica2.dao; import es.ucm.abd.practica2.model.Abedemon; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import javax.xml.xquery.XQConnection; import javax.xml.xquery.XQDataSource; import javax.xml.xquery.XQException; import javax.xml.xquery.XQPreparedExpression; import javax.xml.xquery.XQResultSequence; import org.w3c.dom.Element; /** * Implementación concreta del DAO que hace llamadas a eXist. * * @author Manuel Montenegro ([email protected]) */ public class AbedemonDAOImpl implements AbedemonDAO { private final XQDataSource ds; public AbedemonDAOImpl(XQDataSource ds) { this.ds = ds; } /** * Obtiene los tipos de especies disponibles en la BD. * * @return Lista de tipos de especies (sin duplicados) * @throws XQException */ @Override public List<String> getTypes() { // DONE: Implementar InputStream is = getClass().getResourceAsStream("Abedemon1.xquery"); XQConnection con; try { con = ds.getConnection(); XQPreparedExpression exp = con.prepareExpression(is); XQResultSequence rs = exp.executeQuery(); List<String> types = new ArrayList<String>(); while (rs.next()) { types.add(rs.getItemAsString(null)); } rs.close(); con.close(); exp.close(); return types; } catch (XQException e) { System.err.println("Error obteniendo tipos"); return null; }finally{ } } /** * Obtiene las especies de abedemon de un determinado. * * @param type * Tipo a buscar * @return Especies encontradas del tipo pasado como parámetro. */ @Override public List<Abedemon> getAbedemonsOf(String type) { // DONE: Implementar InputStream is = getClass().getResourceAsStream("Abedemon2.xquery"); XQConnection con; try { con = ds.getConnection(); XQPreparedExpression exp = con.prepareExpression(is); exp.bindString(new QName("tipo"), type, null); XQResultSequence rs = exp.executeQuery(); List<Abedemon> abedemons = new ArrayList<Abedemon>(); while (rs.next()){ Element el = (Element)rs.getNode(); Abedemon abd = new Abedemon(el.getAttribute("id"), el.getAttribute("nombre"), Integer.parseInt(el.getAttribute("num-ataques"))); abedemons.add(abd); } rs.close(); con.close(); exp.close(); return abedemons; } catch (XQException e) { System.err.println("Error obteniendo abedemons por tipo"); e.printStackTrace(); return null; } } /** * Obtiene la descripción de una especie de abedemon. * * @param id * ID de la especie a describir * @return Código XHTML con la descripción de la especie */ @Override public String getAbedemonDescription(String id) { //DONE: Implementar InputStream is = getClass().getResourceAsStream("Abedemon3.xquery"); XQConnection con; try { con = ds.getConnection(); XQPreparedExpression exp = con.prepareExpression(is); exp.bindString(new QName("id"), id, null); XQResultSequence rs = exp.executeQuery(); if (rs != null) rs.next(); String abedemon = rs.getItemAsString(null); rs.close(); con.close(); exp.close(); return abedemon; } catch (XQException e) { System.err.println("Error obteniendo la descripción"); e.printStackTrace(); return null; } } /** * Obtiene el daño máximo recibido por un abedemon de una especie dada al * ser atacado por otro. * * @param idAttacker * ID de la especie del atacante. * @param idReceiver * ID de la especie que recibe el daño. * @return Máximo daño que puede infligir el atacante. */ @Override public Integer getDamage(String idAttacker, String idReceiver) { // TODO: Implementar (parte opcional) InputStream is = getClass().getResourceAsStream("Abedemon4.xquery"); XQConnection con; try { con = ds.getConnection(); XQPreparedExpression exp = con.prepareExpression(is); exp.bindString(new QName("yoId"), idAttacker, null); exp.bindString(new QName("adversarioId"), idReceiver, null); XQResultSequence rs = exp.executeQuery(); String damage = ""; if(rs.next()) damage = rs.getItemAsString(null); else return 0; rs.close(); con.close(); exp.close(); return Integer.parseInt(damage); } catch (XQException e) { System.err.println("Error obteniendo la descripción"); e.printStackTrace(); return null; } } }
26.064706
132
0.683819
11f9177b96f1a75ae5120c2ba7dc90a6337468a2
1,088
package top.suiwngs.netio.entiy; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.util.CharsetUtil; import sun.misc.BASE64Decoder; import java.util.List; public class PackageDecoder extends ByteToMessageDecoder { private final static BASE64Decoder decoder = new BASE64Decoder(); private final static int START = 0x75; private final static int END = 0x76; @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { String text = in.toString(CharsetUtil.UTF_8); in.skipBytes(in.readableBytes()); final String realData = new String(decoder.decodeBuffer(text), "UTF-8"); int loc = realData.indexOf("\n\n"); String functionName = realData.substring(0,loc); String data = realData.substring(loc+2); RoutePackage routePackage = new RoutePackage(); routePackage.data = data; routePackage.name = functionName; out.add(routePackage); } }
31.085714
101
0.715074
dd88cf60cfc275c9d053fe9ca9a9881d0ee9845d
4,613
/* Copyright (c) 2013 AWARE Mobile Context Instrumentation Middleware/Framework http://www.awareframework.com AWARE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version (GPLv3+). AWARE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: http://www.gnu.org/licenses/gpl.html */ package com.aware.ui; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.database.Cursor; import android.os.Bundle; import android.os.PowerManager; import android.os.Vibrator; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.util.Log; import android.view.WindowManager; import com.aware.Aware; import com.aware.Aware_Preferences; import com.aware.ESM; import com.aware.providers.ESM_Provider.ESM_Data; /** * Processes an ESM queue until it's over. * @author denzilferreira */ public class ESM_Queue extends FragmentActivity { private static String TAG = "AWARE::ESM Queue"; private final ESM_QueueManager queue_manager = new ESM_QueueManager(); private static FragmentManager fragmentManager; private static PowerManager powerManager; private static Vibrator vibrator; private static ESM_Queue queue; @Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); queue = this; getWindow().setType(WindowManager.LayoutParams.TYPE_PRIORITY_PHONE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); TAG = Aware.getSetting(getApplicationContext(),Aware_Preferences.DEBUG_TAG).length()>0?Aware.getSetting(getApplicationContext(),Aware_Preferences.DEBUG_TAG):TAG; powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); fragmentManager = (FragmentManager) getSupportFragmentManager(); IntentFilter filter = new IntentFilter(); filter.addAction(ESM.ACTION_AWARE_ESM_ANSWERED); filter.addAction(ESM.ACTION_AWARE_ESM_DISMISSED); filter.addAction(ESM.ACTION_AWARE_ESM_EXPIRED); registerReceiver(queue_manager, filter); Intent queue_started = new Intent(ESM.ACTION_AWARE_ESM_QUEUE_STARTED); sendBroadcast(queue_started); if( getQueueSize(getApplicationContext()) > 0 ) { DialogFragment esm = new ESM_UI(); esm.show(fragmentManager, TAG); if( ! powerManager.isScreenOn() ) { vibrator.vibrate(777); } } } public static class ESM_QueueManager extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if( intent.getAction().equals(ESM.ACTION_AWARE_ESM_ANSWERED) || intent.getAction().equals(ESM.ACTION_AWARE_ESM_DISMISSED) || intent.getAction().equals(ESM.ACTION_AWARE_ESM_EXPIRED) ) { if( getQueueSize(context) > 0 ) { DialogFragment esm = new ESM_UI(); esm.show(fragmentManager, TAG); } if( getQueueSize(context) == 0 ) { if(Aware.DEBUG) Log.d(TAG,"ESM Queue is done!"); Intent esm_done = new Intent(ESM.ACTION_AWARE_ESM_QUEUE_COMPLETE); context.sendBroadcast(esm_done); queue.finish(); } } } } @Override protected void onDestroy() { super.onDestroy(); unregisterReceiver(queue_manager); } /** * Get amount of ESMs waiting on database * @return int count */ public static int getQueueSize(Context c) { int size = 0; Cursor onqueue = c.getContentResolver().query(ESM_Data.CONTENT_URI,null, ESM_Data.STATUS + "=" + ESM.STATUS_NEW, null, null); if( onqueue != null & onqueue.moveToFirst() ) { size = onqueue.getCount(); } if( onqueue != null && ! onqueue.isClosed() ) onqueue.close(); return size; } }
39.09322
190
0.696293
81568ca822a5b479f4b47cb1465fac22dedc929f
58,893
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2020 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * ********************************************************************************/ package org.aoju.bus.core.toolkit; import org.aoju.bus.core.codec.Base64; import org.aoju.bus.core.convert.Convert; import org.aoju.bus.core.image.Image; import org.aoju.bus.core.io.resource.Resource; import org.aoju.bus.core.lang.Assert; import org.aoju.bus.core.lang.FileType; import org.aoju.bus.core.lang.Symbol; import org.aoju.bus.core.lang.exception.InstrumentException; import javax.imageio.*; import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.ImageOutputStream; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.RenderedImage; import java.io.*; import java.net.URL; import java.util.Iterator; import java.util.List; import java.util.Random; /** * 图片处理工具类: * 功能:缩放图像、切割图像、旋转、图像类型转换 * 彩色转黑白、文字水印、图片水印等 * * @author Kimi Liu * @version 6.0.1 * @since JDK 1.8+ */ public class ImageKit { /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式 * * @param srcImageFile 源图像文件 * @param destImageFile 缩放后的图像文件 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 */ public static void scale(File srcImageFile, File destImageFile, float scale) { scale(read(srcImageFile), destImageFile, scale); } /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcStream 源图像来源流 * @param destStream 缩放后的图像写出到的流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 */ public static void scale(InputStream srcStream, OutputStream destStream, float scale) { scale(read(srcStream), destStream, scale); } /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcStream 源图像来源流 * @param destStream 缩放后的图像写出到的流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 */ public static void scale(ImageInputStream srcStream, ImageOutputStream destStream, float scale) { scale(read(srcStream), destStream, scale); } /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcImage 源图像来源流 * @param destFile 缩放后的图像写出到的流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 * @throws InstrumentException IO异常 */ public static void scale(java.awt.Image srcImage, File destFile, float scale) throws InstrumentException { Image.from(srcImage).setTargetImageType(FileKit.extName(destFile)).scale(scale).write(destFile); } /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcImage 源图像来源流 * @param out 缩放后的图像写出到的流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 * @throws InstrumentException IO异常 */ public static void scale(java.awt.Image srcImage, OutputStream out, float scale) throws InstrumentException { scale(srcImage, getImageOutputStream(out), scale); } /** * 缩放图像(按比例缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcImage 源图像来源流 * @param destImageStream 缩放后的图像写出到的流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 * @throws InstrumentException IO异常 */ public static void scale(java.awt.Image srcImage, ImageOutputStream destImageStream, float scale) throws InstrumentException { writeJpg(scale(srcImage, scale), destImageStream); } /** * 缩放图像(按比例缩放) * * @param srcImage 源图像来源流 * @param scale 缩放比例 比例大于1时为放大,小于1大于0为缩小 * @return {@link java.awt.Image} */ public static java.awt.Image scale(java.awt.Image srcImage, float scale) { return Image.from(srcImage).scale(scale).getImg(); } /** * 缩放图像(按长宽缩放) * 注意:目标长宽与原图不成比例会变形 * * @param srcImage 源图像来源流 * @param width 目标宽度 * @param height 目标高度 * @return {@link java.awt.Image} */ public static java.awt.Image scale(java.awt.Image srcImage, int width, int height) { return Image.from(srcImage).scale(width, height).getImg(); } /** * 缩放图像(按高度和宽度缩放) * 缩放后默认为jpeg格式 * * @param srcImageFile 源图像文件地址 * @param destImageFile 缩放后的图像地址 * @param width 缩放后的宽度 * @param height 缩放后的高度 * @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> * @throws InstrumentException IO异常 */ public static void scale(File srcImageFile, File destImageFile, int width, int height, Color fixedColor) throws InstrumentException { write(scale(read(srcImageFile), width, height, fixedColor), destImageFile); } /** * 缩放图像(按高度和宽度缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 缩放后的图像目标流 * @param width 缩放后的宽度 * @param height 缩放后的高度 * @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> * @throws InstrumentException IO异常 */ public static void scale(InputStream srcStream, OutputStream destStream, int width, int height, Color fixedColor) throws InstrumentException { scale(read(srcStream), getImageOutputStream(destStream), width, height, fixedColor); } /** * 缩放图像(按高度和宽度缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 缩放后的图像目标流 * @param width 缩放后的宽度 * @param height 缩放后的高度 * @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> * @throws InstrumentException IO异常 */ public static void scale(ImageInputStream srcStream, ImageOutputStream destStream, int width, int height, Color fixedColor) throws InstrumentException { scale(read(srcStream), destStream, width, height, fixedColor); } /** * 缩放图像(按高度和宽度缩放) * 缩放后默认为jpeg格式,此方法并不关闭流 * * @param srcImage 源图像 * @param destImageStream 缩放后的图像目标流 * @param width 缩放后的宽度 * @param height 缩放后的高度 * @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> * @throws InstrumentException IO异常 */ public static void scale(java.awt.Image srcImage, ImageOutputStream destImageStream, int width, int height, Color fixedColor) throws InstrumentException { writeJpg(scale(srcImage, width, height, fixedColor), destImageStream); } /** * 缩放图像(按高度和宽度缩放) * 缩放后默认为jpeg格式 * * @param srcImage 源图像 * @param width 缩放后的宽度 * @param height 缩放后的高度 * @param fixedColor 比例不对时补充的颜色,不补充为<code>null</code> * @return {@link java.awt.Image} */ public static java.awt.Image scale(java.awt.Image srcImage, int width, int height, Color fixedColor) { return org.aoju.bus.core.image.Image.from(srcImage).scale(width, height, fixedColor).getImg(); } /** * 图像切割(按指定起点坐标和宽高切割) * * @param srcImgFile 源图像文件 * @param destImgFile 切片后的图像文件 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height */ public static void cut(File srcImgFile, File destImgFile, Rectangle rectangle) { cut(read(srcImgFile), destImgFile, rectangle); } /** * 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 切片后的图像输出流 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height */ public static void cut(InputStream srcStream, OutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); } /** * 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 切片后的图像输出流 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height */ public static void cut(ImageInputStream srcStream, ImageOutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); } /** * 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 * * @param srcImage 源图像 * @param destFile 输出的文件 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height * @throws InstrumentException IO异常 */ public static void cut(java.awt.Image srcImage, File destFile, Rectangle rectangle) throws InstrumentException { write(cut(srcImage, rectangle), destFile); } /** * 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 * * @param srcImage 源图像 * @param out 切片后的图像输出流 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height * @throws InstrumentException IO异常 */ public static void cut(java.awt.Image srcImage, OutputStream out, Rectangle rectangle) throws InstrumentException { cut(srcImage, getImageOutputStream(out), rectangle); } /** * 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 * * @param srcImage 源图像 * @param destImageStream 切片后的图像输出流 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height * @throws InstrumentException IO异常 */ public static void cut(java.awt.Image srcImage, ImageOutputStream destImageStream, Rectangle rectangle) throws InstrumentException { writeJpg(cut(srcImage, rectangle), destImageStream); } /** * 图像切割(按指定起点坐标和宽高切割) * * @param srcImage 源图像 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height * @return {@link BufferedImage} */ public static java.awt.Image cut(java.awt.Image srcImage, Rectangle rectangle) { return Image.from(srcImage).setPositionBaseCentre(false).cut(rectangle).getImg(); } /** * 图像切割(按指定起点坐标和宽高切割),填充满整个图片(直径取长宽最小值) * * @param srcImage 源图像 * @param x 原图的x坐标起始位置 * @param y 原图的y坐标起始位置 * @return {@link java.awt.Image} */ public static java.awt.Image cut(java.awt.Image srcImage, int x, int y) { return cut(srcImage, x, y, -1); } /** * 图像切割(按指定起点坐标和宽高切割) * * @param srcImage 源图像 * @param x 原图的x坐标起始位置 * @param y 原图的y坐标起始位置 * @param radius 半径,小于0表示填充满整个图片(直径取长宽最小值) * @return {@link java.awt.Image} */ public static java.awt.Image cut(java.awt.Image srcImage, int x, int y, int radius) { return Image.from(srcImage).cut(x, y, radius).getImg(); } /** * 图像切片(指定切片的宽度和高度) * * @param srcImageFile 源图像 * @param descDir 切片目标文件夹 * @param destWidth 目标切片宽度 默认200 * @param destHeight 目标切片高度 默认150 */ public static void slice(File srcImageFile, File descDir, int destWidth, int destHeight) { slice(read(srcImageFile), descDir, destWidth, destHeight); } /** * 图像切片(指定切片的宽度和高度) * * @param srcImage 源图像 * @param descDir 切片目标文件夹 * @param destWidth 目标切片宽度 默认200 * @param destHeight 目标切片高度 默认150 */ public static void slice(java.awt.Image srcImage, File descDir, int destWidth, int destHeight) { if (destWidth <= 0) { destWidth = 200; // 切片宽度 } if (destHeight <= 0) { destHeight = 150; // 切片高度 } int srcWidth = srcImage.getHeight(null); // 源图宽度 int srcHeight = srcImage.getWidth(null); // 源图高度 try { if (srcWidth > destWidth && srcHeight > destHeight) { int cols = 0; // 切片横向数量 int rows = 0; // 切片纵向数量 // 计算切片的横向和纵向数量 if (srcWidth % destWidth == 0) { cols = srcWidth / destWidth; } else { cols = (int) Math.floor(srcWidth / destWidth) + 1; } if (srcHeight % destHeight == 0) { rows = srcHeight / destHeight; } else { rows = (int) Math.floor(srcHeight / destHeight) + 1; } // 循环建立切片 java.awt.Image tag; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { // 四个参数分别为图像起点坐标和宽高 // 即: CropImageFilter(int x,int y,int width,int height) tag = cut(srcImage, new Rectangle(j * destWidth, i * destHeight, destWidth, destHeight)); // 输出为文件 ImageIO.write(toRenderedImage(tag), FileType.TYPE_JPEG, new File(descDir, "_r" + i + "_c" + j + ".jpg")); } } } } catch (IOException e) { throw new InstrumentException(e); } } /** * 图像切割(指定切片的行数和列数) * * @param srcImageFile 源图像文件 * @param destDir 切片目标文件夹 * @param rows 目标切片行数 默认2,必须是范围 [1, 20] 之内 * @param cols 目标切片列数 默认2,必须是范围 [1, 20] 之内 */ public static void sliceByRowsAndCols(File srcImageFile, File destDir, int rows, int cols) { try { sliceByRowsAndCols(ImageIO.read(srcImageFile), destDir, rows, cols); } catch (IOException e) { throw new InstrumentException(e); } } /** * 图像切割(指定切片的行数和列数) * * @param srcImage 源图像 * @param destDir 切片目标文件夹 * @param rows 目标切片行数 默认2,必须是范围 [1, 20] 之内 * @param cols 目标切片列数 默认2,必须是范围 [1, 20] 之内 */ public static void sliceByRowsAndCols(java.awt.Image srcImage, File destDir, int rows, int cols) { if (false == destDir.exists()) { FileKit.mkdir(destDir); } else if (false == destDir.isDirectory()) { throw new IllegalArgumentException("Destination Dir must be a Directory !"); } try { if (rows <= 0 || rows > 20) { rows = 2; // 切片行数 } if (cols <= 0 || cols > 20) { cols = 2; // 切片列数 } // 读取源图像 final java.awt.Image bi = toBufferedImage(srcImage); int srcWidth = bi.getWidth(null); // 源图宽度 int srcHeight = bi.getHeight(null); // 源图高度 int destWidth = MathKit.partValue(srcWidth, cols); // 每张切片的宽度 int destHeight = MathKit.partValue(srcHeight, rows); // 每张切片的高度 // 循环建立切片 java.awt.Image tag; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { tag = cut(bi, new Rectangle(j * destWidth, i * destHeight, destWidth, destHeight)); // 输出为文件 ImageIO.write(toRenderedImage(tag), FileType.TYPE_JPEG, new File(destDir, "_r" + i + "_c" + j + ".jpg")); } } } catch (IOException e) { throw new InstrumentException(e); } } /** * 图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG * * @param srcImageFile 源图像文件 * @param destImageFile 目标图像文件 */ public static void convert(File srcImageFile, File destImageFile) { Assert.notNull(srcImageFile); Assert.notNull(destImageFile); Assert.isFalse(srcImageFile.equals(destImageFile), "Src file is equals to dest file!"); final String srcExtName = FileKit.extName(srcImageFile); final String destExtName = FileKit.extName(destImageFile); if (StringKit.equalsIgnoreCase(srcExtName, destExtName)) { // 扩展名相同直接复制文件 FileKit.copy(srcImageFile, destImageFile, true); } ImageOutputStream imageOutputStream = null; try { imageOutputStream = getImageOutputStream(destImageFile); convert(read(srcImageFile), destExtName, imageOutputStream, StringKit.equalsIgnoreCase(FileType.TYPE_PNG, srcExtName)); } finally { IoKit.close(imageOutputStream); } } /** * 图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG * 此方法并不关闭流 * * @param srcStream 源图像流 * @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 * @param destStream 目标图像输出流 */ public static void convert(InputStream srcStream, String formatName, OutputStream destStream) { write(read(srcStream), formatName, getImageOutputStream(destStream)); } /** * 图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG * 此方法并不关闭流 * * @param srcImage 源图像流 * @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 * @param destImageStream 目标图像输出流 * @param isSrcPng 源图片是否为PNG格式 */ public static void convert(java.awt.Image srcImage, String formatName, ImageOutputStream destImageStream, boolean isSrcPng) { try { ImageIO.write(isSrcPng ? copyImage(srcImage, BufferedImage.TYPE_INT_RGB) : toBufferedImage(srcImage), formatName, destImageStream); } catch (IOException e) { throw new InstrumentException(e); } } /** * 彩色转为黑白 * * @param srcImageFile 源图像地址 * @param destImageFile 目标图像地址 */ public static void gray(File srcImageFile, File destImageFile) { gray(read(srcImageFile), destImageFile); } /** * 彩色转为黑白 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 */ public static void gray(InputStream srcStream, OutputStream destStream) { gray(read(srcStream), getImageOutputStream(destStream)); } /** * 彩色转为黑白 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 */ public static void gray(ImageInputStream srcStream, ImageOutputStream destStream) { gray(read(srcStream), destStream); } /** * 彩色转为黑白 * * @param srcImage 源图像流 * @param outFile 目标文件 */ public static void gray(java.awt.Image srcImage, File outFile) { write(gray(srcImage), outFile); } /** * 彩色转为黑白 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param out 目标图像流 */ public static void gray(java.awt.Image srcImage, OutputStream out) { gray(srcImage, getImageOutputStream(out)); } /** * 彩色转为黑白 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param destImageStream 目标图像流 * @throws InstrumentException IO异常 */ public static void gray(java.awt.Image srcImage, ImageOutputStream destImageStream) throws InstrumentException { writeJpg(gray(srcImage), destImageStream); } /** * 彩色转为黑白 * * @param srcImage 源图像流 * @return {@link java.awt.Image}灰度后的图片 */ public static java.awt.Image gray(java.awt.Image srcImage) { return Image.from(srcImage).gray().getImg(); } /** * 彩色转为黑白二值化图片,根据目标文件扩展名确定转换后的格式 * * @param srcImageFile 源图像地址 * @param destImageFile 目标图像地址 */ public static void binary(File srcImageFile, File destImageFile) { binary(read(srcImageFile), destImageFile); } /** * 彩色转为黑白二值化图片 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param imageType 图片格式(扩展名) */ public static void binary(InputStream srcStream, OutputStream destStream, String imageType) { binary(read(srcStream), getImageOutputStream(destStream), imageType); } /** * 彩色转为黑白黑白二值化图片 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param imageType 图片格式(扩展名) */ public static void binary(ImageInputStream srcStream, ImageOutputStream destStream, String imageType) { binary(read(srcStream), destStream, imageType); } /** * 彩色转为黑白二值化图片,根据目标文件扩展名确定转换后的格式 * * @param srcImage 源图像流 * @param outFile 目标文件 */ public static void binary(java.awt.Image srcImage, File outFile) { write(binary(srcImage), outFile); } /** * 彩色转为黑白二值化图片 * 此方法并不关闭流,输出JPG格式 * * @param srcImage 源图像流 * @param out 目标图像流 * @param imageType 图片格式(扩展名) */ public static void binary(java.awt.Image srcImage, OutputStream out, String imageType) { binary(srcImage, getImageOutputStream(out), imageType); } /** * 彩色转为黑白二值化图片 * 此方法并不关闭流,输出JPG格式 * * @param srcImage 源图像流 * @param destImageStream 目标图像流 * @param imageType 图片格式(扩展名) * @throws InstrumentException IO异常 */ public static void binary(java.awt.Image srcImage, ImageOutputStream destImageStream, String imageType) throws InstrumentException { write(binary(srcImage), imageType, destImageStream); } /** * 彩色转为黑白二值化图片 * * @param srcImage 源图像流 * @return {@link java.awt.Image}二值化后的图片 */ public static java.awt.Image binary(java.awt.Image srcImage) { return Image.from(srcImage).binary().getImg(); } /** * 给图片添加文字水印 * * @param imageFile 源图像文件 * @param destFile 目标图像文件 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 */ public static void pressText(File imageFile, File destFile, String pressText, Color color, Font font, int x, int y, float alpha) { pressText(read(imageFile), destFile, pressText, color, font, x, y, alpha); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 */ public static void pressText(InputStream srcStream, OutputStream destStream, String pressText, Color color, Font font, int x, int y, float alpha) { pressText(read(srcStream), getImageOutputStream(destStream), pressText, color, font, x, y, alpha); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 */ public static void pressText(ImageInputStream srcStream, ImageOutputStream destStream, String pressText, Color color, Font font, int x, int y, float alpha) { pressText(read(srcStream), destStream, pressText, color, font, x, y, alpha); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcImage 源图像 * @param destFile 目标流 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressText(java.awt.Image srcImage, File destFile, String pressText, Color color, Font font, int x, int y, float alpha) throws InstrumentException { write(pressText(srcImage, pressText, color, font, x, y, alpha), destFile); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcImage 源图像 * @param to 目标流 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressText(java.awt.Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws InstrumentException { pressText(srcImage, getImageOutputStream(to), pressText, color, font, x, y, alpha); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcImage 源图像 * @param destImageStream 目标图像流 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressText(java.awt.Image srcImage, ImageOutputStream destImageStream, String pressText, Color color, Font font, int x, int y, float alpha) throws InstrumentException { writeJpg(pressText(srcImage, pressText, color, font, x, y, alpha), destImageStream); } /** * 给图片添加文字水印 * 此方法并不关闭流 * * @param srcImage 源图像 * @param pressText 水印文字 * @param color 水印的字体颜色 * @param font {@link Font} 字体相关信息,如果默认则为{@code null} * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @return 处理后的图像 */ public static java.awt.Image pressText(java.awt.Image srcImage, String pressText, Color color, Font font, int x, int y, float alpha) { return Image.from(srcImage).pressText(pressText, color, font, x, y, alpha).getImg(); } /** * 给图片添加图片水印 * * @param srcImageFile 源图像文件 * @param destImageFile 目标图像文件 * @param pressImage 水印图片 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 */ public static void pressImage(File srcImageFile, File destImageFile, java.awt.Image pressImage, int x, int y, float alpha) { pressImage(read(srcImageFile), destImageFile, pressImage, x, y, alpha); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 */ public static void pressImage(InputStream srcStream, OutputStream destStream, java.awt.Image pressImage, int x, int y, float alpha) { pressImage(read(srcStream), getImageOutputStream(destStream), pressImage, x, y, alpha); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcStream 源图像流 * @param destStream 目标图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressImage(ImageInputStream srcStream, ImageOutputStream destStream, java.awt.Image pressImage, int x, int y, float alpha) throws InstrumentException { pressImage(read(srcStream), destStream, pressImage, x, y, alpha); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param outFile 写出文件 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressImage(java.awt.Image srcImage, File outFile, java.awt.Image pressImage, int x, int y, float alpha) throws InstrumentException { write(pressImage(srcImage, pressImage, x, y, alpha), outFile); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param out 目标图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressImage(java.awt.Image srcImage, OutputStream out, java.awt.Image pressImage, int x, int y, float alpha) throws InstrumentException { pressImage(srcImage, getImageOutputStream(out), pressImage, x, y, alpha); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param destImageStream 目标图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @throws InstrumentException IO异常 */ public static void pressImage(java.awt.Image srcImage, ImageOutputStream destImageStream, java.awt.Image pressImage, int x, int y, float alpha) throws InstrumentException { writeJpg(pressImage(srcImage, pressImage, x, y, alpha), destImageStream); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param x 修正值 默认在中间,偏移量相对于中间偏移 * @param y 修正值 默认在中间,偏移量相对于中间偏移 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @return 结果图片 */ public static java.awt.Image pressImage(java.awt.Image srcImage, java.awt.Image pressImage, int x, int y, float alpha) { return org.aoju.bus.core.image.Image.from(srcImage).pressImage(pressImage, x, y, alpha).getImg(); } /** * 给图片添加图片水印 * 此方法并不关闭流 * * @param srcImage 源图像流 * @param pressImage 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 * @param rectangle 矩形对象,表示矩形区域的x,y,width,height,x,y从背景图片中心计算 * @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 * @return 结果图片 */ public static java.awt.Image pressImage(java.awt.Image srcImage, java.awt.Image pressImage, Rectangle rectangle, float alpha) { return org.aoju.bus.core.image.Image.from(srcImage).pressImage(pressImage, rectangle, alpha).getImg(); } /** * 旋转图片为指定角度 * 此方法不会关闭输出流 * * @param imageFile 被旋转图像文件 * @param degree 旋转角度 * @param outFile 输出文件 * @throws InstrumentException IO异常 */ public static void rotate(File imageFile, int degree, File outFile) throws InstrumentException { rotate(read(imageFile), degree, outFile); } /** * 旋转图片为指定角度 * 此方法不会关闭输出流 * * @param image 目标图像 * @param degree 旋转角度 * @param outFile 输出文件 * @throws InstrumentException IO异常 */ public static void rotate(java.awt.Image image, int degree, File outFile) throws InstrumentException { write(rotate(image, degree), outFile); } /** * 旋转图片为指定角度 * 此方法不会关闭输出流 * * @param image 目标图像 * @param degree 旋转角度 * @param out 输出流 * @throws InstrumentException IO异常 */ public static void rotate(java.awt.Image image, int degree, OutputStream out) throws InstrumentException { writeJpg(rotate(image, degree), getImageOutputStream(out)); } /** * 旋转图片为指定角度 * 此方法不会关闭输出流,输出格式为JPG * * @param image 目标图像 * @param degree 旋转角度 * @param out 输出图像流 * @throws InstrumentException IO异常 */ public static void rotate(java.awt.Image image, int degree, ImageOutputStream out) throws InstrumentException { writeJpg(rotate(image, degree), out); } /** * 旋转图片为指定角度 * 来自:http://blog.51cto.com/cping1982/130066 * * @param image 目标图像 * @param degree 旋转角度 * @return 旋转后的图片 */ public static java.awt.Image rotate(java.awt.Image image, int degree) { return Image.from(image).rotate(degree).getImg(); } /** * 水平翻转图像 * * @param imageFile 图像文件 * @param outFile 输出文件 * @throws InstrumentException IO异常 */ public static void flip(File imageFile, File outFile) throws InstrumentException { flip(read(imageFile), outFile); } /** * 水平翻转图像 * * @param image 图像 * @param outFile 输出文件 * @throws InstrumentException IO异常 */ public static void flip(java.awt.Image image, File outFile) throws InstrumentException { write(flip(image), outFile); } /** * 水平翻转图像 * * @param image 图像 * @param out 输出 * @throws InstrumentException IO异常 */ public static void flip(java.awt.Image image, OutputStream out) throws InstrumentException { flip(image, getImageOutputStream(out)); } /** * 水平翻转图像,写出格式为JPG * * @param image 图像 * @param out 输出 * @throws InstrumentException IO异常 */ public static void flip(java.awt.Image image, ImageOutputStream out) throws InstrumentException { writeJpg(flip(image), out); } /** * 水平翻转图像 * * @param image 图像 * @return 翻转后的图片 */ public static java.awt.Image flip(java.awt.Image image) { return Image.from(image).flip().getImg(); } /** * 压缩图像,输出图像只支持jpg文件 * * @param imageFile 图像文件 * @param outFile 输出文件,只支持jpg文件 * @param quality 质量 * @throws InstrumentException IO异常 */ public static void compress(File imageFile, File outFile, float quality) throws InstrumentException { org.aoju.bus.core.image.Image.from(imageFile).setQuality(quality).write(outFile); } /** * {@link java.awt.Image} 转 {@link RenderedImage} * 首先尝试强转,否则新建一个{@link BufferedImage}后重新绘制 * * @param image {@link java.awt.Image} * @return {@link BufferedImage} */ public static RenderedImage toRenderedImage(java.awt.Image image) { if (image instanceof RenderedImage) { return (RenderedImage) image; } return copyImage(image, BufferedImage.TYPE_INT_RGB); } /** * {@link java.awt.Image} 转 {@link BufferedImage} * 首先尝试强转,否则新建一个{@link BufferedImage}后重新绘制 * * @param image {@link java.awt.Image} * @return {@link BufferedImage} */ public static BufferedImage toBufferedImage(java.awt.Image image) { if (image instanceof BufferedImage) { return (BufferedImage) image; } return copyImage(image, BufferedImage.TYPE_INT_RGB); } /** * {@link java.awt.Image} 转 {@link BufferedImage} * 如果源图片的RGB模式与目标模式一致,则直接转换,否则重新绘制 * * @param image {@link java.awt.Image} * @param imageType 目标图片类型 * @return {@link BufferedImage} */ public static BufferedImage toBufferedImage(java.awt.Image image, String imageType) { BufferedImage bufferedImage; if (false == imageType.equalsIgnoreCase(FileType.TYPE_PNG)) { // 当目标为非PNG类图片时,源图片统一转换为RGB格式 if (image instanceof BufferedImage) { bufferedImage = (BufferedImage) image; if (BufferedImage.TYPE_INT_RGB != bufferedImage.getType()) { bufferedImage = copyImage(image, BufferedImage.TYPE_INT_RGB); } } else { bufferedImage = copyImage(image, BufferedImage.TYPE_INT_RGB); } } else { bufferedImage = toBufferedImage(image); } return bufferedImage; } /** * 将已有Image复制新的一份出来 * * @param image {@link java.awt.Image} * @param imageType 目标图片类型,{@link BufferedImage}中的常量,例如黑白等 * @return {@link BufferedImage} * @see BufferedImage#TYPE_INT_RGB * @see BufferedImage#TYPE_INT_ARGB * @see BufferedImage#TYPE_INT_ARGB_PRE * @see BufferedImage#TYPE_INT_BGR * @see BufferedImage#TYPE_3BYTE_BGR * @see BufferedImage#TYPE_4BYTE_ABGR * @see BufferedImage#TYPE_4BYTE_ABGR_PRE * @see BufferedImage#TYPE_BYTE_GRAY * @see BufferedImage#TYPE_USHORT_GRAY * @see BufferedImage#TYPE_BYTE_BINARY * @see BufferedImage#TYPE_BYTE_INDEXED * @see BufferedImage#TYPE_USHORT_565_RGB * @see BufferedImage#TYPE_USHORT_555_RGB */ public static BufferedImage copyImage(java.awt.Image image, int imageType) { return copyImage(image, imageType, null); } /** * 将已有Image复制新的一份出来 * * @param image {@link java.awt.Image} * @param imageType 目标图片类型,{@link BufferedImage}中的常量,例如黑白等 * @param backgroundColor 背景色,{@code null} 表示默认背景色(黑色或者透明) * @return {@link BufferedImage} * @see BufferedImage#TYPE_INT_RGB * @see BufferedImage#TYPE_INT_ARGB * @see BufferedImage#TYPE_INT_ARGB_PRE * @see BufferedImage#TYPE_INT_BGR * @see BufferedImage#TYPE_3BYTE_BGR * @see BufferedImage#TYPE_4BYTE_ABGR * @see BufferedImage#TYPE_4BYTE_ABGR_PRE * @see BufferedImage#TYPE_BYTE_GRAY * @see BufferedImage#TYPE_USHORT_GRAY * @see BufferedImage#TYPE_BYTE_BINARY * @see BufferedImage#TYPE_BYTE_INDEXED * @see BufferedImage#TYPE_USHORT_565_RGB * @see BufferedImage#TYPE_USHORT_555_RGB */ public static BufferedImage copyImage(java.awt.Image image, int imageType, Color backgroundColor) { final BufferedImage bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), imageType); final Graphics2D bGr = org.aoju.bus.core.image.Graphics.createGraphics(bimage, backgroundColor); bGr.drawImage(image, 0, 0, null); bGr.dispose(); return bimage; } /** * 将Base64编码的图像信息转为 {@link BufferedImage} * * @param base64 图像的Base64表示 * @return {@link BufferedImage} * @throws InstrumentException IO异常 */ public static BufferedImage toImage(String base64) throws InstrumentException { return toImage(Base64.decode(base64)); } /** * 将的图像bytes转为 {@link BufferedImage} * * @param imageBytes 图像bytes * @return {@link BufferedImage} * @throws InstrumentException IO异常 */ public static BufferedImage toImage(byte[] imageBytes) throws InstrumentException { return read(new ByteArrayInputStream(imageBytes)); } /** * 将图片对象转换为InputStream形式 * * @param image 图片对象 * @param imageType 图片类型 * @return Base64的字符串表现形式 */ public static ByteArrayInputStream toStream(java.awt.Image image, String imageType) { return IoKit.toStream(toBytes(image, imageType)); } /** * 将图片对象转换为Base64形式 * * @param image 图片对象 * @param imageType 图片类型 * @return Base64的字符串表现形式 */ public static String toBase64(java.awt.Image image, String imageType) { return Base64.encode(toBytes(image, imageType)); } /** * 将图片对象转换为Base64的Data URI形式,格式为:data:image/[imageType];base64,[data] * * @param image 图片对象 * @param imageType 图片类型 * @return Base64的字符串表现形式 */ public static String toBase64Uri(java.awt.Image image, String imageType) { return UriKit.toURL("image/" + imageType, "base64", toBase64(image, imageType)); } /** * 将图片对象转换为bytes形式 * * @param image 图片对象 * @param imageType 图片类型 * @return Base64的字符串表现形式 */ public static byte[] toBytes(java.awt.Image image, String imageType) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); write(image, imageType, out); return out.toByteArray(); } /** * 根据文字创建PNG图片 * * @param str 文字 * @param font 字体{@link Font} * @param backgroundColor 背景颜色,默认透明 * @param fontColor 字体颜色,默认黑色 * @param out 图片输出地 */ public static void createImage(String str, Font font, Color backgroundColor, Color fontColor, ImageOutputStream out) { writePng(createImage(str, font, backgroundColor, fontColor, BufferedImage.TYPE_INT_ARGB), out); } /** * 根据文字创建图片 * * @param str 文字 * @param font 字体{@link Font} * @param backgroundColor 背景颜色,默认透明 * @param fontColor 字体颜色,默认黑色 * @param imageType 图片类型,见:{@link BufferedImage} * @return 图片 */ public static BufferedImage createImage(String str, Font font, Color backgroundColor, Color fontColor, int imageType) { // 获取font的样式应用在str上的整个矩形 final Rectangle2D r = getRectangle(str, font); // 获取单个字符的高度 int unitHeight = (int) Math.floor(r.getHeight()); // 获取整个str用了font样式的宽度这里用四舍五入后+1保证宽度绝对能容纳这个字符串作为图片的宽度 int width = (int) Math.round(r.getWidth()) + 1; // 把单个字符的高度+3保证高度绝对能容纳字符串作为图片的高度 int height = unitHeight + 3; // 创建图片 final BufferedImage image = new BufferedImage(width, height, imageType); final Graphics g = image.getGraphics(); if (null != backgroundColor) { // 先用背景色填充整张图片,也就是背景 g.setColor(backgroundColor); g.fillRect(0, 0, width, height); } g.setColor(ObjectKit.defaultIfNull(fontColor, Color.BLACK)); g.setFont(font);// 设置画笔字体 g.drawString(str, 0, font.getSize());// 画出字符串 g.dispose(); return image; } /** * 获取font的样式应用在str上的整个矩形 * * @param str 字符串,必须非空 * @param font 字体,必须非空 * @return {@link Rectangle2D} */ public static Rectangle2D getRectangle(String str, Font font) { return font.getStringBounds(str, new FontRenderContext(AffineTransform.getScaleInstance(1, 1), false, false)); } /** * 根据文件创建字体 * 首先尝试创建{@link Font#TRUETYPE_FONT}字体,此类字体无效则创建{@link Font#TYPE1_FONT} * * @param fontFile 字体文件 * @return {@link Font} */ public static Font createFont(File fontFile) { try { return Font.createFont(Font.TRUETYPE_FONT, fontFile); } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontFile); } catch (Exception e1) { throw new InstrumentException(e); } } catch (IOException e) { throw new InstrumentException(e); } } /** * 根据文件创建字体 * 首先尝试创建{@link Font#TRUETYPE_FONT}字体,此类字体无效则创建{@link Font#TYPE1_FONT} * * @param fontStream 字体流 * @return {@link Font} */ public static Font createFont(InputStream fontStream) { try { return Font.createFont(Font.TRUETYPE_FONT, fontStream); } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontStream); } catch (Exception e1) { throw new InstrumentException(e1); } } catch (IOException e) { throw new InstrumentException(e); } } /** * 创建{@link Graphics2D} * * @param image {@link BufferedImage} * @param color {@link Color}背景颜色以及当前画笔颜色 * @return {@link Graphics2D} * @see org.aoju.bus.core.image.Graphics#createGraphics(BufferedImage, Color) */ public static Graphics2D createGraphics(BufferedImage image, Color color) { return org.aoju.bus.core.image.Graphics.createGraphics(image, color); } /** * 写出图像为JPG格式 * * @param image {@link java.awt.Image} * @param destImageStream 写出到的目标流 * @throws InstrumentException IO异常 */ public static void writeJpg(java.awt.Image image, ImageOutputStream destImageStream) throws InstrumentException { write(image, FileType.TYPE_JPG, destImageStream); } /** * 写出图像为PNG格式 * * @param image {@link java.awt.Image} * @param destImageStream 写出到的目标流 * @throws InstrumentException IO异常 */ public static void writePng(java.awt.Image image, ImageOutputStream destImageStream) throws InstrumentException { write(image, FileType.TYPE_PNG, destImageStream); } /** * 写出图像为JPG格式 * * @param image {@link java.awt.Image} * @param out 写出到的目标流 * @throws InstrumentException IO异常 */ public static void writeJpg(java.awt.Image image, OutputStream out) throws InstrumentException { write(image, FileType.TYPE_JPG, out); } /** * 写出图像为PNG格式 * * @param image {@link java.awt.Image} * @param out 写出到的目标流 * @throws InstrumentException IO异常 */ public static void writePng(java.awt.Image image, OutputStream out) throws InstrumentException { write(image, FileType.TYPE_PNG, out); } /** * 写出图像 * * @param image {@link java.awt.Image} * @param imageType 图片类型(图片扩展名) * @param out 写出到的目标流 * @throws InstrumentException IO异常 */ public static void write(java.awt.Image image, String imageType, OutputStream out) throws InstrumentException { write(image, imageType, getImageOutputStream(out)); } /** * 写出图像为指定格式 * * @param image {@link java.awt.Image} * @param imageType 图片类型(图片扩展名) * @param destImageStream 写出到的目标流 * @return 是否成功写出, 如果返回false表示未找到合适的Writer * @throws InstrumentException IO异常 */ public static boolean write(java.awt.Image image, String imageType, ImageOutputStream destImageStream) throws InstrumentException { return write(image, imageType, destImageStream, 1); } /** * 写出图像为指定格式 * * @param image {@link java.awt.Image} * @param imageType 图片类型(图片扩展名) * @param destImageStream 写出到的目标流 * @param quality 质量,数字为0~1(不包括0和1)表示质量压缩比,除此数字外设置表示不压缩 * @return 是否成功写出, 如果返回false表示未找到合适的Writer * @throws InstrumentException IO异常 */ public static boolean write(java.awt.Image image, String imageType, ImageOutputStream destImageStream, float quality) throws InstrumentException { if (StringKit.isBlank(imageType)) { imageType = FileType.TYPE_JPG; } final ImageWriter writer = getWriter(image, imageType); return write(toBufferedImage(image, imageType), writer, destImageStream, quality); } /** * 写出图像为目标文件扩展名对应的格式 * * @param image {@link java.awt.Image} * @param targetFile 目标文件 * @throws InstrumentException IO异常 */ public static void write(java.awt.Image image, File targetFile) throws InstrumentException { ImageOutputStream out = null; try { out = getImageOutputStream(targetFile); write(image, FileKit.extName(targetFile), out); } finally { IoKit.close(out); } } /** * 通过{@link ImageWriter}写出图片到输出流 * * @param image 图片 * @param writer {@link ImageWriter} * @param output 输出的Image流{@link ImageOutputStream} * @param quality 质量,数字为0~1(不包括0和1)表示质量压缩比,除此数字外设置表示不压缩 * @return 是否成功写出 */ public static boolean write(java.awt.Image image, ImageWriter writer, ImageOutputStream output, float quality) { if (writer == null) { return false; } writer.setOutput(output); final RenderedImage renderedImage = toRenderedImage(image); // 设置质量 ImageWriteParam imgWriteParams = null; if (quality > 0 && quality < 1) { imgWriteParams = writer.getDefaultWriteParam(); if (imgWriteParams.canWriteCompressed()) { imgWriteParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); imgWriteParams.setCompressionQuality(quality); final ColorModel colorModel = renderedImage.getColorModel();// ColorModel.getRGBdefault(); imgWriteParams.setDestinationType(new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(16, 16))); } } try { if (null != imgWriteParams) { writer.write(null, new IIOImage(renderedImage, null, null), imgWriteParams); } else { writer.write(renderedImage); } output.flush(); } catch (IOException e) { throw new InstrumentException(e); } finally { writer.dispose(); } return true; } /** * 获得{@link ImageReader} * * @param type 图片文件类型,例如 "jpeg" 或 "tiff" * @return {@link ImageReader} */ public static ImageReader getReader(String type) { final Iterator<ImageReader> iterator = ImageIO.getImageReadersByFormatName(type); if (iterator.hasNext()) { return iterator.next(); } return null; } /** * 从文件中读取图片,请使用绝对路径,使用相对路径会相对于ClassPath * * @param imageFilePath 图片文件路径 * @return 图片 */ public static BufferedImage read(String imageFilePath) { return read(FileKit.file(imageFilePath)); } /** * 从文件中读取图片 * * @param imageFile 图片文件 * @return 图片 */ public static BufferedImage read(File imageFile) { try { return ImageIO.read(imageFile); } catch (IOException e) { throw new InstrumentException(e); } } /** * 从{@link Resource}中读取图片 * * @param resource 图片资源 * @return 图片 */ public static BufferedImage read(Resource resource) { return read(resource.getStream()); } /** * 从流中读取图片 * * @param imageStream 图片文件 * @return 图片 */ public static BufferedImage read(InputStream imageStream) { try { return ImageIO.read(imageStream); } catch (IOException e) { throw new InstrumentException(e); } } /** * 从图片流中读取图片 * * @param imageStream 图片文件 * @return 图片 */ public static BufferedImage read(ImageInputStream imageStream) { try { return ImageIO.read(imageStream); } catch (IOException e) { throw new InstrumentException(e); } } /** * 从URL中读取图片 * * @param imageUrl 图片文件 * @return 图片 */ public static BufferedImage read(URL imageUrl) { try { return ImageIO.read(imageUrl); } catch (IOException e) { throw new InstrumentException(e); } } /** * 获取{@link ImageOutputStream} * * @param out {@link OutputStream} * @return {@link ImageOutputStream} * @throws InstrumentException IO异常 */ public static ImageOutputStream getImageOutputStream(OutputStream out) throws InstrumentException { try { return ImageIO.createImageOutputStream(out); } catch (IOException e) { throw new InstrumentException(e); } } /** * 获取{@link ImageOutputStream} * * @param outFile {@link File} * @return {@link ImageOutputStream} * @throws InstrumentException IO异常 */ public static ImageOutputStream getImageOutputStream(File outFile) throws InstrumentException { try { return ImageIO.createImageOutputStream(outFile); } catch (IOException e) { throw new InstrumentException(e); } } /** * 获取{@link ImageInputStream} * * @param in {@link InputStream} * @return {@link ImageInputStream} * @throws InstrumentException IO异常 */ public static ImageInputStream getImageInputStream(InputStream in) throws InstrumentException { try { return ImageIO.createImageInputStream(in); } catch (IOException e) { throw new InstrumentException(e); } } /** * 根据给定的Image对象和格式获取对应的{@link ImageWriter},如果未找到合适的Writer,返回null * * @param image {@link java.awt.Image} * @param formatName 图片格式,例如"jpg"、"png" * @return {@link ImageWriter} */ public static ImageWriter getWriter(java.awt.Image image, String formatName) { final ImageTypeSpecifier type = ImageTypeSpecifier.createFromRenderedImage(toRenderedImage(image)); final Iterator<ImageWriter> iter = ImageIO.getImageWriters(type, formatName); return iter.hasNext() ? iter.next() : null; } /** * 根据给定的图片格式或者扩展名获取{@link ImageWriter},如果未找到合适的Writer,返回null * * @param formatName 图片格式或扩展名,例如"jpg"、"png" * @return {@link ImageWriter} */ public static ImageWriter getWriter(String formatName) { ImageWriter writer = null; Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName(formatName); if (iter.hasNext()) { writer = iter.next(); } if (null == writer) { // 尝试扩展名获取 iter = ImageIO.getImageWritersBySuffix(formatName); if (iter.hasNext()) { writer = iter.next(); } } return writer; } /** * Color对象转16进制表示,例如#fcf6d6 * * @param color {@link Color} * @return 16进制的颜色值, 例如#fcf6d6 */ public static String toHex(Color color) { String R = Integer.toHexString(color.getRed()); R = R.length() < 2 ? (Symbol.C_ZERO + R) : R; String G = Integer.toHexString(color.getGreen()); G = G.length() < 2 ? (Symbol.C_ZERO + G) : G; String B = Integer.toHexString(color.getBlue()); B = B.length() < 2 ? (Symbol.C_ZERO + B) : B; return Symbol.C_SHAPE + R + G + B; } /** * 16进制的颜色值转换为Color对象,例如#fcf6d6 * * @param hex 16进制的颜色值,例如#fcf6d6 * @return {@link Color} */ public static Color hexToColor(String hex) { return getColor(Integer.parseInt(StringKit.removePrefix(Symbol.SHAPE, hex), 16)); } /** * 获取一个RGB值对应的颜色 * * @param rgb RGB值 * @return {@link Color} */ public static Color getColor(int rgb) { return new Color(rgb); } /** * 将颜色值转换成具体的颜色类型 汇集了常用的颜色集,支持以下几种形式: * * <pre> * 1. 颜色的英文名(大小写皆可) * 2. 16进制表示,例如:#fcf6d6或者$fcf6d6 * 3. RGB形式,例如:13,148,252 * </pre> * <p> * 方法来自:com.lnwazg.kit * * @param colorName 颜色的英文名,16进制表示或RGB表示 * @return {@link Color} */ public static Color getColor(String colorName) { if (StringKit.isBlank(colorName)) { return null; } colorName = colorName.toUpperCase(); if ("BLACK".equals(colorName)) { return Color.BLACK; } else if ("WHITE".equals(colorName)) { return Color.WHITE; } else if ("LIGHTGRAY".equals(colorName) || "LIGHT_GRAY".equals(colorName)) { return Color.LIGHT_GRAY; } else if ("GRAY".equals(colorName)) { return Color.GRAY; } else if ("DARK_GRAY".equals(colorName) || "DARK_GRAY".equals(colorName)) { return Color.DARK_GRAY; } else if ("RED".equals(colorName)) { return Color.RED; } else if ("PINK".equals(colorName)) { return Color.PINK; } else if ("ORANGE".equals(colorName)) { return Color.ORANGE; } else if ("YELLOW".equals(colorName)) { return Color.YELLOW; } else if ("GREEN".equals(colorName)) { return Color.GREEN; } else if ("MAGENTA".equals(colorName)) { return Color.MAGENTA; } else if ("CYAN".equals(colorName)) { return Color.CYAN; } else if ("BLUE".equals(colorName)) { return Color.BLUE; } else if ("DARKGOLD".equals(colorName)) { // 暗金色 return hexToColor("#9e7e67"); } else if ("LIGHTGOLD".equals(colorName)) { // 亮金色 return hexToColor("#ac9c85"); } else if (StringKit.startWith(colorName, Symbol.C_SHAPE)) { return hexToColor(colorName); } else if (StringKit.startWith(colorName, Symbol.C_DOLLAR)) { // 由于#在URL传输中无法传输,因此用$代替# return hexToColor(Symbol.SHAPE + colorName.substring(1)); } else { // rgb值 final List<String> rgb = StringKit.split(colorName, Symbol.C_COMMA); if (3 == rgb.size()) { final Integer r = Convert.toInt(rgb.get(0)); final Integer g = Convert.toInt(rgb.get(1)); final Integer b = Convert.toInt(rgb.get(2)); if (false == ArrayKit.hasNull(r, g, b)) { return new Color(r, g, b); } } else { return null; } } return null; } /** * 生成随机颜色 * * @return 随机颜色 */ public static Color randomColor() { return randomColor(null); } /** * 生成随机颜色 * * @param random 随机对象 {@link Random} * @return 随机颜色 */ public static Color randomColor(Random random) { if (null == random) { random = RandomKit.getRandom(); } return new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255)); } }
32.809471
190
0.598407
43f069a7e2b1484631736ac5909a7eec02baf63f
284
package com.ruoyi.system.mapper; import com.ruoyi.system.domain.YdShopOrderCancelReason; import java.util.List; /** * 订单取消原因数据库连接层 */ public interface YdShopOrderCancelReasonMapper { int insert(YdShopOrderCancelReason record); List<YdShopOrderCancelReason> selectAll(); }
21.846154
55
0.788732
aabb6e6e545d3ce91e3c7b370b6093d946eca0fa
984
package com.poppywood.docstopdfconverter; import org.apache.commons.io.IOUtils; import org.ghost4j.converter.PDFConverter; import org.ghost4j.document.PSDocument; import java.io.InputStream; import java.io.OutputStream; public class PsToPDFConverter extends PptxToPDFConverter { public PsToPDFConverter(InputStream inStream, OutputStream outStream, boolean showMessages, boolean closeStreamsWhenComplete, boolean rtl, boolean landscape) { super(inStream, outStream, showMessages, closeStreamsWhenComplete, rtl, landscape); } @Override public void convert() throws Exception { loading(); PSDocument document = new PSDocument(); document.load(inStream); processing(); PDFConverter converter = new PDFConverter(); converter.setPDFSettings(PDFConverter.OPTION_PDFSETTINGS_PREPRESS); //convert converter.convert(document, outStream); finished(); IOUtils.closeQuietly(outStream); } }
28.114286
160
0.739837
0fb1a632c757ecd692473b1c4ab5a2bd044a2b6f
2,309
package lv.welding.orders.models; import org.primefaces.model.SelectableDataModel; import javax.faces.model.ListDataModel; import javax.persistence.*; import java.io.Serializable; import java.util.List; @Entity @Table(name="categories") public class CategoryEntity extends ListDataModel<OrderEntity> implements Serializable, SelectableDataModel <CategoryEntity>{ @Id @GeneratedValue private Long id; @Column(name="name") private String name; @Column(name="description") private String description; //Mother category @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name="category_id") private CategoryEntity category; //Child categories @OneToMany(mappedBy="category", fetch = FetchType.EAGER, cascade={CascadeType.REMOVE}) private List<CategoryEntity> subCategories; @OneToMany(fetch = FetchType.EAGER) private List<ProductEntity> products; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public CategoryEntity getCategory() { return category; } public void setCategory(CategoryEntity category) { this.category = category; } public List<CategoryEntity> getSubCategories() { return subCategories; } public void setSubCategories(List<CategoryEntity> subCategories) { this.subCategories = subCategories; } public List<ProductEntity> getProducts() { return products; } public void setProducts(List<ProductEntity> products) { this.products = products; } @Override public CategoryEntity getRowData(String rowKey) { List<CategoryEntity> categories = (List<CategoryEntity>) getWrappedData(); for(CategoryEntity c : categories) { if(c.getName().equals(rowKey)) return c; } return null; } @Override public Object getRowKey(CategoryEntity categoryEntity) { return categoryEntity.getName(); } }
23.804124
125
0.669554
f324fec963eaf96894f00029d7c7a5e4cd892e1b
4,177
/************************************************************************* * * * EJBCA Community: The OpenSource Certificate Authority * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.ejbca.core.ejb.config; import java.util.HashMap; import java.util.Iterator; import java.util.Properties; import org.cesecore.config.CesecoreConfiguration; import org.cesecore.config.ConfigurationHolder; import org.cesecore.configuration.ConfigurationBase; import org.cesecore.configuration.ConfigurationCache; import org.ejbca.config.EjbcaConfigurationHolder; import org.ejbca.config.GlobalConfiguration; /** * Class Holding cache variable for global configuration. Needed because EJB spec does not allow volatile, non-final * fields in session beans. * This is a trivial cache, too trivial, it needs manual handling of setting the cache variable, this class does not keep track on if * the cache variable is null or not, the using class must ensure that it does not try to use a null value. * Only the method "needsUpdate will return true of the cache variable is null. * * @version $Id: GlobalConfigurationCache.java 22740 2016-02-05 13:28:45Z mikekushner $ */ public final class GlobalConfigurationCache implements ConfigurationCache { /** * Cache variable containing the global configuration. This cache may be * unsynchronized between multiple instances of EJBCA, but is common to all * threads in the same VM. Set volatile to make it thread friendly. */ private volatile GlobalConfiguration globalconfigurationCache = null; /** help variable used to control that GlobalConfiguration update isn't performed to often. */ private volatile long lastupdatetime = -1; public GlobalConfigurationCache() { // Do nothing } @Override public boolean needsUpdate() { if (globalconfigurationCache != null && lastupdatetime + CesecoreConfiguration.getCacheGlobalConfigurationTime() > System.currentTimeMillis()) { return false; } return true; } public void clearCache() { globalconfigurationCache = null; } @Override public String getConfigId() { return GlobalConfiguration.GLOBAL_CONFIGURATION_ID; } @Override public void saveData() { globalconfigurationCache.saveData(); } @Override public ConfigurationBase getConfiguration() { return globalconfigurationCache; } @SuppressWarnings("rawtypes") @Override public ConfigurationBase getConfiguration(HashMap data) { ConfigurationBase returnval = new GlobalConfiguration(); returnval.loadData(data); return returnval; } @Override public void updateConfiguration(ConfigurationBase configuration) { this.globalconfigurationCache = (GlobalConfiguration) configuration; lastupdatetime = System.currentTimeMillis(); } @Override public ConfigurationBase getNewConfiguration() { return new GlobalConfiguration(); } @Override public Properties getAllProperties() { Properties ejbca = EjbcaConfigurationHolder.getAsProperties(); Properties cesecore = ConfigurationHolder.getAsProperties(); for (Iterator<Object> iterator = ejbca.keySet().iterator(); iterator.hasNext();) { String key = (String)iterator.next(); cesecore.setProperty(key, ejbca.getProperty(key)); } return cesecore; } }
37.972727
152
0.628681
7a871b068dc9c8c958f6640cf09773ecce48ef00
898
package de.androidbytes.recipr.presentation.single.detail.view; import de.androidbytes.recipr.domain.model.Recipe; import de.androidbytes.recipr.presentation.core.di.scopes.PerActivity; import de.androidbytes.recipr.presentation.core.model.DataMapper; import de.androidbytes.recipr.presentation.single.detail.model.RecipeDetails; import de.androidbytes.recipr.presentation.overview.core.view.ViewDataProcessor; import javax.inject.Inject; @PerActivity public class RecipeDetailsViewDataProcessor implements ViewDataProcessor<Recipe, RecipeDetails> { DataMapper<Recipe, RecipeDetails> dataMapper; @Inject public RecipeDetailsViewDataProcessor(DataMapper<Recipe, RecipeDetails> dataMapper) { this.dataMapper = dataMapper; } @Override public RecipeDetails processData(Recipe recipe) { return dataMapper.transform(recipe); } }
34.538462
98
0.780624
d9b8013488230d55ddcc632e9808921f6ddcc1ef
464
package br.com.luciano.npj.controller.converter; import org.springframework.core.convert.converter.Converter; import org.springframework.util.StringUtils; import br.com.luciano.npj.model.Cabine; public class CabineConverter implements Converter<String, Cabine> { @Override public Cabine convert(String id) { if(!StringUtils.isEmpty(id)) { Cabine cabine = new Cabine(); cabine.setId(Integer.valueOf(id)); return cabine; } return null; } }
21.090909
67
0.752155
91b841d5d666db93492b2a5e516e69f703c9d58d
774
package dev.patika.fourthhomeworkavemphract.model; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.HashSet; import java.util.Set; @Entity @EqualsAndHashCode(exclude = {"instructor","students"},callSuper = false) @Data @AllArgsConstructor @NoArgsConstructor public class Course extends BaseEntity { private String courseName; private String courseCode; private double credit; @ManyToOne @JsonIgnore private Instructor instructor; @ManyToMany(targetEntity = Student.class, cascade = CascadeType.MERGE) @JsonIgnore private final Set<Student> students=new HashSet<>(); }
27.642857
86
0.784238
1063f0249dbc247597023df5931141ca1c0a0701
261
package pl.mmorpg.prototype.clientservercommon.packets.levelup; import lombok.Data; import pl.mmorpg.prototype.clientservercommon.registering.Registerable; @Registerable @Data public class LevelUpPacket { private long targetId; private int levelUpPoints; }
20.076923
71
0.835249
18bbf5a7c5af8ab3ad3df838fa6a71bc16c729ba
316
package fi.riissanen.gwent.game.ui; import fi.riissanen.gwent.engine.render.SpriteBatch; /** * Provides a render method. * @author Daniel */ public interface Renderable { /** * Render method. * @param batch The sprite batch to render with */ public void render(SpriteBatch batch); }
18.588235
52
0.670886
a1bd3426583e440060817cebac0bb1fbce92099d
9,597
package ca.valacware.digblock.screens; import ca.valacware.digblock.Config; import ca.valacware.digblock.Graphics; import ca.valacware.digblock.chunk.*; import ca.valacware.digblock.Player; import ca.valacware.digblock.utils.*; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.IntSet; import java.util.ArrayList; import java.util.Iterator; import ca.valacware.digblock.input.*; /** * The world! * @author Zaneris */ public class World extends InputScreen { public static World world; private static final byte FPC = 30; // Frames per cycle private static final byte CHUNK_SIZE = Chunk.CHUNK_SIZE; private static final byte WORLD_VCHUNK = WorldBuilder.WORLD_VCHUNK; private static final byte WORLD_VBLOCK = WorldBuilder.WORLD_VBLOCK; public final ChunkMap<Chunk> chunkMap = new ChunkMap<>(); private final ChunkMap<Chunk> oldMap = new ChunkMap<>(); private final ArrayList<Chunk> buildQueue = new ArrayList<>(); private final ArrayList<Chunk> faceQueue = new ArrayList<>(); public final ArrayList<Chunk> meshQueue = new ArrayList<>(); private final ArrayList<Chunk> garbage = new ArrayList<>(); private final ArrayList<ChunkMesh> transMesh = new ArrayList<>(); private final OrthographicCamera lightSource; private final OrthographicCamera lightSource2; private final Vector3 light2Target = new Vector3(); private final ChunkBlock cb = new ChunkBlock(); private final Int3 target = new Int3(); private final Int3 cC = new Int3(); private final Int3 i = new Int3(); private final Player player; private byte frameCounter; private Texture depthMap; private Texture depthMap2; private double seed; private short depth; private float tod = 80f; private float tod2 = tod; private short todCount = 0; private boolean flip = false; /** * Create the world. */ public World() { super(false,true); world = this; seed = Math.random()*10000d; lightSource = new OrthographicCamera(); lightSource2 = new OrthographicCamera(); frameCounter = FPC; player = new Player(); updateDepth(); } private void updateDepth() { depth = (short)(Config.DRAW_DIST*16*2); lightSource.viewportHeight = 24; lightSource.viewportWidth = 24; lightSource.far = depth*2; lightSource2.viewportHeight = depth; lightSource2.viewportWidth = depth; lightSource2.far = depth*2; player.cam.far = depth; } private void buildChunks() { Chunk chunk; for(int i = 0; i < buildQueue.size(); i++) { chunk = buildQueue.remove(i); if(!chunk.garbage) { WorldBuilder.buildChunk(chunk,seed); faceQueue.add(chunk); chunk.built = true; return; } } } private void updateFaces() { Chunk chunk; for(int i = 0; i < faceQueue.size(); i++) { chunk = faceQueue.remove(i); if(!chunk.garbage && chunk.built) { chunk.updateFaces(); return; } } } private void createMeshes() { Chunk chunk; for(int i = 0; i < meshQueue.size(); i++) { chunk = meshQueue.remove(i); if(!chunk.garbage && chunk.built && chunk.wait) { ChunkMeshGenerator.createMesh(chunk); chunk.wait = false; return; } } } public ChunkBlock getChunkBlock(int x, int y, int z) { target.set(x, y, z); return getChunkBlock(target); } public ChunkBlock getChunkBlock(Int3 int3) { if(int3.y>WORLD_VBLOCK) return null; target.copyFrom(int3); cC.copyFrom(int3); target.mod(CHUNK_SIZE); cC.div(CHUNK_SIZE); if(cb.chunk == null || !cb.chunk.id.equals(cC)) cb.chunk = chunkMap.get(cC); if(cb.chunk==null || !cb.chunk.built) return null; cb.block = cb.chunk.blocks[target.x][target.y][target.z]; return cb; } private void updateWorldTime() { lightSource.position.set(player.cam.position); lightSource.position.y += depth; lightSource.lookAt(player.cam.position); lightSource.rotateAround(player.cam.position, Vector3.X, 3f); lightSource.rotateAround(player.cam.position, Vector3.Z, tod); lightSource.update(); lightSource2.position.set(light2Target); lightSource2.position.y += depth; lightSource2.lookAt(light2Target); lightSource2.rotateAround(light2Target, Vector3.Z, tod2); lightSource2.update(); tod -= .001f*(flip?-1f:1f); todCount++; if(todCount>200) { if(light2Target.dst(player.cam.position) > 32f) light2Target.set(player.cam.position); todCount = 0; tod2 = tod; } if(tod<-80f) flip = true; else if(tod>80f) flip = false; } private void updateVisible() { oldMap.putAll(chunkMap); chunkMap.clear(); Chunk chunk; Graphics.startRender(player.cam, lightSource, lightSource2, depthMap, depthMap2); Graphics.startSolid(); for (int r = 0; r < Config.DRAW_DIST; r++) { for (i.newLoop(-r, r); i.doneLoop(); i.cubeLoop()) { target.setPlus(i, player.currentChunk); if (target.y >= 0 && target.y < World.WORLD_VCHUNK) { if (player.currentChunk.distance(target) < Config.DRAW_DIST) { chunk = oldMap.remove(target); if(chunk!=null) { if (inFrustum(target)) { if (chunk.hasSolidMesh()) Graphics.renderMesh(chunk.solidMesh); if (chunk.hasTransMesh()) transMesh.add(chunk.transMesh); } chunkMap.add(chunk); } else if (buildQueue.size() < 10) { if(inFrustum(target) || r<2) { if (garbage.isEmpty()) chunk = new Chunk(); else chunk = garbage.remove(0); chunk.set(target); buildQueue.add(chunk); chunkMap.add(chunk); } } } } } } Graphics.endSolid(); renderTrans(); Graphics.endRender(); for(Chunk tR:oldMap.values()) { tR.reset(); garbage.add(tR); tR.garbage = true; } oldMap.clear(); } private void renderTrans() { Graphics.startTrans(); for(ChunkMesh mesh:transMesh) Graphics.renderMesh(mesh); transMesh.clear(); Graphics.endTrans(); } private boolean inFrustum(Int3 int3) { return player.cam.frustum.sphereInFrustumWithoutNearFar( int3.x*16+8, int3.y*16+8, int3.z*16+8, 13.86f); } @Override public void processKeysDown(IntSet keysDown) { IntSet.IntSetIterator iter = keysDown.iterator(); int key; while(iter.hasNext) { key = iter.next(); if(key==Config.Keys.UP[0] || key==Config.Keys.UP[1]) { player.axisY(1f); } else if (key==Config.Keys.DOWN[0] || key==Config.Keys.DOWN[1]) { player.axisY(-1f); } else if (key==Config.Keys.LEFT[0] || key==Config.Keys.LEFT[1]) { player.axisX(-1f); } else if (key==Config.Keys.RIGHT[0] || key==Config.Keys.RIGHT[1]) { player.axisX(1f); } else if (key==Config.Keys.JUMP[0] || key==Config.Keys.JUMP[1]) { player.jump = true; } else if (key==Config.Keys.QUIT[0] || key==Config.Keys.QUIT[1]) { Gdx.app.exit(); } } } @Override public void processKeysTyped(IntSet keys) { IntSet.IntSetIterator iter = keys.iterator(); int key; while(iter.hasNext) { key = iter.next(); if (key==Config.Keys.XRAY[0]) { Config.WIREFRAME = !Config.WIREFRAME; } } } @Override public void processTouch(IntMap<Int2> touch) { int deltaX, deltaY; for(IntMap.Entry entry:touch.entries()) { Int2 value = (Int2)entry.value; Int2 xy = InputHandler.getXY(entry.key); deltaX = value.x-xy.x; deltaY = value.y-xy.y; if(value.x < InputHandler.vWidth/2) { player.axisInput(-deltaX/100f,deltaY/100f); } else { if(player.setRot(deltaX,deltaY)) { value.x = xy.x; value.y = xy.y; player.jumpCount(); } } } } @Override public void processMouseMove(int x, int y) { int deltaX = InputHandler.vWidth/2 - x; int deltaY = InputHandler.vHeight/2 - y; if(player.setRot(deltaX,deltaY)) InputHandler.centerMouse(); } @Override public void run(float deltaTime) { player.move(deltaTime); player.update(); frameCounter++; if(frameCounter>=FPC) { frameCounter = 0; updateVisible(); } else { switch(frameCounter%3) { case 0: createMeshes(); break; case 1: buildChunks(); break; case 2: updateFaces(); } Chunk chunk; Graphics.startRender(player.cam,lightSource,lightSource2,depthMap,depthMap2); Graphics.startSolid(); for(IntMap.Entry entry:chunkMap) { chunk = (Chunk)entry.value; if(chunk.built && chunk.inDepth && inFrustum(chunk.id)) { if(chunk.hasSolidMesh()) Graphics.renderMesh(chunk.solidMesh); if(chunk.hasTransMesh()) transMesh.add(chunk.transMesh); } } Graphics.endSolid(); renderTrans(); Graphics.endRender(); updateWorldTime(); if(todCount==1) { Graphics.startDepth2(lightSource2); for (IntMap.Entry entry : chunkMap) { chunk = (Chunk) entry.value; if (chunk.built) { if (chunk.hasSolidMesh()) { Graphics.renderMesh(chunk.solidMesh); chunk.inDepth = true; } else if (chunk.hasTransMesh()) chunk.inDepth = true; } } depthMap2 = Graphics.endDepth2(); } else { Graphics.startDepth(lightSource); for(IntMap.Entry entry:chunkMap) { chunk = (Chunk)entry.value; if(chunk.built) { if(chunk.hasSolidMesh()) { Graphics.renderMesh(chunk.solidMesh); chunk.inDepth = true; } else if (chunk.hasTransMesh()) chunk.inDepth = true; } } depthMap = Graphics.endDepth(); } } } @Override public void dispose() { world = null; Chunk.dispose(); } @Override public void resize(int width, int height) { player.cam.viewportWidth = width; player.cam.viewportHeight = height; } }
27.110169
83
0.667917
7beb9e3fa639f731ee50878a9230f3411bf6f6fc
4,461
package com.aspose.words.examples.loading_saving; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.File; import javax.imageio.ImageIO; import com.aspose.words.Document; import com.aspose.words.IResourceLoadingCallback; import com.aspose.words.IWarningCallback; import com.aspose.words.LoadOptions; import com.aspose.words.ResourceLoadingAction; import com.aspose.words.ResourceLoadingArgs; import com.aspose.words.ResourceType; import com.aspose.words.WarningInfo; import com.aspose.words.examples.Utils; public class LoadOptionsCallbacks { public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = Utils.getDataDir(LoadOptionsCallbacks.class); LoadOptionsWarningCallback(dataDir); LoadOptionsResourceLoadingCallback(dataDir); } public static void LoadOptionsWarningCallback(String dataDir) throws Exception { // ExStart: LoadOptionsWarningCallback // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java // Create a new LoadOptions object and set its WarningCallback property. LoadOptions loadOptions = new LoadOptions(); loadOptions.setWarningCallback(new DocumentLoadingWarningCallback()); Document doc = new Document(dataDir + "input.docx", loadOptions); // ExEnd: LoadOptionsWarningCallback } // ExStart: DocumentLoadingWarningCallback // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java private static class DocumentLoadingWarningCallback implements IWarningCallback { public void warning(WarningInfo info) { // Prints warnings and their details as they arise during document loading. System.out.println("WARNING: " + info.getWarningType() + " source:" + info.getSource()); System.out.println("\tDescription: " + info.getDescription()); } } // ExEnd: DocumentLoadingWarningCallback public static void LoadOptionsResourceLoadingCallback(String dataDir) throws Exception { // ExStart:LoadOptionsResourceLoadingCallback // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java // Create a new LoadOptions object and set its ResourceLoadingCallback attribute // as an instance of our IResourceLoadingCallback implementation LoadOptions loadOptions = new LoadOptions(); loadOptions.setResourceLoadingCallback(new HtmlLinkedResourceLoadingCallback()); // When we open an Html document, external resources such as references to CSS // stylesheet files and external images // will be handled in a custom manner by the loading callback as the document is // loaded Document doc = new Document(dataDir + "Images.html", loadOptions); doc.save(dataDir + "Document.LoadOptionsCallback_out.pdf"); // ExEnd:LoadOptionsResourceLoadingCallback } // ExStart: HtmlLinkedResourceLoadingCallback // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java private static class HtmlLinkedResourceLoadingCallback implements IResourceLoadingCallback { public int resourceLoading(ResourceLoadingArgs args) throws Exception { switch (args.getResourceType()) { case ResourceType.CSS_STYLE_SHEET: { System.out.println("External CSS Stylesheet found upon loading: " + args.getOriginalUri()); // CSS file will don't used in the document return ResourceLoadingAction.SKIP; } case ResourceType.IMAGE: { // Replaces all images with a substitute String newImageFilename = "Logo.jpg"; System.out.println("\tImage will be substituted with: " + newImageFilename); BufferedImage newImage = ImageIO .read(new File(Utils.getDataDir(LoadOptionsCallbacks.class) + newImageFilename)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(newImage, "jpg", baos); baos.flush(); byte[] imageBytes = baos.toByteArray(); baos.close(); args.setData(imageBytes); // New images will be used instead of presented in the document return ResourceLoadingAction.USER_PROVIDED; } case ResourceType.DOCUMENT: { System.out.println("External document found upon loading: " + args.getOriginalUri()); // Will be used as usual return ResourceLoadingAction.DEFAULT; } default: throw new Exception("Unexpected ResourceType value."); } } } // ExEnd: HtmlLinkedResourceLoadingCallback }
39.131579
109
0.772248
f5ca24e3ede454ea480fa7980e4e6dedb438462f
2,706
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.devops_rdc.model.v20200303; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; /** * @author auto create * @version */ public class GetPipelineStepLogRequest extends RpcAcsRequest<GetPipelineStepLogResponse> { private Long offset; private String userPk; private String orgId; private Long pipelineId; private Long jobId; private String stepIndex; private Long limit; public GetPipelineStepLogRequest() { super("devops-rdc", "2020-03-03", "GetPipelineStepLog"); setMethod(MethodType.POST); } public Long getOffset() { return this.offset; } public void setOffset(Long offset) { this.offset = offset; if(offset != null){ putBodyParameter("Offset", offset.toString()); } } public String getUserPk() { return this.userPk; } public void setUserPk(String userPk) { this.userPk = userPk; if(userPk != null){ putBodyParameter("UserPk", userPk); } } public String getOrgId() { return this.orgId; } public void setOrgId(String orgId) { this.orgId = orgId; if(orgId != null){ putBodyParameter("OrgId", orgId); } } public Long getPipelineId() { return this.pipelineId; } public void setPipelineId(Long pipelineId) { this.pipelineId = pipelineId; if(pipelineId != null){ putBodyParameter("PipelineId", pipelineId.toString()); } } public Long getJobId() { return this.jobId; } public void setJobId(Long jobId) { this.jobId = jobId; if(jobId != null){ putBodyParameter("JobId", jobId.toString()); } } public String getStepIndex() { return this.stepIndex; } public void setStepIndex(String stepIndex) { this.stepIndex = stepIndex; if(stepIndex != null){ putBodyParameter("StepIndex", stepIndex); } } public Long getLimit() { return this.limit; } public void setLimit(Long limit) { this.limit = limit; if(limit != null){ putBodyParameter("Limit", limit.toString()); } } @Override public Class<GetPipelineStepLogResponse> getResponseClass() { return GetPipelineStepLogResponse.class; } }
21.140625
90
0.689209
4777f19288d2709befdfdee0717384cb47112467
1,606
package theInvoker.cards.spells; import basemod.abstracts.AbstractCardModifier; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.core.CardCrawlGame; import com.megacrit.cardcrawl.localization.CardStrings; import theInvoker.InvokerMod; import static theInvoker.InvokerMod.makeID; public class InvokedCardModifier extends AbstractCardModifier { public static String ID = InvokerMod.makeID(InvokedCardModifier.class.getSimpleName()); private static final String SPELL_CARD_ID = makeID(InvokedCardModifier.class.getSimpleName()); private static final CardStrings SPELL_STRINGS = CardCrawlGame.languagePack.getCardStrings(SPELL_CARD_ID); private static final String TEXT = SPELL_STRINGS.DESCRIPTION; private final int discount; public InvokedCardModifier(int discount) { this.discount = discount; } public String modifyDescription(String rawDescription, AbstractCard card) { return rawDescription + TEXT; } public boolean shouldApply(AbstractCard card) { return !card.exhaust && !card.isEthereal; } public void onInitialApplication(AbstractCard card) { int discountedCost = Math.max(card.cost - discount, 0); card.cost = discountedCost; card.costForTurn = discountedCost; card.exhaust = true; card.isEthereal = true; } // public void onRemove(AbstractCard card) { // } public AbstractCardModifier makeCopy() { return new InvokedCardModifier(discount); } public String identifier(AbstractCard card) { return ID; } }
32.12
110
0.737858
c031d66e8e563eedbba50547e91e7a79eea792f5
392
package com.sai.stringpractice; /* String Concatenation 1. Using + operator 2. Using concat method */ public class Example4 { public static void main(String[] args) { String s1 = "Hello"; String s2 = "Welcome"; //Concat using + operator System.out.println(s1+s2); //Concat using concat method System.out.println(s1.concat(s2)); } }
19.6
44
0.619898
4a5a8964a66c29a8c483306e810889b7be559af5
5,209
package com.sibilantsolutions.iptools.net; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.junit.Test; import com.sibilantsolutions.iptools.event.LostConnectionEvt; import com.sibilantsolutions.iptools.event.ReceiveEvt; import com.sibilantsolutions.iptools.event.SocketListenerI; public class LineParserBufferTest { @Test public void testOnReceive() { String data = "abc\r\n"; ReceiveEvt evt = new ReceiveEvt( data.getBytes(), null ); MyProc ircDataProc = new MyProc(); LineParserBuffer ircReceiver = new LineParserBuffer(); ircReceiver.setReceiver( ircDataProc ); ircReceiver.onReceive( evt ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); } @Test public void testOnReceive_multi() { String data = "abc\r\ndef\r\n"; ReceiveEvt evt = new ReceiveEvt( data.getBytes(), null ); MyProc ircDataProc = new MyProc(); LineParserBuffer ircReceiver = new LineParserBuffer(); ircReceiver.setReceiver( ircDataProc ); ircReceiver.onReceive( evt ); assertEquals( 2, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); assertEquals( "def", ircDataProc.lines.get( 1 ) ); } @Test public void testOnReceive_partial() { String data = "ab"; ReceiveEvt evt = new ReceiveEvt( data.getBytes(), null ); MyProc ircDataProc = new MyProc(); LineParserBuffer ircReceiver = new LineParserBuffer(); ircReceiver.setReceiver( ircDataProc ); ircReceiver.onReceive( evt ); assertEquals( 0, ircDataProc.lines.size() ); } @Test public void testOnReceive_multiAndPartial() { String data = "abc\r\ndef\r\ngh"; ReceiveEvt evt = new ReceiveEvt( data.getBytes(), null ); MyProc ircDataProc = new MyProc(); LineParserBuffer ircReceiver = new LineParserBuffer(); ircReceiver.setReceiver( ircDataProc ); ircReceiver.onReceive( evt ); assertEquals( 2, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); assertEquals( "def", ircDataProc.lines.get( 1 ) ); evt = new ReceiveEvt( "i\r\n".getBytes(), null ); ircReceiver.onReceive( evt ); assertEquals( 3, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); assertEquals( "def", ircDataProc.lines.get( 1 ) ); assertEquals( "ghi", ircDataProc.lines.get( 2 ) ); } @Test public void testOnReceive_singleBytes() { MyProc ircDataProc = new MyProc(); LineParserBuffer ircReceiver = new LineParserBuffer(); ircReceiver.setReceiver( ircDataProc ); ircReceiver.onReceive( new ReceiveEvt( "a".getBytes(), null ) ); assertEquals( 0, ircDataProc.lines.size() ); ircReceiver.onReceive( new ReceiveEvt( "b".getBytes(), null ) ); assertEquals( 0, ircDataProc.lines.size() ); ircReceiver.onReceive( new ReceiveEvt( "c".getBytes(), null ) ); assertEquals( 0, ircDataProc.lines.size() ); ircReceiver.onReceive( new ReceiveEvt( "\r".getBytes(), null ) ); assertEquals( 0, ircDataProc.lines.size() ); ircReceiver.onReceive( new ReceiveEvt( "\n".getBytes(), null ) ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); ircReceiver.onReceive( new ReceiveEvt( "d".getBytes(), null ) ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); ircReceiver.onReceive( new ReceiveEvt( "e".getBytes(), null ) ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); ircReceiver.onReceive( new ReceiveEvt( "f".getBytes(), null ) ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); ircReceiver.onReceive( new ReceiveEvt( "\r".getBytes(), null ) ); assertEquals( 1, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); ircReceiver.onReceive( new ReceiveEvt( "\n".getBytes(), null ) ); assertEquals( 2, ircDataProc.lines.size() ); assertEquals( "abc", ircDataProc.lines.get( 0 ) ); assertEquals( "def", ircDataProc.lines.get( 1 ) ); } static private class MyProc implements SocketListenerI { private List<String> lines = new ArrayList<String>(); @Override public void onLostConnection( LostConnectionEvt evt ) { // TODO Auto-generated method stub throw new UnsupportedOperationException( "OGTE TODO!" ); } @Override public void onReceive( ReceiveEvt evt ) { //TODO: Make sure that this uses the correct encoding. String line = new String( evt.getData(), evt.getOffset(), evt.getLength() ); lines.add( line ); } } }
30.109827
88
0.623536
1c849a15b17be7a01e54ca54a792d3b83e5ac09e
2,070
package com.crawl.entity; import java.io.Serializable; public class Custem implements Serializable{ /** * */ private static final long serialVersionUID = 390701803929381100L; /** * 品牌名称Id--->jd的商品号 * **/ private String CustomeId; /** * 品牌名称 * **/ private String BrandName; /** * 商品名称 * **/ private String CustomName; /** * jd商品编号 * **/ private String JdCudtomId; /** * 显卡 * **/ private String CustomGrap; /** * 内存 * **/ private String CustomMermy; /** * 硬盘 * **/ private String CustomHard; /** * 屏幕尺寸 * **/ private String CustomScreeSize; public String getCustomeId() { return CustomeId; } public void setCustomeId(String customeId) { CustomeId = customeId; } public String getBrandName() { return BrandName; } public void setBrandName(String brandName) { BrandName = brandName; } public String getCustomName() { return CustomName; } public void setCustomName(String customName) { CustomName = customName; } public String getJdCudtomId() { return JdCudtomId; } public void setJdCudtomId(String jdCudtomId) { JdCudtomId = jdCudtomId; } public String getCustomGrap() { return CustomGrap; } public void setCustomGrap(String customGrap) { CustomGrap = customGrap; } public String getCustomMermy() { return CustomMermy; } public void setCustomMermy(String customMermy) { CustomMermy = customMermy; } public String getCustomHard() { return CustomHard; } public void setCustomHard(String customHard) { CustomHard = customHard; } public String getCustomScreeSize() { return CustomScreeSize; } public void setCustomScreeSize(String customScreeSize) { CustomScreeSize = customScreeSize; } @Override public String toString() { return "Custem [CustomeId=" + CustomeId + ", BrandName=" + BrandName + ", CustomName=" + CustomName + ", JdCudtomId=" + JdCudtomId + ", CustomGrap=" + CustomGrap + ", CustomMermy=" + CustomMermy + ", CustomHard=" + CustomHard + ", CustomScreeSize=" + CustomScreeSize + "]"; } }
16.428571
101
0.674879
607dbd55099a8d7da7034df2964cff853ef6b4bb
2,726
/** * This class is generated by jOOQ */ package org.jooq.test.oracle3.generatedclasses.tables; /** * This class is generated by jOOQ. */ @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class T_EXOTIC_TYPES extends org.jooq.impl.TableImpl<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES> implements java.lang.Cloneable { private static final long serialVersionUID = 951214691; /** * The singleton instance of <code>T_EXOTIC_TYPES</code> */ public static final org.jooq.test.oracle3.generatedclasses.tables.T_EXOTIC_TYPES T_EXOTIC_TYPES = new org.jooq.test.oracle3.generatedclasses.tables.T_EXOTIC_TYPES(); /** * The class holding records for this type */ @Override public java.lang.Class<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES> getRecordType() { return org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES.class; } /** * The column <code>T_EXOTIC_TYPES.ID</code>. */ public final org.jooq.TableField<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES, java.lang.Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER, this); /** * The column <code>T_EXOTIC_TYPES.UU</code>. */ public final org.jooq.TableField<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES, java.lang.String> UU = createField("UU", org.jooq.impl.SQLDataType.CHAR.length(36), this); /** * Create a <code>T_EXOTIC_TYPES</code> table reference */ public T_EXOTIC_TYPES() { super("T_EXOTIC_TYPES", org.jooq.test.oracle3.generatedclasses.DefaultSchema.DEFAULT_SCHEMA); } /** * Create an aliased <code>T_EXOTIC_TYPES</code> table reference */ public T_EXOTIC_TYPES(java.lang.String alias) { super(alias, org.jooq.test.oracle3.generatedclasses.DefaultSchema.DEFAULT_SCHEMA, org.jooq.test.oracle3.generatedclasses.tables.T_EXOTIC_TYPES.T_EXOTIC_TYPES); } /** * {@inheritDoc} */ @Override public org.jooq.UniqueKey<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES> getPrimaryKey() { return org.jooq.test.oracle3.generatedclasses.Keys.PK_T_EXOTIC_TYPES; } /** * {@inheritDoc} */ @Override public java.util.List<org.jooq.UniqueKey<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES>> getKeys() { return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.test.oracle3.generatedclasses.tables.records.T_EXOTIC_TYPES>>asList(org.jooq.test.oracle3.generatedclasses.Keys.PK_T_EXOTIC_TYPES); } /** * {@inheritDoc} */ @Override public org.jooq.test.oracle3.generatedclasses.tables.T_EXOTIC_TYPES as(java.lang.String alias) { return new org.jooq.test.oracle3.generatedclasses.tables.T_EXOTIC_TYPES(alias); } }
36.346667
194
0.765957
4ea35579abb6f28d9589716084b1c8df86a33dc1
4,553
/* * $Id: AutoCompleteStyledDocument.java 3131 2008-12-05 14:18:13Z kschaefe $ * * Copyright 2008 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx.autocomplete; import java.awt.Color; import java.awt.Font; import javax.swing.text.AttributeSet; import javax.swing.text.DefaultStyledDocument; import javax.swing.text.Document; import javax.swing.text.Element; import javax.swing.text.Style; import javax.swing.text.StyledDocument; /** * * @author Karl George Schaefer */ public class AutoCompleteStyledDocument extends AutoCompleteDocument implements StyledDocument { /** * @param adaptor * @param strictMatching * @param stringConverter * @param delegate */ public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter, StyledDocument delegate) { super(adaptor, strictMatching, stringConverter, delegate); } /** * @param adaptor * @param strictMatching * @param stringConverter */ public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter) { super(adaptor, strictMatching, stringConverter); } /** * @param adaptor * @param strictMatching */ public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching) { super(adaptor, strictMatching); } /** * {@inheritDoc} */ @Override protected Document createDefaultDocument() { return new DefaultStyledDocument(); } /** * {@inheritDoc} */ public Style addStyle(String nm, Style parent) { return ((StyledDocument) delegate).addStyle(nm, parent); } /** * {@inheritDoc} */ public Color getBackground(AttributeSet attr) { return ((StyledDocument) delegate).getBackground(attr); } /** * {@inheritDoc} */ public Element getCharacterElement(int pos) { return ((StyledDocument) delegate).getCharacterElement(pos); } /** * {@inheritDoc} */ public Font getFont(AttributeSet attr) { return ((StyledDocument) delegate).getFont(attr); } /** * {@inheritDoc} */ public Color getForeground(AttributeSet attr) { return ((StyledDocument) delegate).getForeground(attr); } /** * {@inheritDoc} */ public Style getLogicalStyle(int p) { return ((StyledDocument) delegate).getLogicalStyle(p); } /** * {@inheritDoc} */ public Element getParagraphElement(int pos) { return ((StyledDocument) delegate).getParagraphElement(pos); } /** * {@inheritDoc} */ public Style getStyle(String nm) { return ((StyledDocument) delegate).getStyle(nm); } /** * {@inheritDoc} */ public void removeStyle(String nm) { ((StyledDocument) delegate).removeStyle(nm); } /** * {@inheritDoc} */ public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace) { ((StyledDocument) delegate).setCharacterAttributes(offset, length, s, replace); } /** * {@inheritDoc} */ public void setLogicalStyle(int pos, Style s) { ((StyledDocument) delegate).setLogicalStyle(pos, s); } /** * {@inheritDoc} */ public void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace) { ((StyledDocument) delegate).setParagraphAttributes(offset, length, s, replace); } }
27.762195
95
0.652317
f7acffa1cb13ecdbdb206b7d8301c04aaddb94a4
7,781
// Copyright (c) 2003-present, Jodd Team (http://jodd.org) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. package h2o.jodd.util; /** * Base32 encoding. Quite fast. */ public class Base32 { private static final String ERR_CANONICAL_LEN = "Invalid Base32 string length"; private static final String ERR_CANONICAL_END = "Invalid end bits of Base32 string"; private static final String ERR_INVALID_CHARS = "Invalid character in Base32 string"; private static final char[] CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".toCharArray(); private static final byte[] LOOKUP = { 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, // 0123456789:;<=>? -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // @ABCDEFGHIJKLMNO 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, // PQRSTUVWXYZ[\]^_ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // `abcdefghijklmno 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 // pqrstuvwxyz }; /** * Encode an array of binary bytes into a Base32 string. */ public static String encode(final byte[] bytes) { StringBuilder base32 = new StringBuilder((bytes.length * 8 + 4) / 5); int currByte, digit, i = 0; while (i < bytes.length) { // STEP 0; insert new 5 bits, leave 3 bits currByte = bytes[i++] & 255; base32.append(CHARS[currByte >> 3]); digit = (currByte & 7) << 2; if (i >= bytes.length) { base32.append(CHARS[digit]); break; } // STEP 3: insert 2 new bits, then 5 bits, leave 1 bit currByte = bytes[i++] & 255; base32.append(CHARS[digit | (currByte >> 6)]); base32.append(CHARS[(currByte >> 1) & 31]); digit = (currByte & 1) << 4; if (i >= bytes.length) { base32.append(CHARS[digit]); break; } // STEP 1: insert 4 new bits, leave 4 bit currByte = bytes[i++] & 255; base32.append(CHARS[digit | (currByte >> 4)]); digit = (currByte & 15) << 1; if (i >= bytes.length) { base32.append(CHARS[digit]); break; } // STEP 4: insert 1 new bit, then 5 bits, leave 2 bits currByte = bytes[i++] & 255; base32.append(CHARS[digit | (currByte >> 7)]); base32.append(CHARS[(currByte >> 2) & 31]); digit = (currByte & 3) << 3; if (i >= bytes.length) { base32.append(CHARS[digit]); break; } // STEP 2: insert 3 new bits, then 5 bits, leave 0 bit currByte = bytes[i++] & 255; base32.append(CHARS[digit | (currByte >> 5)]); base32.append(CHARS[currByte & 31]); } return base32.toString(); } /** * Decode a Base32 string into an array of binary bytes. */ public static byte[] decode(final String base32) throws IllegalArgumentException { switch (base32.length() % 8) { case 1: case 3: case 6: throw new IllegalArgumentException(ERR_CANONICAL_LEN); } byte[] bytes = new byte[base32.length() * 5 / 8]; int offset = 0, i = 0, lookup; byte nextByte, digit; while (i < base32.length()) { lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 0: leave 5 bits nextByte = (byte) (digit << 3); lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 5: insert 3 bits, leave 2 bits bytes[offset++] = (byte) (nextByte | (digit >> 2)); nextByte = (byte) ((digit & 3) << 6); if (i >= base32.length()) { if (nextByte != (byte) 0) { throw new IllegalArgumentException(ERR_CANONICAL_END); } break; } lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 2: leave 7 bits nextByte |= (byte) (digit << 1); lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 7: insert 1 bit, leave 4 bits bytes[offset++] = (byte) (nextByte | (digit >> 4)); nextByte = (byte) ((digit & 15) << 4); if (i >= base32.length()) { if (nextByte != (byte) 0) { throw new IllegalArgumentException(ERR_CANONICAL_END); } break; } lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 4: insert 4 bits, leave 1 bit bytes[offset++] = (byte) (nextByte | (digit >> 1)); nextByte = (byte) ((digit & 1) << 7); if (i >= base32.length()) { if (nextByte != (byte) 0) { throw new IllegalArgumentException(ERR_CANONICAL_END); } break; } lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 1: leave 6 bits nextByte |= (byte) (digit << 2); lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 6: insert 2 bits, leave 3 bits bytes[offset++] = (byte) (nextByte | (digit >> 3)); nextByte = (byte) ((digit & 7) << 5); if (i >= base32.length()) { if (nextByte != (byte) 0) { throw new IllegalArgumentException(ERR_CANONICAL_END); } break; } lookup = base32.charAt(i++) - '2'; if (lookup < 0 || lookup >= LOOKUP.length) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } digit = LOOKUP[lookup]; if (digit == -1) { throw new IllegalArgumentException(ERR_INVALID_CHARS); } // STEP n = 3: insert 5 bits, leave 0 bit bytes[offset++] = (byte) (nextByte | digit); } return bytes; } }
32.420833
86
0.635008
e03ca0e1f141280d0ec2c1727816cd6d593730e1
36,650
/* * Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.elasticfilesystem.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateFileSystem" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateFileSystemRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. * </p> */ private String creationToken; /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> */ private String performanceMode; /** * <p> * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have * the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key Management Service * (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, * <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * </p> */ private Boolean encrypted; /** * <p> * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required if you * want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS is used. This * ID can be in one of the following formats: * </p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. * </p> */ private String kmsKeyId; /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> */ private String throughputMode; /** * <p> * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The limit * on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more information, * see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS Limits That You Can * Increase</a> in the <i>Amazon EFS User Guide.</i> * </p> */ private Double provisionedThroughputInMibps; /** * <p> * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. * </p> * * @param creationToken * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. */ public void setCreationToken(String creationToken) { this.creationToken = creationToken; } /** * <p> * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. * </p> * * @return String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. */ public String getCreationToken() { return this.creationToken; } /** * <p> * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. * </p> * * @param creationToken * String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFileSystemRequest withCreationToken(String creationToken) { setCreationToken(creationToken); return this; } /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> * * @param performanceMode * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance * mode for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for * most file operations. This can't be changed after the file system has been created. * @see PerformanceMode */ public void setPerformanceMode(String performanceMode) { this.performanceMode = performanceMode; } /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> * * @return The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance * mode for most file systems. File systems using the <code>maxIO</code> performance mode can scale to * higher levels of aggregate throughput and operations per second with a tradeoff of slightly higher * latencies for most file operations. This can't be changed after the file system has been created. * @see PerformanceMode */ public String getPerformanceMode() { return this.performanceMode; } /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> * * @param performanceMode * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance * mode for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for * most file operations. This can't be changed after the file system has been created. * @return Returns a reference to this object so that method calls can be chained together. * @see PerformanceMode */ public CreateFileSystemRequest withPerformanceMode(String performanceMode) { setPerformanceMode(performanceMode); return this; } /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> * * @param performanceMode * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance * mode for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for * most file operations. This can't be changed after the file system has been created. * @see PerformanceMode */ public void setPerformanceMode(PerformanceMode performanceMode) { withPerformanceMode(performanceMode); } /** * <p> * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance mode * for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher levels of * aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file * operations. This can't be changed after the file system has been created. * </p> * * @param performanceMode * The <code>PerformanceMode</code> of the file system. We recommend <code>generalPurpose</code> performance * mode for most file systems. File systems using the <code>maxIO</code> performance mode can scale to higher * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for * most file operations. This can't be changed after the file system has been created. * @return Returns a reference to this object so that method calls can be chained together. * @see PerformanceMode */ public CreateFileSystemRequest withPerformanceMode(PerformanceMode performanceMode) { this.performanceMode = performanceMode.toString(); return this; } /** * <p> * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have * the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key Management Service * (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, * <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * </p> * * @param encrypted * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, * you have the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key * Management Service (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK * for Amazon EFS, <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. */ public void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } /** * <p> * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have * the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key Management Service * (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, * <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * </p> * * @return A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, * you have the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key * Management Service (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK * for Amazon EFS, <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. */ public Boolean getEncrypted() { return this.encrypted; } /** * <p> * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have * the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key Management Service * (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, * <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * </p> * * @param encrypted * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, * you have the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key * Management Service (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK * for Amazon EFS, <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFileSystemRequest withEncrypted(Boolean encrypted) { setEncrypted(encrypted); return this; } /** * <p> * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have * the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key Management Service * (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, * <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. * </p> * * @return A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, * you have the option of specifying a <a>CreateFileSystemRequest$KmsKeyId</a> for an existing AWS Key * Management Service (AWS KMS) customer master key (CMK). If you don't specify a CMK, then the default CMK * for Amazon EFS, <code>/aws/elasticfilesystem</code>, is used to protect the encrypted file system. */ public Boolean isEncrypted() { return this.encrypted; } /** * <p> * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required if you * want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS is used. This * ID can be in one of the following formats: * </p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. * </p> * * @param kmsKeyId * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required * if you want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS * is used. This ID can be in one of the following formats:</p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** * <p> * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required if you * want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS is used. This * ID can be in one of the following formats: * </p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. * </p> * * @return The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only * required if you want to use a non-default CMK. If this parameter is not specified, the default CMK for * Amazon EFS is used. This ID can be in one of the following formats:</p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. */ public String getKmsKeyId() { return this.kmsKeyId; } /** * <p> * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required if you * want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS is used. This * ID can be in one of the following formats: * </p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. * </p> * * @param kmsKeyId * The ID of the AWS KMS CMK to be used to protect the encrypted file system. This parameter is only required * if you want to use a non-default CMK. If this parameter is not specified, the default CMK for Amazon EFS * is used. This ID can be in one of the following formats:</p> * <ul> * <li> * <p> * Key ID - A unique identifier of the key, for example, <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * ARN - An Amazon Resource Name (ARN) for the key, for example, * <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. * </p> * </li> * <li> * <p> * Key alias - A previously created display name for a key. For example, <code>alias/projectKey1</code>. * </p> * </li> * <li> * <p> * Key alias ARN - An ARN for a key alias, for example, * <code>arn:aws:kms:us-west-2:444455556666:alias/projectKey1</code>. * </p> * </li> * </ul> * <p> * If KmsKeyId is specified, the <a>CreateFileSystemRequest$Encrypted</a> parameter must be set to true. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFileSystemRequest withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> * * @param throughputMode * The throughput mode for the file system to be created. There are two throughput modes to choose from for * your file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned * Throughput mode or change between the throughput modes as long as it’s been more than 24 hours since the * last decrease or throughput mode change. * @see ThroughputMode */ public void setThroughputMode(String throughputMode) { this.throughputMode = throughputMode; } /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> * * @return The throughput mode for the file system to be created. There are two throughput modes to choose from for * your file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned * Throughput mode or change between the throughput modes as long as it’s been more than 24 hours since the * last decrease or throughput mode change. * @see ThroughputMode */ public String getThroughputMode() { return this.throughputMode; } /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> * * @param throughputMode * The throughput mode for the file system to be created. There are two throughput modes to choose from for * your file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned * Throughput mode or change between the throughput modes as long as it’s been more than 24 hours since the * last decrease or throughput mode change. * @return Returns a reference to this object so that method calls can be chained together. * @see ThroughputMode */ public CreateFileSystemRequest withThroughputMode(String throughputMode) { setThroughputMode(throughputMode); return this; } /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> * * @param throughputMode * The throughput mode for the file system to be created. There are two throughput modes to choose from for * your file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned * Throughput mode or change between the throughput modes as long as it’s been more than 24 hours since the * last decrease or throughput mode change. * @see ThroughputMode */ public void setThroughputMode(ThroughputMode throughputMode) { withThroughputMode(throughputMode); } /** * <p> * The throughput mode for the file system to be created. There are two throughput modes to choose from for your * file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned Throughput * mode or change between the throughput modes as long as it’s been more than 24 hours since the last decrease or * throughput mode change. * </p> * * @param throughputMode * The throughput mode for the file system to be created. There are two throughput modes to choose from for * your file system: bursting and provisioned. You can decrease your file system's throughput in Provisioned * Throughput mode or change between the throughput modes as long as it’s been more than 24 hours since the * last decrease or throughput mode change. * @return Returns a reference to this object so that method calls can be chained together. * @see ThroughputMode */ public CreateFileSystemRequest withThroughputMode(ThroughputMode throughputMode) { this.throughputMode = throughputMode.toString(); return this; } /** * <p> * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The limit * on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more information, * see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS Limits That You Can * Increase</a> in the <i>Amazon EFS User Guide.</i> * </p> * * @param provisionedThroughputInMibps * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The * limit on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more * information, see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS * Limits That You Can Increase</a> in the <i>Amazon EFS User Guide.</i> */ public void setProvisionedThroughputInMibps(Double provisionedThroughputInMibps) { this.provisionedThroughputInMibps = provisionedThroughputInMibps; } /** * <p> * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The limit * on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more information, * see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS Limits That You Can * Increase</a> in the <i>Amazon EFS User Guide.</i> * </p> * * @return The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The * limit on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more * information, see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS * Limits That You Can Increase</a> in the <i>Amazon EFS User Guide.</i> */ public Double getProvisionedThroughputInMibps() { return this.provisionedThroughputInMibps; } /** * <p> * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The limit * on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more information, * see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS Limits That You Can * Increase</a> in the <i>Amazon EFS User Guide.</i> * </p> * * @param provisionedThroughputInMibps * The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. The * limit on throughput is 1024 MiB/s. You can get these limits increased by contacting AWS Support. For more * information, see <a href="http://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits">Amazon EFS * Limits That You Can Increase</a> in the <i>Amazon EFS User Guide.</i> * @return Returns a reference to this object so that method calls can be chained together. */ public CreateFileSystemRequest withProvisionedThroughputInMibps(Double provisionedThroughputInMibps) { setProvisionedThroughputInMibps(provisionedThroughputInMibps); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCreationToken() != null) sb.append("CreationToken: ").append(getCreationToken()).append(","); if (getPerformanceMode() != null) sb.append("PerformanceMode: ").append(getPerformanceMode()).append(","); if (getEncrypted() != null) sb.append("Encrypted: ").append(getEncrypted()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getThroughputMode() != null) sb.append("ThroughputMode: ").append(getThroughputMode()).append(","); if (getProvisionedThroughputInMibps() != null) sb.append("ProvisionedThroughputInMibps: ").append(getProvisionedThroughputInMibps()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateFileSystemRequest == false) return false; CreateFileSystemRequest other = (CreateFileSystemRequest) obj; if (other.getCreationToken() == null ^ this.getCreationToken() == null) return false; if (other.getCreationToken() != null && other.getCreationToken().equals(this.getCreationToken()) == false) return false; if (other.getPerformanceMode() == null ^ this.getPerformanceMode() == null) return false; if (other.getPerformanceMode() != null && other.getPerformanceMode().equals(this.getPerformanceMode()) == false) return false; if (other.getEncrypted() == null ^ this.getEncrypted() == null) return false; if (other.getEncrypted() != null && other.getEncrypted().equals(this.getEncrypted()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getThroughputMode() == null ^ this.getThroughputMode() == null) return false; if (other.getThroughputMode() != null && other.getThroughputMode().equals(this.getThroughputMode()) == false) return false; if (other.getProvisionedThroughputInMibps() == null ^ this.getProvisionedThroughputInMibps() == null) return false; if (other.getProvisionedThroughputInMibps() != null && other.getProvisionedThroughputInMibps().equals(this.getProvisionedThroughputInMibps()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCreationToken() == null) ? 0 : getCreationToken().hashCode()); hashCode = prime * hashCode + ((getPerformanceMode() == null) ? 0 : getPerformanceMode().hashCode()); hashCode = prime * hashCode + ((getEncrypted() == null) ? 0 : getEncrypted().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getThroughputMode() == null) ? 0 : getThroughputMode().hashCode()); hashCode = prime * hashCode + ((getProvisionedThroughputInMibps() == null) ? 0 : getProvisionedThroughputInMibps().hashCode()); return hashCode; } @Override public CreateFileSystemRequest clone() { return (CreateFileSystemRequest) super.clone(); } }
46.867008
159
0.645402
d2017829c90f35f69fe7fe0a8030dbbe7946f51f
9,590
/* * Copyright 2006-2020 www.anyline.org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package org.anyline.web.tag; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.anyline.util.BasicUtil; import org.anyline.util.BeanUtil; import org.anyline.util.ConfigTable; import org.anyline.util.DESUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BaseBodyTag extends BodyTagSupport implements Cloneable{ private static final long serialVersionUID = 1L; protected final Logger log = LoggerFactory.getLogger(this.getClass()); protected List<Object> paramList = null; protected Map<String,Object> paramMap = null; protected String body = null; protected String id; protected String name; protected Object value; protected Object evl; protected Object nvl; protected String clazz; protected String style; protected String onclick; protected String onchange; protected String onblur; protected String onfocus; protected String disabled; protected String readonly; protected String extra; protected String extraPrefix = "data-"; protected Object extraData; protected String itemExtra; protected String var; protected boolean encrypt; //是否加密 public String getItemExtra() { return itemExtra; } public void setItemExtra(String itemExtra) { this.itemExtra = itemExtra; } public String getExtra() { return extra; } public void setExtra(String extra) { this.extra = extra; } public String getDisabled() { return disabled; } public void setDisabled(String disabled) { this.disabled = disabled; } protected String attribute(){ String html = ""; if(null != id){ html += " id=\"" + id + "\""; } if(null != name){ html += " name=\"" + name + "\""; } // if(null != value){ // html += " value=\"" + value + "\""; // } if(null != clazz){ html += " class=\"" + clazz + "\""; } if(null != style){ html += " style=\"" + style + "\""; } if(null != onclick){ html += " onclick=\"" + onclick + "\""; } if(null != onchange){ html += " onchange=\"" + onchange + "\""; } if(null != onblur){ html += " onblur=\"" + onblur + "\""; } if(null != onfocus){ html += " onfocus=\"" + onfocus + "\""; } if(BasicUtil.isNotEmpty(disabled) && !"false".equalsIgnoreCase(disabled)){ html += " disabled=\"" + disabled + "\""; } if(BasicUtil.isNotEmpty(readonly) && !"false".equalsIgnoreCase(readonly)){ html += " readonly=\"" + readonly + "\""; } html += crateExtraData(); return html; } protected String parseRuntimeValue(Object obj, String key){ return parseRuntimeValue(obj, key, false); } protected String parseRuntimeValue(Object obj, String key, boolean encrypt){ if(null == obj){ return key; } String value = key; if(BasicUtil.isNotEmpty(key)){ if(key.contains("{")){ value = BeanUtil.parseFinalValue(obj, key); } else { value = BeanUtil.getFieldValue(obj, key) + ""; if (encrypt) { value = DESUtil.encryptValue(value + ""); } } } if(ConfigTable.isDebug() && log.isWarnEnabled()){ //log.warn("[parse run time value][key:"+key+"][value:"+value+"]"); } return value; } /** * 条目data-* * itemExtra = "ID:1" * itemExtra = "ID:{ID}" * itemExtra = "ID:{ID}-{NM}" * @param obj obj * @return return */ protected String crateExtraData(Object obj){ String html = ""; if(BasicUtil.isNotEmpty(itemExtra)){ String[] list = itemExtra.split(","); for(String item:list){ String[] tmps = item.split(":"); if(tmps.length>=2){ String id = tmps[0]; String key = tmps[1]; String value = parseRuntimeValue(obj,key); if(null == value){ value = ""; } html += extraPrefix + id + "=\"" + value + "\""; } } } return html; } protected String crateExtraData(){ String html = ""; if(BasicUtil.isNotEmpty(extra)){ if(extra.startsWith("{") && extra.endsWith("}")){ //{id:1,nm:2} > data-id=1,data-nm=2 extra = extra.substring(1,extra.length()-1); String[] list = extra.split(","); for(String item:list){ String[] tmps = item.split(":"); if(tmps.length>=2){ html += extraPrefix + tmps[0] + "=\"" + tmps[1] + "\""; } } }else{ //id:ID,name:{NM}-{CODE} > data-id=extraData.get("ID"),data-NAME=extraData.get("NM")-extraData.get("CODE") String[] list = extra.split(","); for(String item:list){ String[] tmps = item.split(":"); if(tmps.length>=2){ String value = parseRuntimeValue(extraData, tmps[1]); html += extraPrefix + tmps[0] + "=\"" + value + "\""; } } } } return html; } public int doStartTag() throws JspException { return EVAL_BODY_BUFFERED; } public int doAfterBody() throws JspException { if(null != bodyContent){ body = bodyContent.getString().trim(); } return super.doAfterBody(); } public int doEndTag() throws JspException { return EVAL_PAGE; } @Override public void release() { super.release(); if(null != paramList){ paramList.clear(); } if(null != paramMap){ paramMap.clear(); } body = null; id = null; name = null; value = null; //evl = false; evl = null; nvl = null; clazz = null; style = null; onclick = null; onchange = null; onblur = null; onfocus = null; disabled = null; extra = null; itemExtra = null; readonly = null; encrypt = false; extraPrefix ="data-"; extraData = null; var = null; } @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); } @SuppressWarnings({ "rawtypes", "unchecked" }) public void addParam(String key, Object value) { // if(null == value || "".equals(value.toString().trim())){ // return ; // } if(null == key){ if(null == paramList){ paramList = new ArrayList<Object>(); } if(value instanceof Collection){ paramList.addAll((Collection)value); }else{ paramList.add(value); } }else{ if(null == paramMap){ paramMap = new HashMap<String,Object>(); } paramMap.put(key.trim(), value); } } public BodyContent getBodyContent() { return super.getBodyContent(); } public void setBodyContent(BodyContent b) { super.setBodyContent(b); } public String getBody() { return body; } public void setBody(String body) { // if(evl && BasicUtil.isNotEmpty(body)){ // String str = body.toString(); // if(str.contains(",")){ // String[] strs = str.split(","); // body = (String)BasicUtil.nvl(strs); // } // } this.body = body; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Object getValue() { return value; } public void setValue(Object value) { // if(evl && BasicUtil.isNotEmpty(value)){ // String str = value.toString(); // if(str.contains(",")){ // String[] strs = str.split(","); // value = BasicUtil.nvl(strs); // } // } this.value = value; } public String getClazz() { return clazz; } public void setClazz(String clazz) { this.clazz = clazz; } public String getStyle() { return style; } public void setStyle(String style) { this.style = style; } public String getOnclick() { return onclick; } public void setOnclick(String onclick) { this.onclick = onclick; } public String getOnchange() { return onchange; } public void setOnchange(String onchange) { this.onchange = onchange; } public String getOnblur() { return onblur; } public void setOnblur(String onblur) { this.onblur = onblur; } public String getOnfocus() { return onfocus; } public void setOnfocus(String onfocus) { this.onfocus = onfocus; } public boolean isEncrypt() { return encrypt; } public void setEncrypt(boolean encrypt) { this.encrypt = encrypt; } public String getReadonly() { return readonly; } public void setReadonly(String readonly) { this.readonly = readonly; } // public boolean isEvl() { // return evl; // } // public void setEvl(boolean evl) { // this.evl = evl; // } public Object getEvl() { return evl; } public void setEvl(Object evl) { this.evl = evl; } public Object getNvl() { return nvl; } public void setNvl(Object nvl) { this.nvl = nvl; } public String getExtraPrefix() { return extraPrefix; } public void setExtraPrefix(String extraPrefix) { this.extraPrefix = extraPrefix; } public Object getExtraData() { return extraData; } public void setExtraData(Object extraData) { this.extraData = extraData; } public String getVar() { return var; } public void setVar(String var) { this.var = var; } }
23.447433
110
0.630553
3b12236e856644615de6d58976697761d2dec47a
24,656
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package org.apache.doris.qe; import org.apache.doris.analysis.AccessTestUtil; import org.apache.doris.analysis.Analyzer; import org.apache.doris.analysis.DdlStmt; import org.apache.doris.analysis.Expr; import org.apache.doris.analysis.KillStmt; import org.apache.doris.analysis.QueryStmt; import org.apache.doris.analysis.RedirectStatus; import org.apache.doris.analysis.SetStmt; import org.apache.doris.analysis.ShowAuthorStmt; import org.apache.doris.analysis.ShowStmt; import org.apache.doris.analysis.SqlParser; import org.apache.doris.analysis.SqlScanner; import org.apache.doris.analysis.UseStmt; import org.apache.doris.catalog.Catalog; import org.apache.doris.common.DdlException; import org.apache.doris.common.util.RuntimeProfile; import org.apache.doris.metric.MetricRepo; import org.apache.doris.mysql.MysqlChannel; import org.apache.doris.mysql.MysqlSerializer; import org.apache.doris.planner.Planner; import org.apache.doris.rewrite.ExprRewriter; import org.apache.doris.service.FrontendOptions; import org.apache.doris.thrift.TQueryOptions; import org.apache.doris.thrift.TUniqueId; import com.google.common.collect.Lists; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.io.IOException; import java.lang.reflect.Field; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.util.List; import java.util.SortedMap; import java_cup.runtime.Symbol; @RunWith(PowerMockRunner.class) @PowerMockIgnore({"org.apache.log4j.*", "javax.management.*"}) @PrepareForTest({StmtExecutor.class, DdlExecutor.class, Catalog.class}) public class StmtExecutorTest { private ConnectContext ctx; private QueryState state; private ConnectScheduler scheduler; @BeforeClass public static void start() { MetricRepo.init(); try { FrontendOptions.init(); } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Before public void setUp() throws IOException { state = new QueryState(); MysqlChannel channel = EasyMock.createMock(MysqlChannel.class); channel.sendOnePacket(EasyMock.isA(ByteBuffer.class)); EasyMock.expectLastCall().anyTimes(); channel.reset(); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(channel); scheduler = EasyMock.createMock(ConnectScheduler.class); ctx = EasyMock.createMock(ConnectContext.class); EasyMock.expect(ctx.getMysqlChannel()).andReturn(channel).anyTimes(); EasyMock.expect(ctx.getSerializer()).andReturn(MysqlSerializer.newInstance()).anyTimes(); EasyMock.expect(ctx.getCatalog()).andReturn(AccessTestUtil.fetchAdminCatalog()).anyTimes(); EasyMock.expect(ctx.getState()).andReturn(state).anyTimes(); EasyMock.expect(ctx.getConnectScheduler()).andReturn(scheduler).anyTimes(); EasyMock.expect(ctx.getConnectionId()).andReturn(1).anyTimes(); EasyMock.expect(ctx.getQualifiedUser()).andReturn("testUser").anyTimes(); ctx.setKilled(); EasyMock.expectLastCall().anyTimes(); ctx.updateReturnRows(EasyMock.anyInt()); EasyMock.expectLastCall().anyTimes(); ctx.setQueryId(EasyMock.isA(TUniqueId.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(ctx.queryId()).andReturn(new TUniqueId()).anyTimes(); EasyMock.expect(ctx.getStartTime()).andReturn(0L).anyTimes(); EasyMock.expect(ctx.getDatabase()).andReturn("testDb").anyTimes(); SessionVariable sessionVariable = new SessionVariable(); EasyMock.expect(ctx.getSessionVariable()).andReturn(sessionVariable).anyTimes(); ctx.setStmtId(EasyMock.anyLong()); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(ctx.getStmtId()).andReturn(1L).anyTimes(); EasyMock.replay(ctx); } @Test public void testSelect() throws Exception { QueryStmt queryStmt = EasyMock.createMock(QueryStmt.class); queryStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(queryStmt.getColLabels()).andReturn(Lists.<String>newArrayList()).anyTimes(); EasyMock.expect(queryStmt.getResultExprs()).andReturn(Lists.<Expr>newArrayList()).anyTimes(); EasyMock.expect(queryStmt.isExplain()).andReturn(false).anyTimes(); queryStmt.getDbs(EasyMock.isA(Analyzer.class), EasyMock.isA(SortedMap.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(queryStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); queryStmt.rewriteExprs(EasyMock.isA(ExprRewriter.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(queryStmt); Symbol symbol = new Symbol(0, queryStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // mock planner Planner planner = EasyMock.createMock(Planner.class); planner.plan(EasyMock.isA(QueryStmt.class), EasyMock.isA(Analyzer.class), EasyMock.isA(TQueryOptions.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(planner); PowerMock.expectNew(Planner.class).andReturn(planner).anyTimes(); PowerMock.replay(Planner.class); // mock coordinator Coordinator cood = EasyMock.createMock(Coordinator.class); cood.exec(); EasyMock.expectLastCall().anyTimes(); cood.endProfile(); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(cood.getQueryProfile()).andReturn(new RuntimeProfile()).anyTimes(); EasyMock.expect(cood.getNext()).andReturn(new RowBatch()).anyTimes(); EasyMock.replay(cood); PowerMock.expectNew(Coordinator.class, EasyMock.isA(ConnectContext.class), EasyMock.isA(Analyzer.class), EasyMock.isA(Planner.class)) .andReturn(cood).anyTimes(); PowerMock.replay(Coordinator.class); Catalog catalog = Catalog.getInstance(); Field field = catalog.getClass().getDeclaredField("canRead"); field.setAccessible(true); field.setBoolean(catalog, true); PowerMock.mockStatic(Catalog.class); EasyMock.expect(Catalog.getInstance()).andReturn(catalog).anyTimes(); PowerMock.replay(Catalog.class); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.EOF, state.getStateType()); } @Test public void testShow() throws Exception { ShowStmt showStmt = EasyMock.createMock(ShowStmt.class); showStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(showStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.expect(showStmt.toSelectStmt(EasyMock.isA(Analyzer.class))).andReturn(null).anyTimes(); EasyMock.replay(showStmt); Symbol symbol = new Symbol(0, showStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // mock show List<List<String>> rows = Lists.newArrayList(); rows.add(Lists.newArrayList("abc", "bcd")); ShowExecutor executor = EasyMock.createMock(ShowExecutor.class); EasyMock.expect(executor.execute()).andReturn(new ShowResultSet(new ShowAuthorStmt().getMetaData(), rows)) .anyTimes(); EasyMock.replay(executor); PowerMock.expectNew(ShowExecutor.class, EasyMock.isA(ConnectContext.class), EasyMock.isA(ShowStmt.class)) .andReturn(executor).anyTimes(); PowerMock.replay(ShowExecutor.class); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.EOF, state.getStateType()); } @Test public void testShowNull() throws Exception { ShowStmt showStmt = EasyMock.createMock(ShowStmt.class); showStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(showStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.expect(showStmt.toSelectStmt(EasyMock.isA(Analyzer.class))).andReturn(null).anyTimes(); EasyMock.replay(showStmt); Symbol symbol = new Symbol(0, showStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // mock show List<List<String>> rows = Lists.newArrayList(); rows.add(Lists.newArrayList("abc", "bcd")); ShowExecutor executor = EasyMock.createMock(ShowExecutor.class); EasyMock.expect(executor.execute()).andReturn(null).anyTimes(); EasyMock.replay(executor); PowerMock.expectNew(ShowExecutor.class, EasyMock.isA(ConnectContext.class), EasyMock.isA(ShowStmt.class)) .andReturn(executor).anyTimes(); PowerMock.replay(ShowExecutor.class); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.OK, state.getStateType()); } @Test public void testKill() throws Exception { KillStmt killStmt = EasyMock.createMock(KillStmt.class); killStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(killStmt.getConnectionId()).andReturn(1L).anyTimes(); EasyMock.expect(killStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(killStmt); Symbol symbol = new Symbol(0, killStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // suicide EasyMock.expect(scheduler.getContext(1L)).andReturn(ctx); EasyMock.replay(scheduler); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.OK, state.getStateType()); } @Test public void testKillOtherFail() throws Exception { KillStmt killStmt = EasyMock.createMock(KillStmt.class); killStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(killStmt.getConnectionId()).andReturn(1L).anyTimes(); EasyMock.expect(killStmt.isConnectionKill()).andReturn(true).anyTimes(); EasyMock.expect(killStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(killStmt); Symbol symbol = new Symbol(0, killStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); ConnectContext killCtx = EasyMock.createMock(ConnectContext.class); EasyMock.expect(killCtx.getCatalog()).andReturn(AccessTestUtil.fetchAdminCatalog()).anyTimes(); EasyMock.expect(killCtx.getQualifiedUser()).andReturn("blockUser").anyTimes(); killCtx.kill(true); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(killCtx); // suicide EasyMock.expect(scheduler.getContext(1L)).andReturn(killCtx); EasyMock.replay(scheduler); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testKillOther() throws Exception { KillStmt killStmt = EasyMock.createMock(KillStmt.class); killStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(killStmt.getConnectionId()).andReturn(1L).anyTimes(); EasyMock.expect(killStmt.isConnectionKill()).andReturn(true).anyTimes(); EasyMock.expect(killStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(killStmt); Symbol symbol = new Symbol(0, killStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); ConnectContext killCtx = EasyMock.createMock(ConnectContext.class); EasyMock.expect(killCtx.getCatalog()).andReturn(AccessTestUtil.fetchAdminCatalog()).anyTimes(); EasyMock.expect(killCtx.getQualifiedUser()).andReturn("killUser").anyTimes(); killCtx.kill(true); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(killCtx); // suicide EasyMock.expect(scheduler.getContext(1L)).andReturn(killCtx); EasyMock.replay(scheduler); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testKillNoCtx() throws Exception { KillStmt killStmt = EasyMock.createMock(KillStmt.class); killStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(killStmt.getConnectionId()).andReturn(1L).anyTimes(); EasyMock.expect(killStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(killStmt); Symbol symbol = new Symbol(0, killStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // suicide EasyMock.expect(scheduler.getContext(1L)).andReturn(null); EasyMock.replay(scheduler); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testSet() throws Exception { SetStmt setStmt = EasyMock.createMock(SetStmt.class); setStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(setStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(setStmt); Symbol symbol = new Symbol(0, setStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // Mock set SetExecutor executor = EasyMock.createMock(SetExecutor.class); executor.execute(); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(executor); PowerMock.expectNew(SetExecutor.class, EasyMock.isA(ConnectContext.class), EasyMock.isA(SetStmt.class)) .andReturn(executor).anyTimes(); PowerMock.replay(SetExecutor.class); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.OK, state.getStateType()); } @Test public void testSetFail() throws Exception { SetStmt setStmt = EasyMock.createMock(SetStmt.class); setStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(setStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(setStmt); Symbol symbol = new Symbol(0, setStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // Mock set SetExecutor executor = EasyMock.createMock(SetExecutor.class); executor.execute(); EasyMock.expectLastCall().andThrow(new DdlException("failed.")).anyTimes(); EasyMock.replay(executor); PowerMock.expectNew(SetExecutor.class, EasyMock.isA(ConnectContext.class), EasyMock.isA(SetStmt.class)) .andReturn(executor).anyTimes(); PowerMock.replay(SetExecutor.class); StmtExecutor stmtExecutor = new StmtExecutor(ctx, ""); stmtExecutor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testDdl() throws Exception { DdlStmt ddlStmt = EasyMock.createMock(DdlStmt.class); ddlStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(ddlStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(ddlStmt); Symbol symbol = new Symbol(0, ddlStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // Mock ddl PowerMock.mockStatic(DdlExecutor.class); DdlExecutor.execute(EasyMock.isA(Catalog.class), EasyMock.isA(DdlStmt.class)); EasyMock.expectLastCall().anyTimes(); PowerMock.replay(DdlExecutor.class); StmtExecutor executor = new StmtExecutor(ctx, ""); executor.execute(); Assert.assertEquals(QueryState.MysqlStateType.OK, state.getStateType()); } @Test public void testDdlFail() throws Exception { DdlStmt ddlStmt = EasyMock.createMock(DdlStmt.class); ddlStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(ddlStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(ddlStmt); Symbol symbol = new Symbol(0, ddlStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // Mock ddl PowerMock.mockStatic(DdlExecutor.class); DdlExecutor.execute(EasyMock.isA(Catalog.class), EasyMock.isA(DdlStmt.class)); EasyMock.expectLastCall().andThrow(new DdlException("ddl fail")); PowerMock.replay(DdlExecutor.class); StmtExecutor executor = new StmtExecutor(ctx, ""); executor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testDdlFail2() throws Exception { DdlStmt ddlStmt = EasyMock.createMock(DdlStmt.class); ddlStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(ddlStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.replay(ddlStmt); Symbol symbol = new Symbol(0, ddlStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); // Mock ddl PowerMock.mockStatic(DdlExecutor.class); DdlExecutor.execute(EasyMock.isA(Catalog.class), EasyMock.isA(DdlStmt.class)); EasyMock.expectLastCall().andThrow(new Exception("bug")); PowerMock.replay(DdlExecutor.class); StmtExecutor executor = new StmtExecutor(ctx, ""); executor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } @Test public void testUse() throws Exception { UseStmt useStmt = EasyMock.createMock(UseStmt.class); useStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(useStmt.getDatabase()).andReturn("testDb").anyTimes(); EasyMock.expect(useStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.expect(useStmt.getClusterName()).andReturn("testCluster").anyTimes(); EasyMock.replay(useStmt); Symbol symbol = new Symbol(0, useStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); StmtExecutor executor = new StmtExecutor(ctx, ""); executor.execute(); Assert.assertEquals(QueryState.MysqlStateType.OK, state.getStateType()); } @Test public void testUseFail() throws Exception { UseStmt useStmt = EasyMock.createMock(UseStmt.class); useStmt.analyze(EasyMock.isA(Analyzer.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(useStmt.getDatabase()).andReturn("blockDb").anyTimes(); EasyMock.expect(useStmt.getRedirectStatus()).andReturn(RedirectStatus.NO_FORWARD).anyTimes(); EasyMock.expect(useStmt.getClusterName()).andReturn("testCluster").anyTimes(); EasyMock.replay(useStmt); Symbol symbol = new Symbol(0, useStmt); SqlParser parser = EasyMock.createMock(SqlParser.class); EasyMock.expect(parser.parse()).andReturn(symbol).anyTimes(); EasyMock.replay(parser); PowerMock.expectNew(SqlParser.class, EasyMock.isA(SqlScanner.class)).andReturn(parser); PowerMock.replay(SqlParser.class); StmtExecutor executor = new StmtExecutor(ctx, ""); executor.execute(); Assert.assertEquals(QueryState.MysqlStateType.ERR, state.getStateType()); } }
43.104895
117
0.698816
7dc1d85ddbbad537780edb27e967096968517242
192
package debgquestion; public class Debug { public static void main(String[] args) { System.out.println("We will learn debugging by removing all the errors from this python file"); } }
17.454545
97
0.734375
081ff61743de1b6039b0173b447aa6452c08314f
6,600
/* * Copyright (C) 2004-2016 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package quests.Q00192_SevenSignsSeriesOfDoubt; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.State; /** * Seven Signs, Series of Doubt (192) * @author Adry_85 */ public final class Q00192_SevenSignsSeriesOfDoubt extends Quest { // NPCs private static final int HOLLINT = 30191; private static final int HECTOR = 30197; private static final int STAN = 30200; private static final int CROOP = 30676; private static final int UNIDENTIFIED_BODY = 32568; // Items private static final int CROOPS_INTRODUCTION = 13813; private static final int JACOBS_NECKLACE = 13814; private static final int CROOPS_LETTER = 13815; // Misc private static final int MIN_LEVEL = 79; public Q00192_SevenSignsSeriesOfDoubt() { super(192, Q00192_SevenSignsSeriesOfDoubt.class.getSimpleName(), "Seven Signs, Series of Doubt"); addStartNpc(CROOP, UNIDENTIFIED_BODY); addTalkId(CROOP, STAN, UNIDENTIFIED_BODY, HECTOR, HOLLINT); registerQuestItems(CROOPS_INTRODUCTION, JACOBS_NECKLACE, CROOPS_LETTER); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return null; } String htmltext = null; switch (event) { case "30676-02.htm": { htmltext = event; break; } case "30676-03.html": { st.startQuest(); htmltext = event; break; } case "video": { if (st.isCond(1)) { st.setCond(2, true); player.showQuestMovie(8); startQuestTimer("back", 32000, npc, player); return ""; } break; } case "back": { player.teleToLocation(81654, 54851, -1513); return ""; } case "30676-10.html": case "30676-11.html": case "30676-12.html": case "30676-13.html": { if (st.isCond(6) && st.hasQuestItems(JACOBS_NECKLACE)) { htmltext = event; } break; } case "30676-14.html": { if (st.isCond(6) && st.hasQuestItems(JACOBS_NECKLACE)) { st.giveItems(CROOPS_LETTER, 1); st.takeItems(JACOBS_NECKLACE, -1); st.setCond(7, true); htmltext = event; } break; } case "30200-02.html": case "30200-03.html": { if (st.isCond(4)) { htmltext = event; } break; } case "30200-04.html": { if (st.isCond(4)) { st.setCond(5, true); htmltext = event; } break; } case "32568-02.html": { if (st.isCond(5)) { st.giveItems(JACOBS_NECKLACE, 1); st.setCond(6, true); htmltext = event; } break; } case "30197-02.html": { if (st.isCond(3) && st.hasQuestItems(CROOPS_INTRODUCTION)) { htmltext = event; } break; } case "30197-03.html": { if (st.isCond(3) && st.hasQuestItems(CROOPS_INTRODUCTION)) { st.takeItems(CROOPS_INTRODUCTION, -1); st.setCond(4, true); htmltext = event; } break; } case "30191-02.html": { if (st.isCond(7) && st.hasQuestItems(CROOPS_LETTER)) { htmltext = event; } break; } case "reward": { if (st.isCond(7) && st.hasQuestItems(CROOPS_LETTER)) { if (player.getLevel() >= MIN_LEVEL) { st.addExpAndSp(52518015, 5817677); st.exitQuest(false, true); htmltext = "30191-03.html"; } else { htmltext = "level_check.html"; } } break; } } return htmltext; } @Override public String onTalk(L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { case State.COMPLETED: { if (npc.getId() == CROOP) { htmltext = "30676-05.html"; } else if (npc.getId() == UNIDENTIFIED_BODY) { htmltext = "32568-04.html"; } break; } case State.CREATED: { if (npc.getId() == CROOP) { htmltext = (player.getLevel() >= MIN_LEVEL) ? "30676-01.htm" : "30676-04.html"; } else if (npc.getId() == UNIDENTIFIED_BODY) { htmltext = "32568-04.html"; } break; } case State.STARTED: { switch (npc.getId()) { case CROOP: { switch (st.getCond()) { case 1: { htmltext = "30676-06.html"; break; } case 2: { st.giveItems(CROOPS_INTRODUCTION, 1); st.setCond(3, true); htmltext = "30676-07.html"; break; } case 3: case 4: case 5: { htmltext = "30676-08.html"; break; } case 6: { if (st.hasQuestItems(JACOBS_NECKLACE)) { htmltext = "30676-09.html"; } break; } } break; } case HECTOR: { if (st.isCond(3)) { if (st.hasQuestItems(CROOPS_INTRODUCTION)) { htmltext = "30197-01.html"; } } else if (st.getCond() > 3) { htmltext = "30197-04.html"; } break; } case STAN: { if (st.isCond(4)) { htmltext = "30200-01.html"; } else if (st.getCond() > 4) { htmltext = "30200-05.html"; } break; } case UNIDENTIFIED_BODY: { if (st.isCond(5)) { htmltext = "32568-01.html"; } else if (st.getCond() < 5) { htmltext = "32568-03.html"; } break; } case HOLLINT: { if (st.isCond(7) && st.hasQuestItems(CROOPS_LETTER)) { htmltext = "30191-01.html"; } break; } } break; } } return htmltext; } }
21.086262
99
0.582273
4cdd552dfefb16539fce7e14f606cb6a7d05ffbb
3,680
package net.voxelindustry.armedlogistics.common.test; import lombok.Getter; import lombok.Setter; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.voxelindustry.steamlayer.grid.CableGrid; import net.voxelindustry.steamlayer.grid.GridManager; import net.voxelindustry.steamlayer.grid.ITileCable; import net.voxelindustry.steamlayer.grid.ITileNode; import java.util.EnumMap; public class GridTestBuilder { private CableGrid grid; private BlockPos origin; private BlockPos current; private ITileCable lastCable; public GridTestBuilder(CableGrid grid) { this.grid = grid; } public GridTestBuilder origin(BlockPos pos) { origin = pos; return this; } public GridTestBuilder north() { return facing(Direction.NORTH); } public GridTestBuilder south() { return facing(Direction.SOUTH); } public GridTestBuilder east() { return facing(Direction.EAST); } public GridTestBuilder west() { return facing(Direction.WEST); } public GridTestBuilder up() { return facing(Direction.UP); } public GridTestBuilder down() { return facing(Direction.DOWN); } public GridTestBuilder facing(Direction facing) { facingGet(facing); return this; } public ITileCable northGet() { return facingGet(Direction.NORTH); } public ITileCable southGet() { return facingGet(Direction.SOUTH); } public ITileCable eastGet() { return facingGet(Direction.EAST); } public ITileCable westGet() { return facingGet(Direction.WEST); } public ITileCable upGet() { return facingGet(Direction.UP); } public ITileCable downGet() { return facingGet(Direction.DOWN); } public ITileCable facingGet(Direction facing) { if (lastCable != null) current = current.offset(facing); else current = origin; DummyTileCable cable = new DummyTileCable(current, grid.getIdentifier()); if (lastCable != null) { lastCable.connect(facing, cable); cable.connect(facing.getOpposite(), lastCable); } grid.addCable(cable); lastCable = cable; return cable; } public GridTestBuilder current(ITileCable cable) { current = cable.getBlockPos(); lastCable = cable; return this; } public void create() { } public static GridTestBuilder build(CableGrid grid) { return new GridTestBuilder(grid); } @Getter private static class DummyTileCable implements ITileCable { private EnumMap<Direction, ITileCable> connectionsMap = new EnumMap<>(Direction.class); @Getter private BlockPos blockPos; @Getter @Setter private int grid; public DummyTileCable(BlockPos pos, int grid) { blockPos = pos; this.grid = grid; } @Override public World getBlockWorld() { return null; } @Override public CableGrid createGrid(int nextID) { return null; } @Override public GridManager getGridManager() { return null; } @Override public boolean canConnect(Direction facing, ITileNode to) { return true; } } }
20.674157
95
0.59375
7f66f390341b8a971bcfec9e94d29e936bf55f9f
421
package edu.csuft.andromeda.mapper; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import edu.csuft.andromeda.entity.User; @Mapper public interface LogMapper { @Insert("insert into user(name,pwd) values(#{name},#{pwd})") void add(User user); @Select("select * from user where name=#{name}") User findByUname(User user); }
22.157895
61
0.755344
0aa5163652f8b0aa505bd6e6c223c977d0551722
1,161
package com.slipper.modules.read.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonProperty; import com.slipper.common.validator.group.Update; import lombok.Data; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; /** * 文章阅读 * * @author gumingchen * @email [email protected] * @date 1995-08-30 00:00:00 */ @Data @TableName(value = "`read`") public class ReadEntity implements Serializable { private static final long serialVersionUID = 1L; @NotNull(message = "ID不能为空", groups = Update.class) @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 文章ID */ @JsonProperty("article_id") @NotNull(message = "文章ID不能为空", groups = Update.class) private Integer articleId; /** * 用户ID */ @JsonProperty("user_id") private Integer userId; /** * IP地址 */ private String ip; /** * 创建时间 */ @JsonProperty("created_at") private Date createdAt; }
23.22
57
0.685616
e3155a0a6328757588e8f9aa8c0f21a747ba9fa8
2,110
/** * Copyright 2013 Tommi S.E. Laukkanen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.bubblecloud.zigbee.network.impl; import org.junit.Assert; import org.junit.Test; /** * Test for network state serialization. * @author <a href="mailto:[email protected]">Tommi S.E. Laukkanen</a> */ public class NetworkStateSerializerTest { @Test public void testSerializeNetworkState() { final ZigBeeNodeImpl node = new ZigBeeNodeImpl(1, "00:00:00:00:00:00:00:00", (short) 2); final ZigBeeEndpointImpl endpoint = new ZigBeeEndpointImpl(node, 1, 2, (byte) 3, (short) 4, new int[] {5}, new int[] {6}); final ZigBeeNetwork zigBeeNetwork = new ZigBeeNetwork(); zigBeeNetwork.addNode(node); zigBeeNetwork.addEndpoint(endpoint); final NetworkStateSerializer networkStateSerializer = new NetworkStateSerializer(); final String networkState = networkStateSerializer.serialize(zigBeeNetwork); System.out.println(networkState); final ZigBeeNetwork zigBeeNetworkRestored = new ZigBeeNetwork(); networkStateSerializer.deserialize(null, zigBeeNetworkRestored, networkState); Assert.assertEquals(1, zigBeeNetworkRestored.getDevices().size()); Assert.assertEquals(1, zigBeeNetworkRestored.getEndpoints( zigBeeNetworkRestored.getDevices().keySet().iterator().next()).size()); final String networkStateOfRestoredNetwork = networkStateSerializer.serialize(zigBeeNetworkRestored); Assert.assertEquals(networkState, networkStateOfRestoredNetwork); } }
39.811321
130
0.729858
327d06b70ed557f108ac389856e74905e247a094
3,705
package pinacolada.cards.fool.colorless; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.monsters.AbstractMonster; import com.megacrit.cardcrawl.orbs.AbstractOrb; import com.megacrit.cardcrawl.orbs.Frost; import eatyourbeets.powers.CombatStats; import pinacolada.actions.orbs.EvokeOrb; import pinacolada.cards.base.PCLCardData; import pinacolada.cards.base.PCLCardSeries; import pinacolada.cards.base.PCLCardTarget; import pinacolada.cards.base.PCLUseInfo; import pinacolada.cards.base.attributes.PCLAttribute; import pinacolada.cards.base.attributes.TempHPAttribute; import pinacolada.cards.fool.FoolCard; import pinacolada.orbs.pcl.Water; import pinacolada.powers.PCLCombatStats; import pinacolada.powers.PCLPowerHelper; import pinacolada.resources.PGR; import pinacolada.utilities.PCLActions; import pinacolada.utilities.PCLGameUtilities; public class AkariMizunashi extends FoolCard { public static final PCLCardData DATA = Register(AkariMizunashi.class) .SetSkill(1, CardRarity.RARE, PCLCardTarget.Self) .SetNumbers(0, 0, 3, 3) .SetUpgrades( Ups(0, 0, 3, 0, 0, 0), Ups(0, 0, 0, 0, 0, 0) ) .SetAffinity_Blue(1) .SetAffinity_Light(1).SetMaxCopies(1) .SetMultiformData(2, false) .SetColorless(PGR.Enums.Cards.THE_FOOL) .SetSeries(PCLCardSeries.Aria); public AkariMizunashi() { super(DATA); SetHealing(true); SetExhaust(true); } @Override protected String GetRawDescription(Object... args) { return super.GetRawDescription(auxiliaryData.form == 1 ? cardData.Strings.EXTENDED_DESCRIPTION[0] : ""); } @Override public int SetForm(Integer form, int timesUpgraded) { if (timesUpgraded > 0 && form == 0) { SetRetainOnce(true); } return super.SetForm(form, timesUpgraded); } @Override public void triggerWhenDrawn() { super.triggerWhenDrawn(); if (CombatStats.TryActivateLimited(cardID, secondaryValue)) { PCLActions.Bottom.Heal(secondaryValue); PCLActions.Bottom.Flash(this); } } @Override public int GetXValue() { return secondaryValue - PCLCombatStats.GetLimitedActivations(cardID); } public PCLAttribute GetSpecialInfo() { return TempHPAttribute.Instance.SetCard(this, true); } @Override public void OnUse(AbstractPlayer p, AbstractMonster m, PCLUseInfo info) { PCLActions.Bottom.GainTemporaryHP(magicNumber); if (auxiliaryData.form == 1) { for (int i = 0; i < player.orbs.size(); i++) { AbstractOrb orb = player.orbs.get(i); if (PCLGameUtilities.IsValidOrb(orb) && Frost.ORB_ID.equals(orb.ID)) { Water water = new Water(); water.SetBasePassiveAmount(PCLGameUtilities.GetOrbBasePassiveAmount(orb), false); water.SetBaseEvokeAmount(PCLGameUtilities.GetOrbBaseEvokeAmount(orb), false); water.evokeAmount = water.GetBaseEvokeAmount(); player.orbs.set(i, water); } } } PCLActions.Bottom.EvokeOrb(1, EvokeOrb.Mode.SameOrb) .SetFilter(o -> Water.ORB_ID.equals(o.ID)) .AddCallback(orbs -> { if (orbs.size() > 0) { PCLActions.Bottom.Gain(PCLPowerHelper.Focus, 1); } else { PCLActions.Bottom.ChannelOrb(new Water()); } }); } }
35.285714
112
0.632119
f51c348f27bc42e84e5ea39e8e58a7ef1da42532
859
package roito.afterthedrizzle.common.item.food; import net.minecraft.item.Food; public final class NormalFoods { public static final Food DRIED_BEETROOT = (new Food.Builder()).hunger(3).saturation(0.6F).build(); public static final Food DRIED_CARROT = (new Food.Builder()).hunger(5).saturation(0.6F).build(); public static final Food BEEF_JERKY = (new Food.Builder()).hunger(9).saturation(1.0F).meat().build(); public static final Food PORK_JERKY = (new Food.Builder()).hunger(9).saturation(1.0F).meat().build(); public static final Food CHICKEN_JERKY = (new Food.Builder()).hunger(8).saturation(0.8F).meat().build(); public static final Food RABBIT_JERKY = (new Food.Builder()).hunger(6).saturation(1.0F).meat().build(); public static final Food MUTTON_JERKY = (new Food.Builder()).hunger(8).saturation(1.0F).meat().build(); }
53.6875
108
0.718277
f3c3cfccfb683793d22298a1403f62f0ed80c69c
1,361
package cn.bossge.cloud_diary_sso.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.lang.RandomStringUtils; import org.springframework.util.StringUtils; import javax.persistence.*; import java.time.LocalDateTime; @Entity @Table(name = "audit") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class Audit { @Id @GeneratedValue @Column(name = "id") private Long id; @Column(name = "accountid") private Long accountId; @Column(name = "operation") private String operation; @Column(name = "verifycode") private String verifyCode; @Column(name = "operationdate") private LocalDateTime operationDate; @Column(name = "ip") private String ip; public void updateByOperationAndIp(String operation, String ip) { LocalDateTime now = LocalDateTime.now(); this.setOperation(operation); this.setOperationDate(now); this.setIp(ip); } ; public void generateVerifyCode() { this.setVerifyCode(RandomStringUtils.randomAlphabetic(20)); } public boolean confirmVerifyCode(String code) { if (StringUtils.isEmpty(this.verifyCode)) { return false; } else { return this.verifyCode.equals(code); } } }
24.303571
69
0.686995
dfec4438069918411e8e8459a572e2f32adc7b84
8,333
package com.lwd.qjtv.mvp.ui.fragment.live; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import com.jess.arms.base.BaseFragment; import com.jess.arms.base.DefaultAdapter; import com.jess.arms.di.component.AppComponent; import com.jess.arms.utils.UiUtils; import com.paginate.Paginate; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener; import com.scwang.smartrefresh.layout.listener.OnRefreshListener; import com.tbruyelle.rxpermissions2.RxPermissions; import com.lwd.qjtv.R; import com.lwd.qjtv.app.WEApplication; import com.lwd.qjtv.app.utils.Constant; import com.lwd.qjtv.di.component.DaggerLiveGuessComponent; import com.lwd.qjtv.di.module.LiveGuessModule; import com.lwd.qjtv.mvp.contract.LiveGuessContract; import com.lwd.qjtv.mvp.model.entity.GuessCenterBean; import com.lwd.qjtv.mvp.presenter.LiveGuessPresenter; import com.lwd.qjtv.mvp.ui.activity.GuessDetailsActivity; import com.lwd.qjtv.mvp.ui.activity.MyGuessActivity; import com.lwd.qjtv.mvp.ui.activity.RankActivity; import com.lwd.qjtv.mvp.ui.adapter.GuessCenterAdapter; import com.lwd.qjtv.mvp.ui.holder.GuessCenterItemHolder; import com.lwd.qjtv.view.CustomLoadingListItemCreator; import com.lwd.qjtv.view.LoadingPageView; import butterknife.BindView; import static com.jess.arms.utils.Preconditions.checkNotNull; /** * 通过Template生成对应页面的MVP和Dagger代码,请注意输入框中输入的名字必须相同 * 由于每个项目包结构都不一定相同,所以每生成一个文件需要自己导入import包名,可以在设置中设置自动导入包名 * 请在对应包下按以下顺序生成对应代码,Contract->Model->Presenter->Activity->Module->Component * 因为生成Activity时,Module和Component还没生成,但是Activity中有它们的引用,所以会报错,但是不用理会 * 继续将Module和Component生成完后,编译一下项目再回到Activity,按提示修改一个方法名即可 * 如果想生成Fragment的相关文件,则将上面构建顺序中的Activity换为Fragment,并将Component中inject方法的参数改为此Fragment */ /** * Email:[email protected] * Created by ZhengQian on 2017/6/6. */ public class LiveGuessFragment extends BaseFragment<LiveGuessPresenter> implements LiveGuessContract.View, OnRefreshListener, OnLoadmoreListener, GuessCenterItemHolder.GuessClickCallBack, DefaultAdapter.OnRecyclerViewItemClickListener<GuessCenterBean.DataBean> { private Paginate mPaginate; private boolean isLoadingMore; private RxPermissions mRxPermissions; private RecyclerView mRecyclerView; private SmartRefreshLayout mSwipeRefreshLayout; @BindView(R.id.activity_guess_center_rank_ll) LinearLayout rankLl; @BindView(R.id.activity_guess_center_my_guess_ll) LinearLayout guessLl; @BindView(R.id.activity_guess_center_fuhaobang_ll) LinearLayout fhbLl; @BindView(R.id.loading_framelayout) LoadingPageView loadingPageView; private View view; private boolean isNBA; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); Intent intent = new Intent(WEApplication.getContext(), RankActivity.class); intent.putExtra(Constant.IS_GUESS_RANK, true); intent.putExtra(Constant.IS_NBA, isNBA); startActivity(intent); } }; public static LiveGuessFragment newInstance() { LiveGuessFragment fragment = new LiveGuessFragment(); return fragment; } @Override public void setupFragmentComponent(AppComponent appComponent) { DaggerLiveGuessComponent .builder() .appComponent(appComponent) .liveGuessModule(new LiveGuessModule(this))//请将LiveGuessModule()第一个首字母改为小写 .build() .inject(this); } @Override public View initView(LayoutInflater inflater, ViewGroup container) { view = inflater.inflate(R.layout.fragment_live_guess_layout, container, false); return view; } @Override public void initData() { if (getArguments() != null) { isNBA = getArguments().getBoolean("isNBA"); } initListener(); initRecyclerview(); mPresenter.requestGuessCenterList(true);//打开app时自动加载列表 loadingPageView.startLodingAnim(); } private void initRecyclerview() { View listview = view.findViewById(R.id.recyclerView_layout); mSwipeRefreshLayout = (SmartRefreshLayout) listview.findViewById(R.id.zq_refreshlayout); mRecyclerView = (RecyclerView) listview.findViewById(R.id.recyclerView); } private void initListener() { loadingPageView.setClickReload(() -> mPresenter.requestGuessCenterList(true)); rankLl.setOnClickListener(view -> handler.sendEmptyMessage(1)); fhbLl.setOnClickListener(v -> { Intent intent = new Intent(WEApplication.getContext(), RankActivity.class); intent.putExtra(Constant.IS_GUESS_RANK, false); intent.putExtra(Constant.IS_NBA, false); startActivity(intent); }); guessLl.setOnClickListener(view -> startActivity(new Intent(WEApplication.getContext(), MyGuessActivity.class))); } /** * 初始化RecycleView */ private void initRecycleView() { mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setOnLoadmoreListener(this); UiUtils.configRecycleView(mRecyclerView, new LinearLayoutManager(getContext())); } @Override public void showLoading() { } @Override public void hideLoading() { mSwipeRefreshLayout.finishLoadmore(); } @Override public void showMessage(String message) { // UiUtils.SnackbarText(message); UiUtils.makeText(getContext(), message); } @Override public void launchActivity(Intent intent) { UiUtils.startActivity(intent); } @Override public void killMyself() { } @Override public void setData(Object o) { loadingPageView.checkData(o); } @Override public void setAdapter(DefaultAdapter adapter) { mRecyclerView.setAdapter(adapter); adapter.setOnItemClickListener(this); GuessCenterAdapter guessCenterAdapter = (GuessCenterAdapter) adapter; guessCenterAdapter.setGuessCallBack(this); initRecycleView(); // initPaginate(); } /** * 开始加载更多 */ @Override public void startLoadMore() { isLoadingMore = true; } /** * 结束加载更多 */ @Override public void endLoadMore() { isLoadingMore = false; mSwipeRefreshLayout.finishLoadmore(); } @Override public RxPermissions getRxPermissions() { return mRxPermissions; } /** * 初始化Paginate,用于加载更多 */ private void initPaginate() { if (mPaginate == null) { Paginate.Callbacks callbacks = new Paginate.Callbacks() { @Override public void onLoadMore() { } @Override public boolean isLoading() { return isLoadingMore; } @Override public boolean hasLoadedAllItems() { return false; } }; mPaginate = Paginate.with(mRecyclerView, callbacks) .setLoadingTriggerThreshold(10).setLoadingListItemCreator(new CustomLoadingListItemCreator()) .build(); // mPaginate.setHasMoreDataToLoad(true); } } @Override public void clickGuess(GuessCenterBean.DataBean data, int position) { Intent intent = new Intent(getContext(), GuessDetailsActivity.class); intent.putExtra("id", data.getMatch_id()); startActivity(intent); } @Override public void onItemClick(View view, int viewType, GuessCenterBean.DataBean data, int position) { } @Override public void onLoadmore(RefreshLayout refreshlayout) { mPresenter.requestGuessCenterList(false); } @Override public void onRefresh(RefreshLayout refreshlayout) { mPresenter.requestGuessCenterList(true); } }
31.564394
262
0.695668
10611f780bcb2fb95936ad87e4a3ed515478e93a
2,209
package romajs.spring.bean.converter; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.test.context.junit4.SpringRunner; import romajs.spring.BeanConverterContext; import romajs.spring.model.BeanConverterKey; import romajs.spring.model.BeanConverterValue; import java.lang.reflect.Method; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.verify; @RunWith(SpringRunner.class) public class BeanConverterContextTest { @SpyBean BeanConverterContext beanConverterContext; class FirstClass { } class SecondClass { } class ConvertClass { public SecondClass convert(FirstClass firstClass) { return null; } } @Test public void shouldAdd() throws NoSuchMethodException { final ConvertClass convertClass = new ConvertClass(); final Method method = convertClass.getClass().getDeclaredMethod("convert", FirstClass.class); beanConverterContext.add(FirstClass.class, SecondClass.class, method, convertClass); verify(beanConverterContext).add(FirstClass.class, SecondClass.class, method, convertClass); } @Test public void shouldAddFromKeyAndValue() throws NoSuchMethodException { final ConvertClass convertClass = new ConvertClass(); final Method method = convertClass.getClass().getDeclaredMethod("convert", FirstClass.class); final BeanConverterKey beanConverterKey = new BeanConverterKey(FirstClass.class, SecondClass.class); final BeanConverterValue beanConverterValue = new BeanConverterValue(method,convertClass); beanConverterContext.add(beanConverterKey, beanConverterValue); verify(beanConverterContext).add(beanConverterKey, beanConverterValue); } @Test public void shouldGet() { assertNotNull(beanConverterContext.get(FirstClass.class, SecondClass.class)); } @Test public void shouldGetFromkey() { final BeanConverterKey beanConverterKey = new BeanConverterKey(FirstClass.class, SecondClass.class); assertNotNull(beanConverterContext.get(beanConverterKey)); } }
33.469697
108
0.750566
58bc34a2e4bb2ad719009ca8194fff48cbbcf96c
1,534
package s0300; import org.junit.Test; import java.util.Arrays; import java.util.HashSet; import java.util.Set; /** * [349] 两个数组的交集 * <p> * https://leetcode-cn.com/problems/intersection-of-two-arrays/description/ * <p> * algorithms * Easy (61.13%) * Total Accepted: 18.1K * Total Submissions: 29.3K * Testcase Example: '[1,2,2,1]\n[2,2]' * <p> * 给定两个数组,编写一个函数来计算它们的交集。 * <p> * 示例 1: * <p> * 输入: nums1 = [1,2,2,1], nums2 = [2,2] * 输出: [2] * <p> * <p> * 示例 2: * <p> * 输入: nums1 = [4,9,5], nums2 = [9,4,9,8,4] * 输出: [9,4] * <p> * 说明: * <p> * <p> * 输出结果中的每个元素一定是唯一的。 * 我们可以不考虑输出结果的顺序。 * * @author baochen1.zhang * @date 2019.04.20 */ public class N0349Intersection { @Test public void case1() { assert "[2]".equals(Arrays.toString(intersection(new int[]{1, 2, 2, 1}, new int[]{2, 2}))); } @Test public void case2() { int[] result = intersection(new int[]{4, 9, 5}, new int[]{9, 4, 9, 8, 4}); Arrays.sort(result); assert "[4, 9]".equals(Arrays.toString(result)); } public int[] intersection(int[] nums1, int[] nums2) { Set<Integer> set = new HashSet<>(nums1.length); Arrays.sort(nums1); for (int value : nums2) { if (Arrays.binarySearch(nums1, value) >= 0) { set.add(value); } } int[] result = new int[set.size()]; int count = 0; for (Integer integer : set) { result[count++] = integer; } return result; } }
20.72973
99
0.533898
b95bd134b8266ea3f8ac7ff8fc6f554ea4e87c7c
5,550
/******************************************************************************* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. ******************************************************************************/ package org.apache.olingo.osgi.itests; import java.io.File; import java.io.InputStream; import java.util.Properties; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.inject.Inject; import org.apache.karaf.features.FeaturesService; import org.junit.Assert; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.ProbeBuilder; import org.ops4j.pax.exam.TestProbeBuilder; import org.ops4j.pax.exam.options.MavenUrlReference; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; import static org.ops4j.pax.exam.CoreOptions.systemProperty; import static org.ops4j.pax.exam.CoreOptions.when; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; /** * */ public class OlingoOSGiTestSupport { private static final String MAVEN_DEPENDENCIES_PROPERTIES = "/META-INF/maven/dependencies.properties"; @Inject protected BundleContext bundleContext; @Inject protected FeaturesService featureService; protected ExecutorService executor = Executors.newCachedThreadPool(); protected MavenUrlReference olingoUrl; protected MavenUrlReference karafUrl; /** * @param probe * @return */ @ProbeBuilder public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) { probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*,org.apache.felix.service.*;status=provisional"); return probe; } private static String getKarafVersion() { String karafVersion = getVersionFromPom("org.apache.karaf/apache-karaf/version"); if (karafVersion == null) { karafVersion = System.getProperty("karaf.version"); } if (karafVersion == null) { // setup the default version of it karafVersion = "3.0.3"; } return karafVersion; } private static String getVersionFromPom(String key) { try { InputStream ins = OlingoOSGiTestSupport.class.getResourceAsStream(MAVEN_DEPENDENCIES_PROPERTIES); Properties p = new Properties(); p.load(ins); return p.getProperty(key); } catch (Exception t) { throw new IllegalStateException(MAVEN_DEPENDENCIES_PROPERTIES + " can not be found", t); } } /** * Create an {@link org.ops4j.pax.exam.Option} for using a . * * @return */ protected Option olingoBaseConfig() { karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf").version(getKarafVersion()) .type("tar.gz"); olingoUrl = maven().groupId("org.apache.olingo").artifactId("odata-karaf-features").versionAsInProject() .type("xml").classifier("features"); String localRepo = System.getProperty("localRepository"); return composite(karafDistributionConfiguration() .frameworkUrl(karafUrl) .karafVersion(getKarafVersion()) .name("Apache Karaf") .useDeployFolder(false) .unpackDirectory(new File("target/paxexam/")), //DO NOT COMMIT WITH THIS LINE ENABLED!!! //KarafDistributionOption.keepRuntimeFolder(), systemProperty("java.awt.headless").value("true"), when(localRepo != null) .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepo))); } protected void assertBundleStarted(String name) { Bundle bundle = findBundleByName(name); Assert.assertNotNull("Bundle " + name + " should be installed", bundle); Assert.assertEquals("Bundle " + name + " should be started", Bundle.ACTIVE, bundle.getState()); } protected Bundle findBundleByName(String symbolicName) { for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getSymbolicName().equals(symbolicName)) { return bundle; } } return null; } }
41.111111
112
0.636937
0fcac8ff1ce5d12a27b094c8a92b8314861c0955
3,221
package org.xblackcat.sjpu.settings.config; import javassist.ClassPool; import org.xblackcat.sjpu.builder.BuilderUtils; import org.xblackcat.sjpu.settings.SettingsException; import org.xblackcat.sjpu.settings.util.ClassUtils; import org.xblackcat.sjpu.settings.util.IValueGetter; import org.xblackcat.sjpu.util.function.SupplierEx; import java.io.IOException; import java.lang.reflect.Constructor; import java.util.List; import java.util.Map; import java.util.function.UnaryOperator; /** * 14.04.2014 14:43 * * @author xBlackCat */ public abstract class APermanentConfig extends AConfig implements IConfig { private IValueGetter loadedProperties; public APermanentConfig( ClassPool pool, Map<String, UnaryOperator<String>> prefixHandlers, List<SupplierEx<IValueGetter, SettingsException>> substitutions ) { super(pool, prefixHandlers, substitutions); } /** * Loads settings for specified interface. * * @param clazz target interface class for holding settings. * @param prefixName override prefix for properties * @param optional <code>true</code> to return <code>null</code> instead of throwing exception if resource is missing. * @param <T> target interface for holding settings. * @return initialized implementation of the specified interface class. * @throws SettingsException if interface methods are not properly annotated */ @Override public <T> T get(Class<T> clazz, String prefixName, boolean optional) throws SettingsException { if (log.isDebugEnabled()) { log.debug("Load defaults for class " + clazz.getName() + " [prefix: " + prefixName + "]"); } ClassPool pool = BuilderUtils.getClassPool(this.pool, clazz); @SuppressWarnings("unchecked") final Constructor<T> c = ClassUtils.getSettingsConstructor(clazz, pool); IValueGetter loadedProperties = getValueGetter(); if (loadedProperties == null) { // Values are not loaded if (ClassUtils.allMethodsHaveDefaults(clazz)) { loadedProperties = IValueGetter.EMPTY; // Avoid NPE } else if (optional) { if (log.isTraceEnabled()) { log.trace(clazz.getName() + " marked as optional"); } // Optional means no exceptions - just return null return null; } else { throw new SettingsException(clazz.getName() + " has mandatory properties without default values"); } } List<Object> values = buildConstructorParameters(pool, clazz, prefixName, loadedProperties); return ClassUtils.initialize(c, values); } @Override public IValueGetter getValueGetter() throws SettingsException { if (loadedProperties == null) { try { loadedProperties = loadProperties(); } catch (IOException e) { throw new SettingsException("Can't obtain list of values ", e); } } return loadedProperties; } protected abstract IValueGetter loadProperties() throws IOException; }
35.788889
124
0.655697
69f8d229ebdde92edb0ac705c35ab7fbc22e27c3
2,994
package com.example.isa.model; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.OneToOne; import com.example.isa.model.users.AdmUser; import com.fasterxml.jackson.annotation.JsonManagedReference; @Entity public class BioskopPozoriste { @Id @GeneratedValue private long id; private String name; private String description; private String address; @Column(nullable=false) @Enumerated(EnumType.STRING) private BioskopPozoristeType type; @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST) @JsonManagedReference private Repertoire repertoire; //@OneToMany //Promotivne karte @ManyToMany private List<AdmUser> admini; private int bronzeTreshold; private int silverTreshold; private int goldTreshold; public BioskopPozoriste() { } public BioskopPozoriste update(BioskopPozoriste updated) { this.name=updated.getName(); this.description=updated.getDescription(); this.address=updated.getAddress(); this.type=updated.getType(); this.bronzeTreshold=updated.getBronzeTreshold(); this.silverTreshold=updated.getSilverTreshold(); this.goldTreshold=updated.getGoldTreshold(); return this; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public BioskopPozoristeType getType() { return type; } public void setType(BioskopPozoristeType type) { this.type = type; } public Repertoire getRepertoire() { return repertoire; } public void setRepertoire(Repertoire repertoire) { this.repertoire = repertoire; } public List<AdmUser> getAdmini() { return admini; } public void setAdmini(List<AdmUser> admini) { this.admini = admini; } public int getBronzeTreshold() { return bronzeTreshold; } public void setBronzeTreshold(int bronzeTreshold) { this.bronzeTreshold = bronzeTreshold; } public int getSilverTreshold() { return silverTreshold; } public void setSilverTreshold(int silverTreshold) { this.silverTreshold = silverTreshold; } public int getGoldTreshold() { return goldTreshold; } public void setGoldTreshold(int goldTreshold) { this.goldTreshold = goldTreshold; } }
19.827815
67
0.715765
0afc552b897ec8f9c0892ff187852f32307aaa3b
1,697
package com.liangxiaoqiao.leetcode.day.medium; /* * English * id: 1027 * title: Longest Arithmetic Sequence * href: https://leetcode.com/problems/longest-arithmetic-sequence * desc: Given an array A of integers, return the length of the longest arithmetic subsequence in A. * Recall that a subsequence of A is a list A[i_1], A[i_2], ..., A[i_k] with 0 <= i_1 < i_2 < ... < i_k <= A.length - 1, and that a sequence B is arithmetic if B[i+1] - B[i] are all the same value (for 0 <= i < B.length - 1). * Example 1: * Input: [3,6,9,12] * Output: 4 * Explanation: * The whole array is an arithmetic sequence with steps of length = 3. * Example 2: * Input: [9,4,7,2,10] * Output: 3 * Explanation: * The longest arithmetic subsequence is [4,7,10]. * Example 3: * Input: [20,1,15,3,10,5,8] * Output: 4 * Explanation: * The longest arithmetic subsequence is [20,15,10,5]. * Note: * 2 <= A.length <= 2000 * 0 <= A[i] <= 10000 * <p> * 中文 * 序号: 1027 * 标题: 最长等差数列 * 链接: https://leetcode-cn.com/problems/longest-arithmetic-sequence * 描述: 给定一个整数数组 A,返回 A 中最长等差子序列的长度。 * 回想一下,A 的子序列是列表 A[i_1], A[i_2], ..., A[i_k] 其中 0 <= i_1 < i_2 < ... < i_k <= A.length - 1。并且如果 B[i+1] - B[i]( 0 <= i < B.length - 1) 的值都相同,那么序列 B 是等差的。 * 示例 1: * 输入:[3,6,9,12] * 输出:4 * 解释: * 整个数组是公差为 3 的等差数列。 * 示例 2: * 输入:[9,4,7,2,10] * 输出:3 * 解释: * 最长的等差子序列是 [4,7,10]。 * 示例 3: * 输入:[20,1,15,3,10,5,8] * 输出:4 * 解释: * 最长的等差子序列是 [20,15,10,5]。 * 提示: * 2 <= A.length <= 2000 * 0 <= A[i] <= 10000 * <p> * acceptance: 52.7% * difficulty: Medium * private: False */ //TODO init public class LongestArithmeticSequence { public int longestArithSeqLength(int[] A) { return 0; } }
25.712121
225
0.606953
8762051efa99a2cb6ab6d71370a8ee62b5992467
1,124
package com.qa.persistence.dto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import com.qa.HobbyWebAppApplication; @SpringBootTest(classes = HobbyWebAppApplication.class) public class PlayerDTOTest { @Test public void testToString() { PlayerDTO TEST_PLAYER = new PlayerDTO(1L, "Fubuki", "FBK"); String output = "PlayerDTO(playerID=1, playerName=Fubuki, playerIGN=FBK)"; assertEquals(TEST_PLAYER.toString(), output); } @Test public void testEqualsAndHashCode() { PlayerDTO TEST_PLAYER1 = new PlayerDTO(1L, "Fubuki", "FBK"); PlayerDTO TEST_PLAYER2 = new PlayerDTO(1L, "Fubuki", "FBK"); assertEquals(TEST_PLAYER1, TEST_PLAYER2); assertEquals(TEST_PLAYER1.hashCode(), TEST_PLAYER2.hashCode()); } @Test public void testNotEquals() { PlayerDTO TEST_PLAYER1 = new PlayerDTO(1L, "Fubuki", "FBK"); PlayerDTO TEST_PLAYER2 = new PlayerDTO(2L, "Fubuki", "FBK"); assertFalse(TEST_PLAYER1.equals(TEST_PLAYER2)); } }
26.761905
76
0.752669
41858a9f6e1fbf9e2400be7398fbf69cb67e9cc6
192,967
package com.test.c; import org.moe.natj.c.CRuntime; import org.moe.natj.c.ann.CFunction; import org.moe.natj.c.ann.CVariable; import org.moe.natj.general.NatJ; import org.moe.natj.general.ann.ByValue; import org.moe.natj.general.ann.Generated; import org.moe.natj.general.ann.Library; import org.moe.natj.general.ann.Mapped; import org.moe.natj.general.ann.MappedReturn; import org.moe.natj.general.ann.NUInt; import org.moe.natj.general.ann.ReferenceInfo; import org.moe.natj.general.ann.Runtime; import org.moe.natj.general.ann.UncertainArgument; import org.moe.natj.general.ann.UncertainReturn; import org.moe.natj.general.ptr.BoolPtr; import org.moe.natj.general.ptr.BytePtr; import org.moe.natj.general.ptr.CharPtr; import org.moe.natj.general.ptr.ConstBoolPtr; import org.moe.natj.general.ptr.ConstBytePtr; import org.moe.natj.general.ptr.ConstCharPtr; import org.moe.natj.general.ptr.ConstDoublePtr; import org.moe.natj.general.ptr.ConstFloatPtr; import org.moe.natj.general.ptr.ConstIntPtr; import org.moe.natj.general.ptr.ConstLongPtr; import org.moe.natj.general.ptr.ConstShortPtr; import org.moe.natj.general.ptr.DoublePtr; import org.moe.natj.general.ptr.FloatPtr; import org.moe.natj.general.ptr.IntPtr; import org.moe.natj.general.ptr.LongPtr; import org.moe.natj.general.ptr.Ptr; import org.moe.natj.general.ptr.ShortPtr; import org.moe.natj.general.ptr.VoidPtr; import com.test.struct.NG_ISMulti_Struct; import com.test.struct.NG_I_Struct; import java.lang.Boolean; import java.lang.Byte; import java.lang.Character; import java.lang.Double; import java.lang.Float; import java.lang.Integer; import java.lang.Long; import java.lang.Short; import java.lang.String; @Generated @Runtime(CRuntime.class) @Library("jni") public final class Globals { static { NatJ.register(); } @Generated private Globals() { } @Generated @CFunction public static native boolean NGBoolCreate(boolean a); @Generated @CFunction public static native byte NGByteCreate(byte a); @Generated @CFunction public static native short NGShortCreate(short a); @Generated @CFunction public static native char NGCharCreate(char a); @Generated @CFunction public static native int NGIntCreate(int a); @Generated @CFunction public static native long NGLongCreate(long a); @Generated @CFunction public static native float NGFloatCreate(float a); @Generated @CFunction public static native double NGDoubleCreate(double a); @Generated @CFunction public static native boolean NGBoolCompare(boolean a, boolean b); @Generated @CFunction public static native boolean NGByteCompare(byte a, byte b); @Generated @CFunction public static native boolean NGShortCompare(short a, short b); @Generated @CFunction public static native boolean NGCharCompare(char a, char b); @Generated @CFunction public static native boolean NGIntCompare(int a, int b); @Generated @CFunction public static native boolean NGLongCompare(long a, long b); @Generated @CFunction public static native boolean NGFloatCompare(float a, float b); @Generated @CFunction public static native boolean NGDoubleCompare(double a, double b); @Generated @CFunction public static native BoolPtr NGBoolCreateArray(int count); @Generated @CFunction public static native BytePtr NGByteCreateArray(int count); @Generated @CFunction public static native ShortPtr NGShortCreateArray(int count); @Generated @CFunction public static native CharPtr NGCharCreateArray(int count); @Generated @CFunction public static native IntPtr NGIntCreateArray(int count); @Generated @CFunction public static native LongPtr NGLongCreateArray(int count); @Generated @CFunction public static native FloatPtr NGFloatCreateArray(int count); @Generated @CFunction public static native DoublePtr NGDoubleCreateArray(int count); @Generated @CFunction public static native boolean NGBoolArrayCompare(BoolPtr a, BoolPtr b, int count); @Generated @CFunction public static native boolean NGByteArrayCompare(BytePtr a, BytePtr b, int count); @Generated @CFunction public static native boolean NGShortArrayCompare(ShortPtr a, ShortPtr b, int count); @Generated @CFunction public static native boolean NGCharArrayCompare(CharPtr a, CharPtr b, int count); @Generated @CFunction public static native boolean NGIntArrayCompare(IntPtr a, IntPtr b, int count); @Generated @CFunction public static native boolean NGLongArrayCompare(LongPtr a, LongPtr b, int count); @Generated @CFunction public static native boolean NGFloatArrayCompare(FloatPtr a, FloatPtr b, int count); @Generated @CFunction public static native boolean NGDoubleArrayCompare(DoublePtr a, DoublePtr b, int count); @Generated @CFunction public static native void NGBoolArrayFree(BoolPtr a); @Generated @CFunction public static native void NGByteArrayFree(BytePtr a); @Generated @CFunction public static native void NGShortArrayFree(ShortPtr a); @Generated @CFunction public static native void NGCharArrayFree(CharPtr a); @Generated @CFunction public static native void NGIntArrayFree(IntPtr a); @Generated @CFunction public static native void NGLongArrayFree(LongPtr a); @Generated @CFunction public static native void NGFloatArrayFree(FloatPtr a); @Generated @CFunction public static native void NGDoubleArrayFree(DoublePtr a); @Generated @CFunction @ReferenceInfo(type = Boolean.class, depth = 2) public static native Ptr<BoolPtr> NGBoolCreateArrayRef(BoolPtr array); @Generated @CFunction @ReferenceInfo(type = Byte.class, depth = 2) public static native Ptr<BytePtr> NGByteCreateArrayRef(BytePtr array); @Generated @CFunction @ReferenceInfo(type = Short.class, depth = 2) public static native Ptr<ShortPtr> NGShortCreateArrayRef(ShortPtr array); @Generated @CFunction @ReferenceInfo(type = Character.class, depth = 2) public static native Ptr<CharPtr> NGCharCreateArrayRef(CharPtr array); @Generated @CFunction @ReferenceInfo(type = Integer.class, depth = 2) public static native Ptr<IntPtr> NGIntCreateArrayRef(IntPtr array); @Generated @CFunction @ReferenceInfo(type = Long.class, depth = 2) public static native Ptr<LongPtr> NGLongCreateArrayRef(LongPtr array); @Generated @CFunction @ReferenceInfo(type = Float.class, depth = 2) public static native Ptr<FloatPtr> NGFloatCreateArrayRef(FloatPtr array); @Generated @CFunction @ReferenceInfo(type = Double.class, depth = 2) public static native Ptr<DoublePtr> NGDoubleCreateArrayRef(DoublePtr array); @Generated @CFunction public static native boolean NGBoolArrayRefCompare(Ptr<BoolPtr> a, BoolPtr b, int count); @Generated @CFunction public static native boolean NGByteArrayRefCompare(Ptr<BytePtr> a, BytePtr b, int count); @Generated @CFunction public static native boolean NGShortArrayRefCompare(Ptr<ShortPtr> a, ShortPtr b, int count); @Generated @CFunction public static native boolean NGCharArrayRefCompare(Ptr<CharPtr> a, CharPtr b, int count); @Generated @CFunction public static native boolean NGIntArrayRefCompare(Ptr<IntPtr> a, IntPtr b, int count); @Generated @CFunction public static native boolean NGLongArrayRefCompare(Ptr<LongPtr> a, LongPtr b, int count); @Generated @CFunction public static native boolean NGFloatArrayRefCompare(Ptr<FloatPtr> a, FloatPtr b, int count); @Generated @CFunction public static native boolean NGDoubleArrayRefCompare(Ptr<DoublePtr> a, DoublePtr b, int count); @Generated @CFunction public static native void NGBoolArrayRefFree(Ptr<BoolPtr> a); @Generated @CFunction public static native void NGByteArrayRefFree(Ptr<BytePtr> a); @Generated @CFunction public static native void NGShortArrayRefFree(Ptr<ShortPtr> a); @Generated @CFunction public static native void NGCharArrayRefFree(Ptr<CharPtr> a); @Generated @CFunction public static native void NGIntArrayRefFree(Ptr<IntPtr> a); @Generated @CFunction public static native void NGLongArrayRefFree(Ptr<LongPtr> a); @Generated @CFunction public static native void NGFloatArrayRefFree(Ptr<FloatPtr> a); @Generated @CFunction public static native void NGDoubleArrayRefFree(Ptr<DoublePtr> a); @Generated @CFunction @ByValue public static native NG_I_Struct NGIStructCreate(int x, int y); @Generated @CFunction public static native boolean NGIStructCompare(@ByValue NG_I_Struct value, int x, int y); @Generated @CFunction @UncertainReturn("Options: reference, array Fallback: reference") public static native NG_I_Struct NGIStructCreatePtr(@ByValue NG_I_Struct value); @Generated @CFunction public static native boolean NGIStructRefCompare( @UncertainArgument("Options: reference, array Fallback: reference") NG_I_Struct value, int x, int y); @Generated @CFunction public static native void NGIStructRefFree( @UncertainArgument("Options: reference, array Fallback: reference") NG_I_Struct value); @Generated @CFunction @ByValue public static native NG_ISMulti_Struct NGISMultiStructCreate(int x, int y); @Generated @CFunction public static native int NGISMultiStructFind(@ByValue NG_ISMulti_Struct value, int x, int y); @Generated @CFunction @UncertainReturn("Options: reference, array Fallback: reference") public static native NG_ISMulti_Struct NGISMultiStructCreatePtr(int x, int y); @Generated @CFunction public static native void NGISMultiStructRefFree( @UncertainArgument("Options: reference, array Fallback: reference") NG_ISMulti_Struct value); @Generated @CFunction public static native boolean NGLongInvocation_0(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, double arg8, double arg9); @Generated @CFunction public static native boolean NGLongInvocation_1(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, double arg8, float arg9); @Generated @CFunction public static native boolean NGLongInvocation_2(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, float arg8, double arg9); @Generated @CFunction public static native boolean NGLongInvocation_3(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, float arg8, float arg9); @Generated @CFunction public static native boolean NGLongInvocation_4(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long arg8, long arg9); @Generated @CFunction public static native boolean NGLongInvocation_5(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long arg8, int arg9); @Generated @CFunction public static native boolean NGLongInvocation_6(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, int arg8, long arg9); @Generated @CFunction public static native boolean NGLongInvocation_7(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, int arg8, int arg9); @Generated @CFunction public static native boolean NGLongInvocation_8(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, long arg16, long arg17); @Generated @CFunction public static native boolean NGLongInvocation_9(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, long arg16, int arg17); @Generated @CFunction public static native boolean NGLongInvocation_10(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, long arg16, double arg17); @Generated @CFunction public static native boolean NGLongInvocation_11(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, long arg16, float arg17); @Generated @CFunction public static native boolean NGLongInvocation_12(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, double arg16, long arg17); @Generated @CFunction public static native boolean NGLongInvocation_13(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, double arg16, int arg17); @Generated @CFunction public static native boolean NGLongInvocation_14(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, double arg16, double arg17); @Generated @CFunction public static native boolean NGLongInvocation_15(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, double arg16, float arg17); @Generated @CFunction public static native boolean NGLongInvocation_16(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, float arg16, long arg17); @Generated @CFunction public static native boolean NGLongInvocation_17(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, float arg16, int arg17); @Generated @CFunction public static native boolean NGLongInvocation_18(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, float arg16, double arg17); @Generated @CFunction public static native boolean NGLongInvocation_19(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, float arg16, float arg17); @Generated @CFunction public static native boolean NGLongInvocation_20(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, int arg16, long arg17); @Generated @CFunction public static native boolean NGLongInvocation_21(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, int arg16, int arg17); @Generated @CFunction public static native boolean NGLongInvocation_22(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, int arg16, double arg17); @Generated @CFunction public static native boolean NGLongInvocation_23(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15, int arg16, float arg17); @Generated @CFunction public static native int NGInvocation_refs4885_0(int arg0, int arg1, int arg2, int arg3, int arg4, VoidPtr arg5, int arg6); @Generated @CFunction public static native float NGInvocation_refs4885_1(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, VoidPtr arg7, float arg8); @Generated @CFunction public static native boolean NGInvocation_0(int arg0); @Generated @CFunction public static native boolean NGInvocation_1(float arg0); @Generated @CFunction public static native boolean NGInvocation_2(long arg0); @Generated @CFunction public static native boolean NGInvocation_3(double arg0); @Generated @CFunction public static native boolean NGInvocation_4(int arg0, int arg1); @Generated @CFunction public static native boolean NGInvocation_5(int arg0, float arg1); @Generated @CFunction public static native boolean NGInvocation_6(int arg0, long arg1); @Generated @CFunction public static native boolean NGInvocation_7(int arg0, double arg1); @Generated @CFunction public static native boolean NGInvocation_8(float arg0, int arg1); @Generated @CFunction public static native boolean NGInvocation_9(float arg0, float arg1); @Generated @CFunction public static native boolean NGInvocation_10(float arg0, long arg1); @Generated @CFunction public static native boolean NGInvocation_11(float arg0, double arg1); @Generated @CFunction public static native boolean NGInvocation_12(long arg0, int arg1); @Generated @CFunction public static native boolean NGInvocation_13(long arg0, float arg1); @Generated @CFunction public static native boolean NGInvocation_14(long arg0, long arg1); @Generated @CFunction public static native boolean NGInvocation_15(long arg0, double arg1); @Generated @CFunction public static native boolean NGInvocation_16(double arg0, int arg1); @Generated @CFunction public static native boolean NGInvocation_17(double arg0, float arg1); @Generated @CFunction public static native boolean NGInvocation_18(double arg0, long arg1); @Generated @CFunction public static native boolean NGInvocation_19(double arg0, double arg1); @Generated @CFunction public static native boolean NGInvocation_20(int arg0, int arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_21(int arg0, int arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_22(int arg0, int arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_23(int arg0, int arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_24(int arg0, float arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_25(int arg0, float arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_26(int arg0, float arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_27(int arg0, float arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_28(int arg0, long arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_29(int arg0, long arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_30(int arg0, long arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_31(int arg0, long arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_32(int arg0, double arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_33(int arg0, double arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_34(int arg0, double arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_35(int arg0, double arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_36(float arg0, int arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_37(float arg0, int arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_38(float arg0, int arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_39(float arg0, int arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_40(float arg0, float arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_41(float arg0, float arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_42(float arg0, float arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_43(float arg0, float arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_44(float arg0, long arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_45(float arg0, long arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_46(float arg0, long arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_47(float arg0, long arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_48(float arg0, double arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_49(float arg0, double arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_50(float arg0, double arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_51(float arg0, double arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_52(long arg0, int arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_53(long arg0, int arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_54(long arg0, int arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_55(long arg0, int arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_56(long arg0, float arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_57(long arg0, float arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_58(long arg0, float arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_59(long arg0, float arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_60(long arg0, long arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_61(long arg0, long arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_62(long arg0, long arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_63(long arg0, long arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_64(long arg0, double arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_65(long arg0, double arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_66(long arg0, double arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_67(long arg0, double arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_68(double arg0, int arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_69(double arg0, int arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_70(double arg0, int arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_71(double arg0, int arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_72(double arg0, float arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_73(double arg0, float arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_74(double arg0, float arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_75(double arg0, float arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_76(double arg0, long arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_77(double arg0, long arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_78(double arg0, long arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_79(double arg0, long arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_80(double arg0, double arg1, int arg2); @Generated @CFunction public static native boolean NGInvocation_81(double arg0, double arg1, float arg2); @Generated @CFunction public static native boolean NGInvocation_82(double arg0, double arg1, long arg2); @Generated @CFunction public static native boolean NGInvocation_83(double arg0, double arg1, double arg2); @Generated @CFunction public static native boolean NGInvocation_84(int arg0, int arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_85(int arg0, int arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_86(int arg0, int arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_87(int arg0, int arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_88(int arg0, int arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_89(int arg0, int arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_90(int arg0, int arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_91(int arg0, int arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_92(int arg0, int arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_93(int arg0, int arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_94(int arg0, int arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_95(int arg0, int arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_96(int arg0, int arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_97(int arg0, int arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_98(int arg0, int arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_99(int arg0, int arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_100(int arg0, float arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_101(int arg0, float arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_102(int arg0, float arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_103(int arg0, float arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_104(int arg0, float arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_105(int arg0, float arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_106(int arg0, float arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_107(int arg0, float arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_108(int arg0, float arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_109(int arg0, float arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_110(int arg0, float arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_111(int arg0, float arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_112(int arg0, float arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_113(int arg0, float arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_114(int arg0, float arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_115(int arg0, float arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_116(int arg0, long arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_117(int arg0, long arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_118(int arg0, long arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_119(int arg0, long arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_120(int arg0, long arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_121(int arg0, long arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_122(int arg0, long arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_123(int arg0, long arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_124(int arg0, long arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_125(int arg0, long arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_126(int arg0, long arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_127(int arg0, long arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_128(int arg0, long arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_129(int arg0, long arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_130(int arg0, long arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_131(int arg0, long arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_132(int arg0, double arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_133(int arg0, double arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_134(int arg0, double arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_135(int arg0, double arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_136(int arg0, double arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_137(int arg0, double arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_138(int arg0, double arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_139(int arg0, double arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_140(int arg0, double arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_141(int arg0, double arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_142(int arg0, double arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_143(int arg0, double arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_144(int arg0, double arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_145(int arg0, double arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_146(int arg0, double arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_147(int arg0, double arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_148(float arg0, int arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_149(float arg0, int arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_150(float arg0, int arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_151(float arg0, int arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_152(float arg0, int arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_153(float arg0, int arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_154(float arg0, int arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_155(float arg0, int arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_156(float arg0, int arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_157(float arg0, int arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_158(float arg0, int arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_159(float arg0, int arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_160(float arg0, int arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_161(float arg0, int arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_162(float arg0, int arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_163(float arg0, int arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_164(float arg0, float arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_165(float arg0, float arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_166(float arg0, float arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_167(float arg0, float arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_168(float arg0, float arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_169(float arg0, float arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_170(float arg0, float arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_171(float arg0, float arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_172(float arg0, float arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_173(float arg0, float arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_174(float arg0, float arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_175(float arg0, float arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_176(float arg0, float arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_177(float arg0, float arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_178(float arg0, float arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_179(float arg0, float arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_180(float arg0, long arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_181(float arg0, long arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_182(float arg0, long arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_183(float arg0, long arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_184(float arg0, long arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_185(float arg0, long arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_186(float arg0, long arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_187(float arg0, long arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_188(float arg0, long arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_189(float arg0, long arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_190(float arg0, long arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_191(float arg0, long arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_192(float arg0, long arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_193(float arg0, long arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_194(float arg0, long arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_195(float arg0, long arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_196(float arg0, double arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_197(float arg0, double arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_198(float arg0, double arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_199(float arg0, double arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_200(float arg0, double arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_201(float arg0, double arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_202(float arg0, double arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_203(float arg0, double arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_204(float arg0, double arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_205(float arg0, double arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_206(float arg0, double arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_207(float arg0, double arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_208(float arg0, double arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_209(float arg0, double arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_210(float arg0, double arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_211(float arg0, double arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_212(long arg0, int arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_213(long arg0, int arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_214(long arg0, int arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_215(long arg0, int arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_216(long arg0, int arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_217(long arg0, int arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_218(long arg0, int arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_219(long arg0, int arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_220(long arg0, int arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_221(long arg0, int arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_222(long arg0, int arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_223(long arg0, int arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_224(long arg0, int arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_225(long arg0, int arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_226(long arg0, int arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_227(long arg0, int arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_228(long arg0, float arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_229(long arg0, float arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_230(long arg0, float arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_231(long arg0, float arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_232(long arg0, float arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_233(long arg0, float arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_234(long arg0, float arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_235(long arg0, float arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_236(long arg0, float arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_237(long arg0, float arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_238(long arg0, float arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_239(long arg0, float arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_240(long arg0, float arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_241(long arg0, float arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_242(long arg0, float arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_243(long arg0, float arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_244(long arg0, long arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_245(long arg0, long arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_246(long arg0, long arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_247(long arg0, long arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_248(long arg0, long arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_249(long arg0, long arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_250(long arg0, long arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_251(long arg0, long arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_252(long arg0, long arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_253(long arg0, long arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_254(long arg0, long arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_255(long arg0, long arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_256(long arg0, long arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_257(long arg0, long arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_258(long arg0, long arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_259(long arg0, long arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_260(long arg0, double arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_261(long arg0, double arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_262(long arg0, double arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_263(long arg0, double arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_264(long arg0, double arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_265(long arg0, double arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_266(long arg0, double arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_267(long arg0, double arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_268(long arg0, double arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_269(long arg0, double arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_270(long arg0, double arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_271(long arg0, double arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_272(long arg0, double arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_273(long arg0, double arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_274(long arg0, double arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_275(long arg0, double arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_276(double arg0, int arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_277(double arg0, int arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_278(double arg0, int arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_279(double arg0, int arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_280(double arg0, int arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_281(double arg0, int arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_282(double arg0, int arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_283(double arg0, int arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_284(double arg0, int arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_285(double arg0, int arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_286(double arg0, int arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_287(double arg0, int arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_288(double arg0, int arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_289(double arg0, int arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_290(double arg0, int arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_291(double arg0, int arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_292(double arg0, float arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_293(double arg0, float arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_294(double arg0, float arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_295(double arg0, float arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_296(double arg0, float arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_297(double arg0, float arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_298(double arg0, float arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_299(double arg0, float arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_300(double arg0, float arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_301(double arg0, float arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_302(double arg0, float arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_303(double arg0, float arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_304(double arg0, float arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_305(double arg0, float arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_306(double arg0, float arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_307(double arg0, float arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_308(double arg0, long arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_309(double arg0, long arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_310(double arg0, long arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_311(double arg0, long arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_312(double arg0, long arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_313(double arg0, long arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_314(double arg0, long arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_315(double arg0, long arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_316(double arg0, long arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_317(double arg0, long arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_318(double arg0, long arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_319(double arg0, long arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_320(double arg0, long arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_321(double arg0, long arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_322(double arg0, long arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_323(double arg0, long arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_324(double arg0, double arg1, int arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_325(double arg0, double arg1, int arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_326(double arg0, double arg1, int arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_327(double arg0, double arg1, int arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_328(double arg0, double arg1, float arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_329(double arg0, double arg1, float arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_330(double arg0, double arg1, float arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_331(double arg0, double arg1, float arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_332(double arg0, double arg1, long arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_333(double arg0, double arg1, long arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_334(double arg0, double arg1, long arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_335(double arg0, double arg1, long arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_336(double arg0, double arg1, double arg2, int arg3); @Generated @CFunction public static native boolean NGInvocation_337(double arg0, double arg1, double arg2, float arg3); @Generated @CFunction public static native boolean NGInvocation_338(double arg0, double arg1, double arg2, long arg3); @Generated @CFunction public static native boolean NGInvocation_339(double arg0, double arg1, double arg2, double arg3); @Generated @CFunction public static native boolean NGInvocation_340(int arg0, int arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_341(int arg0, int arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_342(int arg0, int arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_343(int arg0, int arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_344(int arg0, int arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_345(int arg0, int arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_346(int arg0, int arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_347(int arg0, int arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_348(int arg0, int arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_349(int arg0, int arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_350(int arg0, int arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_351(int arg0, int arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_352(int arg0, int arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_353(int arg0, int arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_354(int arg0, int arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_355(int arg0, int arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_356(int arg0, int arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_357(int arg0, int arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_358(int arg0, int arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_359(int arg0, int arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_360(int arg0, int arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_361(int arg0, int arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_362(int arg0, int arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_363(int arg0, int arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_364(int arg0, int arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_365(int arg0, int arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_366(int arg0, int arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_367(int arg0, int arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_368(int arg0, int arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_369(int arg0, int arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_370(int arg0, int arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_371(int arg0, int arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_372(int arg0, int arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_373(int arg0, int arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_374(int arg0, int arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_375(int arg0, int arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_376(int arg0, int arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_377(int arg0, int arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_378(int arg0, int arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_379(int arg0, int arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_380(int arg0, int arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_381(int arg0, int arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_382(int arg0, int arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_383(int arg0, int arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_384(int arg0, int arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_385(int arg0, int arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_386(int arg0, int arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_387(int arg0, int arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_388(int arg0, int arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_389(int arg0, int arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_390(int arg0, int arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_391(int arg0, int arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_392(int arg0, int arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_393(int arg0, int arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_394(int arg0, int arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_395(int arg0, int arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_396(int arg0, int arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_397(int arg0, int arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_398(int arg0, int arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_399(int arg0, int arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_400(int arg0, int arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_401(int arg0, int arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_402(int arg0, int arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_403(int arg0, int arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_404(int arg0, float arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_405(int arg0, float arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_406(int arg0, float arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_407(int arg0, float arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_408(int arg0, float arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_409(int arg0, float arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_410(int arg0, float arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_411(int arg0, float arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_412(int arg0, float arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_413(int arg0, float arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_414(int arg0, float arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_415(int arg0, float arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_416(int arg0, float arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_417(int arg0, float arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_418(int arg0, float arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_419(int arg0, float arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_420(int arg0, float arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_421(int arg0, float arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_422(int arg0, float arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_423(int arg0, float arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_424(int arg0, float arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_425(int arg0, float arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_426(int arg0, float arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_427(int arg0, float arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_428(int arg0, float arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_429(int arg0, float arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_430(int arg0, float arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_431(int arg0, float arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_432(int arg0, float arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_433(int arg0, float arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_434(int arg0, float arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_435(int arg0, float arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_436(int arg0, float arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_437(int arg0, float arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_438(int arg0, float arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_439(int arg0, float arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_440(int arg0, float arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_441(int arg0, float arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_442(int arg0, float arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_443(int arg0, float arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_444(int arg0, float arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_445(int arg0, float arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_446(int arg0, float arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_447(int arg0, float arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_448(int arg0, float arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_449(int arg0, float arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_450(int arg0, float arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_451(int arg0, float arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_452(int arg0, float arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_453(int arg0, float arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_454(int arg0, float arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_455(int arg0, float arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_456(int arg0, float arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_457(int arg0, float arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_458(int arg0, float arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_459(int arg0, float arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_460(int arg0, float arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_461(int arg0, float arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_462(int arg0, float arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_463(int arg0, float arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_464(int arg0, float arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_465(int arg0, float arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_466(int arg0, float arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_467(int arg0, float arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_468(int arg0, long arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_469(int arg0, long arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_470(int arg0, long arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_471(int arg0, long arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_472(int arg0, long arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_473(int arg0, long arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_474(int arg0, long arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_475(int arg0, long arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_476(int arg0, long arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_477(int arg0, long arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_478(int arg0, long arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_479(int arg0, long arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_480(int arg0, long arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_481(int arg0, long arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_482(int arg0, long arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_483(int arg0, long arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_484(int arg0, long arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_485(int arg0, long arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_486(int arg0, long arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_487(int arg0, long arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_488(int arg0, long arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_489(int arg0, long arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_490(int arg0, long arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_491(int arg0, long arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_492(int arg0, long arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_493(int arg0, long arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_494(int arg0, long arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_495(int arg0, long arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_496(int arg0, long arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_497(int arg0, long arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_498(int arg0, long arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_499(int arg0, long arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_500(int arg0, long arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_501(int arg0, long arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_502(int arg0, long arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_503(int arg0, long arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_504(int arg0, long arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_505(int arg0, long arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_506(int arg0, long arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_507(int arg0, long arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_508(int arg0, long arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_509(int arg0, long arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_510(int arg0, long arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_511(int arg0, long arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_512(int arg0, long arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_513(int arg0, long arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_514(int arg0, long arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_515(int arg0, long arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_516(int arg0, long arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_517(int arg0, long arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_518(int arg0, long arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_519(int arg0, long arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_520(int arg0, long arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_521(int arg0, long arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_522(int arg0, long arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_523(int arg0, long arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_524(int arg0, long arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_525(int arg0, long arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_526(int arg0, long arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_527(int arg0, long arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_528(int arg0, long arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_529(int arg0, long arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_530(int arg0, long arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_531(int arg0, long arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_532(int arg0, double arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_533(int arg0, double arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_534(int arg0, double arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_535(int arg0, double arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_536(int arg0, double arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_537(int arg0, double arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_538(int arg0, double arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_539(int arg0, double arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_540(int arg0, double arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_541(int arg0, double arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_542(int arg0, double arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_543(int arg0, double arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_544(int arg0, double arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_545(int arg0, double arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_546(int arg0, double arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_547(int arg0, double arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_548(int arg0, double arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_549(int arg0, double arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_550(int arg0, double arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_551(int arg0, double arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_552(int arg0, double arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_553(int arg0, double arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_554(int arg0, double arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_555(int arg0, double arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_556(int arg0, double arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_557(int arg0, double arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_558(int arg0, double arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_559(int arg0, double arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_560(int arg0, double arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_561(int arg0, double arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_562(int arg0, double arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_563(int arg0, double arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_564(int arg0, double arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_565(int arg0, double arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_566(int arg0, double arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_567(int arg0, double arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_568(int arg0, double arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_569(int arg0, double arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_570(int arg0, double arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_571(int arg0, double arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_572(int arg0, double arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_573(int arg0, double arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_574(int arg0, double arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_575(int arg0, double arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_576(int arg0, double arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_577(int arg0, double arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_578(int arg0, double arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_579(int arg0, double arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_580(int arg0, double arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_581(int arg0, double arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_582(int arg0, double arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_583(int arg0, double arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_584(int arg0, double arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_585(int arg0, double arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_586(int arg0, double arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_587(int arg0, double arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_588(int arg0, double arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_589(int arg0, double arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_590(int arg0, double arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_591(int arg0, double arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_592(int arg0, double arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_593(int arg0, double arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_594(int arg0, double arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_595(int arg0, double arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_596(float arg0, int arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_597(float arg0, int arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_598(float arg0, int arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_599(float arg0, int arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_600(float arg0, int arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_601(float arg0, int arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_602(float arg0, int arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_603(float arg0, int arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_604(float arg0, int arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_605(float arg0, int arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_606(float arg0, int arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_607(float arg0, int arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_608(float arg0, int arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_609(float arg0, int arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_610(float arg0, int arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_611(float arg0, int arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_612(float arg0, int arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_613(float arg0, int arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_614(float arg0, int arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_615(float arg0, int arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_616(float arg0, int arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_617(float arg0, int arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_618(float arg0, int arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_619(float arg0, int arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_620(float arg0, int arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_621(float arg0, int arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_622(float arg0, int arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_623(float arg0, int arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_624(float arg0, int arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_625(float arg0, int arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_626(float arg0, int arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_627(float arg0, int arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_628(float arg0, int arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_629(float arg0, int arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_630(float arg0, int arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_631(float arg0, int arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_632(float arg0, int arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_633(float arg0, int arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_634(float arg0, int arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_635(float arg0, int arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_636(float arg0, int arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_637(float arg0, int arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_638(float arg0, int arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_639(float arg0, int arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_640(float arg0, int arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_641(float arg0, int arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_642(float arg0, int arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_643(float arg0, int arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_644(float arg0, int arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_645(float arg0, int arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_646(float arg0, int arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_647(float arg0, int arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_648(float arg0, int arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_649(float arg0, int arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_650(float arg0, int arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_651(float arg0, int arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_652(float arg0, int arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_653(float arg0, int arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_654(float arg0, int arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_655(float arg0, int arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_656(float arg0, int arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_657(float arg0, int arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_658(float arg0, int arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_659(float arg0, int arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_660(float arg0, float arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_661(float arg0, float arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_662(float arg0, float arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_663(float arg0, float arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_664(float arg0, float arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_665(float arg0, float arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_666(float arg0, float arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_667(float arg0, float arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_668(float arg0, float arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_669(float arg0, float arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_670(float arg0, float arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_671(float arg0, float arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_672(float arg0, float arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_673(float arg0, float arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_674(float arg0, float arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_675(float arg0, float arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_676(float arg0, float arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_677(float arg0, float arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_678(float arg0, float arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_679(float arg0, float arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_680(float arg0, float arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_681(float arg0, float arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_682(float arg0, float arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_683(float arg0, float arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_684(float arg0, float arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_685(float arg0, float arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_686(float arg0, float arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_687(float arg0, float arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_688(float arg0, float arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_689(float arg0, float arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_690(float arg0, float arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_691(float arg0, float arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_692(float arg0, float arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_693(float arg0, float arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_694(float arg0, float arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_695(float arg0, float arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_696(float arg0, float arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_697(float arg0, float arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_698(float arg0, float arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_699(float arg0, float arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_700(float arg0, float arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_701(float arg0, float arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_702(float arg0, float arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_703(float arg0, float arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_704(float arg0, float arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_705(float arg0, float arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_706(float arg0, float arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_707(float arg0, float arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_708(float arg0, float arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_709(float arg0, float arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_710(float arg0, float arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_711(float arg0, float arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_712(float arg0, float arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_713(float arg0, float arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_714(float arg0, float arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_715(float arg0, float arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_716(float arg0, float arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_717(float arg0, float arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_718(float arg0, float arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_719(float arg0, float arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_720(float arg0, float arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_721(float arg0, float arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_722(float arg0, float arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_723(float arg0, float arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_724(float arg0, long arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_725(float arg0, long arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_726(float arg0, long arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_727(float arg0, long arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_728(float arg0, long arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_729(float arg0, long arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_730(float arg0, long arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_731(float arg0, long arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_732(float arg0, long arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_733(float arg0, long arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_734(float arg0, long arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_735(float arg0, long arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_736(float arg0, long arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_737(float arg0, long arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_738(float arg0, long arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_739(float arg0, long arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_740(float arg0, long arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_741(float arg0, long arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_742(float arg0, long arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_743(float arg0, long arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_744(float arg0, long arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_745(float arg0, long arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_746(float arg0, long arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_747(float arg0, long arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_748(float arg0, long arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_749(float arg0, long arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_750(float arg0, long arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_751(float arg0, long arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_752(float arg0, long arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_753(float arg0, long arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_754(float arg0, long arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_755(float arg0, long arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_756(float arg0, long arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_757(float arg0, long arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_758(float arg0, long arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_759(float arg0, long arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_760(float arg0, long arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_761(float arg0, long arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_762(float arg0, long arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_763(float arg0, long arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_764(float arg0, long arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_765(float arg0, long arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_766(float arg0, long arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_767(float arg0, long arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_768(float arg0, long arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_769(float arg0, long arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_770(float arg0, long arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_771(float arg0, long arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_772(float arg0, long arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_773(float arg0, long arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_774(float arg0, long arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_775(float arg0, long arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_776(float arg0, long arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_777(float arg0, long arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_778(float arg0, long arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_779(float arg0, long arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_780(float arg0, long arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_781(float arg0, long arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_782(float arg0, long arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_783(float arg0, long arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_784(float arg0, long arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_785(float arg0, long arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_786(float arg0, long arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_787(float arg0, long arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_788(float arg0, double arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_789(float arg0, double arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_790(float arg0, double arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_791(float arg0, double arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_792(float arg0, double arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_793(float arg0, double arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_794(float arg0, double arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_795(float arg0, double arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_796(float arg0, double arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_797(float arg0, double arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_798(float arg0, double arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_799(float arg0, double arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_800(float arg0, double arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_801(float arg0, double arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_802(float arg0, double arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_803(float arg0, double arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_804(float arg0, double arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_805(float arg0, double arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_806(float arg0, double arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_807(float arg0, double arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_808(float arg0, double arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_809(float arg0, double arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_810(float arg0, double arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_811(float arg0, double arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_812(float arg0, double arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_813(float arg0, double arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_814(float arg0, double arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_815(float arg0, double arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_816(float arg0, double arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_817(float arg0, double arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_818(float arg0, double arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_819(float arg0, double arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_820(float arg0, double arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_821(float arg0, double arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_822(float arg0, double arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_823(float arg0, double arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_824(float arg0, double arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_825(float arg0, double arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_826(float arg0, double arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_827(float arg0, double arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_828(float arg0, double arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_829(float arg0, double arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_830(float arg0, double arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_831(float arg0, double arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_832(float arg0, double arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_833(float arg0, double arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_834(float arg0, double arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_835(float arg0, double arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_836(float arg0, double arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_837(float arg0, double arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_838(float arg0, double arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_839(float arg0, double arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_840(float arg0, double arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_841(float arg0, double arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_842(float arg0, double arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_843(float arg0, double arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_844(float arg0, double arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_845(float arg0, double arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_846(float arg0, double arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_847(float arg0, double arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_848(float arg0, double arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_849(float arg0, double arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_850(float arg0, double arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_851(float arg0, double arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_852(long arg0, int arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_853(long arg0, int arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_854(long arg0, int arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_855(long arg0, int arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_856(long arg0, int arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_857(long arg0, int arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_858(long arg0, int arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_859(long arg0, int arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_860(long arg0, int arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_861(long arg0, int arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_862(long arg0, int arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_863(long arg0, int arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_864(long arg0, int arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_865(long arg0, int arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_866(long arg0, int arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_867(long arg0, int arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_868(long arg0, int arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_869(long arg0, int arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_870(long arg0, int arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_871(long arg0, int arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_872(long arg0, int arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_873(long arg0, int arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_874(long arg0, int arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_875(long arg0, int arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_876(long arg0, int arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_877(long arg0, int arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_878(long arg0, int arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_879(long arg0, int arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_880(long arg0, int arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_881(long arg0, int arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_882(long arg0, int arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_883(long arg0, int arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_884(long arg0, int arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_885(long arg0, int arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_886(long arg0, int arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_887(long arg0, int arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_888(long arg0, int arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_889(long arg0, int arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_890(long arg0, int arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_891(long arg0, int arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_892(long arg0, int arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_893(long arg0, int arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_894(long arg0, int arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_895(long arg0, int arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_896(long arg0, int arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_897(long arg0, int arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_898(long arg0, int arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_899(long arg0, int arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_900(long arg0, int arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_901(long arg0, int arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_902(long arg0, int arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_903(long arg0, int arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_904(long arg0, int arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_905(long arg0, int arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_906(long arg0, int arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_907(long arg0, int arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_908(long arg0, int arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_909(long arg0, int arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_910(long arg0, int arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_911(long arg0, int arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_912(long arg0, int arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_913(long arg0, int arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_914(long arg0, int arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_915(long arg0, int arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_916(long arg0, float arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_917(long arg0, float arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_918(long arg0, float arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_919(long arg0, float arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_920(long arg0, float arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_921(long arg0, float arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_922(long arg0, float arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_923(long arg0, float arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_924(long arg0, float arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_925(long arg0, float arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_926(long arg0, float arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_927(long arg0, float arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_928(long arg0, float arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_929(long arg0, float arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_930(long arg0, float arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_931(long arg0, float arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_932(long arg0, float arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_933(long arg0, float arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_934(long arg0, float arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_935(long arg0, float arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_936(long arg0, float arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_937(long arg0, float arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_938(long arg0, float arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_939(long arg0, float arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_940(long arg0, float arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_941(long arg0, float arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_942(long arg0, float arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_943(long arg0, float arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_944(long arg0, float arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_945(long arg0, float arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_946(long arg0, float arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_947(long arg0, float arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_948(long arg0, float arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_949(long arg0, float arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_950(long arg0, float arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_951(long arg0, float arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_952(long arg0, float arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_953(long arg0, float arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_954(long arg0, float arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_955(long arg0, float arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_956(long arg0, float arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_957(long arg0, float arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_958(long arg0, float arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_959(long arg0, float arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_960(long arg0, float arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_961(long arg0, float arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_962(long arg0, float arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_963(long arg0, float arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_964(long arg0, float arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_965(long arg0, float arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_966(long arg0, float arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_967(long arg0, float arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_968(long arg0, float arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_969(long arg0, float arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_970(long arg0, float arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_971(long arg0, float arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_972(long arg0, float arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_973(long arg0, float arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_974(long arg0, float arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_975(long arg0, float arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_976(long arg0, float arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_977(long arg0, float arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_978(long arg0, float arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_979(long arg0, float arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_980(long arg0, long arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_981(long arg0, long arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_982(long arg0, long arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_983(long arg0, long arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_984(long arg0, long arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_985(long arg0, long arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_986(long arg0, long arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_987(long arg0, long arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_988(long arg0, long arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_989(long arg0, long arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_990(long arg0, long arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_991(long arg0, long arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_992(long arg0, long arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_993(long arg0, long arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_994(long arg0, long arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_995(long arg0, long arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_996(long arg0, long arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_997(long arg0, long arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_998(long arg0, long arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_999(long arg0, long arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1000(long arg0, long arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1001(long arg0, long arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1002(long arg0, long arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1003(long arg0, long arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1004(long arg0, long arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1005(long arg0, long arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1006(long arg0, long arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1007(long arg0, long arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1008(long arg0, long arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1009(long arg0, long arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1010(long arg0, long arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1011(long arg0, long arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1012(long arg0, long arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1013(long arg0, long arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1014(long arg0, long arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1015(long arg0, long arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1016(long arg0, long arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1017(long arg0, long arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1018(long arg0, long arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1019(long arg0, long arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1020(long arg0, long arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1021(long arg0, long arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1022(long arg0, long arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1023(long arg0, long arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1024(long arg0, long arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1025(long arg0, long arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1026(long arg0, long arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1027(long arg0, long arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1028(long arg0, long arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1029(long arg0, long arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1030(long arg0, long arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1031(long arg0, long arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1032(long arg0, long arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1033(long arg0, long arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1034(long arg0, long arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1035(long arg0, long arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1036(long arg0, long arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1037(long arg0, long arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1038(long arg0, long arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1039(long arg0, long arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1040(long arg0, long arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1041(long arg0, long arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1042(long arg0, long arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1043(long arg0, long arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1044(long arg0, double arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1045(long arg0, double arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1046(long arg0, double arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1047(long arg0, double arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1048(long arg0, double arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1049(long arg0, double arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1050(long arg0, double arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1051(long arg0, double arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1052(long arg0, double arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1053(long arg0, double arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1054(long arg0, double arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1055(long arg0, double arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1056(long arg0, double arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1057(long arg0, double arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1058(long arg0, double arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1059(long arg0, double arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1060(long arg0, double arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1061(long arg0, double arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1062(long arg0, double arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1063(long arg0, double arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1064(long arg0, double arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1065(long arg0, double arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1066(long arg0, double arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1067(long arg0, double arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1068(long arg0, double arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1069(long arg0, double arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1070(long arg0, double arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1071(long arg0, double arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1072(long arg0, double arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1073(long arg0, double arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1074(long arg0, double arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1075(long arg0, double arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1076(long arg0, double arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1077(long arg0, double arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1078(long arg0, double arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1079(long arg0, double arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1080(long arg0, double arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1081(long arg0, double arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1082(long arg0, double arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1083(long arg0, double arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1084(long arg0, double arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1085(long arg0, double arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1086(long arg0, double arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1087(long arg0, double arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1088(long arg0, double arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1089(long arg0, double arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1090(long arg0, double arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1091(long arg0, double arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1092(long arg0, double arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1093(long arg0, double arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1094(long arg0, double arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1095(long arg0, double arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1096(long arg0, double arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1097(long arg0, double arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1098(long arg0, double arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1099(long arg0, double arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1100(long arg0, double arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1101(long arg0, double arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1102(long arg0, double arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1103(long arg0, double arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1104(long arg0, double arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1105(long arg0, double arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1106(long arg0, double arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1107(long arg0, double arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1108(double arg0, int arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1109(double arg0, int arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1110(double arg0, int arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1111(double arg0, int arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1112(double arg0, int arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1113(double arg0, int arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1114(double arg0, int arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1115(double arg0, int arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1116(double arg0, int arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1117(double arg0, int arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1118(double arg0, int arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1119(double arg0, int arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1120(double arg0, int arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1121(double arg0, int arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1122(double arg0, int arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1123(double arg0, int arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1124(double arg0, int arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1125(double arg0, int arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1126(double arg0, int arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1127(double arg0, int arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1128(double arg0, int arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1129(double arg0, int arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1130(double arg0, int arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1131(double arg0, int arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1132(double arg0, int arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1133(double arg0, int arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1134(double arg0, int arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1135(double arg0, int arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1136(double arg0, int arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1137(double arg0, int arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1138(double arg0, int arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1139(double arg0, int arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1140(double arg0, int arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1141(double arg0, int arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1142(double arg0, int arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1143(double arg0, int arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1144(double arg0, int arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1145(double arg0, int arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1146(double arg0, int arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1147(double arg0, int arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1148(double arg0, int arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1149(double arg0, int arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1150(double arg0, int arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1151(double arg0, int arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1152(double arg0, int arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1153(double arg0, int arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1154(double arg0, int arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1155(double arg0, int arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1156(double arg0, int arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1157(double arg0, int arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1158(double arg0, int arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1159(double arg0, int arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1160(double arg0, int arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1161(double arg0, int arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1162(double arg0, int arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1163(double arg0, int arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1164(double arg0, int arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1165(double arg0, int arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1166(double arg0, int arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1167(double arg0, int arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1168(double arg0, int arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1169(double arg0, int arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1170(double arg0, int arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1171(double arg0, int arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1172(double arg0, float arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1173(double arg0, float arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1174(double arg0, float arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1175(double arg0, float arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1176(double arg0, float arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1177(double arg0, float arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1178(double arg0, float arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1179(double arg0, float arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1180(double arg0, float arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1181(double arg0, float arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1182(double arg0, float arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1183(double arg0, float arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1184(double arg0, float arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1185(double arg0, float arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1186(double arg0, float arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1187(double arg0, float arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1188(double arg0, float arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1189(double arg0, float arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1190(double arg0, float arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1191(double arg0, float arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1192(double arg0, float arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1193(double arg0, float arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1194(double arg0, float arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1195(double arg0, float arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1196(double arg0, float arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1197(double arg0, float arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1198(double arg0, float arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1199(double arg0, float arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1200(double arg0, float arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1201(double arg0, float arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1202(double arg0, float arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1203(double arg0, float arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1204(double arg0, float arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1205(double arg0, float arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1206(double arg0, float arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1207(double arg0, float arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1208(double arg0, float arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1209(double arg0, float arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1210(double arg0, float arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1211(double arg0, float arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1212(double arg0, float arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1213(double arg0, float arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1214(double arg0, float arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1215(double arg0, float arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1216(double arg0, float arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1217(double arg0, float arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1218(double arg0, float arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1219(double arg0, float arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1220(double arg0, float arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1221(double arg0, float arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1222(double arg0, float arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1223(double arg0, float arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1224(double arg0, float arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1225(double arg0, float arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1226(double arg0, float arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1227(double arg0, float arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1228(double arg0, float arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1229(double arg0, float arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1230(double arg0, float arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1231(double arg0, float arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1232(double arg0, float arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1233(double arg0, float arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1234(double arg0, float arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1235(double arg0, float arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1236(double arg0, long arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1237(double arg0, long arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1238(double arg0, long arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1239(double arg0, long arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1240(double arg0, long arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1241(double arg0, long arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1242(double arg0, long arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1243(double arg0, long arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1244(double arg0, long arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1245(double arg0, long arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1246(double arg0, long arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1247(double arg0, long arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1248(double arg0, long arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1249(double arg0, long arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1250(double arg0, long arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1251(double arg0, long arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1252(double arg0, long arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1253(double arg0, long arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1254(double arg0, long arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1255(double arg0, long arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1256(double arg0, long arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1257(double arg0, long arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1258(double arg0, long arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1259(double arg0, long arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1260(double arg0, long arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1261(double arg0, long arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1262(double arg0, long arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1263(double arg0, long arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1264(double arg0, long arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1265(double arg0, long arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1266(double arg0, long arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1267(double arg0, long arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1268(double arg0, long arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1269(double arg0, long arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1270(double arg0, long arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1271(double arg0, long arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1272(double arg0, long arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1273(double arg0, long arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1274(double arg0, long arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1275(double arg0, long arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1276(double arg0, long arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1277(double arg0, long arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1278(double arg0, long arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1279(double arg0, long arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1280(double arg0, long arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1281(double arg0, long arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1282(double arg0, long arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1283(double arg0, long arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1284(double arg0, long arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1285(double arg0, long arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1286(double arg0, long arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1287(double arg0, long arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1288(double arg0, long arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1289(double arg0, long arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1290(double arg0, long arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1291(double arg0, long arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1292(double arg0, long arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1293(double arg0, long arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1294(double arg0, long arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1295(double arg0, long arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1296(double arg0, long arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1297(double arg0, long arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1298(double arg0, long arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1299(double arg0, long arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1300(double arg0, double arg1, int arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1301(double arg0, double arg1, int arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1302(double arg0, double arg1, int arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1303(double arg0, double arg1, int arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1304(double arg0, double arg1, int arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1305(double arg0, double arg1, int arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1306(double arg0, double arg1, int arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1307(double arg0, double arg1, int arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1308(double arg0, double arg1, int arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1309(double arg0, double arg1, int arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1310(double arg0, double arg1, int arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1311(double arg0, double arg1, int arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1312(double arg0, double arg1, int arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1313(double arg0, double arg1, int arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1314(double arg0, double arg1, int arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1315(double arg0, double arg1, int arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1316(double arg0, double arg1, float arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1317(double arg0, double arg1, float arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1318(double arg0, double arg1, float arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1319(double arg0, double arg1, float arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1320(double arg0, double arg1, float arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1321(double arg0, double arg1, float arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1322(double arg0, double arg1, float arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1323(double arg0, double arg1, float arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1324(double arg0, double arg1, float arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1325(double arg0, double arg1, float arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1326(double arg0, double arg1, float arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1327(double arg0, double arg1, float arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1328(double arg0, double arg1, float arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1329(double arg0, double arg1, float arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1330(double arg0, double arg1, float arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1331(double arg0, double arg1, float arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1332(double arg0, double arg1, long arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1333(double arg0, double arg1, long arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1334(double arg0, double arg1, long arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1335(double arg0, double arg1, long arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1336(double arg0, double arg1, long arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1337(double arg0, double arg1, long arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1338(double arg0, double arg1, long arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1339(double arg0, double arg1, long arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1340(double arg0, double arg1, long arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1341(double arg0, double arg1, long arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1342(double arg0, double arg1, long arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1343(double arg0, double arg1, long arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1344(double arg0, double arg1, long arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1345(double arg0, double arg1, long arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1346(double arg0, double arg1, long arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1347(double arg0, double arg1, long arg2, double arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1348(double arg0, double arg1, double arg2, int arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1349(double arg0, double arg1, double arg2, int arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1350(double arg0, double arg1, double arg2, int arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1351(double arg0, double arg1, double arg2, int arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1352(double arg0, double arg1, double arg2, float arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1353(double arg0, double arg1, double arg2, float arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1354(double arg0, double arg1, double arg2, float arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1355(double arg0, double arg1, double arg2, float arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1356(double arg0, double arg1, double arg2, long arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1357(double arg0, double arg1, double arg2, long arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1358(double arg0, double arg1, double arg2, long arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1359(double arg0, double arg1, double arg2, long arg3, double arg4); @Generated @CFunction public static native boolean NGInvocation_1360(double arg0, double arg1, double arg2, double arg3, int arg4); @Generated @CFunction public static native boolean NGInvocation_1361(double arg0, double arg1, double arg2, double arg3, float arg4); @Generated @CFunction public static native boolean NGInvocation_1362(double arg0, double arg1, double arg2, double arg3, long arg4); @Generated @CFunction public static native boolean NGInvocation_1363(double arg0, double arg1, double arg2, double arg3, double arg4); @Generated @CFunction public static native void NGPrepareVariablesWithPrimitivesTest(); @Generated @CVariable() public static native boolean kNGBoolDefault(); @Generated @CVariable() public static native byte kNGByteDefault(); @Generated @CVariable() public static native short kNGShortDefault(); @Generated @CVariable() public static native char kNGCharDefault(); @Generated @CVariable() public static native int kNGIntDefault(); @Generated @CVariable() public static native long kNGLongDefault(); @Generated @CVariable() public static native float kNGFloatDefault(); @Generated @CVariable() public static native double kNGDoubleDefault(); @Generated @CVariable() public static native boolean kNGBoolUnit(); @Generated @CVariable() public static native byte kNGByteUnit(); @Generated @CVariable() public static native short kNGShortUnit(); @Generated @CVariable() public static native char kNGCharUnit(); @Generated @CVariable() public static native int kNGIntUnit(); @Generated @CVariable() public static native long kNGLongUnit(); @Generated @CVariable() public static native float kNGFloatUnit(); @Generated @CVariable() public static native double kNGDoubleUnit(); @Generated @CVariable() public static native boolean kNGBoolValueA(); @Generated @CVariable() public static native byte kNGByteValueA(); @Generated @CVariable() public static native short kNGShortValueA(); @Generated @CVariable() public static native char kNGCharValueA(); @Generated @CVariable() public static native int kNGIntValueA(); @Generated @CVariable() public static native long kNGLongValueA(); @Generated @CVariable() public static native float kNGFloatValueA(); @Generated @CVariable() public static native double kNGDoubleValueA(); @Generated @CVariable() public static native boolean kNGBoolValueB(); @Generated @CVariable() public static native byte kNGByteValueB(); @Generated @CVariable() public static native short kNGShortValueB(); @Generated @CVariable() public static native char kNGCharValueB(); @Generated @CVariable() public static native int kNGIntValueB(); @Generated @CVariable() public static native long kNGLongValueB(); @Generated @CVariable() public static native float kNGFloatValueB(); @Generated @CVariable() public static native double kNGDoubleValueB(); @Generated @CVariable() public static native boolean kNGBoolValueC(); @Generated @CVariable() public static native byte kNGByteValueC(); @Generated @CVariable() public static native short kNGShortValueC(); @Generated @CVariable() public static native char kNGCharValueC(); @Generated @CVariable() public static native int kNGIntValueC(); @Generated @CVariable() public static native long kNGLongValueC(); @Generated @CVariable() public static native float kNGFloatValueC(); @Generated @CVariable() public static native double kNGDoubleValueC(); @Generated @CVariable() public static native ConstBoolPtr kNGBoolValues(); @Generated @CVariable() public static native ConstBytePtr kNGByteValues(); @Generated @CVariable() public static native ConstShortPtr kNGShortValues(); @Generated @CVariable() public static native ConstCharPtr kNGCharValues(); @Generated @CVariable() public static native ConstIntPtr kNGIntValues(); @Generated @CVariable() public static native ConstLongPtr kNGLongValues(); @Generated @CVariable() public static native ConstFloatPtr kNGFloatValues(); @Generated @CVariable() public static native ConstDoublePtr kNGDoubleValues(); }
31.305483
115
0.778511
0a31ff1887bdc321b3caa90242ac6d796a3c34f8
1,471
package org.monkey.pojo; import java.util.*; public class ParameterMap { private Map<String, List<String>> paramHashValues = new LinkedHashMap<>(); public ParameterMap(String originalParam) { if (originalParam == null || "".equals(originalParam.trim())) { return; } String[] params = originalParam.split("&"); for (String param : params) { String[] keyValue = param.split("="); if (keyValue.length != 2) { continue; } String key = keyValue[0]; String value = keyValue[1]; List<String> values = this.paramHashValues.get(key); if (values == null) { values = new ArrayList<>(); this.paramHashValues.put(key, values); } values.add(value); } } public Map<String, List<String>> getParameterMap() { return this.paramHashValues; } public List<String> getParameterValues(String name) { return paramHashValues.get(name); } public String getParameter(String name) { List<String> values = paramHashValues.get(name); if (values != null) { if (values.size() == 0) { return ""; } return values.get(0); } else { return null; } } public Set<String> getParameterNames() { return paramHashValues.keySet(); } }
27.240741
78
0.530931
31fc7a9b2f25f5400e02c7ca197fca358e5c9b23
7,934
/* * MIT License * * Copyright (c) 2020-2022 The OSHI Project Contributors: https://github.com/oshi/oshi/graphs/contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package oshi.util; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.aMapWithSize; import static org.hamcrest.Matchers.anEmptyMap; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; /** * Tests FileUtil */ class FileUtilTest { /** * Test read file. */ @Test void testReadFile() { // Write to a temp file Path multilineFile = null; try { multilineFile = Files.createTempFile("oshitest.multiline", null); String s = "Line 1\nLine 2\nThe third line\nLine 4\nLine 5\n"; Files.write(multilineFile, s.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { fail("IO Exception creating or writing to temporary multiline file."); } // Try the new temp file List<String> tempFileStrings = FileUtil.readFile(multilineFile.toString()); assertThat("Temp file line one mismatch", tempFileStrings.get(0), is("Line 1")); List<String> matchingLines = tempFileStrings.stream().filter(s -> s.startsWith("Line ")) .collect(Collectors.toList()); assertThat("Matching lines mismatch", matchingLines.size(), is(4)); // Delete the temp file try { Files.deleteIfExists(multilineFile); } catch (IOException e) { fail("IO Exception deleting temporary multiline file."); } // Try file not found on deleted file assertThat("Deleted file should return empty", FileUtil.readFile(multilineFile.toString()), is(empty())); } /** * Test get*FromFile */ @Test void testGetFromFile() { // Write to temp file Path integerFile = null; try { integerFile = Files.createTempFile("oshitest.int", null); Files.write(integerFile, "123\n".getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { fail("IO Exception creating or writing to temporary integer file."); } assertThat("unsigned long from int", FileUtil.getUnsignedLongFromFile(integerFile.toString()), is(123L)); assertThat("long from int", FileUtil.getLongFromFile(integerFile.toString()), is(123L)); assertThat("int from int", FileUtil.getIntFromFile(integerFile.toString()), is(123)); assertThat("string from int", FileUtil.getStringFromFile(integerFile.toString()), is("123")); // Delete the temp file try { Files.deleteIfExists(integerFile); } catch (IOException e) { fail("IO Exception deleting temporary integer file."); } // Write to temp file Path stringFile = null; try { stringFile = Files.createTempFile("oshitest.str", null); Files.write(stringFile, "foo bar\n".getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { fail("IO Exception creating or writing to temporary string file."); } assertThat("unsigned long from string", FileUtil.getUnsignedLongFromFile(stringFile.toString()), is(0L)); assertThat("long from string", FileUtil.getLongFromFile(stringFile.toString()), is(0L)); assertThat("int from string", FileUtil.getIntFromFile(stringFile.toString()), is(0)); assertThat("string from string", FileUtil.getStringFromFile(stringFile.toString()), is("foo bar")); // Delete the temp file try { Files.deleteIfExists(stringFile); } catch (IOException e) { fail("IO Exception deleting temporary string file."); } // Try file not found on deleted file assertThat("unsigned long from invalid", FileUtil.getUnsignedLongFromFile(stringFile.toString()), is(0L)); assertThat("long from invalid", FileUtil.getLongFromFile(stringFile.toString()), is(0L)); assertThat("int from invalid", FileUtil.getIntFromFile(stringFile.toString()), is(0)); assertThat("string from invalid ", FileUtil.getStringFromFile(stringFile.toString()), is(emptyString())); } @Test void testReadProcIo() { Map<String, String> expected = new LinkedHashMap<>(); expected.put("rchar", "124788352"); expected.put("wchar", "124802481"); expected.put("syscr", "135"); expected.put("syscw", "1547"); expected.put("read_bytes", "40304640"); expected.put("write_bytes", "124780544"); expected.put("cancelled_write_bytes", "42"); // Write this to a temp file Path procIoFile = null; try { procIoFile = Files.createTempFile("oshitest.procio", null); for (Entry<String, String> e : expected.entrySet()) { String s = e.getKey() + ": " + e.getValue() + "\n"; Files.write(procIoFile, s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND); } } catch (IOException e) { fail("IO Exception creating or writing to temporary procIo file."); } // Read into map Map<String, String> actual = FileUtil.getKeyValueMapFromFile(procIoFile.toString(), ":"); assertThat("procio size", actual, is(aMapWithSize(expected.size()))); for (Entry<String, String> entry : expected.entrySet()) { assertThat("procio entry", actual, hasEntry(entry.getKey(), entry.getValue())); } // Cleanup try { Files.deleteIfExists(procIoFile); } catch (IOException e) { fail("IO Exception deleting temporary procIo file."); } // Test deleted file actual = FileUtil.getKeyValueMapFromFile(procIoFile.toString(), ":"); assertThat("procio size", actual, anEmptyMap()); } @Test void testReadProperties() { Properties props = FileUtil.readPropertiesFromFilename("simplelogger.properties"); assertThat("simplelogger properties", props.getProperty("org.slf4j.simpleLogger.defaultLogLevel"), is("INFO")); props = FileUtil.readPropertiesFromFilename("this.file.does.not.exist"); assertThat("invalid file", props.stringPropertyNames(), is(empty())); } }
42.427807
119
0.661709
5c17e68d07d6778cc708e28b285bbd2616238a78
2,254
package cn.com.hanbinit; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; import io.netty.handler.timeout.ReadTimeoutException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; /** * @author icer */ @EnableEurekaClient @SpringBootApplication public class PreServerApplication extends Thread{ private static final Logger logger = LoggerFactory.getLogger(PreServerApplication.class); private final int PORT = 10000; @Autowired private HandlerInitializer handlerInitializer; public void run() { // Configure the server. EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .handler(new LoggingHandler(LogLevel.INFO)) .childHandler(handlerInitializer); // start server ChannelFuture f = b.bind(PORT).sync(); logger.info(PreServerApplication.class.getName() + " started and listen on " + f.channel().localAddress()); // Wait until the server socket is closed. f.channel().closeFuture().sync(); } catch (InterruptedException e) { logger.error(e.getMessage()); } catch (ReadTimeoutException e) { logger.error(e.getMessage()); } finally { // Shut down all event loops to terminate all threads. bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } @PostConstruct public void serverStart() { this.start(); } @PreDestroy public void serverStop(){ this.interrupt(); } public static void main(String[] args) { SpringApplication.run(PreServerApplication.class, args); } }
28.897436
110
0.771961
7b5132f000ce1522d250490773d77e6cfc4281bf
3,712
import org.sql2o.*; import java.util.ArrayList; import java.util.List; public class Ranger implements DatabaseManagement { private String name; private String contactInfo; private int id; public Ranger(String name, String contactInfo) { this.name = name; this.contactInfo = contactInfo; } public String getName() { return name; } public String getDescription() { return contactInfo; } @Override public boolean equals(Object otherRanger){ if (!(otherRanger instanceof Ranger)) { return false; } else { Ranger newRanger = (Ranger) otherRanger; return this.getName().equals(newRanger.getName()) && this.getDescription().equals(newRanger.getDescription()); } } @Override public void save() { try(Connection con = DB.sql2o.open()) { String sql = "INSERT INTO rangers (name, contactinfo) VALUES (:name, :contactInfo)"; this.id = (int) con.createQuery(sql, true) .addParameter("name", this.name) .addParameter("contactInfo", this.contactInfo) .executeUpdate() .getKey(); } } public static List<Ranger> all() { String sql = "SELECT * FROM rangers"; try(Connection con = DB.sql2o.open()) { return con.createQuery(sql).executeAndFetch(Ranger.class); } } public int getId() { return id; } @Override public void delete() { try(Connection con = DB.sql2o.open()) { String sql = "DELETE FROM rangers WHERE id = :id;"; con.createQuery(sql) .addParameter("id", this.id) .executeUpdate(); String joinDeleteQuery = "DELETE FROM rangers_sightings WHERE ranger_id = :rangerId"; con.createQuery(joinDeleteQuery) .addParameter("rangerId", this.getId()) .executeUpdate(); } } public void addSighting(Sighting sighting) { try(Connection con = DB.sql2o.open()) { String sql = "INSERT INTO rangers_sightings (ranger_id, sighting_id) VALUES (:ranger_id, :sighting_id)"; con.createQuery(sql) .addParameter("ranger_id", this.getId()) .addParameter("sighting_id", sighting.getId()) .executeUpdate(); } } public static Ranger find(int id) { try(Connection con = DB.sql2o.open()) { String sql = "SELECT * FROM rangers where id=:id"; Ranger ranger = con.createQuery(sql) .addParameter("id", id) .executeAndFetchFirst(Ranger.class); return ranger; } } public List<Sighting> getSightings() { try(Connection con = DB.sql2o.open()){ String joinQuery = "SELECT sighting_id FROM rangers_sightings WHERE ranger_id = :ranger_id"; List<Integer> sightingIds = con.createQuery(joinQuery) .addParameter("ranger_id", this.getId()) .executeAndFetch(Integer.class); List<Sighting> sightings = new ArrayList<Sighting>(); for (Integer sightingId : sightingIds) { String sightingQuery = "SELECT * FROM sightings WHERE id = :sightingId"; Sighting Sighting = con.createQuery(sightingQuery) .addParameter("sightingId", sightingId) .executeAndFetchFirst(Sighting.class); sightings.add(Sighting); } return sightings; } } }
36.038835
116
0.560345
766351580f4c237a01196a475b64aad5a672187a
10,112
// Copyright 2008 Peter William Birch <[email protected]> // // This software may be used and distributed according to the terms // of the Genyris License, in the file "LICENSE", incorporated herein by reference. // package org.genyris.io; import java.math.BigDecimal; import org.genyris.core.Bignum; import org.genyris.core.Constants; import org.genyris.core.Exp; import org.genyris.core.Internable; import org.genyris.core.StrinG; import org.genyris.core.SimpleSymbol; import org.genyris.core.Symbol; import org.genyris.core.SymbolTable; import org.genyris.exception.GenyrisException; import org.genyris.interp.Environment; public class Lex { private InStream _input; private PrefixMapper _mapper; private Internable _symbolTable; private char _cdrCharacter, _commentCharacter; public Symbol EOF_TOKEN, QUOTE_TOKEN, DYNAMIC_TOKEN, BACKQUOTE_TOKEN, DOLLAR_AT_TOKEN; public Symbol DOLLAR_TOKEN; public Symbol LEFT_PAREN_TOKEN, RIGHT_PAREN_TOKEN, CDR_TOKEN; public Symbol LEFT_SQUARE_TOKEN, RIGHT_SQUARE_TOKEN; public Symbol LEFT_CURLY_TOKEN, RIGHT_CURLY_TOKEN; public Symbol PLING_TOKEN; private char _dynamicCharacter; private void init(InStream inputSource, Internable table, char dynaChar, char cdrChar, char commentChar) { _mapper = new PrefixMapper(dynaChar); _input = inputSource; _symbolTable = table; _cdrCharacter = cdrChar; _commentCharacter = commentChar; _dynamicCharacter = dynaChar; QUOTE_TOKEN = new SimpleSymbol("QuoteToken"); BACKQUOTE_TOKEN = new SimpleSymbol("BackquoteToken"); DOLLAR_AT_TOKEN = new SimpleSymbol("DOLLAR_AT_TOKEN"); DOLLAR_TOKEN = new SimpleSymbol("DOLLAR_TOKEN"); DYNAMIC_TOKEN = new SimpleSymbol("DYNAMIC_TOKEN"); EOF_TOKEN = new SimpleSymbol("EOF_TOKEN"); LEFT_PAREN_TOKEN = new SimpleSymbol("leftParenToken"); RIGHT_PAREN_TOKEN = new SimpleSymbol("righParenToken"); LEFT_SQUARE_TOKEN = new SimpleSymbol("leftSquareToken"); RIGHT_SQUARE_TOKEN = new SimpleSymbol("rightSquareToken"); LEFT_CURLY_TOKEN = new SimpleSymbol("leftCurlyToken"); RIGHT_CURLY_TOKEN = new SimpleSymbol("rightCurlyToken"); CDR_TOKEN = new SimpleSymbol("pair-delimiterToken"); PLING_TOKEN = new SimpleSymbol("plingToken"); } public Lex(InStream inputSource, Internable table, char dynaChar, char cdrChar, char commentChar) { init(inputSource, table, dynaChar, cdrChar, commentChar); } public Lex(InStream inputSource, SymbolTable table) { init(inputSource, table, Constants.DYNAMICSCOPECHAR2, Constants.CDRCHAR, Constants.COMMENTCHAR); } public BigDecimal parseDecimalNumber() throws LexException { StringBuffer collect = new StringBuffer(); char ch; if (!_input.hasData()) { throw new LexException("unexpected end of file"); } ch = _input.readNext(); if (ch == '-') { collect.append(ch); } else { _input.unGet(ch); } while (_input.hasData()) { ch = _input.readNext(); if ((ch <= '9' && ch >= '0') || (ch == '.')) { collect.append(ch); } else { _input.unGet(ch); break; } } try { return new BigDecimal(collect.toString()); } catch (NumberFormatException e) { throw new LexException("NumberFormatException on " + collect.toString()); } } public Exp parseNumber() throws LexException { BigDecimal floatingValue; char nextChar; floatingValue = parseDecimalNumber(); if (!this._input.hasData()) { return new Bignum(floatingValue); } BigDecimal mantissa; nextChar = _input.readNext(); if (nextChar == 'e' || nextChar == 'E') { mantissa = parseDecimalNumber(); double mantissaRaised = Math.pow(10, mantissa.intValue()); return (new Bignum(floatingValue.doubleValue() * mantissaRaised)); } else { _input.unGet(nextChar); return new Bignum(floatingValue); } } private boolean isNotIdentEscapeChar(char c) { switch (c) { case '\f': case '\n': case '\t': case '\r': return false; default: return true; } } public boolean isIdentCharacter(char c) { if (c == _cdrCharacter) return false; if (c == _commentCharacter) return false; if( c == _dynamicCharacter) return false; switch (c) { case '\f': case '\n': case '\t': case ' ': case '\r': case '(': case ')': case '[': case ']': case '{': case '}': case Constants.BQUOTECHAR: case Constants.QUOTECHAR: case '\'': case '"': case '!': return false; default: return true; } } public Exp parseIdentEscaped() throws GenyrisException { char ch; StringBuffer collect = new StringBuffer(); if (!_input.hasData()) { throw new LexException("unexpected end of file"); } while (_input.hasData()) { ch = _input.readNext(); if (isNotIdentEscapeChar(ch)) { if (ch == Constants.SYMBOLESCAPE) break; if (ch == '\\') ch = _input.readNext(); collect.append(ch); } else { throw new LexException("unexpected end of escaped symbol"); } } return _symbolTable.internSymbol(Symbol.symbolFactory(collect.toString(), true)); } public Exp parseIdent() throws GenyrisException { char ch; StringBuffer collect = new StringBuffer(""); if (!_input.hasData()) { throw new LexException("unexpected end of file"); } while (_input.hasData()) { ch = _input.readNext(); if (isIdentCharacter(ch)) { if (ch == '\\') ch = _input.readNext(); collect.append(ch); } else { _input.unGet(ch); break; } } return replaceMacro(collect); } private Exp replaceMacro(StringBuffer collect) throws GenyrisException { // // replace @LINE and @FILE with current values or return a symbol. // if( collect.toString().equals(Constants.ATLINE) ) { return new Bignum(getLineNumber()); } else if(collect.toString().equals(Constants.ATFILE) ) { return new StrinG(_input.getFilename()); } else { return _symbolTable.internSymbol(_mapper.symbolFactory(collect.toString())); } } public Exp nextToken() throws GenyrisException { char ch; do { if (!_input.hasData()) { return EOF_TOKEN; } ch = _input.readNext(); if (ch == this._cdrCharacter) return CDR_TOKEN; if (ch == this._commentCharacter) { while (_input.hasData()) { ch = _input.readNext(); if (ch == '\n') { break; } } } if( ch == _dynamicCharacter ) { return DYNAMIC_TOKEN; } switch (ch) { case '\f': case '\n': case '\t': case ' ': case '\r': break; case '-': if (!_input.hasData()) { return EOF_TOKEN; } ch = _input.readNext(); if (ch >= '0' && ch <= '9') { _input.unGet(ch); _input.unGet('-'); return parseNumber(); } else { _input.unGet(ch); _input.unGet('-'); return parseIdent(); } case '"': _input.unGet(ch); return parseString('"'); case '\'': _input.unGet(ch); return parseString('\''); case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': _input.unGet(ch); return parseNumber(); case '!': return PLING_TOKEN; case '(': return LEFT_PAREN_TOKEN; case ')': return RIGHT_PAREN_TOKEN; case '[': return LEFT_SQUARE_TOKEN; case ']': return RIGHT_SQUARE_TOKEN; case '{': return LEFT_CURLY_TOKEN; case '}': return RIGHT_CURLY_TOKEN; case Constants.QUOTECHAR: return QUOTE_TOKEN; case Constants.BQUOTECHAR: return BACKQUOTE_TOKEN; case Constants.DOLLARCHAR: { if (_input.hasData()) { ch = _input.readNext(); if (ch == Constants.ATCHAR) { return DOLLAR_AT_TOKEN; } else { _input.unGet(ch); ch = Constants.DOLLARCHAR; return DOLLAR_TOKEN; } } else { return DOLLAR_TOKEN; } } case Constants.SYMBOLESCAPE: return parseIdentEscaped(); default: if ((ch >= ' ') && (ch <= '~')) { _input.unGet(ch); return parseIdent(); } else { throw new LexException("invalid input character"); } } } while (true); } public Exp parseString(char quotechar) throws LexException { char ch; StringBuffer collect = new StringBuffer(); ch = _input.readNext(); while (_input.hasData()) { ch = _input.readNext(); if (ch == quotechar) { break; } else { if (ch == '\\') { if (!_input.hasData()) throw new LexException("unexpected end of file"); char ch2 = _input.readNext(); switch (ch2) { case 'a': ch = '\u0007'; break; case 'n': ch = '\n'; break; case 'r': ch = '\r'; break; case 't': ch = '\t'; break; case 'f': ch = '\f'; break; case '"': ch = '\"'; break; case 'e': ch = '\033'; break; case '\\': ch = '\\'; break; default: ch = ch2; break; } } collect.append(ch); } } return new StrinG(collect, quotechar); } public void addprefix(String prefix, String uri) throws GenyrisException { _mapper.addprefix(prefix, uri); } public void resetAfterError() { _input.resetAfterError(); } public void withinExpression(Environment env) { _input.withinExpression(env); } public void beginningExpression() { _input.beginningExpression(); } public int getLineNumber() { return _input.getLineNumber(); } public String getFilename() { return _input.getFilename(); } }
25.029703
108
0.597013
12af58bd16f8e97ac9657699a1480a912ef0aa7b
5,512
/* * Copyright 2012-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.joshworks.snappy.loader; import io.joshworks.snappy.loader.util.AsciiBytes; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; /** * Tests for {@link AsciiBytes}. * * @author Phillip Webb */ public class AsciiBytesTests { @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void createFromBytes() throws Exception { AsciiBytes bytes = new AsciiBytes(new byte[]{65, 66}); assertThat(bytes.toString(), equalTo("AB")); } @Test public void createFromBytesWithOffset() throws Exception { AsciiBytes bytes = new AsciiBytes(new byte[]{65, 66, 67, 68}, 1, 2); assertThat(bytes.toString(), equalTo("BC")); } @Test public void createFromString() throws Exception { AsciiBytes bytes = new AsciiBytes("AB"); assertThat(bytes.toString(), equalTo("AB")); } @Test public void length() throws Exception { AsciiBytes b1 = new AsciiBytes(new byte[]{65, 66}); AsciiBytes b2 = new AsciiBytes(new byte[]{65, 66, 67, 68}, 1, 2); assertThat(b1.length(), equalTo(2)); assertThat(b2.length(), equalTo(2)); } @Test public void startWith() throws Exception { AsciiBytes abc = new AsciiBytes(new byte[]{65, 66, 67}); AsciiBytes ab = new AsciiBytes(new byte[]{65, 66}); AsciiBytes bc = new AsciiBytes(new byte[]{65, 66, 67}, 1, 2); AsciiBytes abcd = new AsciiBytes(new byte[]{65, 66, 67, 68}); assertThat(abc.startsWith(abc), equalTo(true)); assertThat(abc.startsWith(ab), equalTo(true)); assertThat(abc.startsWith(bc), equalTo(false)); assertThat(abc.startsWith(abcd), equalTo(false)); } @Test public void endsWith() throws Exception { AsciiBytes abc = new AsciiBytes(new byte[]{65, 66, 67}); AsciiBytes bc = new AsciiBytes(new byte[]{65, 66, 67}, 1, 2); AsciiBytes ab = new AsciiBytes(new byte[]{65, 66}); AsciiBytes aabc = new AsciiBytes(new byte[]{65, 65, 66, 67}); assertThat(abc.endsWith(abc), equalTo(true)); assertThat(abc.endsWith(bc), equalTo(true)); assertThat(abc.endsWith(ab), equalTo(false)); assertThat(abc.endsWith(aabc), equalTo(false)); } @Test public void substringFromBeingIndex() throws Exception { AsciiBytes abcd = new AsciiBytes(new byte[]{65, 66, 67, 68}); assertThat(abcd.substring(0).toString(), equalTo("ABCD")); assertThat(abcd.substring(1).toString(), equalTo("BCD")); assertThat(abcd.substring(2).toString(), equalTo("CD")); assertThat(abcd.substring(3).toString(), equalTo("D")); assertThat(abcd.substring(4).toString(), equalTo("")); this.thrown.expect(IndexOutOfBoundsException.class); abcd.substring(5); } @Test public void substring() throws Exception { AsciiBytes abcd = new AsciiBytes(new byte[]{65, 66, 67, 68}); assertThat(abcd.substring(0, 4).toString(), equalTo("ABCD")); assertThat(abcd.substring(1, 3).toString(), equalTo("BC")); assertThat(abcd.substring(3, 4).toString(), equalTo("D")); assertThat(abcd.substring(3, 3).toString(), equalTo("")); this.thrown.expect(IndexOutOfBoundsException.class); abcd.substring(3, 5); } @Test public void appendString() throws Exception { AsciiBytes bc = new AsciiBytes(new byte[]{65, 66, 67, 68}, 1, 2); AsciiBytes appended = bc.append("D"); assertThat(bc.toString(), equalTo("BC")); assertThat(appended.toString(), equalTo("BCD")); } @Test public void appendBytes() throws Exception { AsciiBytes bc = new AsciiBytes(new byte[]{65, 66, 67, 68}, 1, 2); AsciiBytes appended = bc.append(new byte[]{68}); assertThat(bc.toString(), equalTo("BC")); assertThat(appended.toString(), equalTo("BCD")); } @Test public void hashCodeAndEquals() throws Exception { AsciiBytes abcd = new AsciiBytes(new byte[]{65, 66, 67, 68}); AsciiBytes bc = new AsciiBytes(new byte[]{66, 67}); AsciiBytes bc_substring = new AsciiBytes(new byte[]{65, 66, 67, 68}) .substring(1, 3); AsciiBytes bc_string = new AsciiBytes("BC"); assertThat(bc.hashCode(), equalTo(bc.hashCode())); assertThat(bc.hashCode(), equalTo(bc_substring.hashCode())); assertThat(bc.hashCode(), equalTo(bc_string.hashCode())); assertThat(bc, equalTo(bc)); assertThat(bc, equalTo(bc_substring)); assertThat(bc, equalTo(bc_string)); assertThat(bc.hashCode(), not(equalTo(abcd.hashCode()))); assertThat(bc, not(equalTo(abcd))); } }
38.013793
76
0.643505
1ffee5663b84ae14247381d28c4e3d7fc04b290e
340
public class ClientInterne extends Salarie implements IClient{ private Compte compte; ClientInterne(double salaire){ super(salaire); } public Compte creerCompte(){ this.compte = new Compte(); return compte; } public void verserSalaire(){ compte.crediter(getSalaire()); } }
22.666667
62
0.626471
e1676d91dc0de01837d01b27b2e7d5f93bc08d5c
4,631
/* * Copyright (c) 2018-2021, Antonio Gabriel Muñoz Conejo <antoniogmc at gmail dot com> * Distributed under the terms of the MIT License */ package com.github.tonivade.purefun.instances; import static com.github.tonivade.purefun.Function1.identity; import java.time.Duration; import com.github.tonivade.purefun.Consumer1; import com.github.tonivade.purefun.Function1; import com.github.tonivade.purefun.Kind; import com.github.tonivade.purefun.Producer; import com.github.tonivade.purefun.Unit; import com.github.tonivade.purefun.concurrent.Par; import com.github.tonivade.purefun.concurrent.ParOf; import com.github.tonivade.purefun.concurrent.Par_; import com.github.tonivade.purefun.typeclasses.Applicative; import com.github.tonivade.purefun.typeclasses.Bracket; import com.github.tonivade.purefun.typeclasses.Defer; import com.github.tonivade.purefun.typeclasses.Functor; import com.github.tonivade.purefun.typeclasses.Monad; import com.github.tonivade.purefun.typeclasses.MonadDefer; import com.github.tonivade.purefun.typeclasses.MonadThrow; import com.github.tonivade.purefun.typeclasses.Reference; import com.github.tonivade.purefun.typeclasses.Resource; public interface ParInstances { static Functor<Par_> functor() { return ParFunctor.INSTANCE; } static Applicative<Par_> applicative() { return PureApplicative.INSTANCE; } static Monad<Par_> monad() { return ParMonad.INSTANCE; } static MonadDefer<Par_> monadDefer() { return ParMonadDefer.INSTANCE; } static <A> Reference<Par_, A> reference(A value) { return Reference.of(monadDefer(), value); } static <A extends AutoCloseable> Resource<Par_, A> resource(Par<A> acquire) { return resource(acquire, AutoCloseable::close); } static <A> Resource<Par_, A> resource(Par<A> acquire, Consumer1<A> release) { return Resource.from(monadDefer(), acquire, release); } } interface ParFunctor extends Functor<Par_> { ParFunctor INSTANCE = new ParFunctor() {}; @Override default <T, R> Par<R> map(Kind<Par_, ? extends T> value, Function1<? super T, ? extends R> mapper) { return value.fix(ParOf::narrowK).map(mapper); } } interface ParPure extends Applicative<Par_> { @Override default <T> Par<T> pure(T value) { return Par.success(value); } } interface PureApplicative extends ParPure { PureApplicative INSTANCE = new PureApplicative() {}; @Override default <T, R> Par<R> ap(Kind<Par_, ? extends T> value, Kind<Par_, ? extends Function1<? super T, ? extends R>> apply) { return value.fix(ParOf::<T>narrowK).ap(apply.fix(ParOf::narrowK)); } } interface ParMonad extends ParPure, Monad<Par_> { ParMonad INSTANCE = new ParMonad() {}; @Override default <T, R> Par<R> flatMap(Kind<Par_, ? extends T> value, Function1<? super T, ? extends Kind<Par_, ? extends R>> map) { return value.fix(ParOf::narrowK).flatMap(x -> map.apply(x).fix(ParOf::narrowK)); } /** * XXX In order to create real parallel computations, we need to override ap to use the * applicative version of the ap method */ @Override default <T, R> Par<R> ap(Kind<Par_, ? extends T> value, Kind<Par_, ? extends Function1<? super T, ? extends R>> apply) { return ParInstances.applicative().ap(value, apply).fix(ParOf::narrowK); } } interface ParMonadThrow extends ParMonad, MonadThrow<Par_> { ParMonadThrow INSTANCE = new ParMonadThrow() {}; @Override default <A> Par<A> raiseError(Throwable error) { return Par.<A>failure(error); } @Override default <A> Par<A> handleErrorWith(Kind<Par_, A> value, Function1<? super Throwable, ? extends Kind<Par_, ? extends A>> handler) { return ParOf.narrowK(value).fold(handler.andThen(ParOf::narrowK), Par::success).flatMap(identity()); } } interface ParDefer extends Defer<Par_> { @Override default <A> Par<A> defer(Producer<? extends Kind<Par_, ? extends A>> defer) { return Par.defer(defer.map(ParOf::<A>narrowK)::get); } } interface ParBracket extends Bracket<Par_, Throwable> { @Override default <A, B> Par<B> bracket( Kind<Par_, ? extends A> acquire, Function1<? super A, ? extends Kind<Par_, ? extends B>> use, Function1<? super A, ? extends Kind<Par_, Unit>> release) { return Par.bracket(ParOf.narrowK(acquire), use.andThen(ParOf::narrowK), release::apply); } } interface ParMonadDefer extends ParMonadThrow, ParDefer, ParBracket, MonadDefer<Par_> { ParMonadDefer INSTANCE = new ParMonadDefer() {}; @Override default Par<Unit> sleep(Duration duration) { return Par.sleep(duration); } }
30.467105
125
0.713453
389b64480ad84e991dcc216b665b98b9eadec0e6
453
package FirstStepsInCoding.Lab; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // String text = scanner.nextLine(); // System.out.println(text); int num1 = Integer.parseInt(scanner.nextLine()); double num2 = Double.parseDouble(scanner.nextLine()); System.out.println(num1); System.out.println(num2); } }
23.842105
61
0.640177
4a614205e27005164fcb1e21100c15529c5870a1
9,466
package cz.habarta.typescript.generator.parser; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.ser.*; import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; import cz.habarta.typescript.generator.*; import cz.habarta.typescript.generator.compiler.EnumKind; import cz.habarta.typescript.generator.compiler.EnumMemberModel; import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.*; public class Jackson2Parser extends ModelParser { private final ObjectMapper objectMapper = new ObjectMapper(); public Jackson2Parser(Settings settings, TypeProcessor typeProcessor) { this(settings, typeProcessor, false); } public Jackson2Parser(Settings settings, TypeProcessor typeProcessor, boolean useJaxbAnnotations) { super(settings, typeProcessor); if (useJaxbAnnotations) { AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()); objectMapper.setAnnotationIntrospector(introspector); } } @Override protected BeanModel parseBean(SourceType<Class<?>> sourceClass) { final List<PropertyModel> properties = new ArrayList<>(); final BeanHelper beanHelper = getBeanHelper(sourceClass.type); if (beanHelper != null) { for (BeanPropertyWriter beanPropertyWriter : beanHelper.getProperties()) { if (!isParentProperty(beanPropertyWriter.getName(), sourceClass.type)) { Type propertyType = beanPropertyWriter.getGenericPropertyType(); if (propertyType == JsonNode.class) { propertyType = Object.class; } boolean isInAnnotationFilter = settings.includePropertyAnnotations.isEmpty(); if (!isInAnnotationFilter) { for (Class<? extends Annotation> optionalAnnotation : settings.includePropertyAnnotations) { if (beanPropertyWriter.getAnnotation(optionalAnnotation) != null) { isInAnnotationFilter = true; break; } } if (!isInAnnotationFilter) { System.out.println("Skipping " + sourceClass.type + "." + beanPropertyWriter.getName() + " because it is missing an annotation from includePropertyAnnotations!"); continue; } } boolean optional = false; for (Class<? extends Annotation> optionalAnnotation : settings.optionalAnnotations) { if (beanPropertyWriter.getAnnotation(optionalAnnotation) != null) { optional = true; break; } } final Member originalMember = beanPropertyWriter.getMember().getMember(); properties.add(processTypeAndCreateProperty(beanPropertyWriter.getName(), propertyType, optional, sourceClass.type, originalMember)); } } } final JsonTypeInfo jsonTypeInfo = sourceClass.type.getAnnotation(JsonTypeInfo.class); if (jsonTypeInfo != null && jsonTypeInfo.include() == JsonTypeInfo.As.PROPERTY) { if (!containsProperty(properties, jsonTypeInfo.property())) { properties.add(new PropertyModel(jsonTypeInfo.property(), String.class, false, null, null)); } } final JsonSubTypes jsonSubTypes = sourceClass.type.getAnnotation(JsonSubTypes.class); if (jsonSubTypes != null) { for (JsonSubTypes.Type type : jsonSubTypes.value()) { addBeanToQueue(new SourceType<>(type.value(), sourceClass.type, "<subClass>")); } } final Type superclass = sourceClass.type.getGenericSuperclass() == Object.class ? null : sourceClass.type.getGenericSuperclass(); if (superclass != null) { addBeanToQueue(new SourceType<>(superclass, sourceClass.type, "<superClass>")); } final List<Type> interfaces = Arrays.asList(sourceClass.type.getGenericInterfaces()); for (Type aInterface : interfaces) { addBeanToQueue(new SourceType<>(aInterface, sourceClass.type, "<interface>")); } return new BeanModel(sourceClass.type, superclass, interfaces, properties); } private boolean isParentProperty(String property, Class<?> cls) { final List<Class<?>> parents = new ArrayList<>(); if (cls.getSuperclass() != Object.class) { parents.add(cls.getSuperclass()); } parents.addAll(Arrays.asList(cls.getInterfaces())); for (Class<?> parent : parents) { final BeanHelper beanHelper = getBeanHelper(parent); if (beanHelper != null) { for (BeanPropertyWriter beanPropertyWriter : beanHelper.getProperties()) { if (beanPropertyWriter.getName().equals(property)) { return true; } } } } return false; } private BeanHelper getBeanHelper(Class<?> beanClass) { if (beanClass == null) { return null; } try { final DefaultSerializerProvider.Impl serializerProvider1 = (DefaultSerializerProvider.Impl) objectMapper.getSerializerProvider(); final DefaultSerializerProvider.Impl serializerProvider2 = serializerProvider1.createInstance(objectMapper.getSerializationConfig(), objectMapper.getSerializerFactory()); final JavaType simpleType = objectMapper.constructType(beanClass); final JsonSerializer<?> jsonSerializer = BeanSerializerFactory.instance.createSerializer(serializerProvider2, simpleType); if (jsonSerializer == null) { return null; } if (jsonSerializer instanceof BeanSerializer) { return new BeanHelper((BeanSerializer) jsonSerializer); } else { final String jsonSerializerName = jsonSerializer.getClass().getName(); if (settings.displaySerializerWarning) { System.out.println(String.format("Warning: Unknown serializer '%s' for class '%s'", jsonSerializerName, beanClass)); } return null; } } catch (JsonMappingException e) { throw new RuntimeException(e); } } private static class BeanHelper extends BeanSerializer { private static final long serialVersionUID = 1; public BeanHelper(BeanSerializer src) { super(src); } public BeanPropertyWriter[] getProperties() { return _props; } } @Override protected EnumModel<?> parseEnum(SourceType<Class<?>> sourceClass) { final JsonFormat jsonFormat = sourceClass.type.getAnnotation(JsonFormat.class); final boolean isNumberBased = jsonFormat != null && ( jsonFormat.shape() == JsonFormat.Shape.NUMBER || jsonFormat.shape() == JsonFormat.Shape.NUMBER_FLOAT || jsonFormat.shape() == JsonFormat.Shape.NUMBER_INT); if (isNumberBased) { return parseNumberEnum(sourceClass); } else { return super.parseEnum(sourceClass); } } private EnumModel<Number> parseNumberEnum(SourceType<Class<?>> sourceClass) { final Class<?> enumClass = sourceClass.type; final List<EnumMemberModel<Number>> members = new ArrayList<>(); try { Method valueMethod = null; final BeanInfo beanInfo = Introspector.getBeanInfo(enumClass); for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { final Method readMethod = propertyDescriptor.getReadMethod(); if (readMethod.isAnnotationPresent(JsonValue.class)) { valueMethod = readMethod; } } int index = 0; for (Field field : enumClass.getFields()) { if (field.isEnumConstant()) { final Number value; if (valueMethod != null) { final Object constant = field.get(null); value = (Number) valueMethod.invoke(constant); } else { value = index++; } members.add(new EnumMemberModel<>(field.getName(), value, null)); } } } catch (Exception e) { System.out.println(String.format("Cannot get enum values for '%s' enum", enumClass.getName())); e.printStackTrace(System.out); } return new EnumModel<>(enumClass, EnumKind.NumberBased, members, null); } }
44.862559
190
0.610501
5d1332dd43a29e96a7f3d5a33baa46ba50a9a25e
7,108
package com.codepath.apps.restclienttemplate; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.core.content.res.ResourcesCompat; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Toast; import com.codepath.apps.restclienttemplate.models.Tweet; import com.codepath.asynchttpclient.callback.JsonHttpResponseHandler; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.parceler.Parcel; import org.parceler.Parcels; import java.util.ArrayList; import java.util.List; import okhttp3.Headers; public class TimelineActivity extends AppCompatActivity { public static final String TAG = "TimelineActivity"; // Request code used by the activity, can be any number as long as it is unique to the request public static final int REQUEST_CODE = 20; private SwipeRefreshLayout swipeContainer; TwitterClient client; RecyclerView rvTweets; List<Tweet> tweets; TweetsAdapter tweetsAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_timeline); // Find the toolbar view inside the activity layout Toolbar toolbar = (Toolbar) findViewById(R.id.tbTwitter); // Set the Toolbar to act as the ActionBar for this Activity window. setSupportActionBar(toolbar); getSupportActionBar().setTitle(""); client = TwitterApp.getRestClient(this); // Find the recycler view and swipe container view rvTweets = findViewById(R.id.rvTweets); swipeContainer = (SwipeRefreshLayout) findViewById(R.id.swipeContainer); //Instantiate my OnClickListener from the interface in TweetsAdapter TweetsAdapter.OnClickListener clickListener = new TweetsAdapter.OnClickListener() { @Override public void onReplyClick(int position) { // make sure the position exists if (position != RecyclerView.NO_POSITION) { // get the tweet at the position just clicked on Tweet clickedTweet = tweets.get(position); Intent intent = new Intent(TimelineActivity.this, ComposeActivity.class); // serialize the clickedTweet using parceler with its name as the key intent.putExtra(Tweet.class.getSimpleName(), Parcels.wrap(clickedTweet)); //then start the activity startActivityForResult(intent, REQUEST_CODE); } } }; tweets = new ArrayList<>(); // The adapter is created the clickListener is passed in to be set on the views in the adapter tweetsAdapter = new TweetsAdapter(this, tweets, clickListener); // Set up recycler view: layout manager and the adapter rvTweets.setLayoutManager(new LinearLayoutManager(this)); rvTweets.setAdapter(tweetsAdapter); // Makes the API call to get the tweets and shows them on the screen populateHomeTimeline(); // Setup refresh listener which triggers new data loading swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // Call the API to get the new tweets and populate them into the timeline (a refresh) populateHomeTimeline(); } }); } // Method to populate the home timeline with Tweets: // Calls the API through the client, clears old data, and replaces old tweets with new, parsed API response tweets private void populateHomeTimeline() { client.getHomeTimeline(new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Headers headers, JSON json) { JSONArray jsonArray = json.jsonArray; try { // Clear out old items before appending in the new ones tweetsAdapter.clear(); tweets.addAll(Tweet.fromJSONArray(jsonArray)); tweetsAdapter.notifyDataSetChanged(); // signal that the refresh has completed swipeContainer.setRefreshing(false); } catch (JSONException e) { Log.e(TAG, "Encountered an exception parsing JSON object returned from API: " + e.getMessage(), e); } } @Override public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) { Log.e(TAG, "API request failed with status code " + statusCode + " and response " + response, throwable); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present getMenuInflater().inflate(R.menu.menu_main, menu); // Must return true for the menu to be displayed return true; } // Called by the Activity bar (or stand-in Toolbar in this case) when an item in the bar is selected @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.compose) { // Compose item has been tapped // Navigate to the compose activity Intent i = new Intent(TimelineActivity.this, ComposeActivity.class); startActivityForResult(i, REQUEST_CODE); return true; } return super.onOptionsItemSelected(item); } // When the other activity returns with a result @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { // Check that the activity is from the same ComposeActitvity and the operation succeeded if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { // Get the extra parcel from the intent and unwrap it/parse it into a Tweet object Tweet tweet = Parcels.unwrap(data.getParcelableExtra(ComposeActivity.INTENT_NAME_TWEET)); // Modify data source (tweets): add the new tweet at the beginning of the list of tweets for the feed tweets.add(0, tweet); // Notify the adapter that the data has changed at position 0 and it should reevaluate tweetsAdapter.notifyItemInserted(0); // AdapterView scrolls up to the top of the list of tweets so the newly created tweet is visible rvTweets.smoothScrollToPosition(0); } super.onActivityResult(requestCode, resultCode, data); } }
40.158192
121
0.668261
f8532ff31a2f61de1dd0484e5732a4d5da7708c1
1,755
package io.nlopez.smartadapters.sample.view; import android.content.Context; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso; import butterknife.ButterKnife; import butterknife.InjectView; import io.nlopez.smartadapters.sample.R; import io.nlopez.smartadapters.sample.model.User; import io.nlopez.smartadapters.sample.util.Interactions; import io.nlopez.smartadapters.views.BindableFrameLayout; import io.nlopez.smartadapters.views.BindableLinearLayout; /** * Created by mrm on 24/5/15. */ public class UserAltView extends BindableLinearLayout<User> { @InjectView(R.id.user_image) ImageView userImage; @InjectView(R.id.user_text) TextView userText; public UserAltView(Context context) { super(context); } @Override public int getLayoutId() { return R.layout.view_user_alt; } @Override public void onViewInflated() { ButterKnife.inject(this); setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); } @Override public int getOrientation() { return HORIZONTAL; } @Override public void bind(User item) { userText.setText(TextUtils.concat(item.getFirstName(), " ", item.getLastName(), "\n", item.getRole())); Picasso.with(getContext()).load(item.getAvatar()).into(userImage); setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { notifyItemAction(Interactions.USER_CLICKED); } }); } }
27.421875
126
0.712251
ce6f1396711156d53378b0501c7658e2e13f29e8
175
package com.zyj.filemanager.bean; /** * Created by ${zhaoyanjun} on 2017/1/11. */ public enum FileType { directory , txt , zip , video , music , image ,apk , other }
17.5
62
0.64
cc79f4606f7f5a219886e35dd64d7448d5f235c1
3,054
/* * Original work: Copyright (c) 2010-2011 Brigham Young University * Modified work: Copyright (c) 2017 Xilinx, Inc. * All rights reserved. * * Author: Chris Lavin, Xilinx Research Labs. * * This file is part of RapidWright. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * */ package com.xilinx.rapidwright.gui; import java.io.File; import com.trolltech.qt.gui.QBitmap; import com.trolltech.qt.gui.QBrush; import com.trolltech.qt.gui.QColor; import com.trolltech.qt.gui.QGraphicsItemInterface; import com.trolltech.qt.gui.QGraphicsRectItem; import com.trolltech.qt.gui.QPen; import com.xilinx.rapidwright.device.Tile; import com.xilinx.rapidwright.gui.TileScene; import com.xilinx.rapidwright.util.FileTools; /** * @author marc * */ public class HMTile extends QGraphicsRectItem { private Tile tile; private boolean containsSLICEM; private boolean isAnchor; public static QColor GREEN = new QColor(0, 255, 0, 190); public static QColor ORANGE = new QColor(255, 153, 51, 190); public static QColor RED = new QColor(255, 0, 0, 190); public static QBitmap anchorPixmap = new QBitmap(FileTools.getRapidWrightPath()+File.separator+FileTools.IMAGES_FOLDER_NAME+File.separator+"anchor.bmp"); public static QBrush ANCHOR_GREEN = new QBrush(GREEN, anchorPixmap); public static QBrush ANCHOR_ORANGE = new QBrush(ORANGE, anchorPixmap); public static QBrush ANCHOR_RED = new QBrush(RED, anchorPixmap); public HMTile(Tile newTile, TileScene scene, QGraphicsItemInterface parent, boolean hasSLICEM, boolean isAnchor) { super(0,0,scene.tileSize - 2, scene.tileSize - 2, parent); this.tile = newTile; this.containsSLICEM = hasSLICEM; this.isAnchor = isAnchor; } public HMTile(Tile newTile, TileScene scene, QGraphicsItemInterface parent) { this(newTile,scene,parent,false,false); } public Tile getTile() { return tile; } public boolean containsSLICEM(){ return containsSLICEM; } public void setState(GUIShapeState newState){ switch (newState) { case VALID: this.setPen(new QPen(GREEN)); if(isAnchor) this.setBrush(ANCHOR_GREEN); else this.setBrush(new QBrush(GREEN)); break; case COLLIDING: this.setPen(new QPen(ORANGE)); if(isAnchor) this.setBrush(ANCHOR_ORANGE); else this.setBrush(new QBrush(ORANGE)); break; case INVALID: this.setPen(new QPen(RED)); if(isAnchor) this.setBrush(ANCHOR_RED); else this.setBrush(new QBrush(RED)); break; default: break; } } }
27.513514
154
0.724296
5210cb140624ed953ec8117f6ab752bc3623d511
2,610
package org.tempuri.calculator; /** * Please modify this class to meet your needs * This class is not complete */ import java.io.File; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; /** * This class was generated by Apache CXF 3.2.1 * 2017-11-29T14:58:41.283-02:00 * Generated source version: 3.2.1 * */ public final class CalculatorSoap_CalculatorSoap_Client { private static final QName SERVICE_NAME = new QName("http://tempuri.org/", "Calculator"); private CalculatorSoap_CalculatorSoap_Client() { } public static void main(String args[]) throws java.lang.Exception { URL wsdlURL = Calculator.WSDL_LOCATION; if (args.length > 0 && args[0] != null && !"".equals(args[0])) { File wsdlFile = new File(args[0]); try { if (wsdlFile.exists()) { wsdlURL = wsdlFile.toURI().toURL(); } else { wsdlURL = new URL(args[0]); } } catch (MalformedURLException e) { e.printStackTrace(); } } Calculator ss = new Calculator(wsdlURL, SERVICE_NAME); CalculatorSoap port = ss.getCalculatorSoap(); { System.out.println("Invoking subtract..."); int _subtract_intA = 0; int _subtract_intB = 0; int _subtract__return = port.subtract(_subtract_intA, _subtract_intB); System.out.println("subtract.result=" + _subtract__return); } { System.out.println("Invoking divide..."); int _divide_intA = 0; int _divide_intB = 0; int _divide__return = port.divide(_divide_intA, _divide_intB); System.out.println("divide.result=" + _divide__return); } { System.out.println("Invoking add..."); int _add_intA = 0; int _add_intB = 0; int _add__return = port.add(_add_intA, _add_intB); System.out.println("add.result=" + _add__return); } { System.out.println("Invoking multiply..."); int _multiply_intA = 0; int _multiply_intB = 0; int _multiply__return = port.multiply(_multiply_intA, _multiply_intB); System.out.println("multiply.result=" + _multiply__return); } System.exit(0); } }
28.064516
93
0.611111
8864cbbb1831dbe9aa4e7556aba27185d3b4439a
752
package top.chenqwwq.leetcode.topic.hash._1010; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** * @author chen * @date 2020/5/18 下午9:35 */ class SolutionTest { Solution solution = new Solution(); @Test void numPairsDivisibleBy60() { Assertions.assertEquals(3, solution.numPairsDivisibleBy60(new int[]{30, 20, 150, 100, 40})); Assertions.assertEquals(3, solution.numPairsDivisibleBy60(new int[]{60, 60, 60})); Assertions.assertEquals(0, solution.numPairsDivisibleBy60(new int[]{439, 407, 197, 191, 291, 486, 30, 307, 11})); Assertions.assertEquals(1, solution.numPairsDivisibleBy60(new int[]{418, 204, 77, 278, 239, 457, 284, 263, 372, 279, 476, 416, 360, 18})); } }
35.809524
146
0.68617
97bb8f7e110989bede8268f02b25a905d88d6d96
2,068
package com.chickling.kmanager.jmx.metrics; /** * * @author Hulva Luva.H * @since 2017-07-26 * */ public class MetricType1 { private long count; private String eventType; private double meanRate; private double oneMinuteRate; private double fiveMinuteRate; private double fifteenMinuteRate; private String rateUnit; public long getCount() { return count; } public void setCount(long count) { this.count = count; } public String getEventType() { return eventType; } public void setEventType(String eventType) { this.eventType = eventType; } public double getMeanRate() { return meanRate; } public void setMeanRate(double meanRate) { this.meanRate = meanRate; } public double getOneMinuteRate() { return oneMinuteRate; } public void setOneMinuteRate(double oneMinuteRate) { this.oneMinuteRate = oneMinuteRate; } public double getFiveMinuteRate() { return fiveMinuteRate; } public void setFiveMinuteRate(double fiveMinuteRate) { this.fiveMinuteRate = fiveMinuteRate; } public double getFifteenMinuteRate() { return fifteenMinuteRate; } public void setFifteenMinuteRate(double fifteenMinuteRate) { this.fifteenMinuteRate = fifteenMinuteRate; } public String getRateUnit() { return rateUnit; } public void setRateUnit(String rateUnit) { this.rateUnit = rateUnit; } @Override public String toString() { switch (this.eventType) { case "bytes": break; case "requests": break; case "percent": break; case "messages": break; case "expands": // IsrExpandsPerSec break; case "shrinks": // IsrShrinksPerSec break; default: break; } return "MetricType1 [count=" + count + ", eventType=" + eventType + ", meanRate=" + meanRate + ", oneMinuteRate=" + oneMinuteRate + ", fiveMinuteRate=" + fiveMinuteRate + ", fifteenMinuteRate=" + fifteenMinuteRate + ", rateUnit=" + rateUnit + "]"; } }
20.07767
133
0.653288
b751b614083db8bac566c791f2410803276e1961
2,145
package moe.bay.clipboard.api; import java.awt.*; /** * @author Bailey Riezebos * @version 1.0 */ public enum LogType { EVENT, CACHED_MESSAGE_PIN, CACHED_MESSAGE_UNPIN, CERTAIN_MESSAGE, CHANNEL, CHANNEL_PINS_UPDATE, GROUP_CHANNEL_CHANGE_NAME, GROUP_CHANNEL_CREATE, GROUP_CHANNEL_DELETE, GROUP_CHANNEL_EVENT, KNOWN_CUSTOM_EMOJI_CHANGE_NAME, KNOWN_CUSTOM_EMOJI_CHANGE_WHITELISTED_ROLES, KNOWN_CUSTOM_EMOJI_CREATE, KNOWN_CUSTOM_EMOJI_DELETE, KNOWN_CUSTOM_EMOJI, ; // // // CHANNEL(0, "A channel logger logs Channel Create, Delete, Edit (Permissions & Topic) & Move Events"), // MESSAGE(1, "A message logger logs Message Edit, Delete, Pin, Unpin and ReactionAdd Events"), // ROLE(2, "A role logger logs Role Create, Delete, Move, ColorChange, NameChange, HoistChange and PermissionsChange Events"), // SERVER(3, "A server logger logs server events"), //TODO specify all events // USER(4, "A user logger logs user events"); //TODO specify all events // private final int id; // private final String description; // private final Color color; /** * @param description the description of the LogType (what a logger with this type does). * @param color */ LogType( // String description, Color color ) { // this.id = id; // this.description = description; // this.color = color; } /** * @return LogType's id */ // public int getId() { // return id; // } /** * @return LogType's description */ // public String getDescription() { // return description; // } // public static LogType getLogTypeFromId(int id) { // for (LogType logType : LogType.values()) { // if (logType.getId() == id) { // return logType; // } // } // return null; // } public static boolean exists(String name) { try { LogType.valueOf(name.toUpperCase()); return true; } catch (IllegalArgumentException e) { return false; } } }
24.655172
129
0.608392
172a0b6166b481d8beaefc0e191696766610bfa6
1,880
package io.github.longlinht.library.anti.common; import android.content.Context; import android.content.pm.PackageManager; import java.lang.reflect.Method; /** * Common functions used for detection of system fingerprints. * * Created by Tao He on 18-4-27. * [email protected] * */ public class Utilities { /** * Method to reflectively invoke the SystemProperties.get command - which is the equivalent to the adb shell getProp * command. * * @param context * A {@link Context} object used to get the proper ClassLoader (just needs to be Application Context * object) * @param property * A {@code String} object for the property to retrieve. * @return {@code String} value of the property requested. */ public static String getProp(Context context, String property) { try { ClassLoader classLoader = context.getClassLoader(); Class<?> systemProperties = classLoader.loadClass("android.os.SystemProperties"); Method get = systemProperties.getMethod("get", String.class); Object[] params = new Object[1]; params[0] = new String(property); return (String) get.invoke(systemProperties, params); } catch (IllegalArgumentException iAE) { throw iAE; } catch (Exception exception) { throw null; } } public static boolean hasPackageNameInstalled(Context context, String packageName) { PackageManager packageManager = context.getPackageManager(); // In theory, if the package installer does not throw an exception, package exists try { packageManager.getInstallerPackageName(packageName); return true; } catch (IllegalArgumentException exception) { return false; } } }
32.413793
120
0.642021
aa749ceebf266f231897cb87967327f402c92748
6,596
/* * Copyright 2008-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.codehaus.groovy.transform; import groovy.transform.SourceURI; import org.codehaus.groovy.GroovyBugError; import org.codehaus.groovy.ast.ASTNode; import org.codehaus.groovy.ast.AnnotatedNode; import org.codehaus.groovy.ast.AnnotationNode; import org.codehaus.groovy.ast.ClassHelper; import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.ast.FieldNode; import org.codehaus.groovy.ast.expr.ArgumentListExpression; import org.codehaus.groovy.ast.expr.ConstantExpression; import org.codehaus.groovy.ast.expr.DeclarationExpression; import org.codehaus.groovy.ast.expr.EmptyExpression; import org.codehaus.groovy.ast.expr.Expression; import org.codehaus.groovy.ast.expr.StaticMethodCallExpression; import org.codehaus.groovy.control.CompilePhase; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.control.messages.SyntaxErrorMessage; import org.codehaus.groovy.syntax.SyntaxException; import java.io.File; import java.net.URI; import java.util.Arrays; /** * Handles transformation for the @ScriptURI annotation. * * @author Paul King * @author Cedric Champeau * @author Vladimir Orany * @author Jim White */ @GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS) public class SourceURIASTTransformation extends AbstractASTTransformation { private static final Class<SourceURI> MY_CLASS = SourceURI.class; private static final ClassNode MY_TYPE = ClassHelper.make(MY_CLASS); private static final String MY_TYPE_NAME = "@" + MY_TYPE.getNameWithoutPackage(); private static final ClassNode URI_TYPE = ClassHelper.make(java.net.URI.class); private SourceUnit sourceUnit; public void visit(ASTNode[] nodes, SourceUnit source) { sourceUnit = source; if (nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + Arrays.asList(nodes)); } AnnotatedNode parent = (AnnotatedNode) nodes[1]; AnnotationNode node = (AnnotationNode) nodes[0]; if (!MY_TYPE.equals(node.getClassNode())) return; if (parent instanceof DeclarationExpression) { setScriptURIOnDeclaration((DeclarationExpression) parent, node); } else if (parent instanceof FieldNode) { setScriptURIOnField((FieldNode) parent, node); } else { addError("Expected to find the annotation " + MY_TYPE_NAME + " on an declaration statement.", parent); } } private void setScriptURIOnDeclaration(final DeclarationExpression de, final AnnotationNode node) { if (de.isMultipleAssignmentDeclaration()) { addError("Annotation " + MY_TYPE_NAME + " not supported with multiple assignment notation.", de); return; } if (!(de.getRightExpression() instanceof EmptyExpression)) { addError("Annotation " + MY_TYPE_NAME + " not supported with variable assignment.", de); return; } URI uri = getSourceURI(node); if (uri == null) { addError("Unable to get the URI for the source of this script!", de); } else { // Set the RHS to '= URI.create("string for this URI")'. // That may throw an IllegalArgumentExpression wrapping the URISyntaxException. de.setRightExpression(getExpression(uri)); } } private void setScriptURIOnField(final FieldNode fieldNode, final AnnotationNode node) { if (fieldNode.hasInitialExpression()) { addError("Annotation " + MY_TYPE_NAME + " not supported with variable assignment.", fieldNode); return; } URI uri = getSourceURI(node); if (uri == null) { addError("Unable to get the URI for the source of this class!", fieldNode); } else { // Set the RHS to '= URI.create("string for this URI")'. // That may throw an IllegalArgumentExpression wrapping the URISyntaxException. fieldNode.setInitialValueExpression(getExpression(uri)); } } private StaticMethodCallExpression getExpression(URI uri) { return new StaticMethodCallExpression(URI_TYPE, "create" , new ArgumentListExpression(new ConstantExpression(uri.toString()))); } protected URI getSourceURI(AnnotationNode node) { URI uri = sourceUnit.getSource().getURI(); if (uri != null) { if (!(uri.isAbsolute() || memberHasValue(node, "allowRelative", true))) { // FIXME: What should we use as the base URI? // It is unlikely we get to this point with a relative URI since making a URL // from will make it absolute I think. But lets handle the simple case of // using file paths and turning that into an absolute file URI. // So we will use the current working directory as the base. URI baseURI = new File(".").toURI(); uri = uri.resolve(baseURI); } } return uri; } public SourceUnit getSourceUnit() { return sourceUnit; } protected boolean memberHasValue(AnnotationNode node, String name, Object value) { final Expression member = node.getMember(name); return member != null && member instanceof ConstantExpression && ((ConstantExpression) member).getValue().equals(value); } protected void addError(String msg, ASTNode expr) { // for some reason the source unit is null sometimes, e.g. in testNotAllowedInScriptInnerClassMethods sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage( new SyntaxException(msg + '\n', expr.getLineNumber(), expr.getColumnNumber(), expr.getLastLineNumber(), expr.getLastColumnNumber()), sourceUnit) ); } }
41.484277
131
0.68299
aa2d4f23ff629c25d6685387259bba950a720377
3,236
package com.morelang.jwt; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Component; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @Component public class JwtTokenUtil implements Serializable { private static final long serialVersionUID = -2550185165626007488L; public static final long JWT_ACCESS_TOKEN_VALIDITY = 24* 60 * 60; //30분 public static final long JWT_REFRESH_TOKEN_VALIDITY = 24 * 60 * 60 * 7; //일주일 @Value("${jwt.secret}") private String secret; public String getUsernameFromToken(String token) { return getClaimFromToken(token, Claims::getSubject); } public Date getExpirationDateFromToken(String token) { return getClaimFromToken(token, Claims::getExpiration); } public <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) { final Claims claims = getAllClaimsFromToken(token); return claimsResolver.apply(claims); } private Claims getAllClaimsFromToken(String token) { return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody(); } public Map<String, Object> getUserParseInfo(String token) { Claims parseInfo = Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody(); Map<String, Object> result = new HashMap<>(); result.put("username", parseInfo.getSubject()); result.put("role", parseInfo.get("role", List.class)); return result; } public Boolean isTokenExpired(String token) { final Date expiration = getExpirationDateFromToken(token); return expiration.before(new Date()); } public String generateAccessToken(UserDetails userDetails) { Map<String, Object> claims = new HashMap<>(); List<String> li = new ArrayList<>(); for (GrantedAuthority a: userDetails.getAuthorities()) { li.add(a.getAuthority()); } claims.put("role",li); return Jwts.builder().setClaims(claims).setSubject(userDetails.getUsername()).setIssuedAt(new Date(System.currentTimeMillis())) .setExpiration(new Date(System.currentTimeMillis() + JWT_ACCESS_TOKEN_VALIDITY * 1000)) .signWith(SignatureAlgorithm.HS512, secret).compact(); } public String generateRefreshToken(String username) { return Jwts.builder().setSubject(username).setIssuedAt(new Date(System.currentTimeMillis())) .setExpiration(new Date(System.currentTimeMillis() + JWT_REFRESH_TOKEN_VALIDITY * 1000)) .signWith(SignatureAlgorithm.HS512, secret).compact(); } public Boolean validateToken(String token, UserDetails userDetails) { final String username = getUsernameFromToken(token); return (username.equals(userDetails.getUsername()) && !isTokenExpired(token)); } }
40.45
135
0.713535
6a8f3cee27b51c5560372d0422f22910bc760c0c
7,116
package net.sf.regadb.workflow.analysis.execution; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import net.sf.regadb.workflow.analysis.Analysis; import net.sf.regadb.workflow.analysis.AnalysisConnection; import net.sf.regadb.workflow.jgraph.WFAnalysisBox; import net.sf.regadb.workflow.jgraph.WFInputPortUserObject; import net.sf.regadb.workflow.jgraph.WFOutputPortUserObject; import net.sf.regadb.workflow.jgraph.WorkFlow; import org.apache.commons.io.FileUtils; import org.jgraph.graph.CellView; import org.jgraph.graph.DefaultPort; public class Execute { public boolean edgeControl(WorkFlow workflow) { CellView[] cv = workflow.getGraphLayoutCache().getAllViews(); Object[] os = workflow.getGraphLayoutCache().getCells(cv); for(Object o : os) { if(o instanceof DefaultPort) { if(((DefaultPort)o).getEdges().size()==0) return false; } } return true; } public void generateDirectoryStructure(File workingDir, ArrayList<WFAnalysisBox> boxes) { for(WFAnalysisBox box : boxes) { File wp = box.getAnalysis().getAnalysisPath(workingDir); wp.mkdirs(); } } public void exec(WorkFlow workflow, File workingDir) { CellView[] cv = workflow.getGraphLayoutCache().getAllViews(); Object[] os = workflow.getGraphLayoutCache().getCells(cv); ArrayList<DefaultPort> ports = new ArrayList<DefaultPort>(); ArrayList<WFAnalysisBox> boxes = new ArrayList<WFAnalysisBox>(); for(Object o : os) { if(o instanceof WFAnalysisBox) { boxes.add((WFAnalysisBox)o); } else if(o instanceof DefaultPort) { ports.add((DefaultPort)o); } } generateDirectoryStructure(workingDir, boxes); //remove analyses which are already ready for(Iterator<WFAnalysisBox> i = boxes.iterator(); i.hasNext();) { if(i.next().getAnalysis().isReady()) i.remove(); } if(boxes.size()==0) { writeLog("Nothing to be done..."); return; } WFAnalysisBox box; boolean stop = false; ArrayList<String> log = new ArrayList<String>(); while(boxes.size()!=0 && !stop) { for(Iterator<WFAnalysisBox> i = boxes.iterator(); i.hasNext();) { box = i.next(); if(readyForExecution(box)) { writeLog("Preparing analysis " + getAnalysisName(box.getAnalysis())); String copyLog = copyDependencyFiles(box, workingDir); if(copyLog!=null){ writeLog("Stopping execution!!!!"); writeLog("Could not copy necessary input files, in analysis " + box.getAnalysis().getType() + " " + box.getAnalysis().getSpecType() + " " + box.getAnalysis().getName()); writeLog(copyLog); stop = true; break; } writeLog("Executing analysis " + getAnalysisName(box.getAnalysis())); log.clear(); if(box.getAnalysis().execute(workingDir, log)) { box.getAnalysis().setReady(true); writeLog("Successfully executed analysis " + getAnalysisName(box.getAnalysis())); i.remove(); } else { writeLog("Stopping execution!!!!"); writeLog("Stopped Analysis " + getAnalysisName(box.getAnalysis())); writeLog(log); stop = true; break; } } } } } public String getAnalysisName(Analysis analysis) { return analysis.getType() + " " + analysis.getSpecType() + " " + analysis.getName(); } public void writeLog(String log) { System.err.println(log); } public void writeLog(ArrayList<String> log) { for(String l : log) { writeLog(l); } } private String copyDependencyFiles(WFAnalysisBox box, File workingDir) { ArrayList<DefaultPort> inputs = new ArrayList<DefaultPort>(); List children = box.getChildren(); for(Object c : children) { if(c instanceof DefaultPort) { Object uo = ((DefaultPort)c).getUserObject(); if(uo instanceof WFInputPortUserObject) { inputs.add(((DefaultPort)c)); } } } for(DefaultPort input : inputs) { Set edges = input.getEdges(); for(Object edge : edges) { AnalysisConnection ac = (AnalysisConnection)edge; DefaultPort source = ((DefaultPort)ac.getSource()); Object uo = source.getUserObject(); WFOutputPortUserObject ouput = (WFOutputPortUserObject)uo; WFAnalysisBox parentBox = (WFAnalysisBox)source.getParent(); File from = new File(parentBox.getAnalysis().getAnalysisPath(workingDir).getAbsolutePath() + File.separatorChar + ouput.portName_); File to = new File(box.getAnalysis().getAnalysisPath(workingDir).getAbsolutePath() + File.separatorChar + ((WFInputPortUserObject)input.getUserObject()).portName_); if(!from.exists()) return "Following file does not exist: " + from.getAbsolutePath(); try { FileUtils.copyFile(from, to); } catch (IOException e) { return "Copying failed: " + from.getAbsolutePath() + " -> " + to.getAbsolutePath(); } } } return null; } private boolean readyForExecution(WFAnalysisBox box) { ArrayList<DefaultPort> inputs = new ArrayList<DefaultPort>(); List children = box.getChildren(); for(Object c : children) { if(c instanceof DefaultPort) { Object uo = ((DefaultPort)c).getUserObject(); if(uo instanceof WFInputPortUserObject) { inputs.add(((DefaultPort)c)); } } } if(inputs.size()==0) return true; for(DefaultPort input : inputs) { Set edges = input.getEdges(); for(Object edge : edges) { AnalysisConnection ac = (AnalysisConnection)edge; DefaultPort source = ((DefaultPort)ac.getSource()); WFAnalysisBox parentBox = (WFAnalysisBox)source.getParent(); if(!parentBox.getAnalysis().isReady()) return false; } } return true; } }
39.533333
193
0.54511
e2a21f2f886926f3ae88110533b3438ca6b29476
7,010
package pokecube.core.items.megastuff; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.ICapabilityProvider; import pokecube.core.database.Database; import pokecube.core.database.PokedexEntry; import pokecube.core.interfaces.IPokemob; import pokecube.core.items.ItemHeldItems; import thut.lib.CompatWrapper; public class MegaCapability implements ICapabilityProvider, IMegaCapability { public static interface RingChecker { boolean canMegaEvolve(EntityPlayer player, PokedexEntry toEvolve); } public static boolean canMegaEvolve(EntityPlayer player, IPokemob target) { PokedexEntry entry = target.getPokedexEntry(); return checker.canMegaEvolve(player, entry); } public static boolean matches(ItemStack stack, PokedexEntry entry) { IMegaCapability cap = stack.getCapability(MegaCapability.MEGA_CAP, null); if (cap != null) { if (cap.isStone(stack)) return false; PokedexEntry stacks; if ((stacks = cap.getEntry(stack)) == null) return true; PokedexEntry stackbase = stacks.getBaseForme() == null ? stacks : stacks.getBaseForme(); PokedexEntry entrybase = entry.getBaseForme() == null ? entry : entry.getBaseForme(); return entrybase == stackbase; } return false; } public static RingChecker checker = new RingChecker() { @Override public boolean canMegaEvolve(EntityPlayer player, PokedexEntry toEvolve) { for (int i = 0; i < player.inventory .getSizeInventory(); i++) { ItemStack stack = player.inventory .getStackInSlot(i); if (stack != null) { if (matches(stack, toEvolve)) return true; } } for (int i = 0; i < player.inventory.armorInventory .size(); i++) { ItemStack stack = player.inventory.armorInventory .get(i); if (stack != null) { if (matches(stack, toEvolve)) return true; } } return false; } }; @CapabilityInject(IMegaCapability.class) public static final Capability<IMegaCapability> MEGA_CAP = null; final ItemStack stack; public MegaCapability(ItemStack itemStack) { this.stack = itemStack; } @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability != MEGA_CAP) return false; if (stack.getItem() instanceof ItemMegawearable) return true; if (stack.hasTagCompound() && stack.getTagCompound().hasKey("gemTag")) { ItemStack stack2 = new ItemStack(CompatWrapper.getTag(stack, "gemTag", false)); if (stack2 != null) return getEntry(stack2) != null; } return false; } @Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (!hasCapability(MEGA_CAP, facing)) return null; if (MEGA_CAP != null && capability == MEGA_CAP) { Object object = (stack.getItem() instanceof IMegaCapability) ? stack.getItem() : this; return MEGA_CAP.cast((IMegaCapability) object); } return null; } @Override public boolean isStone(ItemStack stack) { if (stack.getItem() instanceof IMegaCapability) return ((IMegaCapability) stack.getItem()).isStone(stack); return stack.getItem() instanceof ItemHeldItems && stack.getItem().getRegistryName().getResourcePath().contains("mega"); } @Override public boolean isValid(ItemStack stack, PokedexEntry entry) { if (stack.getItem() instanceof IMegaCapability) return ((IMegaCapability) stack.getItem()).isValid(stack, entry); PokedexEntry stacks = getEntry(stack); if (entry == null) return true; if (stacks == null) return true; PokedexEntry stackbase = stacks.getBaseForme() == null ? stacks : stacks.getBaseForme(); PokedexEntry entrybase = entry.getBaseForme() == null ? entry : entry.getBaseForme(); return entrybase == stackbase; } @Override public PokedexEntry getEntry(ItemStack stack) { if (stack.getItem() instanceof IMegaCapability) return ((IMegaCapability) stack.getItem()).getEntry(stack); if (stack.getItem() instanceof ItemHeldItems) { return Database .getEntry(stack.getItem().getRegistryName().getResourcePath()); } if (stack.hasTagCompound() && stack.getTagCompound().hasKey("gemTag")) { ItemStack stack2 = new ItemStack(CompatWrapper.getTag(stack, "gemTag", false)); if (!stack2.isEmpty()) return getEntry(stack2); } return null; } }
49.366197
123
0.464907
15651347d6efcb7487251aa9c7831901b4b55874
802
package com.game.platform; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import models.DeleteFormModel; public class DeleteSteps { DeleteFormModel deleteForm = new DeleteFormModel(); @Given("^Отваря формичка за триене от системата$") public void openForm() throws Throwable { deleteForm.showDeleteForm(); } @When("^Въвежда потребителско име за триене \"([^\"]*)\"$") public void addUsername(String arg1) throws Throwable { deleteForm.addUsername(arg1); } @When("^Натиска бутона Delete$") public void clickDeleteButton() throws Throwable { deleteForm.clickButton(); } @Then("^Вижда съобщение за успешно изтриване \"([^\"]*)\"\\.$") public void showMessage(String arg1) throws Throwable { deleteForm.showMessage(); } }
25.0625
64
0.730673
5e49b3e3503a0eef64c00b29b7e08c6a440ef184
1,111
package com.outman.study.asynclistdiffdemo; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; public abstract class CommonAdapter extends RecyclerView.Adapter<DemoViewHolder> { @NonNull @Override public DemoViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View root = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_recycler, null); return new DemoViewHolder(root); } @Override public void onBindViewHolder(@NonNull DemoViewHolder demoViewHolder, int i) { DemoData data = getItem(i); demoViewHolder.setData(data); Log.d("AsyncListDiffDemo", "AsyncListDiffDemo onBindViewHolder title " + data.title); } protected abstract DemoData getItem(int pos); public abstract void updateData(List<DemoData> datas); public abstract void setData(List<DemoData> datas); public abstract List<DemoData> getData(); }
30.861111
102
0.748875
0836682e9bd821756d6a634de7170df675454429
2,619
/* * Copyright (c) 2002-2016, the original author or authors. * * This software is distributable under the BSD license. See the terms of the * BSD license in the documentation provided with this software. * * http://www.opensource.org/licenses/bsd-license.php */ package org.jline.utils; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import java.io.OutputStream; import java.util.Objects; /** * Helper methods for running unix commands. */ public final class ExecHelper { private ExecHelper() { } public static String exec(boolean redirectInput, final String... cmd) throws IOException { Objects.requireNonNull(cmd); try { Log.trace("Running: ", cmd); ProcessBuilder pb = new ProcessBuilder(cmd); if (redirectInput) { pb.redirectInput(ProcessBuilder.Redirect.INHERIT); } Process p = pb.start(); String result = waitAndCapture(p); Log.trace("Result: ", result); if (p.exitValue() != 0) { if (result.endsWith("\n")) { result = result.substring(0, result.length() - 1); } throw new IOException("Error executing '" + String.join(" ", (CharSequence[]) cmd) + "': " + result); } return result; } catch (InterruptedException e) { throw (IOException) new InterruptedIOException("Command interrupted").initCause(e); } } public static String waitAndCapture(Process p) throws IOException, InterruptedException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); InputStream in = null; InputStream err = null; OutputStream out = null; try { int c; in = p.getInputStream(); while ((c = in.read()) != -1) { bout.write(c); } err = p.getErrorStream(); while ((c = err.read()) != -1) { bout.write(c); } out = p.getOutputStream(); p.waitFor(); } finally { close(in, out, err); } return bout.toString(); } private static void close(final Closeable... closeables) { for (Closeable c : closeables) { if (c != null) { try { c.close(); } catch (Exception e) { // Ignore } } } } }
30.103448
117
0.544483
6ff3fabbe154db4474489e4c593169e83a3f6325
407
/* * Copyright arupingit(Arup Dutta) * github profile url https://github.com/arupingit * */ package net.arup.spring.dependencyInjection; /** * The Interface Instruments. * * @author ARUP */ public interface Instruments { /** * Gets the intruments. * * @return the intruments */ public void getIntruments(); /** * Put instruments back. */ public void putInstrumentsBack(); }
14.535714
51
0.660934
2d49a0f61ef2e4cf15717953baecc0f0b302f646
3,693
/** * Copyright 2020 the original author or authors. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.thierrysquirrel.sparrow.server.database.service; import com.github.thierrysquirrel.sparrow.server.common.netty.domain.SparrowMessage; import com.github.thierrysquirrel.sparrow.server.core.container.ConsumerMessageQuery; import com.github.thierrysquirrel.sparrow.server.core.container.constant.ConsumerMessageQueryConstant; import com.github.thierrysquirrel.sparrow.server.core.utils.DomainUtils; import com.github.thierrysquirrel.sparrow.server.database.mapper.SparrowMessageMapper; import com.github.thierrysquirrel.sparrow.server.database.mapper.entity.SparrowMessageEntity; import com.github.thierrysquirrel.sparrow.server.database.service.core.constant.SparrowMessageServiceConstant; import com.github.thierrysquirrel.sparrow.server.database.service.core.container.DatabaseReadStateContainer; import com.github.thierrysquirrel.sparrow.server.database.service.core.utils.DateUtils; import com.google.common.collect.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.ObjectUtils; import java.util.Date; import java.util.List; /** * ClassName: SparrowMessageService * Description: * date: 2020/12/7 4:45 * * @author ThierrySquirrel * @since JDK 1.8 */ public class SparrowMessageService { @Autowired private SparrowMessageMapper sparrowMessageMapper; public void initSparrowMessageEntity() { sparrowMessageMapper.initSparrowMessageEntity(); sparrowMessageMapper.initIndexTopic(); sparrowMessageMapper.initIndexIsDeleted(); } public void saveAll(List<SparrowMessageEntity> sparrowMessageEntityList, String topic) { sparrowMessageMapper.saveAll(sparrowMessageEntityList); List<SparrowMessage> sparrowMessagesList = DomainUtils.convertList(sparrowMessageEntityList, SparrowMessage.class); ConsumerMessageQuery.putMessage(topic, sparrowMessagesList); } public void deleteAllTimeoutMessage() { Date gmtModified = DateUtils.getPastTime(SparrowMessageServiceConstant.RETENTION_TIME_DAY); sparrowMessageMapper.deleteAllByIsDeletedAndGmtCreateLessThanEqual(SparrowMessageServiceConstant.IS_DELETE, gmtModified, SparrowMessageServiceConstant.DELETE_MESSAGE_NUMBER); } public void findAllByTopic(String topic) { List<SparrowMessageEntity> sparrowMessageEntityList = sparrowMessageMapper.findAllByTopicAndIsDeleted(topic, SparrowMessageServiceConstant.IS_NOT_DELETE, SparrowMessageServiceConstant.FIND_ALL_MESSAGE_NUMBER); if (ObjectUtils.isEmpty(sparrowMessageEntityList)) { return; } List<SparrowMessage> sparrowMessageList = DomainUtils.convertList(sparrowMessageEntityList, SparrowMessage.class); List<List<SparrowMessage>> messageLists = Lists.partition(sparrowMessageList, ConsumerMessageQueryConstant.LIST_MESSAGE_NUMBER); for (List<SparrowMessage> messageList : messageLists) { ConsumerMessageQuery.putMessage(topic, messageList); } DatabaseReadStateContainer.tryCloseDatabaseRead(topic); } public void updateAllByIdList(List<Long> idList) { sparrowMessageMapper.updateAllById(idList, SparrowMessageServiceConstant.IS_DELETE); } }
43.964286
211
0.82697
9062886e27d06afb5d3d37351f3b7049043070df
2,292
package com.adyen.model.nexo; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; import java.util.Arrays; /** * <p>Java class for AttributeType. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;simpleType name="AttributeType"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt; * &lt;enumeration value="id-at-commonName"/&gt; * &lt;enumeration value="id-at-localityName"/&gt; * &lt;enumeration value="id-at-organizationName"/&gt; * &lt;enumeration value="id-at-organizationalUnitName"/&gt; * &lt;enumeration value="id-at-countryName"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> */ @XmlType(name = "AttributeType") @XmlEnum public enum AttributeType { /** * Common Name - (OID: joint-iso-ccitt(2) ds(5) 4 3) */ @XmlEnumValue("id-at-commonName") ID_AT_COMMON_NAME("id-at-commonName"), /** * Locality - (OID: joint-iso-ccitt(2) ds(5) 4 7) */ @XmlEnumValue("id-at-localityName") ID_AT_LOCALITY_NAME("id-at-localityName"), /** * Organization Name - (OID: joint-iso-ccitt(2) ds(5) 4 10) */ @XmlEnumValue("id-at-organizationName") ID_AT_ORGANIZATION_NAME("id-at-organizationName"), /** * Organization Unit Name - (OID: joint-iso-ccitt(2) ds(5) 4 11) */ @XmlEnumValue("id-at-organizationalUnitName") ID_AT_ORGANIZATIONAL_UNIT_NAME("id-at-organizationalUnitName"), /** * Country Name - (OID: joint-iso-ccitt(2) ds(5) 4 6) */ @XmlEnumValue("id-at-countryName") ID_AT_COUNTRY_NAME("id-at-countryName"); private final String value; AttributeType(String v) { value = v; } /** * Value string. * * @return the string */ public String value() { return value; } /** * From value attribute type. * * @param v the v * @return the attribute type */ public static AttributeType fromValue(String v) { return Arrays.stream(values()). filter(s -> s.value.equals(v)). findFirst().orElseThrow(() -> new IllegalArgumentException(v)); } }
26.045455
95
0.626091
2fe7a305e3ae770dd775390082e0c4662066aaf0
150
package com.teammental.meservice.testapp; import com.teammental.meservice.BaseCrudService; public interface TestService extends BaseCrudService { }
21.428571
54
0.846667
829493667b293dd5fda51a1460a149475548efb7
14,473
// Copyright 2021 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import static java.nio.charset.StandardCharsets.UTF_8; import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * Class for parsing a single .obj file into openGL-usable pieces. * * <p>Usage: * * <p>SimpleObjParser objParser = new SimpleObjParser("animations/cow/cow320.obj", .015f); * * <p>if (objParser.parse()) { ... } */ class ShortPair { private final Short first; private final Short second; public ShortPair(Short newFirst, Short newSecond) { first = newFirst; second = newSecond; } public Short getFirst() { return first; } public Short getSecond() { return second; } } public class SimpleObjParser { private static final String TAG = SimpleObjParser.class.getSimpleName(); private static final boolean DEBUG = true; private static final int INVALID_INDEX = -1; private static final int POSITIONS_COORDS_PER_VERTEX = 3; private static final int TEXTURE_COORDS_PER_VERTEX = 2; private final String fileName; // Since .obj doesn't tie together texture coordinates and vertex // coordinates, but OpenGL does, we need to keep a map of all such pairings that occur in // our face list. private final HashMap<ShortPair, Short> vertexTexCoordMap; // Internal (de-coupled) unique vertices and texture coordinates private ArrayList<Float> vertices; private ArrayList<Float> textureCoords; // Data we expose to openGL for rendering private float[] finalizedVertices; private float[] finalizedTextureCoords; private ArrayList<Short> finalizedTriangles; // So we only display warnings about dropped w-coordinates once private boolean vertexCoordIgnoredWarning; private boolean textureCoordIgnoredWarning; private boolean startedProcessingFaces; private int numPrimitiveVertices; private int numPrimitiveTextureCoords; private int numPrimitiveFaces; // For scratchwork, so we don't have to keep reallocating private float[] tempCoords; // We scale all our position coordinates uniformly by this factor private float objectUniformScaleFactor; public SimpleObjParser(String objFile, float scaleFactor) { objectUniformScaleFactor = scaleFactor; fileName = objFile; vertices = new ArrayList<Float>(); textureCoords = new ArrayList<Float>(); vertexTexCoordMap = new HashMap<ShortPair, Short>(); finalizedTriangles = new ArrayList<Short>(); tempCoords = new float[Math.max(POSITIONS_COORDS_PER_VERTEX, TEXTURE_COORDS_PER_VERTEX)]; numPrimitiveFaces = 0; vertexCoordIgnoredWarning = false; textureCoordIgnoredWarning = false; startedProcessingFaces = false; } // Simple helper wrapper function private void debugLogString(String message) { if (DEBUG) { System.out.println(message); } } private void parseVertex(String[] linePieces) { // Note: Traditionally xyzw is acceptable as a format, with w defaulting to 1.0, but for now // we only parse xyz. if (linePieces.length < POSITIONS_COORDS_PER_VERTEX + 1 || linePieces.length > POSITIONS_COORDS_PER_VERTEX + 2) { System.out.println("Malformed vertex coordinate specification, assuming xyz format only."); return; } else if (linePieces.length == POSITIONS_COORDS_PER_VERTEX + 2 && !vertexCoordIgnoredWarning) { System.out.println( "Only x, y, and z parsed for vertex coordinates; w coordinates will be ignored."); vertexCoordIgnoredWarning = true; } boolean success = true; try { for (int i = 1; i < POSITIONS_COORDS_PER_VERTEX + 1; i++) { tempCoords[i - 1] = Float.parseFloat(linePieces[i]); } } catch (NumberFormatException e) { success = false; System.out.println("Malformed vertex coordinate error: " + e.toString()); } if (success) { for (int i = 0; i < POSITIONS_COORDS_PER_VERTEX; i++) { vertices.add(Float.valueOf(tempCoords[i] * objectUniformScaleFactor)); } } } private void parseTextureCoordinate(String[] linePieces) { // Similar to vertices, uvw is acceptable as a format, with w defaulting to 0.0, but for now we // only parse uv. if (linePieces.length < TEXTURE_COORDS_PER_VERTEX + 1 || linePieces.length > TEXTURE_COORDS_PER_VERTEX + 2) { System.out.println("Malformed texture coordinate specification, assuming uv format only."); return; } else if (linePieces.length == (TEXTURE_COORDS_PER_VERTEX + 2) && !textureCoordIgnoredWarning) { debugLogString("Only u and v parsed for texture coordinates; w coordinates will be ignored."); textureCoordIgnoredWarning = true; } boolean success = true; try { for (int i = 1; i < TEXTURE_COORDS_PER_VERTEX + 1; i++) { tempCoords[i - 1] = Float.parseFloat(linePieces[i]); } } catch (NumberFormatException e) { success = false; System.out.println("Malformed texture coordinate error: " + e.toString()); } if (success) { // .obj files treat (0,0) as top-left, compared to bottom-left for openGL. So invert "v" // texture coordinate only here. textureCoords.add(Float.valueOf(tempCoords[0])); textureCoords.add(Float.valueOf(1.0f - tempCoords[1])); } } // Will return INVALID_INDEX if error occurs, and otherwise will return finalized (combined) // index, adding and hashing new combinations as it sees them. private short parseAndProcessCombinedVertexCoord(String coordString) { String[] coords = coordString.split("/"); try { // Parse vertex and texture indices; 1-indexed from front if positive and from end of list if // negative. short vertexIndex = Short.parseShort(coords[0]); short textureIndex = Short.parseShort(coords[1]); if (vertexIndex > 0) { vertexIndex--; } else { vertexIndex = (short) (vertexIndex + numPrimitiveVertices); } if (textureIndex > 0) { textureIndex--; } else { textureIndex = (short) (textureIndex + numPrimitiveTextureCoords); } // Combine indices and look up in pair map. ShortPair indexPair = new ShortPair(Short.valueOf(vertexIndex), Short.valueOf(textureIndex)); Short combinedIndex = vertexTexCoordMap.get(indexPair); if (combinedIndex == null) { short numIndexPairs = (short) vertexTexCoordMap.size(); vertexTexCoordMap.put(indexPair, numIndexPairs); return numIndexPairs; } else { return combinedIndex.shortValue(); } } catch (NumberFormatException e) { // Failure to parse coordinates as shorts return INVALID_INDEX; } } // Note: it is assumed that face list occurs AFTER vertex and texture coordinate lists finish in // the obj file format. private void parseFace(String[] linePieces) { if (linePieces.length < 4) { System.out.println("Malformed face index list: there must be at least 3 indices per face"); return; } short[] faceIndices = new short[linePieces.length - 1]; boolean success = true; for (int i = 1; i < linePieces.length; i++) { short faceIndex = parseAndProcessCombinedVertexCoord(linePieces[i]); if (faceIndex < 0) { System.out.println(faceIndex); System.out.println("Malformed face index: " + linePieces[i]); success = false; break; } faceIndices[i - 1] = faceIndex; } if (success) { numPrimitiveFaces++; // Manually triangulate the face under the assumption that the points are coplanar, the poly // is convex, and the points are listed in either clockwise or anti-clockwise orientation. for (int i = 1; i < faceIndices.length - 1; i++) { // We use a triangle fan here, so first point is part of all triangles finalizedTriangles.add(faceIndices[0]); finalizedTriangles.add(faceIndices[i]); finalizedTriangles.add(faceIndices[i + 1]); } } } // Iterate over map and reconstruct proper vertex/texture coordinate pairings. private boolean constructFinalCoordinatesFromMap() { final int numIndexPairs = vertexTexCoordMap.size(); // XYZ vertices and UV texture coordinates finalizedVertices = new float[POSITIONS_COORDS_PER_VERTEX * numIndexPairs]; finalizedTextureCoords = new float[TEXTURE_COORDS_PER_VERTEX * numIndexPairs]; try { for (Map.Entry<ShortPair, Short> entry : vertexTexCoordMap.entrySet()) { ShortPair indexPair = entry.getKey(); short rawVertexIndex = indexPair.getFirst().shortValue(); short rawTexCoordIndex = indexPair.getSecond().shortValue(); short finalIndex = entry.getValue().shortValue(); for (int i = 0; i < POSITIONS_COORDS_PER_VERTEX; i++) { finalizedVertices[POSITIONS_COORDS_PER_VERTEX * finalIndex + i] = vertices.get(rawVertexIndex * POSITIONS_COORDS_PER_VERTEX + i); } for (int i = 0; i < TEXTURE_COORDS_PER_VERTEX; i++) { finalizedTextureCoords[TEXTURE_COORDS_PER_VERTEX * finalIndex + i] = textureCoords.get(rawTexCoordIndex * TEXTURE_COORDS_PER_VERTEX + i); } } } catch (NumberFormatException e) { System.out.println("Malformed index in vertex/texture coordinate mapping."); return false; } return true; } public HashMap<ShortPair, Short> getVertexTexCoordMap() { return vertexTexCoordMap; } /** * Returns the vertex position coordinate list (x1, y1, z1, x2, y2, z2, ...) after a successful * call to parse(). */ public float[] getVertices() { return finalizedVertices; } /** * Returns the vertex texture coordinate list (u1, v1, u2, v2, ...) after a successful call to * parse(). */ public float[] getTextureCoords() { return finalizedTextureCoords; } /** * Returns the list of indices (a1, b1, c1, a2, b2, c2, ...) after a successful call to parse(). * Each (a, b, c) triplet specifies a triangle to be rendered, with a, b, and c Short objects used * to index into the coordinates returned by getVertices() and getTextureCoords().<p></p> * For example, a Short index representing 5 should be used to index into vertices[15], * vertices[16], and vertices[17], as well as textureCoords[10] and textureCoords[11]. */ public ArrayList<Short> getTriangles() { return finalizedTriangles; } /** * Attempts to locate and read the specified .obj file, and parse it accordingly. None of the * getter functions in this class will return valid results until a value of true is returned * from this function. * @return true on success. */ public boolean parse() { boolean success = true; BufferedReader reader = null; int vertexCount = 0; try { reader = Files.newBufferedReader(Paths.get(fileName), UTF_8); String line; while ((line = reader.readLine()) != null) { // Skip over lines with no characters if (line.length() < 1) { continue; } // Ignore comment lines entirely if (line.charAt(0) == '#') { continue; } // Split into pieces based on whitespace, and process according to first command piece String[] linePieces = line.split(" +"); switch (linePieces[0]) { case "v": // Add vertex if (startedProcessingFaces) { throw new IOException("Vertices must all be declared before faces in obj files."); } //debugLogString("vertexCount: " + String.valueOf(++vertexCount)); parseVertex(linePieces); break; case "vt": // Add texture coordinate if (startedProcessingFaces) { throw new IOException( "Texture coordinates must all be declared before faces in obj files."); } parseTextureCoordinate(linePieces); break; case "f": // Vertex and texture coordinate lists should be locked into place by now if (!startedProcessingFaces) { startedProcessingFaces = true; numPrimitiveVertices = vertices.size() / POSITIONS_COORDS_PER_VERTEX; numPrimitiveTextureCoords = textureCoords.size() / TEXTURE_COORDS_PER_VERTEX; } // Add face parseFace(linePieces); break; default: // Unknown or unused directive: ignoring // Note: We do not yet process vertex normals or curves, so we ignore {vp, vn, s} // Note: We assume only a single object, so we ignore {g, o} // Note: We also assume a single texture, which we process independently, so we ignore // {mtllib, usemtl} break; } } // If we made it all the way through, then we have a vertex-to-tex-coord pair mapping, so // construct our final vertex and texture coordinate lists now. success = constructFinalCoordinatesFromMap(); } catch (IOException e) { success = false; System.out.println("Failure to parse obj file: " + e.toString()); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { System.out.println("Couldn't close reader"); } } if (success) { debugLogString("Successfully parsed " + numPrimitiveVertices + " vertices and " + numPrimitiveTextureCoords + " texture coordinates into " + vertexTexCoordMap.size() + " combined vertices and " + numPrimitiveFaces + " faces, represented as a mesh of " + finalizedTriangles.size() / 3 + " triangles."); } return success; } }
35.824257
100
0.663028
ceee45ef79cd3a294167917c7f1fe77b725611b8
23,792
package ru.raingo.monkey; import android.app.Activity; import android.app.ActivityManager; import android.app.Fragment; import android.app.FragmentTransaction; import android.content.Context; import android.content.pm.ConfigurationInfo; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Point; import android.opengl.GLES20; import android.opengl.GLSurfaceView; import android.opengl.GLUtils; import android.opengl.Matrix; import android.os.Bundle; import android.util.Log; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.ShortBuffer; import java.util.LinkedList; import java.util.Queue; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; public class Monkey { private Activity activity; private Screen currentScreen; public Monkey (Activity a){ this.activity = a; // Проверяем поддерживается ли OpenGL ES 2.0. if (!supportsEs2()) { Log.e("app", "OpenGl ES 2.0 is not supported"); this.activity.finish(); } } void setScreen(int container, Screen s){ this.activity.setContentView(R.layout.activity_main); FragmentTransaction fTrans = this.activity.getFragmentManager().beginTransaction(); fTrans.replace(container, s); fTrans.addToBackStack(null); fTrans.commit(); this.currentScreen = s; } private boolean supportsEs2() { ActivityManager activityManager = (ActivityManager) this.activity.getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); return (configurationInfo.reqGlEsVersion >= 0x20000); } public Viewport createViewport(int w,int h){ return new Viewport(w,h); } public Screen createScreen(Viewport v){ Screen s = new Screen(); s.init(v); return s; } public Screen createScreen(){ Screen s = new Screen(); s.init(); return s; } public Texture createTexture(int p, float zBuffer, float a){ return new Texture(p, zBuffer, a, currentScreen); } ///////////////////////////// //////ВНУТРЕННИЕ КЛАССЫ////// ///////////////////////////// private class GameSurfaceView extends GLSurfaceView { public OpenGLRenderer renderer; public GameSurfaceView(Context context, Viewport v, GameLoop l) { super(context); setEGLContextClientVersion(2); this.renderer = new OpenGLRenderer(v, l); setRenderer(this.renderer); //this.setRenderMode(RENDERMODE_WHEN_DIRTY); } } private class OpenGLRenderer implements GLSurfaceView.Renderer { public GameLoop loop; private Viewport viewport; //private Runnable runnable = null; //private int i =0; private Queue<Runnable> queue = new LinkedList<>(); public OpenGLRenderer(Viewport v, GameLoop l) { //this.context = c; //Log.e("app", "context load:"); //Log.e("app", String.valueOf(this.context)); this.viewport = v; this.loop = l; } public void setGameLoop(GameLoop l) { this.loop = l; } @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { //Log.e("app", "onSurfaceCreated"); /*texture = new Texture(context); this.loop = new Loop(){ public void run(){ texture.draw(); } };*/ this.viewport.set(this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height); } @Override public void onSurfaceChanged(GL10 gl, int w, int h) { this.viewport.set(0,0,w,h); } @Override public void onDrawFrame(GL10 gl) { GLES20.glEnable(GLES20.GL_DEPTH_TEST); // включает использование буфера глубины GLES20.glDepthFunc(GLES20.GL_LEQUAL); // определяет работу буфера глубины: более ближние объекты перекрывают дальние GLES20.glClearColor(0.2f, 0.3f, 0.3f, 1.0f); //GLES20.glClearColor(1.f, 1.f, 1.f, 1.0f); //GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); //texture.draw(); //loop.run(); //GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3); /* i++; Log.e("app", "Итерация: " + String.valueOf(i)); */ //if(!queue.isEmpty()){ while (!queue.isEmpty()){ queue.poll().run(); Log.e("app", "runnable run"); } //} loop.run(); } public void act(Runnable runnable){ queue.add(runnable); } } public interface GameLoop{ public void run(); } public class Viewport{ public int width; public int height; public int x; public int y; public Viewport(int w,int h){ this.width = w; this.height = h; } public void set(int x, int y, int w,int h){ this.width = w; this.height = h; this.x = x; this.y = y; GLES20.glViewport(this.x, this.y, this.width, this.height); } } public class Screen extends Fragment { public Viewport viewport; public GameSurfaceView gameSurfaceView; private GameLoop loop; public void init(){ this.loop = new GameLoop(){ public void run() { } }; Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); this.viewport = new Viewport(size.x, size.y); this.gameSurfaceView = new GameSurfaceView(activity, this.viewport, this.loop); } public void init(Viewport v){ this.loop = new GameLoop(){ public void run() { } }; this.viewport = v; this.gameSurfaceView = new GameSurfaceView(activity, this.viewport, this.loop); } public void setGameLoop(GameLoop l) { this.loop = l; this.gameSurfaceView.renderer.setGameLoop(this.loop); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //TextView textView = new TextView(getActivity()); //textView.setText(R.string.hello_blank_fragment); //return textView; //gameSurfaceView = new GLSurfaceView(getActivity()); /* this.gameSurfaceView = new GLSurfaceView(activity); this.gameSurfaceView.setEGLContextClientVersion(2); //gameSurfaceView.setRenderer(new OpenGLRenderer(getActivity())); this.gameSurfaceView.setRenderer(this.renderer); */ return this.gameSurfaceView; } } public class Texture { public String name; public boolean init; private Context context; private TextureGL textureGL; private TextureDraw textureDraw; public int path; //путь к текстуре public float z; //zBuffer public float alpha; public Bitmap img; private Screen screen; //к какому окну принадлежит текстура public Texture(int p, float zBuffer, float a, Screen s) { init = false; this.path = p; this.name = activity.getResources().getResourceName(path); this.z = zBuffer; this.alpha = a; this.screen = s; textureDraw = new TextureDraw(){ @Override public void run(){} @Override public void run(float zBuffer) {}}; screen.gameSurfaceView.renderer.act(new Runnable(){ @Override public void run() { textureGL = new TextureGL(path, z, alpha, screen); init = true; textureDraw = new TextureDraw(){ @Override public void run(){ //Log.e("app", "TextureDraw run"); textureGL.draw(); } @Override public void run(float zBuffer) { textureGL.draw(zBuffer); } }; } }); } public void draw(float zBuffer) { textureDraw.run(zBuffer); //Log.e("app", name + " = " + String.valueOf(init)); } public void draw() { textureDraw.run(); //Log.e("app", name + " = " + String.valueOf(init)); } private abstract class TextureDraw{ public abstract void run(); public abstract void run(float zBuffer); } } public class TextureGL{ public int path; //путь к текстуре public Shader shader; public Mesh mesh; public float z; //zBuffer public float alpha; public boolean init; //проверка загрузки изо public Bitmap img; private float[] trans = new float[16]; private float[] MVP = new float[16]; private Screen screen; //к какому окну принадлежит текстура public TextureGL(int p, float zBuffer, float a, Screen s) { this.path = p; this.z = zBuffer; this.alpha = a; this.init = false; this.screen = s; // получение Bitmap BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; this.img = BitmapFactory.decodeResource( activity.getResources(), path, options); if (this.img == null) { Log.e("app", "Error create bitmap!"); } this.shader = new Shader(this); this.mesh = new Mesh(this.shader.shaderProgram, img); //затем убрать это float position[] = {0.0f, 0.5f, 0.0f}; float rotation[] = {0.0f, 0.0f, 1.0f}; float scale[] = {0.5f, 0.5f, 1.0f}; Matrix.setIdentityM(this.trans, 0); float angle = 90.0f; Matrix.translateM(this.trans, 0, position[0], position[1], position[2]); Matrix.rotateM(this.trans, 0, angle, rotation[0], rotation[1], rotation[2]); Matrix.scaleM(this.trans, 0, scale[0], scale[1], scale[2]); //без декомпозиции //ибо математических библиотек для opengl нет float zoom = 1.f; float cameraPosition[] = {0.f, 0.5f, 10.f}; float cameraTarget[] = {0.0f, 0.5f, 0.0f}; float upVector[] = {0.0f, 1.0f, 0.0f}; float projection[] = new float[16]; float CameraMatrix[] = new float[16]; Matrix.orthoM(projection, 0, -1.f * zoom, 1.f * zoom, -1.f * zoom, 1.f * zoom, 0.1f, 20.f ); Matrix.setLookAtM(CameraMatrix, 0, cameraPosition[0], cameraPosition[1], cameraPosition[2], cameraTarget[0], cameraTarget[1], cameraTarget[2], upVector[0], upVector[1], upVector[2] ); zoom = 0.75f; Matrix.orthoM(projection, 0, -1.f * zoom, 1.f * zoom, -1.f * zoom, 1.f * zoom, 0.1f, 20.f ); Matrix.multiplyMM(this.MVP, 0, CameraMatrix, 0, this.trans, 0); Matrix.multiplyMM(this.MVP, 0, projection, 0, this.MVP, 0); } public void draw(){ GLES20.glEnable(GLES20.GL_BLEND); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); this.shader.use(); int alphaLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "alpha"); GLES20.glUniform1f(alphaLoc, this.alpha); int MVPLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "MVP"); GLES20.glUniformMatrix4fv(MVPLoc, 1, false, this.MVP, 0); int zLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "z"); GLES20.glUniform1f(zLoc, this.z); this.mesh.draw(); GLES20.glDisable(GLES20.GL_BLEND); } public void draw(float zBuffer){ GLES20.glEnable(GLES20.GL_BLEND); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); this.shader.use(); int alphaLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "alpha"); GLES20.glUniform1f(alphaLoc, alpha); int MVPLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "MVP"); GLES20.glUniformMatrix4fv(MVPLoc, 1, false, this.MVP, 0); int zLoc = GLES20.glGetUniformLocation(this.shader.shaderProgram, "z"); GLES20.glUniform1f(zLoc, zBuffer); this.mesh.draw(); GLES20.glDisable(GLES20.GL_BLEND); } //////////// //внутряки// //////////// private class Shader{ public String vertex; public String fragment; public int shaderProgram; private int vertexShader; private int fragmentShader; private TextureGL texture; public Shader(TextureGL t) { this.texture = t; this.vertex = "attribute vec3 position;\n" + "attribute vec3 color;\n" + "attribute vec2 texCoord;\n" + "varying vec3 vertexColor;\n" + "varying vec2 TexCoord;\n" + "uniform mat4 MVP;\n" + "uniform float z;\n" + "void main()\n" + "{\n" + " gl_Position = vec4(position.x, position.y, z, 1.0) * MVP;\n" + " vertexColor = color;\n" + " TexCoord = vec2(texCoord.x, 1.0 - texCoord.y);\n" + "}\n"; this.fragment = "precision mediump float;\n" + "varying vec3 vertexColor;\n" + "varying vec2 TexCoord;\n" + "uniform float alpha;\n" + "uniform sampler2D ourTexture;\n" + "void main()\n" + "{\n" + " vec4 texColor = texture2D(ourTexture, TexCoord);\n" + " if(texColor.a < 0.1) discard;\n" + " texColor.a = alpha;\n" + " gl_FragColor = texColor;\n" + "}\n"; this.vertexShader = createShader(GLES20.GL_VERTEX_SHADER, this.vertex); this.fragmentShader = createShader(GLES20.GL_FRAGMENT_SHADER, this.fragment); this.shaderProgram = GLES20.glCreateProgram(); GLES20.glAttachShader(this.shaderProgram, this.vertexShader); GLES20.glAttachShader(this.shaderProgram, this.fragmentShader); GLES20.glLinkProgram(this.shaderProgram); //отладка int[] linked = new int[1]; // Check the link status GLES20.glGetProgramiv(this.shaderProgram, GLES20.GL_LINK_STATUS, linked, 0); if (linked[0] == 0) { Log.e("app", "Error linking program:"); Log.e("app", GLES20.glGetProgramInfoLog(this.shaderProgram)); GLES20.glDeleteProgram(this.shaderProgram); } Log.e("app", "Текстура создана!"); } public void use() { GLES20.glUseProgram(this.shaderProgram);} private int createShader(int type, String source) { // Create the shader object int shader = GLES20.glCreateShader(type); // Load the shader source GLES20.glShaderSource(shader, source); // Compile the shader GLES20.glCompileShader(shader); //отладка int[] compiled = new int[1]; // Check the compile status GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0); if (compiled[0] == 0) { Log.e("app", "Error create shader:"); Log.e("app", GLES20.glGetShaderInfoLog(shader)); GLES20.glDeleteShader(shader); return 0; } return shader; } } private class Mesh{ public float[] vertices; public float[] colors; public short[] indices; public float[] texCoords; private int shaderProgram; private Bitmap img; private FloatBuffer vertexBuffer; private FloatBuffer colorBuffer; private FloatBuffer textureBuffer; private ShortBuffer indexBuffer; private int VBO; private int colorBO; private int texBO; private int IBO; private int texture; public Mesh(int s, Bitmap i) { this.shaderProgram = s; this.img = i; //массив вершин треугольника this.vertices = new float[]{ 0.5f, 0.5f, 0.0f, // Верхний правый угол 0.5f, -0.5f, 0.0f, // Нижний правый угол -0.5f, -0.5f, 0.0f, // Нижний левый угол -0.5f, 0.5f, 0.0f // Верхний левый угол }; this.indices = new short[]{ 0, 1, 3, // Первый треугольник 1, 2, 3 // Второй треугольник }; this.colors = new float[]{ 1.0f, 0.0f, 0.0f, // Верхний правый угол 0.0f, 1.0f, 0.0f, // Нижний правый угол 0.0f, 0.0f, 1.0f, // Нижний левый угол 1.0f, 0.0f, 1.0f // Верхний левый угол }; this.texCoords = new float[]{ 1.0f, 1.0f, // Верхний правый угол 1.0f, 0.0f, // Нижний правый угол 0.0f, 0.0f, // Нижний левый угол 0.0f, 1.0f // Верхний левый угол }; int[] textures = new int[1]; GLES20.glGenTextures(1, textures, 0); this.texture = textures[0]; GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, this.texture); /*GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, img.getWidth(), img.getHeight(), 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, img);*/ //GLES20.glPixelStorei(GLES20.GL_UNPACK_IMAGE_HEIGHT); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, this.img, 0); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); //GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, img, 0); //GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); //img.recycle(); this.vertexBuffer = ByteBuffer.allocateDirect(this.vertices.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); this.vertexBuffer.put(this.vertices); this.vertexBuffer.position(0); this.colorBuffer = ByteBuffer.allocateDirect(this.colors.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); this.colorBuffer.put(this.colors); this.colorBuffer.position(0); this.textureBuffer = ByteBuffer.allocateDirect(this.colors.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); this.textureBuffer.put(this.texCoords); this.textureBuffer.position(0); this.indexBuffer = ByteBuffer.allocateDirect(this.indices.length * 2).order(ByteOrder.nativeOrder()).asShortBuffer(); this.indexBuffer.put(this.indices); this.indexBuffer.position(0); int buffers[] = new int[4]; GLES20.glGenBuffers(4, buffers, 0); this.VBO = buffers[0]; this.colorBO = buffers[1]; this.texBO = buffers[2]; this.IBO = buffers[3]; GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.VBO); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, this.vertexBuffer.capacity()*4, this.vertexBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.colorBO); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, this.colorBuffer.capacity()*4, this.colorBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.texBO); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, this.textureBuffer.capacity()*4, this.textureBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, this.IBO); GLES20.glBufferData(GLES20.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity()*2, this.indexBuffer, GLES20.GL_STATIC_DRAW); } public void draw(){ GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.VBO); int posLoc = GLES20.glGetAttribLocation(this.shaderProgram, "position"); GLES20.glVertexAttribPointer(posLoc, 3, GLES20.GL_FLOAT, false, 0, 0); GLES20.glEnableVertexAttribArray(posLoc); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.colorBO); int colorLoc = GLES20.glGetAttribLocation(this.shaderProgram, "color"); GLES20.glVertexAttribPointer(colorLoc, 3, GLES20.GL_FLOAT, false, 0, 0); GLES20.glEnableVertexAttribArray(colorLoc); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, this.texBO); int texLoc = GLES20.glGetAttribLocation(this.shaderProgram, "texCoord"); GLES20.glVertexAttribPointer(texLoc, 2, GLES20.GL_FLOAT, false, 0, 0); GLES20.glEnableVertexAttribArray(texLoc); //GLES20.glActiveTexture(gl.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, this.texture); //int samplerUniform = gl.glGetUniformLocation(shaderProgram, "ourTexture"); //gl.glUniform1i(samplerUniform, 0); GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, this.IBO); GLES20.glDrawElements(GLES20.GL_TRIANGLES, 6, GLES20.GL_UNSIGNED_SHORT, 0); } } } }
34.183908
136
0.542325
e6d1cd1d50b23155ec9e73e88b97176425b6a0c8
15,673
/* * ESnet Network Operating System (ENOS) Copyright (c) 2016, The Regents * of the University of California, through Lawrence Berkeley National * Laboratory (subject to receipt of any required approvals from the * U.S. Dept. of Energy). All rights reserved. * * If you have questions about your rights to use or distribute this * software, please contact Berkeley Lab's Innovation & Partnerships * Office at [email protected]. * * NOTICE. This Software was developed under funding from the * U.S. Department of Energy and the U.S. Government consequently retains * certain rights. As such, the U.S. Government has been granted for * itself and others acting on its behalf a paid-up, nonexclusive, * irrevocable, worldwide license in the Software to reproduce, * distribute copies to the public, prepare derivative works, and perform * publicly and display publicly, and to permit other to do so. * */ package net.es.netshell.controller.core; import net.es.netshell.controller.impl.SdnController; import net.es.netshell.odlcorsa.OdlCorsaIntf; import net.es.netshell.odlmdsal.impl.OdlMdsalImpl; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.reflect.Method; import java.math.BigInteger; import java.util.List; import java.util.concurrent.ExecutionException; /** * Created by bmah on 10/14/15. */ public class Controller { // This is a quasi-singleton. In theory there can be multiple of these objects // in a system, but in practice it seems that each one of these is associated // with a single instance of the OSGi bundle, which basically just means just // one per system. So we can somewhat safely say there should be at most one // instance, and keep a class member variable pointing to that one instance. static private volatile Controller instance = null; public OdlMdsalImpl getOdlMdsalImpl() { return OdlMdsalImpl.getInstance(); } private volatile BundleContext bundleContext; public BundleContext getBundleContext() { return bundleContext; } public void setBundleContext(BundleContext bundleContext) { this.bundleContext = bundleContext; } /** * Get an object that implements the Corsa glue interface. * Note that even loading the code/class for the Corsa glue is optional, * so we have to be able to do this even if the implementation class * isn't loaded. * @return OdlCorsaImpl object */ public OdlCorsaIntf getOdlCorsaImpl() { try { // We need to use our OSGi-aware class loader to find the OdlCorsaImpl object // and then some reflection techniques to find its getInstance() method. Class c = null; try { // This is clunky. We can't do this everytime we need to invoke this method, // maybe need to cache it or something like that? The difficulty, as always, // is knowing when to invalidate the cache. BundleContext bc = this.getBundleContext(); Bundle[] bundles = bc.getBundles(); OsgiBundlesClassLoader classLoader = new OsgiBundlesClassLoader(bundles, OdlCorsaIntf.class.getClassLoader()); c = classLoader.findClass("net.es.netshell.odlcorsa.impl.OdlCorsaImpl"); } catch (ClassNotFoundException e) { return null; } Method m = null; try { m = c.getMethod("getInstance"); } catch (NoSuchMethodException e) { return null; } // We found the method, invoke it. Note that we pass a null // as the object to invoke on, because this is a static method. Object o = m.invoke(null); OdlCorsaIntf oci = (OdlCorsaIntf) o; return oci; } catch (Exception e) { e.printStackTrace(); return null; } } /** * Abstract Layer 2 Translation specification * Somewhat decoupled from OpenFlow, and assuming exact matches on, and * forwarding to, port/VLAN/destMAC only. */ static public class L2Translation { /** * Output specification. * A "normal" L2Translation structure will have ony one of these, * but broadcast and tapping will have more than one. */ static public class L2TranslationOutput{ public String outPort; public short vlan; public MacAddress dstMac; } public byte [] dpid; public int priority; public BigInteger c; public String inPort; public short vlan1; public MacAddress srcMac1; public MacAddress dstMac1; public L2TranslationOutput [] outputs; public short pcp; public short queue; public long meter; public FlowRef flowRef; public L2Translation() { // Initialize some fields that have reasonable defaults. this.priority = OFConstants.DEFAULT_FLOW_PRIORITY; this.c = BigInteger.ZERO; this.outputs = new L2TranslationOutput[0]; this.pcp = 0; this.meter = 0; } } public Controller() { if (instance == null) { instance = this; } else { throw new RuntimeException("Attempt to create multiple " + Controller.class.getName()); } // Automatically start up an instance of SdnController, running in its own thread, // to listen for RabbitMQ messages. // // XXX When we move the SdnController stuff to a different bundle, this code should be // a part of the activator of that bundle. // // When we start up a Karaf container that has netshell-controller already loaded, // there appears to be a possible race condition with the startup of the ODL // MD-SAL and ODL Corsa bundles. The symptom is that SdnController doesn't get // PacketReceived notifications. We make sure that the callback setting actually succeeds // and if not we wait a second and try again (giving up after 60 seconds). try { SdnController sdncont = new SdnController(); boolean ok = false; Integer countdown = new Integer(60); while (!ok) { boolean rc = sdncont.setCallback(); logger.info("sdncont.setCallback returns " + (rc ? "true" : "false") + " with countdown " + countdown.toString()); if (rc) { ok = true; } else { if (countdown-- < 0) { break; } Thread.sleep(1000); } } if (ok) { Thread sdnthr = new Thread(sdncont); sdnthr.start(); } else { throw new RuntimeException("Can't set SdnController callback"); } } catch (Exception e) { e.printStackTrace(); logger.error("Unable to start SdnController instance"); } } public static Controller getInstance() { return instance; } public void reinit() { } // Logging static final private Logger logger = LoggerFactory.getLogger(Controller.class); // Glue to get some stuff from MD-SAL without the caller needing to have a handle // to the MD-SAL implementation public List<Node> getNetworkDevices() { return this.getOdlMdsalImpl().getNetworkDevices(); } static public NodeConnector getNodeConnector(Node node, String nodeConnectorName) { return OdlMdsalImpl.getNodeConnector(node, nodeConnectorName); } public FlowRef installL2ForwardingRule(L2Translation translation) { Node node; NodeConnector inNc; FlowRef fr = null; // Make sure the node and its input connector exist node = this.getOdlMdsalImpl().getNetworkDeviceByDpidArray(translation.dpid); if (node == null) { return null; } inNc = OdlMdsalImpl.getNodeConnector(node, translation.inPort); if (inNc == null) { return null; } logger.debug("checked node and ncid"); try { if (isCorsa(translation.dpid)) { logger.debug("Corsa"); // The Corsa can only do one translation at a time...no packet copying if (translation.outputs.length == 1) { // Make sure we can resolve the output connector NodeConnector outNc = OdlMdsalImpl.getNodeConnector(node, translation.outputs[0].outPort); if (outNc != null) { fr = this.getOdlCorsaImpl().createTransitVlanMacCircuit(node, translation.priority, translation.c, translation.dstMac1, inNc.getId(), translation.vlan1, translation.outputs[0].dstMac, outNc.getId(), translation.outputs[0].vlan, translation.pcp, translation.queue, translation.meter); } else { return null; } } else { return null; } } else if (isOVS(translation.dpid)) { logger.debug("OVS"); // For now we only support a single translation, like the Corsa. // We should be able to take a vector of translations. // XXX do this if (translation.outputs.length == 1) { logger.debug("single"); // Make sure we can resolve the output connector NodeConnector outNc = OdlMdsalImpl.getNodeConnector(node, translation.outputs[0].outPort); if (outNc != null) { fr = this.getOdlMdsalImpl().createTransitVlanMacCircuit(node, translation.priority, translation.c, translation.srcMac1, translation.dstMac1, inNc.getId(), translation.vlan1, translation.outputs[0].dstMac, outNc.getId(), translation.outputs[0].vlan); } else { return null; } } else { // Multipoint circuit logger.debug("multi"); // Construct vector of output tuples OdlMdsalImpl.L2Output[] outputs = new OdlMdsalImpl.L2Output[translation.outputs.length]; for (int i = 0; i < translation.outputs.length; i++) { NodeConnector outNc = OdlMdsalImpl.getNodeConnector(node, translation.outputs[i].outPort); if (outNc == null) { return null; } outputs[i] = new OdlMdsalImpl.L2Output(); outputs[i].mac = translation.outputs[i].dstMac; outputs[i].ncid = outNc.getId(); outputs[i].vlan = translation.outputs[i].vlan; } fr = this.getOdlMdsalImpl().createMultipointVlanMacCircuit(node, translation.priority, translation.c, translation.srcMac1, translation.dstMac1, inNc.getId(), translation.vlan1, outputs); } } else { // XXX log something } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } translation.flowRef = fr; return fr; } public FlowRef installL2ControllerRule(L2Translation translation) { // XXX sendtocontroller // OVS doesn't do this yet. Probably want for consistency // Node node; NodeConnector inNc; FlowRef fr = null; node = this.getOdlMdsalImpl().getNetworkDeviceByDpidArray(translation.dpid); if (node == null) { return null; } inNc = OdlMdsalImpl.getNodeConnector(node, translation.inPort); if (inNc == null) { return null; } try { if (isCorsa(translation.dpid)) { fr = this.getOdlCorsaImpl().sendVlanMacToController(node, translation.priority, translation.c, translation.dstMac1, inNc.getId(), translation.vlan1); } else if (isOVS(translation.dpid)) { // fr = this.getOdlMdsalImpl().sendVlanMacToController(node, translation.priority, translation.c, // translation.dstMac1, inNc.getId(), translation.vlan1); } else { // XXX log something } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } translation.flowRef = fr; return fr; } public boolean deleteL2ForwardingRule(L2Translation translation) { return deleteFlow(translation.dpid, translation.flowRef); } public boolean deleteFlow(byte [] dpid, FlowRef flowRef) { boolean rc = false; try { // XXX in theory if we have the FlowRef we know what switch it applies to, // and therefore know what the switch vendor is. if (isCorsa(dpid)) { this.getOdlCorsaImpl().deleteFlow(flowRef); rc = true; } else if (isOVS(dpid)) { rc = this.getOdlMdsalImpl().deleteFlow(flowRef); } else { /// XXX log something } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } return rc; } public boolean transmitDataPacket(byte [] dpid, String outPort, byte [] payload) { Node node; node = this.getOdlMdsalImpl().getNetworkDeviceByDpidArray(dpid); if (node == null) { // XXX log something return false; } NodeConnector outNc = this.getOdlMdsalImpl().getNodeConnector(node, outPort); if (outNc == null) { // XXX log something return false; } boolean rc = false; this.getOdlMdsalImpl().transmitDataPacket(node, outNc, payload); return true; } /** * Return whether the DPID parameter encodes a Corsa switch. * * Encodes a policy specific to the ESnet 100G SDN testbed. * @param dpid * @return */ public static boolean isCorsa(byte [] dpid) { return dpid[0] == 2; } /** * Return whether the DPID parameter encodes an OVS switch. * * Encodes a policy specific to the ESnet 100G SDN testbed. * @param dpid * @return */ public static boolean isOVS(byte [] dpid) { return dpid[0] == 1; } }
37.052009
130
0.582275
b4572b69bed9c8af035f12e94a52a55c74a63c12
3,554
package com.android.launcher3.icon.iconpacksupport; /* * Created by Michele on 06/07/2017. */ import android.content.ComponentName; import android.content.Context; import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.util.ArrayMap; import com.android.launcher3.FastBitmapDrawable; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.util.pixel.PixelIcon; import java.util.List; import java.util.Map; public class IconPacks { private final String mIconBack; private final String mIconUpon; private final String mIconMask; private final float mScale; private final List<String> mCalendars; private Map<String, IconPackProvider.IconInfo> icons = new ArrayMap<>(); private String packageName; private Context mContext; public IconPacks(Map<String, IconPackProvider.IconInfo> icons, Context context, String packageName, String iconBack, String iconUpon, String iconMask, float scale, List<String> calendars) { this.icons = icons; this.packageName = packageName; mContext = context; mIconBack = iconBack; mIconUpon = iconUpon; mIconMask = iconMask; mScale = scale; mCalendars = calendars; } public Drawable getIcon(LauncherActivityInfoCompat info) { return getIcon(info.getComponentName()); } public Drawable getIcon(ActivityInfo info) { return getIcon(new ComponentName(info.packageName, info.name)); } public Drawable getIcon(ComponentName info) { IconPackProvider.IconInfo iconInfo = icons.get(info.toString()); if (iconInfo != null && iconInfo.prefix != null) { Drawable drawable = getDrawable(iconInfo.prefix + (PixelIcon.dayOfMonth() + 1)); if (drawable != null) { return drawable; } } if (iconInfo != null && iconInfo.drawable != null) return getDrawable(iconInfo.drawable); if (mIconBack != null || mIconUpon != null || mIconMask != null) return getMaskedDrawable(info); return null; } private Drawable getMaskedDrawable(ComponentName info) { try { return new CustomIconDrawable(mContext, this, info); } catch (Exception e) { e.printStackTrace(); return null; } } private Drawable getDrawable(String name) { Resources res; try { res = mContext.getPackageManager().getResourcesForApplication(packageName); int resourceId = res.getIdentifier(name, "drawable", packageName); if (0 != resourceId) { Bitmap b = BitmapFactory.decodeResource(res, resourceId); return new FastBitmapDrawable(b); } } catch (Exception ignored) { } return null; } public String getPackageName() { return packageName; } public String getIconBack() { return mIconBack; } public String getIconUpon() { return mIconUpon; } public String getIconMask() { return mIconMask; } public float getScale() { return mScale; } public List<String> getCalendars() { return mCalendars; } }
30.904348
110
0.627743
28611e1e94d7dafebc63fac3935c2964c59f925b
6,906
package com.cqupt.fragment; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.AbsListView; import android.widget.BaseExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.TextView; import com.cqupt.R; import com.cqupt.model.Chapter; import com.cqupt.model.ChapterGroup; import java.util.ArrayList; /** * Created by Alan on 2016/5/24. */ public class TreeFragment extends Fragment { private static final String ARGUMENT_DATA = "data"; private ArrayList<ChapterGroup> mDatas; private OnTreeNodeClickListener mOnTreeNodeClickListener; private ExpandableListView mListView; private MyListViewAdapter mMyListViewAdapter; private int mFocusedGroupPosition = -1;//-1 means no focused item private int mFocusedChildrenPosition = -1; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if(mListView == null){ mDatas = (ArrayList<ChapterGroup>) getArguments().getSerializable(ARGUMENT_DATA); mListView = new ExpandableListView(getActivity()); LayoutParams p = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT); mListView.setLayoutParams(p); mMyListViewAdapter = new MyListViewAdapter(); mListView.setAdapter(mMyListViewAdapter); mListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { mFocusedGroupPosition = groupPosition; mFocusedChildrenPosition = -1; mMyListViewAdapter.notifyDataSetChanged(); if(mOnTreeNodeClickListener != null){ mOnTreeNodeClickListener.OnTreeNodeClick(mDatas.get(groupPosition).getChapter()); } return false; } }); mListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { mFocusedGroupPosition = groupPosition; mFocusedChildrenPosition = childPosition; mMyListViewAdapter.notifyDataSetChanged(); if(mOnTreeNodeClickListener != null){ mOnTreeNodeClickListener.OnTreeNodeClick(mDatas.get(groupPosition).getChildren().get(childPosition)); } return false; } }); } return mListView; } public static TreeFragment getInstance(ArrayList<ChapterGroup> datas){ Bundle bundle = new Bundle(); bundle.putSerializable(ARGUMENT_DATA,datas); TreeFragment f = new TreeFragment(); f.setArguments(bundle); return f; } public void setOnTreeNodeClickListener(OnTreeNodeClickListener listener){ mOnTreeNodeClickListener = listener; } public class MyListViewAdapter extends BaseExpandableListAdapter{ @Override public int getGroupCount() { return mDatas == null ? 0 : mDatas.size(); } @Override public int getChildrenCount(int groupPosition) { if(mDatas == null || mDatas.get(groupPosition) == null || mDatas.get(groupPosition).getChildren() == null){ return 0; } return mDatas.get(groupPosition).getChildren().size(); } @Override public Object getGroup(int groupPosition) { return mDatas.get(groupPosition); } @Override public Object getChild(int groupPosition, int childPosition) { return mDatas.get(groupPosition).getChildren().get(childPosition); } @Override public long getGroupId(int groupPosition) { return 0; } @Override public long getChildId(int groupPosition, int childPosition) { return 0; } @Override public boolean hasStableIds() { return false; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if(convertView == null){ convertView = LayoutInflater.from(getActivity()).inflate(R.layout.layout_empty_textview,parent,false); AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,AbsListView.LayoutParams.WRAP_CONTENT); convertView.setLayoutParams(lp); } TextView textView = (TextView) convertView; textView.setPadding(80,20,0,20); textView.setText(mDatas.get(groupPosition).getChapter().getChapterTitle()); if(mFocusedChildrenPosition == -1 && mFocusedGroupPosition == groupPosition){ textView.setBackgroundColor(Color.LTGRAY); }else{ textView.setBackgroundColor(Color.WHITE); } return convertView; } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { if(convertView == null){ convertView = LayoutInflater.from(getActivity()).inflate(R.layout.layout_empty_textview,parent,false); AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,AbsListView.LayoutParams.WRAP_CONTENT); convertView.setLayoutParams(lp); } TextView textView = (TextView) convertView; textView.setPadding(80,20,0,20); textView.setTextSize(13); textView.setTextColor(Color.GRAY); textView.setText(mDatas.get(groupPosition).getChildren().get(childPosition).getChapterTitle()); if(mFocusedChildrenPosition == childPosition && mFocusedGroupPosition == groupPosition){ textView.setBackgroundColor(Color.LTGRAY); }else{ textView.setBackgroundColor(Color.WHITE); } return convertView; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } } public interface OnTreeNodeClickListener { void OnTreeNodeClick(Chapter chapter); } }
33.852941
152
0.642774
8b29137843982215960228dc09184dda57ca2e66
1,443
package org.apache.airavata.registry.core.entities.expcatalog; import javax.persistence.*; @Entity @Table(name = "USERS") @IdClass(UserPK.class) public class UserEntity { private String airavataInternalUserId; private String userId; private String password; private String gatewayId; private GatewayEntity gateway; @Id @Column(name = "USER_NAME") public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } @Id @Column(name = "GATEWAY_ID") public String getGatewayId() { return gatewayId; } public void setGatewayId(String gatewayId) { this.gatewayId = gatewayId; } @Column(name = "AIRAVATA_INTERNAL_USER_ID") public String getAiravataInternalUserId() { return airavataInternalUserId; } public void setAiravataInternalUserId(String airavataInternalUserId) { this.airavataInternalUserId = airavataInternalUserId; } @Column(name = "PASSWORD") public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @ManyToOne(targetEntity = GatewayEntity.class) @JoinColumn(name = "GATEWAY_ID") public GatewayEntity getGateway() { return gateway; } public void setGateway(GatewayEntity gateway) { this.gateway = gateway; } }
22.904762
74
0.668053
d832b709649f2fdd988dfb62a93b8ff00dd1fc31
12,764
/* * Created by zhangxiangwei on 2020/09/09. * Copyright 2015-2021 Sensors Data Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sensorsdata.abtest.core; import android.content.Context; import android.text.TextUtils; import com.sensorsdata.abtest.OnABTestReceivedData; import com.sensorsdata.abtest.SensorsABTest; import com.sensorsdata.abtest.SensorsABTestConfigOptions; import com.sensorsdata.abtest.entity.AppConstants; import com.sensorsdata.abtest.entity.Experiment; import com.sensorsdata.abtest.entity.ExperimentRequest; import com.sensorsdata.abtest.entity.SABErrorEnum; import com.sensorsdata.abtest.util.TaskRunner; import com.sensorsdata.abtest.util.UrlUtil; import com.sensorsdata.analytics.android.sdk.SALog; import com.sensorsdata.analytics.android.sdk.network.HttpCallback; import com.sensorsdata.analytics.android.sdk.network.HttpMethod; import com.sensorsdata.analytics.android.sdk.network.RequestHelper; import com.sensorsdata.analytics.android.sdk.util.JSONUtils; import com.sensorsdata.analytics.android.sdk.util.NetworkUtils; import org.json.JSONArray; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class SensorsABTestApiRequestHelper<T> { private static final String TAG = "SAB.SensorsABTestApiRequestHelper"; private boolean mHasCallback = false; private String mDistinctId; public void requestExperimentByParamName(final String distinctId, final String loginId, final String anonymousId, final String paramName, final T defaultValue, final int timeoutMillSeconds, final OnABTestReceivedData<T> callBack) { // callback 为 null if (callBack == null) { SALog.i(TAG, "试验 callback 不正确,试验 callback 不能为空!"); return; } // 传参非法 if (TextUtils.isEmpty(paramName)) { SALog.i(TAG, String.format("experiment param name:%s,试验参数名不正确,试验参数名必须为非空字符串!", paramName)); if (!mHasCallback) { SABErrorDispatcher.dispatchSABException(SABErrorEnum.ASYNC_REQUEST_NULL_EXPERIMENT_PARAMETER_NAME, defaultValue); mHasCallback = true; TaskRunner.getUiThreadHandler().post(new Runnable() { @Override public void run() { callBack.onResult(defaultValue); } }); } return; } // 网络状态不可用 Context context = SensorsABTest.shareInstance().getContext(); if (context != null && !NetworkUtils.isNetworkAvailable(context)) { if (!mHasCallback) { SABErrorDispatcher.dispatchSABException(SABErrorEnum.ASYNC_REQUEST_NETWORK_UNAVAILABLE, defaultValue); mHasCallback = true; TaskRunner.getUiThreadHandler().post(new Runnable() { @Override public void run() { callBack.onResult(defaultValue); } }); } return; } // 启动定时器 final TimeoutRunnable runnable = new TimeoutRunnable(callBack, defaultValue); TaskRunner.getBackHandler().postDelayed(runnable, timeoutMillSeconds); mDistinctId = distinctId; requestExperimentsAndUpdateCache(new IApiCallback<Map<String, Experiment>>() { @Override public void onSuccess(Map<String, Experiment> experimentMap) { try { TaskRunner.getBackHandler().removeCallbacks(runnable); if (experimentMap == null) { if (!mHasCallback) { SALog.i(TAG, "onSuccess response is empty and return default value: " + defaultValue); callBack.onResult(defaultValue); mHasCallback = true; } return; } Experiment experiment = experimentMap.get(paramName); if (experiment == null) { if (!mHasCallback) { SALog.i(TAG, "onSuccess experiment is empty and return default value: " + defaultValue); callBack.onResult(defaultValue); mHasCallback = true; } return; } if (!experiment.checkTypeIsValid(paramName, defaultValue)) { if (!mHasCallback) { if (defaultValue != null) { String variableType = ""; Experiment.Variable variable = experiment.getVariableByParamName(paramName); if (variable != null) { variableType = variable.type; } SABErrorDispatcher.dispatchSABException(SABErrorEnum.ASYNC_REQUEST_PARAMS_TYPE_NOT_VALID, paramName, variableType, defaultValue.getClass().toString()); } callBack.onResult(defaultValue); mHasCallback = true; } return; } T value = experiment.getVariableValue(paramName, defaultValue); if (value != null) { if (!mHasCallback) { SALog.i(TAG, "onSuccess return value: " + value); callBack.onResult(value); mHasCallback = true; } else { SALog.i(TAG, "mOnABTestReceivedData is null "); } if (!experiment.isWhiteList) { SensorsABTestTrackHelper.getInstance().trackABTestTrigger(experiment, distinctId, loginId, anonymousId); } } } catch (Exception e) { if (!mHasCallback) { SALog.i(TAG, "onSuccess Exception and return default value: " + defaultValue); callBack.onResult(defaultValue); mHasCallback = true; } } } @Override public void onFailure(int errorCode, String message) { TaskRunner.getBackHandler().removeCallbacks(runnable); if (!mHasCallback) { SALog.i(TAG, "onFailure and return default value: " + defaultValue); callBack.onResult(defaultValue); mHasCallback = true; } } }); } void requestExperiments(final IApiCallback<String> callBack) { requestExperiments(null, callBack); } void requestExperiments(JSONObject object, final IApiCallback<String> callBack) { String url = null, key = null; SensorsABTestConfigOptions configOptions = SensorsABTest.shareInstance().getConfigOptions(); if (configOptions != null) { String serverUrl = configOptions.getUrl(); url = UrlUtil.getApiBaseUrl(serverUrl); key = UrlUtil.getProjectKey(serverUrl); } if (TextUtils.isEmpty(url)) { SALog.i(TAG, "url is empty and request cancel"); return; } if (TextUtils.isEmpty(key)) { SALog.i(TAG, "key is empty and request cancel"); return; } Map<String, String> headers = new HashMap<>(); headers.put("project-key", key); new RequestHelper.Builder(HttpMethod.POST, url) .header(headers) .jsonData(new ExperimentRequest(object).createRequestBody().toString()) .callback(new HttpCallback.StringCallback() { @Override public void onFailure(final int code, final String errorMessage) { if (callBack != null) { callBack.onFailure(code, errorMessage); } } @Override public void onResponse(String response) { if (callBack != null) { callBack.onSuccess(response); } } @Override public void onAfter() { } }).execute(); } public void requestExperimentsAndUpdateCache() { requestExperimentsAndUpdateCache(null); } void requestExperimentsAndUpdateCache(final IApiCallback<Map<String, Experiment>> callBack) { requestExperiments(new IApiCallback<String>() { @Override public void onSuccess(String s) { try { SALog.i(TAG, String.format("试验返回:response:%s", s)); ConcurrentHashMap<String, Experiment> hashMap = null; JSONObject response = new JSONObject(s); String status = response.optString("status"); if (TextUtils.equals(AppConstants.AB_TEST_SUCCESS, status)) { SALog.i(TAG, String.format("获取试验成功:results:%s", JSONUtils.formatJson(response.toString()))); JSONArray array = response.optJSONArray("results"); JSONObject object = null; if (array != null) { object = new JSONObject(); object.put("experiments", array); object.put("distinct_id", mDistinctId); } JSONObject configs = response.optJSONObject("configs"); SALog.i(TAG, "configs is null? " + (configs == null)); if (configs != null) { SensorsABTestConfigManager.getInstance().setConfigs(configs); if (object != null) { object.put("configs", configs); } } hashMap = SensorsABTestCacheManager.getInstance().loadExperimentsFromCache(object != null ? object.toString() : ""); } else if (TextUtils.equals(AppConstants.AB_TEST_FAILURE, status)) { SALog.i(TAG, String.format("获取试验失败:error_type:%s,error:%s", response.optString("error_type"), response.optString("error"))); } if (callBack != null) { callBack.onSuccess(hashMap); } } catch (Exception e) { SALog.i(TAG, String.format("试验数据解析失败,response :%s!", s)); if (callBack != null) { callBack.onSuccess(null); } } } @Override public void onFailure(int errorCode, String message) { SALog.i(TAG, "onFailure error_code: " + errorCode + ",message: " + message); if (callBack != null) { callBack.onFailure(errorCode, message); } } }); } private class TimeoutRunnable implements Runnable { private T defaultValue; private OnABTestReceivedData<T> onABTestReceivedData; TimeoutRunnable(OnABTestReceivedData<T> onABTestReceivedData, T defaultValue) { this.onABTestReceivedData = onABTestReceivedData; this.defaultValue = defaultValue; } @Override public void run() { if (onABTestReceivedData != null && !mHasCallback) { SALog.i(TAG, "timeout return value: " + defaultValue); SABErrorDispatcher.dispatchSABException(SABErrorEnum.ASYNC_REQUEST_TIMEOUT, defaultValue); onABTestReceivedData.onResult(defaultValue); mHasCallback = true; } } } }
43.267797
235
0.544187
e64d069bc73312fac30211f1942ac49c0f9b8bb4
1,188
/********************************************************************************* * Copyright (c)2020 CEC Health * FILE: CS3ClientInterface * 版本 DATE BY REMARKS * ---- ----------- --------------- ------------------------------------------ * 1.0 2020-01-16 xiwu ********************************************************************************/ package cn.intcoder.phr.pacs.dcm4che3.client; import cn.intcoder.phr.pacs.dcm4che3.param.DicomParam; import java.io.File; import java.util.List; /** * non-singleton * @Author: wuxi * @Date: 2019/3/14 */ public interface PacsClientInterface { /** * * @param hostname * @param port * @param aet * @return */ PacsClientInterface init(String hostname, Integer port, String aet); /** * 获取dicom原文件 * @param outputDir 输出目录 * @param keys 查询参数 * @return 返回studyInstanceUID列表 */ List<String> get(File outputDir, DicomParam... keys); /** * 获取dicom原文件 * @param outputDir 输出目录 * @param keys 查询参数 * @return 返回studyInstanceUID列表 */ List<String> getByRest(File outputDir, DicomParam... keys); }
24.244898
82
0.481481
735ecf490958a785e14d12a1ffd5de7c56a7403a
483
package com.ibm.pross.server.app.avpss.exceptions; import com.ibm.pross.server.app.avpss.AlertLog.ErrorCondition; public class StateViolationException extends ErrorConditionException { private static final long serialVersionUID = 3515964453168981538L; public StateViolationException() { super(); } public StateViolationException(String message) { super(message); } @Override public ErrorCondition getErrorCondition() { return ErrorCondition.StateViolation; } }
21
70
0.795031
ce92d1bd29a31c807ad879516395345745709a55
9,716
/* * Copyright 2019 Miroslav Pokorny (github.com/mP1) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package walkingkooka.tree.select; import org.junit.jupiter.api.Test; import walkingkooka.Cast; import walkingkooka.collect.list.Lists; import walkingkooka.naming.StringName; import walkingkooka.tree.TestNode; import walkingkooka.visit.Visiting; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; final public class ChildrenNodeSelectorTest extends AxisNodeSelectorTestCase<ChildrenNodeSelector<TestNode, StringName, StringName, Object>> { @Test public void testChildrenChildless() { this.applyAndCheck(TestNode.with("childless")); } @Test public void testChildrenChildWithParent() { final TestNode child = TestNode.with("child"); final TestNode parent = TestNode.with("parent").setChildren(Lists.of(child)); this.applyAndCheck(parent.child(0)); } @Test public void testChildrenParentWithChild() { final TestNode child = TestNode.with("child"); this.applyAndCheck(TestNode.with("parent of one", child), child); } @Test public void testChildrenManyChildren() { final TestNode child1 = TestNode.with("child1"); final TestNode child2 = TestNode.with("child2"); this.applyAndCheck(TestNode.with("parent of many children", child1, child2), child1, child2); } @Test public void testChildrenIgnoresGrandChild() { final TestNode grandChild = TestNode.with("grandchild"); final TestNode child = TestNode.with("child", grandChild); final TestNode parent = TestNode.with("parent", child); this.applyAndCheck(parent, child); } @Test public void testChildrenIgnoresSiblings() { final TestNode child = TestNode.with("child"); final TestNode parent = TestNode.with("parent", child); this.applyAndCheck(parent, child); } @Test public void testChildrenFilter() { final TestNode child1 = TestNode.with("child1"); final TestNode child2 = TestNode.with("child2"); final TestNode child3 = TestNode.with("child3"); final TestNode parent = TestNode.with("parent", child1, child2, child3); this.applyFilterAndCheck(TestNode.relativeNodeSelector().children(), parent, (n) -> !n.name().equals(child2.name()), child1, child3); } @Test public void testDescendantOrSelfChildren() { final TestNode grand1 = TestNode.with("grand1"); final TestNode grand2 = TestNode.with("grand2"); final TestNode child1 = TestNode.with("child1", grand1, grand2); final TestNode grand3 = TestNode.with("grand3"); final TestNode grand4 = TestNode.with("grand4"); final TestNode grand5 = TestNode.with("grand5"); final TestNode child2 = TestNode.with("child2", grand3, grand4, grand5); this.applyAndCheck(TestNode.absoluteNodeSelector().descendantOrSelf().children(), TestNode.with("parent", child1, child2), child1, child2, grand1, grand2, grand3, grand4, grand5); } @Test public void testDescendantOrSelfNamedChildren() { TestNode.disableUniqueNameChecks(); final TestNode grand1 = TestNode.with("grand1"); final TestNode grand2 = TestNode.with("grand2"); final TestNode child1 = TestNode.with("child", grand1, grand2); final TestNode grand3 = TestNode.with("grand3"); final TestNode grand4 = TestNode.with("grand4"); final TestNode grand5 = TestNode.with("grand5"); final TestNode child3 = TestNode.with("child", grand3, grand4, grand5); this.applyAndCheck(TestNode.absoluteNodeSelector().descendantOrSelf().named(child1.name()).children(), TestNode.with("parent", child1, TestNode.with("skip", TestNode.with("skip2")), child3), grand1, grand2, grand3, grand4, grand5); } @Test public void testChildrenMapWithoutChildren() { this.acceptMapAndCheck(TestNode.with("without-children")); } @Test public final void testChildrenFinishedTrue2() { this.applyFinisherAndCheck(this.createSelector(), TestNode.with("parent", TestNode.with("child")), () -> true); } @Test public final void testChildrenFinishedCountdown() { final TestNode child1 = TestNode.with("child1"); final TestNode child2 = TestNode.with("child2"); final TestNode parent = TestNode.with("parent", child1, child2); this.applyFinisherAndCheck(this.createSelector(), parent, 1, child1); } @Test public final void testChildrenFinishedCountdown2() { final TestNode child1 = TestNode.with("child1"); final TestNode child2 = TestNode.with("child2"); final TestNode child3 = TestNode.with("child3"); final TestNode parent = TestNode.with("parent", child1, child2, child3); this.applyFinisherAndCheck(this.createSelector(), parent, 2, child1, child2); } @Test public void testChildrenMap() { final TestNode grandParent = TestNode.with("grand", TestNode.with("parent1", TestNode.with("child1"), TestNode.with("child2")), TestNode.with("parent2", TestNode.with("child3"))); TestNode.clear(); this.acceptMapAndCheck(grandParent.child(0), TestNode.with("grand", TestNode.with("parent1", TestNode.with("child1*0"), TestNode.with("child2*1")), TestNode.with("parent2", TestNode.with("child3"))) .child(0)); } @Test public void testChildrenMap2() { final TestNode grandParent = TestNode.with("grand", TestNode.with("parent1", TestNode.with("child1"), TestNode.with("child2")), TestNode.with("parent2", TestNode.with("child3"))); TestNode.clear(); this.acceptMapAndCheck(grandParent, TestNode.with("grand", TestNode.with("parent1*0", TestNode.with("child1"), TestNode.with("child2")), TestNode.with("parent2*1", TestNode.with("child3")))); } // NodeSelectorVisitor............................................................................................ @Test public void testAccept() { final StringBuilder b = new StringBuilder(); final List<NodeSelector> visited = Lists.array(); final ChildrenNodeSelector<TestNode, StringName, StringName, Object> selector = this.createSelector(); final NodeSelector<TestNode, StringName, StringName, Object> next = selector.next; new FakeNodeSelectorVisitor<TestNode, StringName, StringName, Object>() { @Override protected Visiting startVisit(final NodeSelector<TestNode, StringName, StringName, Object> s) { b.append("1"); visited.add(s); return Visiting.CONTINUE; } @Override protected void endVisit(final NodeSelector<TestNode, StringName, StringName, Object> s) { b.append("2"); visited.add(s); } @Override protected Visiting startVisitChildren(final NodeSelector<TestNode, StringName, StringName, Object> s) { assertSame(selector, s, "selector"); b.append("3"); visited.add(s); return Visiting.CONTINUE; } @Override protected void endVisitChildren(final NodeSelector<TestNode, StringName, StringName, Object> s) { assertSame(selector, s, "selector"); b.append("4"); visited.add(s); } @Override protected void visitTerminal(final NodeSelector<TestNode, StringName, StringName, Object> s) { assertSame(next, s); b.append("5"); visited.add(s); } }.accept(selector); assertEquals("1315242", b.toString()); assertEquals(Lists.of(selector, selector, next, next, next, selector, selector), visited, "visited"); } // toString.................................................................................................... @Test public void testToString() { this.toStringAndCheck(this.createSelector(), "child::*"); } @Override ChildrenNodeSelector<TestNode, StringName, StringName, Object> createSelector() { return ChildrenNodeSelector.get(); } @Override public Class<ChildrenNodeSelector<TestNode, StringName, StringName, Object>> type() { return Cast.to(ChildrenNodeSelector.class); } }
35.985185
118
0.604981
2770ad73ec0fbad9e0dc12bece927e55402575b3
2,303
package com.limpygnome.parrot.library.crypto; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @RunWith(MockitoJUnitRunner.class) public class EncryptedAesValueTest { private static final long LAST_MODIFIED = 123; private static final byte[] IV = { 0x11, 0x11, 0x44 }; private static final byte[] VALUE = { 0x55, 0x44, 0x33 }; // SUT private EncryptedAesValue encryptedAesValue; @Before public void setup() { encryptedAesValue = new EncryptedAesValue(LAST_MODIFIED, IV, VALUE); } @Test public void getIv_isReflected() { // When byte[] iv = encryptedAesValue.getIv(); // Then assertEquals("IV should be same as passed in", IV, iv); } @Test public void getValue_isReflected() { // When byte[] value = encryptedAesValue.getValue(); // Then assertEquals("Value should be same as passed in", VALUE, value); } @Test public void clone_asExpected() { // When EncryptedAesValue clone = (EncryptedAesValue) encryptedAesValue.clone(); // Then assertEquals("Identifier should be same", encryptedAesValue.getUuid(), clone.getUuid()); assertArrayEquals("IV should be same", IV, clone.getIv()); assertArrayEquals("Value should be same", VALUE, clone.getValue()); } @Test public void equals_isTrueWhenSame() { // Given EncryptedAesValue similar = new EncryptedAesValue(LAST_MODIFIED, IV, VALUE); // When boolean isEqual = similar.equals(encryptedAesValue); // Then assertTrue("Should be equal as same params passed in", isEqual); } @Test public void equals_isFalseWhenDifferent() { // Given EncryptedAesValue similar = new EncryptedAesValue(LAST_MODIFIED, null, null); // When boolean isEqual = similar.equals(encryptedAesValue); // Then assertFalse("Should be equal as same params passed in", isEqual); } }
26.170455
96
0.656535
6c0a154b8555a8653aea56e82350752a357f1be2
49,626
package com.twilio.video.quickstart.activity; import android.Manifest; import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.media.AudioAttributes; import android.media.AudioFocusRequest; import android.media.AudioManager; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import androidx.annotation.NonNull; import com.facebook.react.bridge.ReactApplicationContext; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.koushikdutta.ion.Ion; import com.twilio.video.AudioCodec; import com.twilio.video.CameraCapturer; import com.twilio.video.CameraCapturer.CameraSource; import com.twilio.video.ConnectOptions; import com.twilio.video.EncodingParameters; import com.twilio.video.G722Codec; import com.twilio.video.H264Codec; import com.twilio.video.IsacCodec; import com.twilio.video.LocalAudioTrack; import com.twilio.video.LocalParticipant; import com.twilio.video.LocalVideoTrack; import com.twilio.video.OpusCodec; import com.twilio.video.PcmaCodec; import com.twilio.video.PcmuCodec; import com.twilio.video.RemoteAudioTrack; import com.twilio.video.RemoteAudioTrackPublication; import com.twilio.video.RemoteDataTrack; import com.twilio.video.RemoteDataTrackPublication; import com.twilio.video.RemoteParticipant; import com.twilio.video.RemoteVideoTrack; import com.twilio.video.RemoteVideoTrackPublication; import com.twilio.video.Room; import com.twilio.video.TwilioException; import com.twilio.video.Video; import com.twilio.video.VideoCodec; import com.twilio.video.VideoRenderer; import com.twilio.video.VideoTrack; import com.twilio.video.VideoView; import com.twilio.video.Vp8Codec; import com.twilio.video.Vp9Codec; import com.twilio.video.quickstart.BuildConfig; import com.twilio.video.quickstart.R; import com.twilio.video.quickstart.dialog.Dialog; import com.twilio.video.quickstart.model.RetroToken; import com.twilio.video.quickstart.network.GetDataService; import com.twilio.video.quickstart.network.RetrofitClientInstance; import com.twilio.video.quickstart.util.CameraCapturerCompat; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.UUID; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import static com.twilio.video.quickstart.R.drawable.ic_phonelink_ring_white_24dp; import static com.twilio.video.quickstart.R.drawable.ic_volume_up_white_24dp; public class VideoActivity extends AppCompatActivity { private static final int CAMERA_MIC_PERMISSION_REQUEST_CODE = 1; private static final String TAG = "VideoActivity"; /* * Audio and video tracks can be created with names. This feature is useful for categorizing * tracks of participants. For example, if one participant publishes a video track with * ScreenCapturer and CameraCapturer with the names "screen" and "camera" respectively then * other participants can use RemoteVideoTrack#getName to determine which video track is * produced from the other participant's screen or camera. */ private static final String LOCAL_AUDIO_TRACK_NAME = "mic"; private static final String LOCAL_VIDEO_TRACK_NAME = "camera"; /* * You must provide a Twilio Access Token to connect to the Video service */ private static final String TWILIO_ACCESS_TOKEN = BuildConfig.TWILIO_ACCESS_TOKEN; private static final String ACCESS_TOKEN_SERVER = BuildConfig.TWILIO_ACCESS_TOKEN_SERVER; /* * Access token used to connect. This field will be set either from the console generated token * or the request to the token server. */ private String accessToken; /* * A Room represents communication between a local participant and one or more participants. */ private Room room; private LocalParticipant localParticipant; /* * AudioCodec and VideoCodec represent the preferred codec for encoding and decoding audio and * video. */ private AudioCodec audioCodec; private VideoCodec videoCodec; /* * Encoding parameters represent the sender side bandwidth constraints. */ private EncodingParameters encodingParameters; /* * A VideoView receives frames from a local or remote video track and renders them * to an associated view. */ private VideoView primaryVideoView; private VideoView thumbnailVideoView; /* * Android shared preferences used for settings */ private SharedPreferences preferences; /* * Android application UI elements */ private CameraCapturerCompat cameraCapturerCompat; private LocalAudioTrack localAudioTrack; private LocalVideoTrack localVideoTrack; private FloatingActionButton connectActionFab; private FloatingActionButton switchCameraActionFab; private FloatingActionButton localVideoActionFab; private FloatingActionButton muteActionFab; private ProgressBar reconnectingProgressBar; private AlertDialog connectDialog; private AudioManager audioManager; private String remoteParticipantIdentity; private MenuItem turnSpeakerOnMenuItem; private MenuItem turnSpeakerOffMenuItem; private int previousAudioMode; private boolean previousMicrophoneMute; private VideoRenderer localVideoView; private boolean disconnectedFromOnDestroy; private boolean isSpeakerPhoneEnabled = true; private boolean enableAutomaticSubscription; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video); primaryVideoView = findViewById(R.id.primary_video_view); thumbnailVideoView = findViewById(R.id.thumbnail_video_view); reconnectingProgressBar = findViewById(R.id.reconnecting_progress_bar); connectActionFab = findViewById(R.id.connect_action_fab); switchCameraActionFab = findViewById(R.id.switch_camera_action_fab); localVideoActionFab = findViewById(R.id.local_video_action_fab); muteActionFab = findViewById(R.id.mute_action_fab); Button btnButton = findViewById(R.id.button); btnButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(VideoActivity.this, RNActivity.class); startActivity(intent); } }); /* * Get shared preferences to read settings */ preferences = PreferenceManager.getDefaultSharedPreferences(this); /* * Enable changing the volume using the up/down keys during a conversation */ setVolumeControlStream(AudioManager.STREAM_VOICE_CALL); /* * Needed for setting/abandoning audio focus during call */ audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audioManager.setSpeakerphoneOn(isSpeakerPhoneEnabled); /* * Check camera and microphone permissions. Needed in Android M. */ if (!checkPermissionForCameraAndMicrophone()) { requestPermissionForCameraAndMicrophone(); } else { createAudioAndVideoTracks(); setAccessToken(); } /* * Set the initial state of the UI */ intializeUI(); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_video_activity, menu); turnSpeakerOnMenuItem = menu.findItem(R.id.menu_turn_speaker_on); turnSpeakerOffMenuItem = menu.findItem(R.id.menu_turn_speaker_off); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_settings: startActivity(new Intent(this, SettingsActivity.class)); return true; case R.id.menu_turn_speaker_on: case R.id.menu_turn_speaker_off: boolean expectedSpeakerPhoneState = !audioManager.isSpeakerphoneOn(); audioManager.setSpeakerphoneOn(expectedSpeakerPhoneState); turnSpeakerOffMenuItem.setVisible(expectedSpeakerPhoneState); turnSpeakerOnMenuItem.setVisible(!expectedSpeakerPhoneState); isSpeakerPhoneEnabled = expectedSpeakerPhoneState; return true; default: return false; } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == CAMERA_MIC_PERMISSION_REQUEST_CODE) { boolean cameraAndMicPermissionGranted = true; for (int grantResult : grantResults) { cameraAndMicPermissionGranted &= grantResult == PackageManager.PERMISSION_GRANTED; } if (cameraAndMicPermissionGranted) { createAudioAndVideoTracks(); setAccessToken(); } else { Toast.makeText(this, R.string.permissions_needed, Toast.LENGTH_LONG).show(); } } } @SuppressLint("SetTextI18n") @Override protected void onResume() { super.onResume(); /* * Update preferred audio and video codec in case changed in settings */ audioCodec = getAudioCodecPreference(SettingsActivity.PREF_AUDIO_CODEC, SettingsActivity.PREF_AUDIO_CODEC_DEFAULT); videoCodec = getVideoCodecPreference(SettingsActivity.PREF_VIDEO_CODEC, SettingsActivity.PREF_VIDEO_CODEC_DEFAULT); enableAutomaticSubscription = getAutomaticSubscriptionPreference(SettingsActivity.PREF_ENABLE_AUTOMATIC_SUBSCRIPTION, SettingsActivity.PREF_ENABLE_AUTOMATIC_SUBSCRIPTION_DEFAULT); /* * Get latest encoding parameters */ final EncodingParameters newEncodingParameters = getEncodingParameters(); /* * If the local video track was released when the app was put in the background, recreate. */ if (localVideoTrack == null && checkPermissionForCameraAndMicrophone()) { localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturerCompat.getVideoCapturer(), LOCAL_VIDEO_TRACK_NAME); localVideoTrack.addRenderer(localVideoView); /* * If connected to a Room then share the local video track. */ if (localParticipant != null) { localParticipant.publishTrack(localVideoTrack); /* * Update encoding parameters if they have changed. */ if (!newEncodingParameters.equals(encodingParameters)) { localParticipant.setEncodingParameters(newEncodingParameters); } } } /* * Update encoding parameters */ encodingParameters = newEncodingParameters; /* * Route audio through cached value. */ audioManager.setSpeakerphoneOn(isSpeakerPhoneEnabled); /* * Update reconnecting UI */ if (room != null) { reconnectingProgressBar.setVisibility((room.getState() != Room.State.RECONNECTING) ? View.GONE : View.VISIBLE); } } @Override protected void onPause() { /* * Release the local video track before going in the background. This ensures that the * camera can be used by other applications while this app is in the background. */ if (localVideoTrack != null) { /* * If this local video track is being shared in a Room, unpublish from room before * releasing the video track. Participants will be notified that the track has been * unpublished. */ if (localParticipant != null) { localParticipant.unpublishTrack(localVideoTrack); } localVideoTrack.release(); localVideoTrack = null; } super.onPause(); } @Override protected void onDestroy() { /* * Always disconnect from the room before leaving the Activity to * ensure any memory allocated to the Room resource is freed. */ if (room != null && room.getState() != Room.State.DISCONNECTED) { room.disconnect(); disconnectedFromOnDestroy = true; } /* * Release the local audio and video tracks ensuring any memory allocated to audio * or video is freed. */ if (localAudioTrack != null) { localAudioTrack.release(); localAudioTrack = null; } if (localVideoTrack != null) { localVideoTrack.release(); localVideoTrack = null; } super.onDestroy(); } private boolean checkPermissionForCameraAndMicrophone() { int resultCamera = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA); int resultMic = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO); return resultCamera == PackageManager.PERMISSION_GRANTED && resultMic == PackageManager.PERMISSION_GRANTED; } private void requestPermissionForCameraAndMicrophone() { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.RECORD_AUDIO)) { Toast.makeText(this, R.string.permissions_needed, Toast.LENGTH_LONG).show(); } else { ActivityCompat.requestPermissions( this, new String[]{Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}, CAMERA_MIC_PERMISSION_REQUEST_CODE); } } private void createAudioAndVideoTracks() { // Share your microphone localAudioTrack = LocalAudioTrack.create(this, true, LOCAL_AUDIO_TRACK_NAME); // Share your camera cameraCapturerCompat = new CameraCapturerCompat(this, getAvailableCameraSource()); localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturerCompat.getVideoCapturer(), LOCAL_VIDEO_TRACK_NAME); primaryVideoView.setMirror(true); localVideoTrack.addRenderer(primaryVideoView); localVideoView = primaryVideoView; } private CameraSource getAvailableCameraSource() { return (CameraCapturer.isSourceAvailable(CameraSource.FRONT_CAMERA)) ? (CameraSource.FRONT_CAMERA) : (CameraSource.BACK_CAMERA); } private void setAccessToken() { if (!BuildConfig.USE_TOKEN_SERVER) { /* * OPTION 1 - Generate an access token from the getting started portal * https://www.twilio.com/console/video/dev-tools/testing-tools and add * the variable TWILIO_ACCESS_TOKEN setting it equal to the access token * string in your local.properties file. */ this.accessToken = TWILIO_ACCESS_TOKEN; } else { /* * OPTION 2 - Retrieve an access token from your own web app. * Add the variable ACCESS_TOKEN_SERVER assigning it to the url of your * token server and the variable USE_TOKEN_SERVER=true to your * local.properties file. */ retrieveAccessTokenfromServer(); } } private void connectToRoom(String roomName) { configureAudio(true); ConnectOptions.Builder connectOptionsBuilder = new ConnectOptions.Builder(accessToken) .roomName(roomName); /* * Add local audio track to connect options to share with participants. */ if (localAudioTrack != null) { connectOptionsBuilder .audioTracks(Collections.singletonList(localAudioTrack)); } /* * Add local video track to connect options to share with participants. */ if (localVideoTrack != null) { connectOptionsBuilder.videoTracks(Collections.singletonList(localVideoTrack)); } /* * Set the preferred audio and video codec for media. */ connectOptionsBuilder.preferAudioCodecs(Collections.singletonList(audioCodec)); connectOptionsBuilder.preferVideoCodecs(Collections.singletonList(videoCodec)); /* * Set the sender side encoding parameters. */ connectOptionsBuilder.encodingParameters(encodingParameters); /* * Toggles automatic track subscription. If set to false, the LocalParticipant will receive * notifications of track publish events, but will not automatically subscribe to them. If * set to true, the LocalParticipant will automatically subscribe to tracks as they are * published. If unset, the default is true. Note: This feature is only available for Group * Rooms. Toggling the flag in a P2P room does not modify subscription behavior. */ connectOptionsBuilder.enableAutomaticSubscription(enableAutomaticSubscription); room = Video.connect(this, connectOptionsBuilder.build(), roomListener()); setDisconnectAction(); } /* * The initial state when there is no active room. */ private void intializeUI() { connectActionFab.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_video_call_white_24dp)); connectActionFab.show(); connectActionFab.setOnClickListener(connectActionClickListener()); switchCameraActionFab.show(); switchCameraActionFab.setOnClickListener(switchCameraClickListener()); localVideoActionFab.show(); localVideoActionFab.setOnClickListener(localVideoClickListener()); muteActionFab.show(); muteActionFab.setOnClickListener(muteClickListener()); } /* * Get the preferred audio codec from shared preferences */ private AudioCodec getAudioCodecPreference(String key, String defaultValue) { final String audioCodecName = preferences.getString(key, defaultValue); switch (audioCodecName) { case IsacCodec.NAME: return new IsacCodec(); case OpusCodec.NAME: return new OpusCodec(); case PcmaCodec.NAME: return new PcmaCodec(); case PcmuCodec.NAME: return new PcmuCodec(); case G722Codec.NAME: return new G722Codec(); default: return new OpusCodec(); } } /* * Get the preferred video codec from shared preferences */ private VideoCodec getVideoCodecPreference(String key, String defaultValue) { final String videoCodecName = preferences.getString(key, defaultValue); switch (videoCodecName) { case Vp8Codec.NAME: boolean simulcast = preferences.getBoolean(SettingsActivity.PREF_VP8_SIMULCAST, SettingsActivity.PREF_VP8_SIMULCAST_DEFAULT); return new Vp8Codec(simulcast); case H264Codec.NAME: return new H264Codec(); case Vp9Codec.NAME: return new Vp9Codec(); default: return new Vp8Codec(); } } private boolean getAutomaticSubscriptionPreference(String key, boolean defaultValue) { return preferences.getBoolean(key, defaultValue); } private EncodingParameters getEncodingParameters() { final int maxAudioBitrate = Integer.parseInt( preferences.getString(SettingsActivity.PREF_SENDER_MAX_AUDIO_BITRATE, SettingsActivity.PREF_SENDER_MAX_AUDIO_BITRATE_DEFAULT)); final int maxVideoBitrate = Integer.parseInt( preferences.getString(SettingsActivity.PREF_SENDER_MAX_VIDEO_BITRATE, SettingsActivity.PREF_SENDER_MAX_VIDEO_BITRATE_DEFAULT)); return new EncodingParameters(maxAudioBitrate, maxVideoBitrate); } /* * The actions performed during disconnect. */ private void setDisconnectAction() { connectActionFab.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_call_end_white_24px)); connectActionFab.show(); connectActionFab.setOnClickListener(disconnectClickListener()); } /* * Creates an connect UI dialog */ private void showConnectDialog() { EditText roomEditText = new EditText(this); connectDialog = Dialog.createConnectDialog(roomEditText, connectClickListener(roomEditText), cancelConnectDialogClickListener(), this); connectDialog.show(); } /* * Called when remote participant joins the room */ @SuppressLint("SetTextI18n") private void addRemoteParticipant(RemoteParticipant remoteParticipant) { /* * This app only displays video for one additional participant per Room */ if (thumbnailVideoView.getVisibility() == View.VISIBLE) { Snackbar.make(connectActionFab, "Multiple participants are not currently support in this UI", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); return; } remoteParticipantIdentity = remoteParticipant.getIdentity(); /* * Add remote participant renderer */ if (remoteParticipant.getRemoteVideoTracks().size() > 0) { RemoteVideoTrackPublication remoteVideoTrackPublication = remoteParticipant.getRemoteVideoTracks().get(0); /* * Only render video tracks that are subscribed to */ if (remoteVideoTrackPublication.isTrackSubscribed()) { addRemoteParticipantVideo(remoteVideoTrackPublication.getRemoteVideoTrack()); } } /* * Start listening for participant events */ remoteParticipant.setListener(remoteParticipantListener()); } /* * Set primary view as renderer for participant video track */ private void addRemoteParticipantVideo(VideoTrack videoTrack) { moveLocalVideoToThumbnailView(); primaryVideoView.setMirror(false); videoTrack.addRenderer(primaryVideoView); } private void moveLocalVideoToThumbnailView() { if (thumbnailVideoView.getVisibility() == View.GONE) { thumbnailVideoView.setVisibility(View.VISIBLE); localVideoTrack.removeRenderer(primaryVideoView); localVideoTrack.addRenderer(thumbnailVideoView); localVideoView = thumbnailVideoView; thumbnailVideoView.setMirror(cameraCapturerCompat.getCameraSource() == CameraSource.FRONT_CAMERA); } } /* * Called when remote participant leaves the room */ @SuppressLint("SetTextI18n") private void removeRemoteParticipant(RemoteParticipant remoteParticipant) { if (!remoteParticipant.getIdentity().equals(remoteParticipantIdentity)) { return; } /* * Remove remote participant renderer */ if (!remoteParticipant.getRemoteVideoTracks().isEmpty()) { RemoteVideoTrackPublication remoteVideoTrackPublication = remoteParticipant.getRemoteVideoTracks().get(0); /* * Remove video only if subscribed to participant track */ if (remoteVideoTrackPublication.isTrackSubscribed()) { removeParticipantVideo(remoteVideoTrackPublication.getRemoteVideoTrack()); } } moveLocalVideoToPrimaryView(); } private void removeParticipantVideo(VideoTrack videoTrack) { videoTrack.removeRenderer(primaryVideoView); } private void moveLocalVideoToPrimaryView() { if (thumbnailVideoView.getVisibility() == View.VISIBLE) { thumbnailVideoView.setVisibility(View.GONE); if (localVideoTrack != null) { localVideoTrack.removeRenderer(thumbnailVideoView); localVideoTrack.addRenderer(primaryVideoView); } localVideoView = primaryVideoView; primaryVideoView.setMirror(cameraCapturerCompat.getCameraSource() == CameraSource.FRONT_CAMERA); } } /* * Room events listener */ @SuppressLint("SetTextI18n") private Room.Listener roomListener() { return new Room.Listener() { @Override public void onConnected(Room room) { localParticipant = room.getLocalParticipant(); setTitle(room.getName()); for (RemoteParticipant remoteParticipant : room.getRemoteParticipants()) { addRemoteParticipant(remoteParticipant); break; } } @Override public void onReconnecting(@NonNull Room room, @NonNull TwilioException twilioException) { reconnectingProgressBar.setVisibility(View.VISIBLE); } @Override public void onReconnected(@NonNull Room room) { reconnectingProgressBar.setVisibility(View.GONE); } @Override public void onConnectFailure(Room room, TwilioException e) { configureAudio(false); intializeUI(); } @Override public void onDisconnected(Room room, TwilioException e) { localParticipant = null; reconnectingProgressBar.setVisibility(View.GONE); VideoActivity.this.room = null; // Only reinitialize the UI if disconnect was not called from onDestroy() if (!disconnectedFromOnDestroy) { configureAudio(false); intializeUI(); moveLocalVideoToPrimaryView(); } } @Override public void onParticipantConnected(Room room, RemoteParticipant remoteParticipant) { addRemoteParticipant(remoteParticipant); } @Override public void onParticipantDisconnected(Room room, RemoteParticipant remoteParticipant) { removeRemoteParticipant(remoteParticipant); } @Override public void onRecordingStarted(Room room) { /* * Indicates when media shared to a Room is being recorded. Note that * recording is only available in our Group Rooms developer preview. */ Log.d(TAG, "onRecordingStarted"); } @Override public void onRecordingStopped(Room room) { /* * Indicates when media shared to a Room is no longer being recorded. Note that * recording is only available in our Group Rooms developer preview. */ Log.d(TAG, "onRecordingStopped"); } }; } @SuppressLint("SetTextI18n") private RemoteParticipant.Listener remoteParticipantListener() { return new RemoteParticipant.Listener() { @Override public void onAudioTrackPublished(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication) { Log.i(TAG, String.format("onAudioTrackPublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteAudioTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteAudioTrackPublication.getTrackSid(), remoteAudioTrackPublication.isTrackEnabled(), remoteAudioTrackPublication.isTrackSubscribed(), remoteAudioTrackPublication.getTrackName())); } @Override public void onAudioTrackUnpublished(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication) { Log.i(TAG, String.format("onAudioTrackUnpublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteAudioTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteAudioTrackPublication.getTrackSid(), remoteAudioTrackPublication.isTrackEnabled(), remoteAudioTrackPublication.isTrackSubscribed(), remoteAudioTrackPublication.getTrackName())); } @Override public void onDataTrackPublished(RemoteParticipant remoteParticipant, RemoteDataTrackPublication remoteDataTrackPublication) { Log.i(TAG, String.format("onDataTrackPublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteDataTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteDataTrackPublication.getTrackSid(), remoteDataTrackPublication.isTrackEnabled(), remoteDataTrackPublication.isTrackSubscribed(), remoteDataTrackPublication.getTrackName())); } @Override public void onDataTrackUnpublished(RemoteParticipant remoteParticipant, RemoteDataTrackPublication remoteDataTrackPublication) { Log.i(TAG, String.format("onDataTrackUnpublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteDataTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteDataTrackPublication.getTrackSid(), remoteDataTrackPublication.isTrackEnabled(), remoteDataTrackPublication.isTrackSubscribed(), remoteDataTrackPublication.getTrackName())); } @Override public void onVideoTrackPublished(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication) { Log.i(TAG, String.format("onVideoTrackPublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteVideoTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteVideoTrackPublication.getTrackSid(), remoteVideoTrackPublication.isTrackEnabled(), remoteVideoTrackPublication.isTrackSubscribed(), remoteVideoTrackPublication.getTrackName())); } @Override public void onVideoTrackUnpublished(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication) { Log.i(TAG, String.format("onVideoTrackUnpublished: " + "[RemoteParticipant: identity=%s], " + "[RemoteVideoTrackPublication: sid=%s, enabled=%b, " + "subscribed=%b, name=%s]", remoteParticipant.getIdentity(), remoteVideoTrackPublication.getTrackSid(), remoteVideoTrackPublication.isTrackEnabled(), remoteVideoTrackPublication.isTrackSubscribed(), remoteVideoTrackPublication.getTrackName())); } @Override public void onAudioTrackSubscribed(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication, RemoteAudioTrack remoteAudioTrack) { Log.i(TAG, String.format("onAudioTrackSubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteAudioTrack: enabled=%b, playbackEnabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteAudioTrack.isEnabled(), remoteAudioTrack.isPlaybackEnabled(), remoteAudioTrack.getName())); } @Override public void onAudioTrackUnsubscribed(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication, RemoteAudioTrack remoteAudioTrack) { Log.i(TAG, String.format("onAudioTrackUnsubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteAudioTrack: enabled=%b, playbackEnabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteAudioTrack.isEnabled(), remoteAudioTrack.isPlaybackEnabled(), remoteAudioTrack.getName())); } @Override public void onAudioTrackSubscriptionFailed(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication, TwilioException twilioException) { Log.i(TAG, String.format("onAudioTrackSubscriptionFailed: " + "[RemoteParticipant: identity=%s], " + "[RemoteAudioTrackPublication: sid=%b, name=%s]" + "[TwilioException: code=%d, message=%s]", remoteParticipant.getIdentity(), remoteAudioTrackPublication.getTrackSid(), remoteAudioTrackPublication.getTrackName(), twilioException.getCode(), twilioException.getMessage())); } @Override public void onDataTrackSubscribed(RemoteParticipant remoteParticipant, RemoteDataTrackPublication remoteDataTrackPublication, RemoteDataTrack remoteDataTrack) { Log.i(TAG, String.format("onDataTrackSubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteDataTrack: enabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteDataTrack.isEnabled(), remoteDataTrack.getName())); } @Override public void onDataTrackUnsubscribed(RemoteParticipant remoteParticipant, RemoteDataTrackPublication remoteDataTrackPublication, RemoteDataTrack remoteDataTrack) { Log.i(TAG, String.format("onDataTrackUnsubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteDataTrack: enabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteDataTrack.isEnabled(), remoteDataTrack.getName())); } @Override public void onDataTrackSubscriptionFailed(RemoteParticipant remoteParticipant, RemoteDataTrackPublication remoteDataTrackPublication, TwilioException twilioException) { Log.i(TAG, String.format("onDataTrackSubscriptionFailed: " + "[RemoteParticipant: identity=%s], " + "[RemoteDataTrackPublication: sid=%b, name=%s]" + "[TwilioException: code=%d, message=%s]", remoteParticipant.getIdentity(), remoteDataTrackPublication.getTrackSid(), remoteDataTrackPublication.getTrackName(), twilioException.getCode(), twilioException.getMessage())); } @Override public void onVideoTrackSubscribed(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication, RemoteVideoTrack remoteVideoTrack) { Log.i(TAG, String.format("onVideoTrackSubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteVideoTrack: enabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteVideoTrack.isEnabled(), remoteVideoTrack.getName())); addRemoteParticipantVideo(remoteVideoTrack); } @Override public void onVideoTrackUnsubscribed(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication, RemoteVideoTrack remoteVideoTrack) { Log.i(TAG, String.format("onVideoTrackUnsubscribed: " + "[RemoteParticipant: identity=%s], " + "[RemoteVideoTrack: enabled=%b, name=%s]", remoteParticipant.getIdentity(), remoteVideoTrack.isEnabled(), remoteVideoTrack.getName())); removeParticipantVideo(remoteVideoTrack); } @Override public void onVideoTrackSubscriptionFailed(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication, TwilioException twilioException) { Log.i(TAG, String.format("onVideoTrackSubscriptionFailed: " + "[RemoteParticipant: identity=%s], " + "[RemoteVideoTrackPublication: sid=%b, name=%s]" + "[TwilioException: code=%d, message=%s]", remoteParticipant.getIdentity(), remoteVideoTrackPublication.getTrackSid(), remoteVideoTrackPublication.getTrackName(), twilioException.getCode(), twilioException.getMessage())); Snackbar.make(connectActionFab, String.format("Failed to subscribe to %s video track", remoteParticipant.getIdentity()), Snackbar.LENGTH_LONG) .show(); } @Override public void onAudioTrackEnabled(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication) { } @Override public void onAudioTrackDisabled(RemoteParticipant remoteParticipant, RemoteAudioTrackPublication remoteAudioTrackPublication) { } @Override public void onVideoTrackEnabled(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication) { } @Override public void onVideoTrackDisabled(RemoteParticipant remoteParticipant, RemoteVideoTrackPublication remoteVideoTrackPublication) { } }; } private DialogInterface.OnClickListener connectClickListener(final EditText roomEditText) { return (dialog, which) -> { /* * Connect to room */ connectToRoom(roomEditText.getText().toString()); }; } private View.OnClickListener disconnectClickListener() { return v -> { /* * Disconnect from room */ if (room != null) { room.disconnect(); } intializeUI(); }; } private View.OnClickListener connectActionClickListener() { return v -> showConnectDialog(); } private DialogInterface.OnClickListener cancelConnectDialogClickListener() { return (dialog, which) -> { intializeUI(); connectDialog.dismiss(); }; } private View.OnClickListener switchCameraClickListener() { return v -> { if (cameraCapturerCompat != null) { CameraSource cameraSource = cameraCapturerCompat.getCameraSource(); cameraCapturerCompat.switchCamera(); if (thumbnailVideoView.getVisibility() == View.VISIBLE) { thumbnailVideoView.setMirror(cameraSource == CameraSource.BACK_CAMERA); } else { primaryVideoView.setMirror(cameraSource == CameraSource.BACK_CAMERA); } } }; } private View.OnClickListener localVideoClickListener() { return v -> { /* * Enable/disable the local video track */ if (localVideoTrack != null) { boolean enable = !localVideoTrack.isEnabled(); localVideoTrack.enable(enable); int icon; if (enable) { icon = R.drawable.ic_videocam_white_24dp; switchCameraActionFab.show(); } else { icon = R.drawable.ic_videocam_off_black_24dp; switchCameraActionFab.hide(); } localVideoActionFab.setImageDrawable( ContextCompat.getDrawable(VideoActivity.this, icon)); } }; } private View.OnClickListener muteClickListener() { return v -> { /* * Enable/disable the local audio track. The results of this operation are * signaled to other Participants in the same Room. When an audio track is * disabled, the audio is muted. */ if (localAudioTrack != null) { boolean enable = !localAudioTrack.isEnabled(); localAudioTrack.enable(enable); int icon = enable ? R.drawable.ic_mic_white_24dp : R.drawable.ic_mic_off_black_24dp; muteActionFab.setImageDrawable(ContextCompat.getDrawable( VideoActivity.this, icon)); } }; } private void retrieveAccessTokenfromServer() { /*Create handle for the RetrofitInstance interface*/ GetDataService service = RetrofitClientInstance.getRetrofitInstance().create(GetDataService.class); Map<String, String> params = new HashMap<String, String>(); params.put("identity", UUID.randomUUID().toString()); Call<RetroToken> call = service.getVideoToken(params); call.enqueue(new Callback<RetroToken>() { @Override public void onResponse(Call<RetroToken> call, Response<RetroToken> response) { VideoActivity.this.accessToken = response.body().getToken(); Log.e("TWILIO Token", VideoActivity.this.accessToken); } @Override public void onFailure(Call<RetroToken> call, Throwable t) { Toast.makeText(VideoActivity.this, R.string.error_retrieving_access_token, Toast.LENGTH_LONG) .show(); } }); // Ion.with(this) // .load(String.format("%s?identity=%s", ACCESS_TOKEN_SERVER, // UUID.randomUUID().toString())) // .asJsonObject() // .setCallback((e, json) -> { // if (e == null) { // VideoActivity.this.accessToken = json.get("token").getAsString(); // } else { // Toast.makeText(VideoActivity.this, // R.string.error_retrieving_access_token, Toast.LENGTH_LONG) // .show(); // } // }); // .asString() // .setCallback((e, token) -> { // if (e == null) { // VideoActivity.this.accessToken = token; // } else { // Toast.makeText(VideoActivity.this, // R.string.error_retrieving_access_token, Toast.LENGTH_LONG) // .show(); // } // }); } private void configureAudio(boolean enable) { if (enable) { previousAudioMode = audioManager.getMode(); // Request audio focus before making any device switch requestAudioFocus(); /* * Use MODE_IN_COMMUNICATION as the default audio mode. It is required * to be in this mode when playout and/or recording starts for the best * possible VoIP performance. Some devices have difficulties with * speaker mode if this is not set. */ audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); /* * Always disable microphone mute during a WebRTC call. */ previousMicrophoneMute = audioManager.isMicrophoneMute(); audioManager.setMicrophoneMute(false); } else { audioManager.setMode(previousAudioMode); audioManager.abandonAudioFocus(null); audioManager.setMicrophoneMute(previousMicrophoneMute); } } private void requestAudioFocus() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { AudioAttributes playbackAttributes = new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION) .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) .build(); AudioFocusRequest focusRequest = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT) .setAudioAttributes(playbackAttributes) .setAcceptsDelayedFocusGain(true) .setOnAudioFocusChangeListener( i -> { }) .build(); audioManager.requestAudioFocus(focusRequest); } else { audioManager.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); } } }
41.949281
125
0.594507
8721fcb2c0574cc564763e6416029c0e7588da8c
1,182
package com.adventofcode.year2018; import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.InputStream; import java.util.Objects; import java.util.Scanner; import static org.assertj.core.api.Assertions.assertThat; class Day06Test { @Test void inputExample() { String input = """ 1, 1 1, 6 8, 3 3, 4 5, 5 8, 9"""; assertThat(Day06.maxArea(new Scanner(input))).isEqualTo(17); assertThat(Day06.region(new Scanner(input), 30)).isEqualTo(16); } @Test void inputPartOne() throws IOException { try (InputStream is = Day06Test.class.getResourceAsStream("/2018/day/6/input"); Scanner scanner = new Scanner(Objects.requireNonNull(is))) { assertThat(Day06.maxArea(scanner)).isEqualTo(4060); } } @Test void inputPartTwo() throws IOException { try (InputStream is = Day06Test.class.getResourceAsStream("/2018/day/6/input"); Scanner scanner = new Scanner(Objects.requireNonNull(is))) { assertThat(Day06.region(scanner, 10000)).isEqualTo(36136); } } }
26.266667
148
0.617597
31c97eb36e20512802f69c3d012ab162e76b2fee
8,541
/* * Copyright 2015-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.cloud.dataflow.server.controller; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.springframework.cloud.dataflow.core.StreamAppDefinition; import org.springframework.cloud.dataflow.core.StreamDefinition; import org.springframework.cloud.dataflow.rest.resource.AppInstanceStatusResource; import org.springframework.cloud.dataflow.rest.resource.AppStatusResource; import org.springframework.cloud.dataflow.server.repository.DeploymentIdRepository; import org.springframework.cloud.dataflow.server.repository.DeploymentKey; import org.springframework.cloud.dataflow.server.repository.StreamDefinitionRepository; import org.springframework.cloud.deployer.spi.app.AppDeployer; import org.springframework.cloud.deployer.spi.app.AppInstanceStatus; import org.springframework.cloud.deployer.spi.app.AppStatus; import org.springframework.data.domain.PageImpl; import org.springframework.data.web.PagedResourcesAssembler; import org.springframework.hateoas.ExposesResourceFor; import org.springframework.hateoas.PagedResources; import org.springframework.hateoas.ResourceAssembler; import org.springframework.hateoas.Resources; import org.springframework.hateoas.mvc.ResourceAssemblerSupport; import org.springframework.http.HttpStatus; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; /** * Exposes runtime status of deployed apps. * * @author Eric Bottard * @author Mark Fisher * @author Janne Valkealahti */ @RestController @RequestMapping("/runtime/apps") @ExposesResourceFor(AppStatusResource.class) public class RuntimeAppsController { private static final Comparator<? super AppInstanceStatus> INSTANCE_SORTER = new Comparator<AppInstanceStatus>() { @Override public int compare(AppInstanceStatus i1, AppInstanceStatus i2) { return i1.getId().compareTo(i2.getId()); } }; /** * The repository this controller will use for stream CRUD operations. */ private final StreamDefinitionRepository streamDefinitionRepository; /** * The repository this controller will use for deployment IDs. */ private final DeploymentIdRepository deploymentIdRepository; /** * The deployer this controller will use to deploy stream apps. */ private final AppDeployer appDeployer; private final ResourceAssembler<AppStatus, AppStatusResource> statusAssembler = new Assembler(); /** * Instantiates a new runtime apps controller. * * @param streamDefinitionRepository the repository this controller will use for stream CRUD operations * @param deploymentIdRepository the repository this controller will use for deployment IDs * @param appDeployer the deployer this controller will use to deploy stream apps */ public RuntimeAppsController(StreamDefinitionRepository streamDefinitionRepository, DeploymentIdRepository deploymentIdRepository, AppDeployer appDeployer) { Assert.notNull(streamDefinitionRepository, "StreamDefinitionRepository must not be null"); Assert.notNull(deploymentIdRepository, "DeploymentIdRepository must not be null"); Assert.notNull(appDeployer, "AppDeployer must not be null"); this.streamDefinitionRepository = streamDefinitionRepository; this.deploymentIdRepository = deploymentIdRepository; this.appDeployer = appDeployer; } @RequestMapping public PagedResources<AppStatusResource> list(PagedResourcesAssembler<AppStatus> assembler) { List<AppStatus> values = new ArrayList<>(); for (StreamDefinition streamDefinition : this.streamDefinitionRepository.findAll()) { for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { String key = DeploymentKey.forStreamAppDefinition(streamAppDefinition); String id = this.deploymentIdRepository.findOne(key); if (id != null) { values.add(appDeployer.status(id)); } } } Collections.sort(values, new Comparator<AppStatus>() { @Override public int compare(AppStatus o1, AppStatus o2) { return o1.getDeploymentId().compareTo(o2.getDeploymentId()); } }); return assembler.toResource(new PageImpl<>(values), statusAssembler); } @RequestMapping("/{id}") public AppStatusResource display(@PathVariable String id) { AppStatus status = appDeployer.status(id); if (status != null) { return statusAssembler.toResource(status); } throw new ResourceNotFoundException(); } private class Assembler extends ResourceAssemblerSupport<AppStatus, AppStatusResource> { public Assembler() { super(RuntimeAppsController.class, AppStatusResource.class); } @Override public AppStatusResource toResource(AppStatus entity) { return createResourceWithId(entity.getDeploymentId(), entity); } @Override protected AppStatusResource instantiateResource(AppStatus entity) { AppStatusResource resource = new AppStatusResource(entity.getDeploymentId(), entity.getState().name()); List<AppInstanceStatusResource> instanceStatusResources = new ArrayList<>(); InstanceAssembler instanceAssembler = new InstanceAssembler(entity); List<AppInstanceStatus> instanceStatuses = new ArrayList<>(entity.getInstances().values()); Collections.sort(instanceStatuses, INSTANCE_SORTER); for (AppInstanceStatus appInstanceStatus : instanceStatuses) { instanceStatusResources.add(instanceAssembler.toResource(appInstanceStatus)); } resource.setInstances(new Resources<>(instanceStatusResources)); return resource; } } @RestController @RequestMapping("/runtime/apps/{appId}/instances") @ExposesResourceFor(AppInstanceStatusResource.class) public static class AppInstanceController { private final AppDeployer appDeployer; public AppInstanceController(AppDeployer appDeployer) { this.appDeployer = appDeployer; } @RequestMapping public PagedResources<AppInstanceStatusResource> list(@PathVariable String appId, PagedResourcesAssembler<AppInstanceStatus> assembler) { AppStatus status = appDeployer.status(appId); if (status != null) { List<AppInstanceStatus> appInstanceStatuses = new ArrayList<>(status.getInstances().values()); Collections.sort(appInstanceStatuses, INSTANCE_SORTER); return assembler.toResource(new PageImpl<>(appInstanceStatuses), new InstanceAssembler(status)); } throw new ResourceNotFoundException(); } @RequestMapping("/{instanceId}") public AppInstanceStatusResource display(@PathVariable String appId, @PathVariable String instanceId) { AppStatus status = appDeployer.status(appId); if (status != null) { AppInstanceStatus appInstanceStatus = status.getInstances().get(instanceId); if (appInstanceStatus == null) { throw new ResourceNotFoundException(); } return new InstanceAssembler(status).toResource(appInstanceStatus); } throw new ResourceNotFoundException(); } } @SuppressWarnings("serial") @ResponseStatus(HttpStatus.NOT_FOUND) private static class ResourceNotFoundException extends RuntimeException { } private static class InstanceAssembler extends ResourceAssemblerSupport<AppInstanceStatus, AppInstanceStatusResource> { private final AppStatus owningApp; public InstanceAssembler(AppStatus owningApp) { super(AppInstanceController.class, AppInstanceStatusResource.class); this.owningApp = owningApp; } @Override public AppInstanceStatusResource toResource(AppInstanceStatus entity) { return createResourceWithId("/" + entity.getId(), entity, owningApp.getDeploymentId().toString()); } @Override protected AppInstanceStatusResource instantiateResource(AppInstanceStatus entity) { return new AppInstanceStatusResource(entity.getId(), entity.getState().name(), entity.getAttributes()); } } }
38.822727
131
0.792296
2d4aa4b616588e0c40e11cfefd6db3fe2b1b8e52
115
// "Convert to ThreadLocal" "true" class X { final ThreadLocal<Integer> i = ThreadLocal.withInitial(() -> 0); }
28.75
68
0.669565
4e3d0acc9c994dde6496f26184136606fccc2b64
1,072
/* * Copyright (c) 2017. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * ajain17 & nverma1 - API , implementation and initial documentation */ package com.intuit.ugc.impl.persistence.dse; import com.google.inject.Inject; import com.intuit.ugc.impl.core.AbstractGraphPersistence; import com.intuit.ugc.impl.core.queryplan.MutationExecutorFactory; import com.intuit.ugc.impl.core.spi.GraphVisitor; /** * represents a DSE Graph Persistence * * is initialized with a {@link com.intuit.ugc.impl.core.spi.GraphVisitor} * instance specific to DSE and a * {@link com.intuit.ugc.impl.core.queryplan.MutationExecutorFactory} * * @author nverma1 * */ public class DSEPersistence extends AbstractGraphPersistence { @Inject public DSEPersistence(GraphVisitor repository, MutationExecutorFactory factory) { super(repository, factory); } }
28.972973
82
0.766791
70d53b6c3fa81f0ec1b49987fb929a5465debfb6
27,740
package jp.swest.ledcamp.setting; import com.google.common.base.Objects; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.io.File; import java.util.HashSet; import java.util.List; import java.util.function.Consumer; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRootPane; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; import jp.swest.ledcamp.setting.GenerateSetting; import jp.swest.ledcamp.setting.SettingManager; import jp.swest.ledcamp.setting.TemplateEngine; import jp.swest.ledcamp.setting.TemplateMap; import jp.swest.ledcamp.setting.TemplateType; import jp.swest.ledcamp.setting.TextBinding; import org.eclipse.xtend.lib.annotations.Accessors; import org.eclipse.xtext.xbase.lib.Conversions; import org.eclipse.xtext.xbase.lib.Functions.Function1; import org.eclipse.xtext.xbase.lib.IterableExtensions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.StringExtensions; @SuppressWarnings("all") public class SettingDialog extends JDialog { public static class TemplatePanel extends JPanel { private SettingDialog settingDialog; private TemplateMap map; private JComboBox<TemplateType> comboType; private JPanel cardPane; private CardLayout typeCardLayout; private JTextField templateFile_G; private JTextField templateFile_D; private JTextField templateFile_S; private JTextField fileName; private JTextField fileExtension_D; private JTextField fileExtension_S; private JTextField stereotype; public TemplatePanel(final SettingDialog settingDialog, final TemplateMap map) { this.settingDialog = settingDialog; this.map = map; this.initComponent(settingDialog); TemplateType _templateType = map.getTemplateType(); boolean _tripleNotEquals = (_templateType != null); if (_tripleNotEquals) { this.comboType.setSelectedItem(map.getTemplateType()); } else { this.comboType.setSelectedItem(TemplateType.Default); } TemplateType _templateType_1 = map.getTemplateType(); if (_templateType_1 != null) { switch (_templateType_1) { case Global: this.setField(this.templateFile_G, map.getTemplateFile()); this.setField(this.fileName, map.getFileName()); break; case Default: this.setField(this.templateFile_D, map.getTemplateFile()); this.setField(this.fileExtension_D, map.getFileExtension()); break; case Stereotype: this.setField(this.templateFile_S, map.getTemplateFile()); this.setField(this.fileExtension_S, map.getFileExtension()); this.setField(this.stereotype, map.getStereotype()); break; default: { this.setField(this.templateFile_D, map.getTemplateFile()); this.setField(this.fileExtension_D, map.getFileExtension()); } break; } } else { { this.setField(this.templateFile_D, map.getTemplateFile()); this.setField(this.fileExtension_D, map.getFileExtension()); } } } @Override public Dimension getPreferredSize() { return new Dimension((this.settingDialog.templatePanel.getSize().width - 10), 30); } @Override public Dimension getMaximumSize() { return new Dimension(this.settingDialog.templatePanel.getSize().width, 30); } @Override public Dimension getMinimumSize() { JPanel _templatePanel = null; if (this.settingDialog!=null) { _templatePanel=this.settingDialog.templatePanel; } Dimension _size = null; if (_templatePanel!=null) { _size=_templatePanel.getSize(); } return new Dimension(_size.width, 30); } public void initComponent(final SettingDialog settingDialog) { BorderLayout _borderLayout = new BorderLayout(); this.setLayout(_borderLayout); { JComboBox<TemplateType> _jComboBox = new JComboBox<TemplateType>(); this.comboType = _jComboBox; CardLayout _cardLayout = new CardLayout(); this.typeCardLayout = _cardLayout; final Consumer<TemplateType> _function = (TemplateType it) -> { this.comboType.addItem(it); }; ((List<TemplateType>)Conversions.doWrapArray(TemplateType.values())).forEach(_function); final ActionListener _function_1 = (ActionEvent it) -> { int _selectedIndex = this.comboType.getSelectedIndex(); boolean _notEquals = (_selectedIndex != (-1)); if (_notEquals) { final TemplateType item = this.comboType.getItemAt(this.comboType.getSelectedIndex()); this.typeCardLayout.show(this.cardPane, item.name()); this.map.setTemplateType(item); } }; this.comboType.addActionListener(_function_1); this.add(this.comboType, BorderLayout.WEST); } { JPanel _jPanel = new JPanel(); this.cardPane = _jPanel; this.cardPane.setLayout(this.typeCardLayout); this.add(this.cardPane, BorderLayout.CENTER); { final JPanel globalCard = new JPanel(); GridLayout _gridLayout = new GridLayout(1, 2); globalCard.setLayout(_gridLayout); this.cardPane.add(globalCard, TemplateType.Global.name()); { JTextField _jTextField = new JTextField("file name"); this.fileName = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setFileName(it); }; new TextBinding(this.fileName, _function); this.fileName.setForeground(Color.GRAY); this.fileName.addFocusListener(this.clearField(this.fileName)); globalCard.add(this.fileName); } { JTextField _jTextField = new JTextField("template file path"); this.templateFile_G = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setTemplateFile(it); }; new TextBinding(this.templateFile_G, _function); this.templateFile_G.setForeground(Color.GRAY); this.templateFile_G.addFocusListener( this.browseFile(settingDialog.textTemplateDir.getText(), this.templateFile_G)); globalCard.add(this.templateFile_G); } } { final JPanel defaultCard = new JPanel(); GridLayout _gridLayout = new GridLayout(1, 2); defaultCard.setLayout(_gridLayout); this.cardPane.add(defaultCard, TemplateType.Default.name()); { JTextField _jTextField = new JTextField("file extension"); this.fileExtension_D = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setFileExtension(it); }; new TextBinding(this.fileExtension_D, _function); this.fileExtension_D.setForeground(Color.GRAY); this.fileExtension_D.addFocusListener(this.clearField(this.fileExtension_D)); defaultCard.add(this.fileExtension_D); } { JTextField _jTextField = new JTextField("template file path"); this.templateFile_D = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setTemplateFile(it); }; new TextBinding(this.templateFile_D, _function); this.templateFile_D.setForeground(Color.GRAY); this.templateFile_D.addFocusListener( this.browseFile(settingDialog.textTemplateDir.getText(), this.templateFile_D)); defaultCard.add(this.templateFile_D); } } { final JPanel stereotypeCard = new JPanel(); GridLayout _gridLayout = new GridLayout(1, 3); stereotypeCard.setLayout(_gridLayout); this.cardPane.add(stereotypeCard, TemplateType.Stereotype.name()); { JTextField _jTextField = new JTextField("stereotype"); this.stereotype = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setStereotype(it); }; new TextBinding(this.stereotype, _function); this.stereotype.setForeground(Color.GRAY); this.stereotype.addFocusListener(this.clearField(this.stereotype)); stereotypeCard.add(this.stereotype); } { JTextField _jTextField = new JTextField("file extension"); this.fileExtension_S = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setFileExtension(it); }; new TextBinding(this.fileExtension_S, _function); this.fileExtension_S.setForeground(Color.GRAY); this.fileExtension_S.addFocusListener(this.clearField(this.fileExtension_S)); stereotypeCard.add(this.fileExtension_S); } { JTextField _jTextField = new JTextField("template file path"); this.templateFile_S = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.map.setTemplateFile(it); }; new TextBinding(this.templateFile_S, _function); this.templateFile_S.setForeground(Color.GRAY); this.templateFile_S.addFocusListener( this.browseFile(settingDialog.textTemplateDir.getText(), this.templateFile_S)); stereotypeCard.add(this.templateFile_S); } } } { final JButton btnRemove = new JButton("x"); final SettingDialog.TemplatePanel thisPanel = this; final ActionListener _function = (ActionEvent it) -> { final Container owner = thisPanel.getParent(); settingDialog.manager.getCurrentSetting().getMapping().remove(thisPanel.map); owner.remove(thisPanel); owner.revalidate(); owner.repaint(); }; btnRemove.addActionListener(_function); this.add(btnRemove, BorderLayout.EAST); } } private void setField(final JTextField field, final String text) { boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(text); boolean _not = (!_isNullOrEmpty); if (_not) { field.setText(text); field.setForeground(Color.BLACK); } } private FocusAdapter browseFile(final String path, final JTextField field) { abstract class __TemplatePanel_1 extends FocusAdapter { boolean first; } return new __TemplatePanel_1() { { first = true; } @Override public void focusGained(final FocusEvent e) { if (this.first) { final JFileChooser fileChooser = new JFileChooser(); String _text = field.getText(); String _plus = ((path + "/") + _text); final File file = new File(_plus); final File dir = new File(path); boolean _exists = file.exists(); if (_exists) { fileChooser.setCurrentDirectory(file); } else { boolean _exists_1 = dir.exists(); if (_exists_1) { fileChooser.setCurrentDirectory(dir); } } int _showOpenDialog = fileChooser.showOpenDialog(TemplatePanel.this.getParent()); boolean _equals = (JFileChooser.APPROVE_OPTION == _showOpenDialog); if (_equals) { field.setText(fileChooser.getSelectedFile().getName()); field.setForeground(Color.BLACK); } this.first = false; } } @Override public void focusLost(final FocusEvent arg0) { this.first = true; } }; } private FocusAdapter clearField(final JTextField field) { return new FocusAdapter() { @Override public void focusGained(final FocusEvent arg0) { Color _foreground = field.getForeground(); boolean _notEquals = (!Objects.equal(_foreground, Color.BLACK)); if (_notEquals) { field.setForeground(Color.BLACK); field.setText(""); } } @Override public void focusLost(final FocusEvent arg0) { } }; } } private SettingManager manager = SettingManager.getInstance(); private JPanel contentPanel = new JPanel(); private JComboBox<String> combo_templateSet; private JTextField textDestinationPath; private JComboBox<TemplateEngine> combo_templateEngine; private JButton btnAddSet; @Accessors private JTextField textTemplateDir; @Accessors private JPanel templatePanel; public SettingDialog(final JFrame parent) { super(parent, "Generator Settings", true); this.initComponent(); } private void initComponent() { this.setBounds(100, 100, 800, 600); final Container root = this.getContentPane(); BorderLayout _borderLayout = new BorderLayout(); root.setLayout(_borderLayout); EmptyBorder _emptyBorder = new EmptyBorder(5, 5, 5, 5); this.contentPanel.setBorder(_emptyBorder); root.add(this.contentPanel, BorderLayout.CENTER); final GridBagLayout gbl = new GridBagLayout(); gbl.columnWeights = new double[] { 0, 0, 0, 0 }; gbl.columnWeights = new double[] { 0.0, 1.0, 0.0, Double.MIN_VALUE }; gbl.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0 }; gbl.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE }; this.contentPanel.setLayout(gbl); final Insets insets = new Insets(0, 0, 5, 5); { JComboBox<String> _jComboBox = new JComboBox<String>(); this.combo_templateSet = _jComboBox; final Consumer<String> _function = (String it) -> { this.combo_templateSet.addItem(it); }; this.manager.keySet().forEach(_function); int _itemCount = this.combo_templateSet.getItemCount(); boolean _equals = (_itemCount == 0); if (_equals) { this.disableAll(); } GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.ABOVE_BASELINE; gbc.insets = insets; gbc.gridx = 0; gbc.gridy = 0; this.contentPanel.add(this.combo_templateSet, gbc); } { JPanel paneButton = new JPanel(); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.insets = insets; gbc.anchor = GridBagConstraints.WEST; this.contentPanel.add(paneButton, gbc); { JButton _jButton = new JButton("Add"); this.btnAddSet = _jButton; final ActionListener _function = (ActionEvent it) -> { final String setName = JOptionPane.showInputDialog(this, "please input templateSet name"); if ((setName != null)) { final GenerateSetting generateSetting = new GenerateSetting(); this.manager.put(setName, generateSetting); this.manager.setCurrentSetting(generateSetting); GenerateSetting _currentSetting = this.manager.getCurrentSetting(); _currentSetting.setTemplateID(setName); this.combo_templateSet.addItem(setName); this.combo_templateSet.setSelectedItem(setName); this.enableAll(); } }; this.btnAddSet.addActionListener(_function); GridBagConstraints _gridBagConstraints = new GridBagConstraints(); gbc = _gridBagConstraints; gbc.anchor = GridBagConstraints.WEST; gbc.insets = insets; gbc.gridx = 1; gbc.gridy = 0; paneButton.add(this.btnAddSet, gbc); } { final JButton btnRemoveSet = new JButton("Remove"); final ActionListener _function = (ActionEvent it) -> { final Object selectedSet = this.combo_templateSet.getSelectedItem(); this.combo_templateSet.removeItem(selectedSet); this.manager.remove(selectedSet); final Object afterSelectedItem = this.combo_templateSet.getSelectedItem(); if ((afterSelectedItem != null)) { this.manager.setCurrentSetting(this.manager.get(this.combo_templateSet.getSelectedItem())); } else { this.manager.setCurrentSetting(null); this.disableAll(); } }; btnRemoveSet.addActionListener(_function); GridBagConstraints _gridBagConstraints = new GridBagConstraints(); gbc = _gridBagConstraints; gbc.anchor = GridBagConstraints.WEST; gbc.insets = insets; gbc.gridx = 2; gbc.gridy = 0; paneButton.add(btnRemoveSet, gbc); } } { final JLabel lblTemplateEngine = new JLabel("Template Engine"); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.EAST; Insets _insets = new Insets(0, 10, 5, 10); gbc.insets = _insets; gbc.gridx = 0; gbc.gridy = 1; this.contentPanel.add(lblTemplateEngine, gbc); } { JComboBox<TemplateEngine> _jComboBox = new JComboBox<TemplateEngine>(); this.combo_templateEngine = _jComboBox; final Consumer<TemplateEngine> _function = (TemplateEngine it) -> { this.combo_templateEngine.addItem(it); }; ((List<TemplateEngine>)Conversions.doWrapArray(TemplateEngine.values())).forEach(_function); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.WEST; Insets _insets = new Insets(0, 10, 5, 10); gbc.insets = _insets; gbc.gridx = 1; gbc.gridy = 1; this.contentPanel.add(this.combo_templateEngine, gbc); } { final JLabel lblTemplateDir = new JLabel("Template Dir"); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.EAST; Insets _insets = new Insets(0, 10, 5, 10); gbc.insets = _insets; gbc.gridx = 0; gbc.gridy = 2; this.contentPanel.add(lblTemplateDir, gbc); } { JTextField _jTextField = new JTextField(); this.textTemplateDir = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.manager.getCurrentSetting().setTemplatePath(it); }; new TextBinding(this.textTemplateDir, _function); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = insets; gbc.gridx = 1; gbc.gridy = 2; this.contentPanel.add(this.textTemplateDir, gbc); } { final JButton btnTempDirBrowse = new JButton("..."); final ActionListener _function = (ActionEvent it) -> { String _property = System.getProperty("user.home"); String _plus = (_property + "/.astah/plugins/m2t/"); this.browseDirectory(_plus, this.textTemplateDir); }; btnTempDirBrowse.addActionListener(_function); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = insets; gbc.gridx = 2; gbc.gridy = 2; this.contentPanel.add(btnTempDirBrowse, gbc); } { final JLabel lblDestinationPath = new JLabel("Destination Path"); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.EAST; Insets _insets = new Insets(0, 10, 5, 10); gbc.insets = _insets; gbc.gridx = 0; gbc.gridy = 3; this.contentPanel.add(lblDestinationPath, gbc); } { JTextField _jTextField = new JTextField(); this.textDestinationPath = _jTextField; final jp.swest.ledcamp.xtendhelper.Consumer<String> _function = (String it) -> { this.manager.getCurrentSetting().setTargetPath(it); }; new TextBinding(this.textDestinationPath, _function); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = insets; gbc.gridx = 1; gbc.gridy = 3; this.contentPanel.add(this.textDestinationPath, gbc); } { final JButton btnDestBrowse = new JButton("..."); final ActionListener _function = (ActionEvent it) -> { this.browseDirectory("", this.textDestinationPath); }; btnDestBrowse.addActionListener(_function); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = insets; gbc.gridx = 2; gbc.gridy = 3; this.contentPanel.add(btnDestBrowse, gbc); } { final JScrollPane scrollPane = new JScrollPane(); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.gridwidth = 3; gbc.insets = insets; gbc.gridx = 0; gbc.gridy = 4; this.contentPanel.add(scrollPane, gbc); { JPanel _jPanel = new JPanel(); this.templatePanel = _jPanel; BoxLayout _boxLayout = new BoxLayout(this.templatePanel, BoxLayout.Y_AXIS); this.templatePanel.setLayout(_boxLayout); scrollPane.setViewportView(this.templatePanel); } } { final JButton btnAddTemplate = new JButton("Add template"); final ActionListener _function = (ActionEvent it) -> { final TemplateMap map = new TemplateMap(); final SettingDialog.TemplatePanel template = new SettingDialog.TemplatePanel(this, map); this.manager.getCurrentSetting().getMapping().add(map); this.templatePanel.add(template); this.templatePanel.revalidate(); }; btnAddTemplate.addActionListener(_function); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = insets; gbc.gridx = 0; gbc.gridy = 5; this.contentPanel.add(btnAddTemplate, gbc); } { final JCheckBox chkUse3WayMerge = new JCheckBox("Use 3Way Merge"); chkUse3WayMerge.setSelected(this.manager.isUse3wayMerge()); final ActionListener _function = (ActionEvent it) -> { this.manager.setUse3wayMerge(chkUse3WayMerge.isSelected()); }; chkUse3WayMerge.addActionListener(_function); final GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = insets; gbc.gridx = 1; gbc.gridy = 5; this.contentPanel.add(chkUse3WayMerge, gbc); } { final JPanel buttonPane = new JPanel(); FlowLayout _flowLayout = new FlowLayout(FlowLayout.RIGHT); buttonPane.setLayout(_flowLayout); root.add(buttonPane, BorderLayout.SOUTH); { final JButton btnOk = new JButton("OK"); btnOk.setActionCommand("OK"); final ActionListener _function = (ActionEvent it) -> { this.manager.save(); this.dispose(); }; btnOk.addActionListener(_function); buttonPane.add(btnOk, this.getLocale()); JRootPane _rootPane = this.getRootPane(); _rootPane.setDefaultButton(btnOk); } { final JButton btnCancel = new JButton("Cancel"); final ActionListener _function = (ActionEvent it) -> { this.dispose(); }; btnCancel.addActionListener(_function); btnCancel.setActionCommand("Cancel"); buttonPane.add(btnCancel); } } final ActionListener _function = (ActionEvent it) -> { this.changeTemplateSet(); }; this.combo_templateSet.addActionListener(_function); final Function1<String, Boolean> _function_1 = (String it) -> { return Boolean.valueOf(this.manager.getCurrentSetting().getTemplateID().equals(it)); }; this.combo_templateSet.setSelectedItem(IterableExtensions.<String>findFirst(this.manager.keySet(), _function_1)); } private void disableAll() { final Consumer<Component> _function = (Component it) -> { it.setEnabled(false); }; ((List<Component>)Conversions.doWrapArray(this.contentPanel.getComponents())).forEach(_function); this.btnAddSet.setEnabled(true); } private void enableAll() { final Consumer<Component> _function = (Component it) -> { it.setEnabled(true); }; ((List<Component>)Conversions.doWrapArray(this.contentPanel.getComponents())).forEach(_function); } private void changeTemplateSet() { final Object templateSet = this.combo_templateSet.getSelectedItem(); if ((templateSet == null)) { return; } final GenerateSetting c = this.manager.get(((String) templateSet)); this.manager.setCurrentSetting(c); String _templatePath = null; if (c!=null) { _templatePath=c.getTemplatePath(); } this.textTemplateDir.setText(_templatePath); String _targetPath = null; if (c!=null) { _targetPath=c.getTargetPath(); } this.textDestinationPath.setText(_targetPath); this.templatePanel.removeAll(); this.templatePanel.revalidate(); this.templatePanel.repaint(); HashSet<TemplateMap> _mapping = null; if (c!=null) { _mapping=c.getMapping(); } if (_mapping!=null) { final Consumer<TemplateMap> _function = (TemplateMap map) -> { SettingDialog.TemplatePanel _templatePanel = new SettingDialog.TemplatePanel(this, map); this.templatePanel.add(_templatePanel); this.templatePanel.revalidate(); this.templatePanel.repaint(); }; _mapping.forEach(_function); } } private void browseDirectory(final String path, final JTextField field) { final File pluginPath = new File(path); String _text = field.getText(); final File file = new File(_text); final JFileChooser dirChooser = new JFileChooser(); boolean _exists = file.exists(); if (_exists) { dirChooser.setCurrentDirectory(file); } else { boolean _exists_1 = pluginPath.exists(); if (_exists_1) { dirChooser.setCurrentDirectory(pluginPath); } } dirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int _showOpenDialog = dirChooser.showOpenDialog(this.getParent()); boolean _equals = (JFileChooser.APPROVE_OPTION == _showOpenDialog); if (_equals) { field.setText(dirChooser.getSelectedFile().getAbsolutePath()); } } @Pure public JTextField getTextTemplateDir() { return this.textTemplateDir; } public void setTextTemplateDir(final JTextField textTemplateDir) { this.textTemplateDir = textTemplateDir; } @Pure public JPanel getTemplatePanel() { return this.templatePanel; } public void setTemplatePanel(final JPanel templatePanel) { this.templatePanel = templatePanel; } }
37.335128
117
0.647044
0f3ceea6ce9e2afb0009ff05d0b29414eb8ab3d8
1,933
/** * Copyright 2016 AT&T * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.att.aro.core.model; import java.lang.reflect.Field; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.stereotype.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.att.aro.core.ILogger; import com.att.aro.core.impl.LoggerImpl; @Component public class LoggerPostProcessor implements BeanPostProcessor { private static final Logger LOG = LoggerFactory.getLogger(LoggerPostProcessor.class); @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { Field[] fields = bean.getClass().getDeclaredFields(); for(Field field : fields){ if(ILogger.class.isAssignableFrom(field.getType()) && field.getAnnotation(InjectLogger.class) != null){ ILogger log = new LoggerImpl(bean.getClass().getName()); try { field.setAccessible(true); field.set(bean, log); } catch (IllegalArgumentException e) { LOG.error(e.getMessage(), e); } catch (IllegalAccessException e) { LOG.error(e.getMessage(), e); } } } return bean; } @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } }
33.327586
107
0.725297
5b6fb8a1d220e3bcf16c3f0e1c3b06db01532902
2,290
package com.xxc.dao.model; import java.io.Serializable; import java.util.Date; import javax.persistence.*; @Table(name = "group_relation") public class GroupRelation implements Serializable { @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; /** * 群标识 */ @Column(name = "gid") private Integer gid; /** * 成员标识 */ @Column(name = "uid") private String uid; /** * 关系0-解除1-建立 */ @Column(name = "valid") private Boolean valid; /** * 离群时间 */ @Column(name = "updated") private Date updated; /** * 进群时间 */ @Column(name = "created") private Date created; private static final long serialVersionUID = 1L; /** * @return id */ public Integer getId() { return id; } /** * @param id */ public void setId(Integer id) { this.id = id; } /** * 获取群标识 * * @return gid - 群标识 */ public Integer getGid() { return gid; } /** * 设置群标识 * * @param gid 群标识 */ public void setGid(Integer gid) { this.gid = gid; } /** * 获取成员标识 * * @return uid - 成员标识 */ public String getUid() { return uid; } /** * 设置成员标识 * * @param uid 成员标识 */ public void setUid(String uid) { this.uid = uid; } /** * 获取关系0-解除1-建立 * * @return valid - 关系0-解除1-建立 */ public Boolean getValid() { return valid; } /** * 设置关系0-解除1-建立 * * @param valid 关系0-解除1-建立 */ public void setValid(Boolean valid) { this.valid = valid; } /** * 获取离群时间 * * @return updated - 离群时间 */ public Date getUpdated() { return updated; } /** * 设置离群时间 * * @param updated 离群时间 */ public void setUpdated(Date updated) { this.updated = updated; } /** * 获取进群时间 * * @return created - 进群时间 */ public Date getCreated() { return created; } /** * 设置进群时间 * * @param created 进群时间 */ public void setCreated(Date created) { this.created = created; } }
15.472973
55
0.483843
710c3bb44408469347d490e2ed67ac91ddee192f
673
package model.commands.multipleTurtleCommands; import model.commands.AbstractCommand; import model.configuration.Arguments; import model.configuration.Scope; import model.exceptions.CommandException; /** * * @author DhruvKPatel * */ public class Turtles extends AbstractCommand { @Override public double execute(Arguments args, Scope scope) throws CommandException { return scope.getWorld().getAllTurtleIndicies().size(); } @Override public Arguments getDefaultArgs() { return new Arguments(); } @Override public Scope getScopeRequest() { return new Scope(false, false, true, true); } @Override public String getID() { return "Turtles"; } }
18.694444
77
0.751857
48f24106b876779bb76ae0f6108a13a316752236
962
/*****************************************************************************/ /* Software Testing Automation Framework (STAF) */ /* (C) Copyright IBM Corp. 2002 */ /* */ /* This software is licensed under the Eclipse Public License (EPL) V1.0. */ /*****************************************************************************/ package com.ibm.staf.service.stax; public class STAXTimedEvent { public STAXTimedEvent(long notificationTime, STAXTimedEventListener listener) { fNotificationTime = notificationTime; fListener = listener; } public long getNotificationTime() { return fNotificationTime; } public STAXTimedEventListener getTimedEventListener() { return fListener; } private long fNotificationTime = 0; private STAXTimedEventListener fListener = null; }
40.083333
81
0.493763
8ecc232eb90d043ad5d10cb93c7879c108bf3d45
1,480
package com.jacobmountain.graphql.client.visitor; import com.jacobmountain.graphql.client.annotations.GraphQLMutation; import com.jacobmountain.graphql.client.annotations.GraphQLQuery; import com.jacobmountain.graphql.client.annotations.GraphQLSubscription; import com.jacobmountain.graphql.client.modules.ClientDetails; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementKindVisitor8; import java.lang.annotation.Annotation; public class ClientDetailsVisitor extends ElementKindVisitor8<ClientDetails, Void> { @Override public ClientDetails visitType(TypeElement type, Void unused) { return ClientDetails.builder() .requiresSubscriber(requiresSubscriber(type)) .requiresFetcher(requiresFetcher(type)) .build(); } private boolean requiresSubscriber(TypeElement element) { return element.getEnclosedElements() .stream() .anyMatch(it -> hasAnnotation(it, GraphQLSubscription.class)); } private boolean requiresFetcher(TypeElement element) { return element.getEnclosedElements() .stream() .anyMatch(it -> hasAnnotation(it, GraphQLQuery.class) || hasAnnotation(it, GraphQLMutation.class)); } private boolean hasAnnotation(Element el, Class<? extends Annotation> annotation) { return el.getAnnotation(annotation) != null; } }
37
115
0.725
4ffc69b42a07054197aefebf583d0cef51a0141d
1,759
package com.smile.clz.api.beans; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import java.io.Serializable; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @JsonInclude( value = JsonInclude.Include.NON_NULL ) @JsonIgnoreProperties( ignoreUnknown = true ) public class WeatherData implements Serializable { private Location coord; private List<Weather> weather; private MainData main; public Location getCoord() { return coord; } public void setCoord(Location coord) { this.coord = coord; } public List<Weather> getWeather() { return weather; } public void setWeather(List<Weather> weather) { this.weather = weather; } public MainData getMain() { return main; } public void setMain(MainData main) { this.main = main; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } WeatherData that = (WeatherData) o; return new EqualsBuilder() .append(coord, that.coord) .append(weather, that.weather) .append(main, that.main) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(17, 37) .append(coord) .append(weather) .append(main) .toHashCode(); } @Override public String toString() { return new ToStringBuilder(this) .append("coord", coord) .append("weather", weather) .append("main", main) .toString(); } }
20.940476
61
0.661171
b413df087a9e366fee6b29bea444b9b165edbdff
1,023
package com.qiyue.utils; import com.qiyue.vo.Result; import com.qiyue.vo.TableResult; import java.util.List; /** * Created by y747718944 on 2018/2/6 * Result 返回工具 */ public class ResultUtils { public static Result getResult(Object data){ return new Result(data); } public static Result success() { return new Result(true); } public static Result success(String successMsg) { return new Result(successMsg,true); } public static Result success(String successMsg,Object data) { return new Result(successMsg,data); } public static Result error() { return new Result(false); } public static Result error(String errorMsg) { return new Result(errorMsg,false); } public static Result error(String errorMsg, Integer errorCode) { return new Result(errorMsg,errorCode); } public static TableResult getResultByPage(long total, List<Object> rows){ return new TableResult(total,rows); } }
21.3125
77
0.663734
36d16ecb609921b8608c7216c01466c5aae6a7ce
735
package com.fbd.core.app.crowdfunding.dao; import java.util.List; import com.fbd.core.app.crowdfunding.model.CrowdfundingFounderEducationsModel; import com.fbd.core.app.crowdfunding.model.CrowdfundingFounderWorksModel; import com.fbd.core.base.BaseDao; public interface ICrowdfundingFounderEducationsDao extends BaseDao<CrowdfundingFounderEducationsModel> { /** * 根据领导人id删除列表 * Description: * @param * @return void * @throws * Create Date: 2016-8-11 下午12:37:59 */ public void deleteByFounderId(String founderId); /** * 查询列表 */ public List<CrowdfundingFounderEducationsModel> selectList(CrowdfundingFounderEducationsModel model); }
29.4
106
0.704762