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
ed0f7ddd042f72d37ea081aa1bd4494528d6201c
23,052
package com.sonal.meettheteam.Utils; import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.media.ExifInterface; import android.media.MediaMetadataRetriever; import android.net.Uri; import android.os.Build; import android.os.Environment; import android.provider.MediaStore; import android.widget.ImageView; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.util.HashMap; /** * Created by HGS on 12/16/2015. */ @SuppressWarnings("deprecation") public class CustomBitmapUtils { private static int IMAGE_MAX_SIZE = 512; private static float BITMAP_SCALE = 0.5f; public static Bitmap getRoundedTopCornersBitmap(Context context, Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = convertDipsToPixels(context, pixels); // final Rect topRightRect = new Rect(bitmap.getWidth() / 2, 0, // bitmap.getWidth(), bitmap.getHeight() / 2); final Rect bottomRect = new Rect(0, bitmap.getHeight() / 2, bitmap.getWidth(), bitmap.getHeight()); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); // Fill in upper right corner // canvas.drawRect(topRightRect, paint); // Fill in bottom corners canvas.drawRect(bottomRect, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } public static Bitmap getRoundedBottomCornersBitmap(Context context, Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = convertDipsToPixels(context, pixels); final Rect topRect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight() / 2); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); canvas.drawRect(topRect, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } public static Bitmap getRoundedCornerBitmap(Context context, Bitmap bitmap, int roundDips) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = convertDipsToPixels(context, roundDips); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } /** */ public static Bitmap create_image(Context context, int id) { Bitmap bitmap = null; try { BitmapFactory.Options options = new BitmapFactory.Options(); options.inPurgeable = true; // declare as purgeable to disk bitmap = BitmapFactory.decodeResource(context.getResources(), id, options); } catch (RuntimeException e1) { e1.printStackTrace(); } catch (Exception e) { // e.printStackTrace(); } return bitmap; } public static int convertDipsToPixels(Context context, int dips) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dips * scale + 0.5f); } public static int converPixelsToDips(Context context, int pixs) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (pixs / scale + 0.5f); } public static Bitmap rotateImage(Bitmap source, float angle) { Matrix matrix = new Matrix(); matrix.postRotate(angle); return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true); } public static Bitmap getCroppedImage(Bitmap source) { float width = source.getWidth(); float height = source.getHeight(); float CROP_SIZE = Math.min(width, height); float cropWindowX = width / 2 - CROP_SIZE / 2; float cropWindowY = height / 2 - CROP_SIZE / 2; // Crop the subset from the original Bitmap. Bitmap croppedBitmap = Bitmap.createBitmap(source, (int) cropWindowX, (int) cropWindowY, (int) CROP_SIZE, (int) CROP_SIZE); return croppedBitmap; } public static boolean saveOutput(File file, Bitmap bitmap) { if (bitmap == null) return false; try { FileOutputStream fos = new FileOutputStream(file); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); fos.close(); return true; } catch (Exception ex) { ex.printStackTrace(); return false; } } public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { // Raw height and width of image final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { final int halfHeight = height / 2; final int halfWidth = width / 2; // Calculate the largest inSampleSize value that is a power of 2 and // keeps both // height and width larger than the requested height and width. while ((halfHeight / inSampleSize) > reqHeight && (halfWidth / inSampleSize) > reqWidth) { inSampleSize *= 2; } } return inSampleSize; } public static Bitmap getBitmapFromUri(Context context, Uri uri) { Bitmap returnedBitmap = null; try { InputStream in = context.getContentResolver().openInputStream(uri); BitmapFactory.Options bitOpt = new BitmapFactory.Options(); bitOpt.inJustDecodeBounds = true; // get width and height of bitmap BitmapFactory.decodeStream(in, null, bitOpt); in.close(); int inSampleSize = BitmapUtils.calculateInSampleSize(bitOpt, 250, 250); bitOpt = new BitmapFactory.Options(); bitOpt.inSampleSize = inSampleSize; // get bitmap in = context.getContentResolver().openInputStream(uri); Bitmap bitmap = BitmapFactory.decodeStream(in, null, bitOpt); in.close(); ExifInterface ei = new ExifInterface(uri.getPath()); int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); switch (orientation) { case ExifInterface.ORIENTATION_ROTATE_90: returnedBitmap = BitmapUtils.rotateImage(bitmap, 90); // Free up the memory bitmap.recycle(); bitmap = null; break; case ExifInterface.ORIENTATION_ROTATE_180: returnedBitmap = BitmapUtils.rotateImage(bitmap, 180); // Free up the memory bitmap.recycle(); bitmap = null; break; case ExifInterface.ORIENTATION_ROTATE_270: returnedBitmap = BitmapUtils.rotateImage(bitmap, 270); // Free up the memory bitmap.recycle(); bitmap = null; break; default: returnedBitmap = bitmap; } } catch (Exception e) { } return returnedBitmap; } public static File getOutputMediaFile(Context context) { File mediaStorageDir = new File( Environment.getExternalStorageDirectory() + "/android/data/" + context.getPackageName() + "/temp"); if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { return null; } } File mediaFile = new File(mediaStorageDir.getPath() + File.separator + "temp.jpg"); return mediaFile; } public static File getOutputMediaFile(Context context, String filename) { File mediaStorageDir = new File( Environment.getExternalStorageDirectory() + "/android/data/" + context.getPackageName() + "/temp"); if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { return null; } } File mediaFile = new File(mediaStorageDir.getPath() + File.separator + filename); return mediaFile; } public static String getRealPathFromURI(Context context, Uri contentURI) { String result; Cursor cursor = context.getContentResolver().query(contentURI, null, null, null, null); if (cursor == null) { result = contentURI.getPath(); } else { cursor.moveToFirst(); int idx = cursor .getColumnIndex(MediaStore.Images.ImageColumns.DATA); result = cursor.getString(idx); cursor.close(); } return result; } public static Bitmap loadOrientationAdjustedBitmap(String p_strFileName) { int p_nMaxWidth = IMAGE_MAX_SIZE; int p_nMaxHeight = IMAGE_MAX_SIZE; // // BitmapFactory.Options w_opt = new BitmapFactory.Options(); w_opt.inJustDecodeBounds = true; BitmapFactory.decodeFile(p_strFileName, w_opt); w_opt.inSampleSize = calculateInSampleSize(w_opt, p_nMaxWidth, p_nMaxHeight); w_opt.inJustDecodeBounds = false; Bitmap w_bmpCaptured = BitmapFactory.decodeFile(p_strFileName, w_opt); // // ExifInterface w_exif = null; try { w_exif = new ExifInterface(p_strFileName); } catch (Exception e) { e.printStackTrace(); return w_bmpCaptured; } int w_nOrientation = w_exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED); int w_nRotateAngle = 0; switch (w_nOrientation) { case ExifInterface.ORIENTATION_UNDEFINED: case ExifInterface.ORIENTATION_NORMAL: break; case ExifInterface.ORIENTATION_ROTATE_90: w_nRotateAngle = 90; break; case ExifInterface.ORIENTATION_ROTATE_180: w_nRotateAngle = 180; break; case ExifInterface.ORIENTATION_ROTATE_270: w_nRotateAngle = 270; break; } w_bmpCaptured = rotateImage(w_bmpCaptured, w_nRotateAngle); return w_bmpCaptured; } /** * Do image size limit to max width or height. * If the image is bigger than the threshold(500 * 500), it resizes to fit the threshold and save it to the temp folder and return the temp file path. * If the image is smaller than the threshold, it returns nothing(null). * * @param p_bitmap * @return */ public static String getSizeLimitedImageFilePath(Bitmap p_bitmap) { int w_nMaxWidth = IMAGE_MAX_SIZE; int w_nBmpWidth = p_bitmap.getWidth(); int w_nBmpHeight = p_bitmap.getHeight(); Bitmap w_bmpSizeLimited = p_bitmap; if (w_nBmpWidth > w_nMaxWidth || w_nBmpHeight > w_nBmpHeight) { // // Resize. // float rate = 0.0f; if (w_nBmpWidth > w_nBmpHeight) { rate = w_nMaxWidth / (float) w_nBmpWidth; w_nBmpHeight = (int) (w_nBmpHeight * rate); w_nBmpWidth = w_nMaxWidth; } else { rate = w_nMaxWidth / (float) w_nBmpHeight; w_nBmpWidth = (int) (w_nBmpWidth * rate); w_nBmpHeight = w_nMaxWidth; } w_bmpSizeLimited = Bitmap.createScaledBitmap(p_bitmap, w_nBmpWidth, w_nBmpHeight, true); } // // Save to the temp folder // String w_strFilePath = getTempFolderPath() + "photo_temp.jpg"; try { File w_file = new File(w_strFilePath); w_file.createNewFile(); FileOutputStream w_out = new FileOutputStream(w_file); w_bmpSizeLimited.compress(Bitmap.CompressFormat.JPEG, 100, w_out); w_out.flush(); w_out.close(); } catch (Exception e) { e.printStackTrace(); return null; } return w_strFilePath; } public static String getUploadImageFilePath(Bitmap p_bitmap, String filename) { int w_nMaxWidth = IMAGE_MAX_SIZE; int w_nBmpWidth = p_bitmap.getWidth(); int w_nBmpHeight = p_bitmap.getHeight(); Bitmap w_bmpSizeLimited = p_bitmap; if (w_nBmpWidth > w_nMaxWidth || w_nBmpHeight > w_nBmpHeight) { // // Resize. // float rate = 0.0f; if (w_nBmpWidth > w_nBmpHeight) { rate = w_nMaxWidth / (float) w_nBmpWidth; w_nBmpHeight = (int) (w_nBmpHeight * rate); w_nBmpWidth = w_nMaxWidth; } else { rate = w_nMaxWidth / (float) w_nBmpHeight; w_nBmpWidth = (int) (w_nBmpWidth * rate); w_nBmpHeight = w_nMaxWidth; } w_bmpSizeLimited = Bitmap.createScaledBitmap(p_bitmap, w_nBmpWidth, w_nBmpHeight, true); } // // Save to the temp folder // String w_strFilePath = getUploadFolderPath() + filename; try { File w_file = new File(w_strFilePath); w_file.createNewFile(); FileOutputStream w_out = new FileOutputStream(w_file); w_bmpSizeLimited.compress(Bitmap.CompressFormat.JPEG, 100, w_out); w_out.flush(); w_out.close(); } catch (Exception e) { e.printStackTrace(); return null; } return w_strFilePath; } public static Bitmap getSizeLimitedBitmap(Bitmap p_bitmap) { int w_nMaxWidth = IMAGE_MAX_SIZE; int w_nBmpWidth = p_bitmap.getWidth(); int w_nBmpHeight = p_bitmap.getHeight(); if (w_nBmpWidth > w_nMaxWidth || w_nBmpHeight > w_nBmpHeight) { float rate = 0.0f; if (w_nBmpWidth > w_nBmpHeight) { rate = w_nMaxWidth / (float) w_nBmpWidth; w_nBmpHeight = (int) (w_nBmpHeight * rate); w_nBmpWidth = w_nMaxWidth; } else { rate = w_nMaxWidth / (float) w_nBmpHeight; w_nBmpWidth = (int) (w_nBmpWidth * rate); w_nBmpHeight = w_nMaxWidth; } Bitmap w_bmpSizeLimited = Bitmap.createScaledBitmap(p_bitmap, w_nBmpWidth, w_nBmpHeight, true); return w_bmpSizeLimited; } return p_bitmap; } public static String getSizeLimitedImageFilePath(String p_strBmpFilePath) { Bitmap w_bmpSource = decodeFile(p_strBmpFilePath); return getSizeLimitedImageFilePath(w_bmpSource); } public static Bitmap decodeFile(String path) { Bitmap b = null; File f = new File(path); if (!f.exists()) return b; // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; FileInputStream fis = null; try { fis = new FileInputStream(f); BitmapFactory.decodeStream(fis, null, o); fis.close(); int scale = 1; if (o.outHeight > IMAGE_MAX_SIZE || o.outWidth > IMAGE_MAX_SIZE) { scale = (int) Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5))); } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; fis = new FileInputStream(f); b = BitmapFactory.decodeStream(fis, null, o2); fis.close(); } catch (Exception e) { e.printStackTrace(); } return b; } public static String getLocalFolderPath() { String w_strTempFolderPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Meettheteam/"; File w_fTempFolder = new File(w_strTempFolderPath); if (w_fTempFolder.exists() && w_fTempFolder.isDirectory()) { return w_strTempFolderPath; } else { w_fTempFolder.mkdir(); return w_strTempFolderPath; } } public static String getVideoThumbFolderPath() { String tempFolderPath = getLocalFolderPath(); String w_strTempFolderPath = tempFolderPath + "VideoThumb/"; File w_fTempFolder = new File(w_strTempFolderPath); if (w_fTempFolder.exists() && w_fTempFolder.isDirectory()) { return w_strTempFolderPath; } else { w_fTempFolder.mkdir(); return w_strTempFolderPath; } } public static String getDownloadFolderPath() { String tempFolderPath = getLocalFolderPath(); String w_strTempFolderPath = tempFolderPath + "Download/"; File w_fTempFolder = new File(w_strTempFolderPath); if (w_fTempFolder.exists() && w_fTempFolder.isDirectory()) { return w_strTempFolderPath; } else { w_fTempFolder.mkdir(); return w_strTempFolderPath; } } public static String getUploadFolderPath() { String tempFolderPath = getLocalFolderPath(); String w_strTempFolderPath = tempFolderPath + "Upload/"; File w_fTempFolder = new File(w_strTempFolderPath); if (w_fTempFolder.exists() && w_fTempFolder.isDirectory()) { return w_strTempFolderPath; } else { w_fTempFolder.mkdir(); return w_strTempFolderPath; } } public static String getTempFolderPath() { String tempFolderPath = getLocalFolderPath(); String w_strTempFolderPath = tempFolderPath + "Temp/"; File w_fTempFolder = new File(w_strTempFolderPath); if (w_fTempFolder.exists() && w_fTempFolder.isDirectory()) { return w_strTempFolderPath; } else { w_fTempFolder.mkdir(); return w_strTempFolderPath; } } public static Bitmap retriveVideoFrameFromVideo(String videoPath) { Bitmap bitmap = null; MediaMetadataRetriever mediaMetadataRetriever = null; try { mediaMetadataRetriever = new MediaMetadataRetriever(); if (Build.VERSION.SDK_INT >= 14) mediaMetadataRetriever.setDataSource(videoPath, new HashMap<String, String>()); else mediaMetadataRetriever.setDataSource(videoPath); // mediaMetadataRetriever.setDataSource(videoPath); bitmap = mediaMetadataRetriever.getFrameAtTime(); } catch (Exception e) { e.printStackTrace(); } finally { if (mediaMetadataRetriever != null) { mediaMetadataRetriever.release(); } } return bitmap; } public static void copyFile(String srcPath, String destPath) { try { FileInputStream fis = new FileInputStream(srcPath); FileOutputStream fos = new FileOutputStream(destPath); byte[] buf = new byte[1024]; int len; while ((len = fis.read(buf)) > 0) { fos.write(buf, 0, len); } fis.close(); fos.close(); } catch (Exception e) { } } public static void setLocked(ImageView v) { ColorMatrix matrix = new ColorMatrix(); matrix.setSaturation(0); //0 means grayscale ColorMatrixColorFilter cf = new ColorMatrixColorFilter(matrix); v.setColorFilter(cf); v.setAlpha(192); // 128 = 0.5 } public static void setUnlocked(ImageView v) { v.setColorFilter(null); v.setAlpha(255); } }
33.312139
155
0.570536
936fbb15a5f33474462e86e1991c2a5d7b05c80d
6,619
/** * */ package soars.application.visualshell.executor.simulator; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Locale; import soars.application.visualshell.common.file.ScriptFile; import soars.application.visualshell.executor.common.Parameters; import soars.application.visualshell.layer.LayerManager; import soars.application.visualshell.main.Constant; import soars.application.visualshell.main.Environment; import soars.application.visualshell.object.comment.CommentManager; import soars.common.soars.environment.CommonEnvironment; import soars.common.utility.tool.clipboard.Clipboard; import soars.common.utility.tool.common.Tool; import soars.common.utility.tool.stream.StreamPumper; /** * The Simulator runner class. * @author kurata / SOARS project */ public class Simulator { /** * Returns true for running the Simulator with the specified data. * @param scriptFile the specified script file * @param parameters the simulation parameters * @param currentDirectory the directory which contains the simulator.jar * @param currentDirectoryName the name of the directory which contains the simulator.jar * @param direct * @return true for running the Simulator with the specified data */ public static boolean run(ScriptFile scriptFile, Parameters parameters, File currentDirectory, String currentDirectoryName, boolean direct) { String propertyDirectoryName = System.getProperty( Constant._soarsProperty); String memorySize = CommonEnvironment.get_instance().get_memory_size(); String osname = System.getProperty( "os.name"); File soarsFile = LayerManager.get_instance().get_current_file(); String[] cmdarray = get_cmdarray( scriptFile, parameters, currentDirectoryName, propertyDirectoryName, memorySize, osname, soarsFile, parameters.get_user_data_directory(), parameters.get_gaming_runner_file()); debug( "Simulator.run", osname, System.getProperty( "os.version"), cmdarray); Process process; try { process = ( Process)Runtime.getRuntime().exec( cmdarray, null, currentDirectory); if ( !direct) { new StreamPumper( process.getInputStream(), false).start(); new StreamPumper( process.getErrorStream(), false).start(); } } catch (IOException e) { //e.printStackTrace(); return false; } return true; } /** * @param scriptFile * @param parameters * @param currentDirectoryName * @param propertyDirectoryName * @param memorySize * @param osname * @param soarsFile * @param userDataDirectory * @param gamingRunnerFile * @return */ private static String[] get_cmdarray(ScriptFile scriptFile, Parameters parameters, String currentDirectoryName, String propertyDirectoryName, String memorySize, String osname, File soarsFile, File userDataDirectory, File gamingRunnerFile) { List< String>list = new ArrayList< String>(); if ( 0 <= osname.indexOf( "Windows")) { list.add( Constant._windowsJava); } else if ( 0 <= osname.indexOf( "Mac")) { list.add( Constant.get_mac_java_command()); //if ( System.getProperty( Constant._systemDefaultFileEncoding, "").equals( "")) list.add( "-Dfile.encoding=UTF-8"); list.add( "-D" + Constant._systemDefaultFileEncoding + "=" + System.getProperty( Constant._systemDefaultFileEncoding, "")); list.add( "-X" + Constant._macScreenMenuName + "=SOARS Simulator"); //list.add( "-D" + Constant._macScreenMenuName + "=SOARS Simulator"); list.add( "-X" + Constant._macIconFilename + "=../resource/icon/application/simulator/icon.png"); list.add( "-D" + Constant._macScreenMenu + "=true"); } else { list.add( Tool.get_java_command()); } // list.add( "-Djava.endorsed.dirs=" + currentDirectoryName + "/../" + Constant._xercesDirectory); list.add( "-D" + Constant._soarsHome + "=" + currentDirectoryName); list.add( "-D" + Constant._soarsProperty + "=" + propertyDirectoryName); if ( null != gamingRunnerFile) list.add( "-D" + Constant._soarsGamingRunnerFile + "=" + gamingRunnerFile.getAbsolutePath()); list.add( "-D" + Constant._soarsSorFile + "=" + scriptFile._path.getAbsolutePath()); if ( null != userDataDirectory) list.add( "-D" + Constant._soarsUserDataDirectory + "=" + userDataDirectory.getAbsolutePath().replaceAll( "\\\\", "/")); if ( !memorySize.equals( "0")) { list.add( "-D" + Constant._soarsMemorySize + "=" + memorySize); list.add( "-Xmx" + memorySize + "m"); } // list.add( "-jar"); // list.add( currentDirectoryName + "/" + Constant._simulatorJarFilename); list.add( "-cp"); //list.add( currentDirectoryName + "/" + Constant._simulatorJarFilename // + ( ( null == gamingRunnerFile) ? "" : ( File.pathSeparator + currentDirectoryName + "/../" + Constant._gamingRunnerJarFilename))); list.add( currentDirectoryName + "/" + Constant._simulatorJarFilename + File.pathSeparator + currentDirectoryName + "/../" + Constant._gamingRunnerJarFilename); list.add( Constant._simulatorMainClassname); list.add( "-language"); list.add( CommonEnvironment.get_instance().get( CommonEnvironment._localeKey, Locale.getDefault().getLanguage())); list.add( "-script"); list.add( scriptFile._path.getAbsolutePath()); list.add( "-parent_directory"); list.add( parameters._parentDirectory.getAbsolutePath()); if ( null != soarsFile) { list.add( "-soars"); list.add( soarsFile.getAbsolutePath()); } if ( !scriptFile._experimentName.equals( "")) { list.add( "-experiment"); list.add( scriptFile._experimentName); } if ( Environment.get_instance().get( Environment._editExportSettingDialogToFileKey, "false").equals( "true") && !scriptFile._logFolderPath.equals( "")) { list.add( "-log"); list.add( scriptFile._logFolderPath); } if ( null != CommentManager.get_instance()._title && !CommentManager.get_instance()._title.equals( "")) { list.add( "-visualshell_title"); list.add( CommentManager.get_instance()._title); } return list.toArray( new String[ 0]); } /** * @param type * @param osname * @param osversion * @param cmdarray */ private static void debug(String type, String osname, String osversion, String[] cmdarray) { String text = ""; text += ( "Type : " + type + Constant._lineSeparator); text += ( "OS : " + osname + " [" + osversion + "]" + Constant._lineSeparator); for ( int i = 0; i < cmdarray.length; ++i) text += ( "Parameter : " + cmdarray[ i] + Constant._lineSeparator); Clipboard.set( text); } }
43.546053
242
0.699804
12644502caad7174f335653026176bcfac1afb95
853
/** * File: IReferenceContainer.java * Author: Thomas Calmant * Date: 10 janv. 2012 */ package org.psem2m.sca.converter.model; import org.psem2m.sca.converter.utils.QName; /** * Represents a SCA element which can contain references and services * * @author Thomas Calmant */ public interface IReferenceContainer extends INameable { /** * Retrieves the first reference with the given name, null if not found * * @param aReferenceName * A reference name * @return The found reference, or null */ Reference getReference(QName aReferenceName); /** * Retrieves the first service with the given name, null if not found * * @param aServiceName * A service name * @return The found service, or null */ Service getService(QName aServiceName); }
24.371429
75
0.654162
593654ee26130a60c33c7e372a562d69d8f66fc4
1,725
package net.estinet.gFeatures.Feature.EstiBans.Commands; import com.velocitypowered.api.command.CommandSource; import net.estinet.gFeatures.EstiCommand; import net.estinet.gFeatures.gFeature; import net.estinet.gFeatures.Feature.EstiBans.EstiBans; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; /* gFeatures https://github.com/EstiNet/gFeaturesBungee Copyright 2018 EstiNet 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. */ public class UnbanCommand extends EstiCommand{ public UnbanCommand(gFeature feature) { super(new String[]{"unban"}, "gFeatures.EstiBans.ban", feature); } @Override public void execute(CommandSource sender, String[] args) { if(args.length != 2){ sender.sendMessage(EstiBans.estiBansPrefix.append(Component.text("/unban [Player] [Server]"))); } else{ if(!EstiBans.isBannedOn(args[0], args[1])){ sender.sendMessage(EstiBans.estiBansPrefix.append(Component.text("Player is not banned!", NamedTextColor.RED))); } else{ sender.sendMessage(EstiBans.estiBansPrefix.append(Component.text("Player " + args[0] + " has been unbanned on " + args[1] + "."))); EstiBans.unbanPlayer(args[0], args[1]); } } } }
33.823529
135
0.747246
a0412df80970c588793cc5e5f80e5e6be713049c
983
/** * */ package org.frameworkset.security.session.impl; /** * @author yinbp * * @Date:2016-12-22 12:49:29 */ public class SessionID { private String sessionId; private String signSessionId; /** * */ public SessionID() { // TODO Auto-generated constructor stub } public String getSessionId() { return sessionId; } public void setSessionId(String sessionId) { this.sessionId = sessionId; } public String getSignSessionId() { return signSessionId == null?this.sessionId:this.signSessionId; } public void setSignSessionId(String signSessionId) { this.signSessionId = signSessionId; } @Override public int hashCode() { // TODO Auto-generated method stub return sessionId.hashCode(); } @Override public boolean equals(Object obj) { if(obj == null) return false; if(obj instanceof SessionID) { return this.sessionId.equals(((SessionID)obj).getSessionId()); } else { return this.sessionId.equals((String)obj); } } }
18.54717
65
0.692777
223acf80f37db50088b2746a4a58c9cacdd13360
5,317
/* * 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.qualitycheck.transform.v20190115; import java.util.ArrayList; import java.util.List; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse.Data; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse.Data.HitRuleReviewInfo; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse.Data.HitRuleReviewInfo.ConditionHitInfo; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse.Data.HitRuleReviewInfo.ConditionHitInfo.KeyWord; import com.aliyuncs.qualitycheck.model.v20190115.TestRuleResponse.Data.HitRuleReviewInfo.ConditionHitInfo.Phrase; import com.aliyuncs.transform.UnmarshallerContext; public class TestRuleResponseUnmarshaller { public static TestRuleResponse unmarshall(TestRuleResponse testRuleResponse, UnmarshallerContext _ctx) { testRuleResponse.setRequestId(_ctx.stringValue("TestRuleResponse.RequestId")); testRuleResponse.setCode(_ctx.stringValue("TestRuleResponse.Code")); testRuleResponse.setMessage(_ctx.stringValue("TestRuleResponse.Message")); testRuleResponse.setSuccess(_ctx.booleanValue("TestRuleResponse.Success")); Data data = new Data(); data.setPoc(_ctx.booleanValue("TestRuleResponse.Data.Poc")); List<HitRuleReviewInfo> hitRuleReviewInfoList = new ArrayList<HitRuleReviewInfo>(); for (int i = 0; i < _ctx.lengthValue("TestRuleResponse.Data.HitRuleReviewInfoList.Length"); i++) { HitRuleReviewInfo hitRuleReviewInfo = new HitRuleReviewInfo(); hitRuleReviewInfo.setRid(_ctx.longValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].Rid")); List<ConditionHitInfo> conditionHitInfoList = new ArrayList<ConditionHitInfo>(); for (int j = 0; j < _ctx.lengthValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList.Length"); j++) { ConditionHitInfo conditionHitInfo = new ConditionHitInfo(); List<String> cid = new ArrayList<String>(); for (int k = 0; k < _ctx.lengthValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Cid.Length"); k++) { cid.add(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Cid["+ k +"]")); } conditionHitInfo.setCid(cid); Phrase phrase = new Phrase(); phrase.setWords(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.Words")); phrase.setBegin(_ctx.longValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.Begin")); phrase.setIdentity(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.Identity")); phrase.setPid(_ctx.integerValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.Pid")); phrase.setEmotionValue(_ctx.integerValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.EmotionValue")); phrase.setEnd(_ctx.longValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.End")); phrase.setRole(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].Phrase.Role")); conditionHitInfo.setPhrase(phrase); List<KeyWord> keyWords = new ArrayList<KeyWord>(); for (int k = 0; k < _ctx.lengthValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords.Length"); k++) { KeyWord keyWord = new KeyWord(); keyWord.setTo(_ctx.integerValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords["+ k +"].To")); keyWord.setFrom(_ctx.integerValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords["+ k +"].From")); keyWord.setVal(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords["+ k +"].Val")); keyWord.setTid(_ctx.stringValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords["+ k +"].Tid")); keyWord.setPid(_ctx.integerValue("TestRuleResponse.Data.HitRuleReviewInfoList["+ i +"].ConditionHitInfoList["+ j +"].KeyWords["+ k +"].Pid")); keyWords.add(keyWord); } conditionHitInfo.setKeyWords(keyWords); conditionHitInfoList.add(conditionHitInfo); } hitRuleReviewInfo.setConditionHitInfoList(conditionHitInfoList); hitRuleReviewInfoList.add(hitRuleReviewInfo); } data.setHitRuleReviewInfoList(hitRuleReviewInfoList); testRuleResponse.setData(data); return testRuleResponse; } }
59.077778
153
0.750235
8ab405fbde720c9a0864edc7ce13c14350637a71
152,852
package haxe.at.dotpoint.spatial.transform; import haxe.root.*; @SuppressWarnings(value={"rawtypes", "unchecked"}) public class Transform<TEntity> extends haxe.at.dotpoint.core.entity.Component<TEntity> implements haxe.at.dotpoint.spatial.transform.ITransform { public Transform(haxe.lang.EmptyObject empty) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" super(haxe.lang.EmptyObject.EMPTY); } public Transform() { //line 83 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" super(haxe.lang.EmptyObject.EMPTY); //line 83 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.Transform.__hx_ctor_haxe_at_dotpoint_spatial_transform_Transform(this); } public static <TEntity_c> void __hx_ctor_haxe_at_dotpoint_spatial_transform_Transform(haxe.at.dotpoint.spatial.transform.Transform<TEntity_c> __temp_me104) { //line 83 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.core.entity.Component.__hx_ctor_haxe_at_dotpoint_core_entity_Component(__temp_me104); //line 85 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.m_position = new haxe.at.dotpoint.math.lazy.LazyVector3(0, 0, 0, null); //line 86 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.m_rotation = new haxe.at.dotpoint.math.lazy.LazyQuaternion(0, 0, 0, null); //line 87 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.m_scale = new haxe.at.dotpoint.math.lazy.LazyVector3(1, 1, 1, null); //line 89 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.localMatrix = new haxe.at.dotpoint.spatial.transform.TransformationMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (null) )); //line 90 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.worldMatrix = new haxe.at.dotpoint.spatial.transform.TransformationMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (null) )); //line 92 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 93 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_me104.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; } public static java.lang.Object __hx_createEmpty() { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return new haxe.at.dotpoint.spatial.transform.Transform<java.lang.Object>(haxe.lang.EmptyObject.EMPTY); } public static java.lang.Object __hx_create(haxe.root.Array arr) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return new haxe.at.dotpoint.spatial.transform.Transform<java.lang.Object>(); } public haxe.at.dotpoint.math.lazy.LazyVector3 m_position; public haxe.at.dotpoint.math.lazy.LazyQuaternion m_rotation; public haxe.at.dotpoint.math.lazy.LazyVector3 m_scale; public haxe.at.dotpoint.spatial.transform.TransformationMatrix localMatrix; public haxe.at.dotpoint.spatial.transform.TransformationMatrix worldMatrix; public haxe.at.dotpoint.core.lazy.LazyStatus statusLocalMatrix; public haxe.at.dotpoint.core.lazy.LazyStatus statusWorldMatrix; @Override public void onEntityAdded() { //line 107 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.assertRequiredComponents(new haxe.root.Array<java.lang.Class>(new java.lang.Class[]{haxe.at.dotpoint.core.datastructure.graph.TreeNode.class})); //line 111 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.onUpdate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "onUpdateComponent")) ); //line 112 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.onValidate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLP")) ); //line 114 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.onUpdate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "onUpdateComponent")) ); //line 115 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.onValidate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLR")) ); //line 117 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.onUpdate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "onUpdateComponent")) ); //line 118 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.onValidate = ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLS")) ); //line 122 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).addListener(haxe.at.dotpoint.core.datastructure.graph.event.TreeNodeEvent.REMOVED_FROM_NODE, ((haxe.lang.Function) (new haxe.lang.Closure(this, "onSpatialTreeChanged")) )); } @Override public void onEntityRemoved() { //line 132 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.onUpdate = null; //line 133 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.onValidate = null; //line 135 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.onUpdate = null; //line 136 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.onValidate = null; //line 138 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.onUpdate = null; //line 139 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.onValidate = null; //line 143 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).removeListener(haxe.at.dotpoint.core.datastructure.graph.event.TreeNodeEvent.REMOVED_FROM_NODE, ((haxe.lang.Function) (new haxe.lang.Closure(this, "onSpatialTreeChanged")) )); } public haxe.at.dotpoint.math.vector.IVector3 get_position() { //line 159 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_position; } public haxe.at.dotpoint.math.vector.IVector3 set_position(haxe.at.dotpoint.math.vector.IVector3 value) { //line 163 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.set(value.get_x(), value.get_y(), value.get_z(), value.get_w()); //line 164 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_position; } public haxe.at.dotpoint.math.vector.IQuaternion get_rotation() { //line 176 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_rotation; } public haxe.at.dotpoint.math.vector.IQuaternion set_rotation(haxe.at.dotpoint.math.vector.IQuaternion value) { //line 180 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.set(value.get_x(), value.get_y(), value.get_z(), value.get_w()); //line 181 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_rotation; } public haxe.at.dotpoint.math.vector.IVector3 get_scale() { //line 193 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_scale; } public haxe.at.dotpoint.math.vector.IVector3 set_scale(haxe.at.dotpoint.math.vector.IVector3 value) { //line 197 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.set(value.get_x(), value.get_y(), value.get_z(), value.get_w()); //line 198 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_scale; } public void setMatrix(haxe.at.dotpoint.math.vector.IMatrix44 value, haxe.at.dotpoint.math.geom.Space space) { //line 210 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space != null )) { //line 210 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" switch (space) { case WORLD: { //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix.set44(value); //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.set44(this.calculateLocalMatrix()); //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); //line 213 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } default: { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.set44(value); //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } } } else { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.set44(value); //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } //line 216 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); } } public haxe.at.dotpoint.math.vector.IMatrix44 getMatrix(haxe.at.dotpoint.math.vector.IMatrix44 output, haxe.at.dotpoint.math.geom.Space space) { //line 225 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( output == null )) { //line 226 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" output = new haxe.at.dotpoint.math.vector.Matrix44(((haxe.at.dotpoint.math.vector.IMatrix44) (null) )); } //line 230 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space != null )) { //line 230 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" switch (space) { case WORLD: { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.TransformationMatrix __temp_stmt3 = null; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 wm = null; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = this.localMatrix; } //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm = this.getParentWorldMatrix(); //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm != null )) { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm, wm, null)) ); } //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix.set44(wm); //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_stmt3 = this.worldMatrix; } //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" output.set44(__temp_stmt3); //line 233 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } default: { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.TransformationMatrix __temp_stmt2 = null; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_stmt2 = this.localMatrix; } //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" output.set44(__temp_stmt2); //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } } } else { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.TransformationMatrix __temp_stmt1 = null; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_stmt1 = this.localMatrix; } //line 236 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" output.set44(__temp_stmt1); } //line 239 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return output; } public final void setLocalMatrix(haxe.at.dotpoint.math.vector.IMatrix44 value) { //line 251 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.set44(value); //line 253 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 255 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } //line 256 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 256 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 256 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 256 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } //line 258 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); } public final haxe.at.dotpoint.spatial.transform.TransformationMatrix getLocalMatrix() { //line 266 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 267 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 269 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.localMatrix; } public final void validateLocalMatrix() { //line 277 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 279 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 280 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 280 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 280 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 280 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } public final void setWorldMatrix(haxe.at.dotpoint.math.vector.IMatrix44 value) { //line 292 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix.set44(value); //line 293 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.set44(this.calculateLocalMatrix()); //line 295 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 296 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 298 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } //line 300 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); //line 301 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 303 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } public final haxe.at.dotpoint.spatial.transform.TransformationMatrix getWorldMatrix() { //line 311 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 wm = null; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = this.localMatrix; } //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm = this.getParentWorldMatrix(); //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm != null )) { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm, wm, null)) ); } //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix.set44(wm); //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 312 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 314 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.worldMatrix; } public final void validateWorldMatrix() { //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 wm = null; //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.setComponents(this.m_rotation, this.m_scale, this.m_position); //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } //line 322 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = this.localMatrix; } //line 323 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm = this.getParentWorldMatrix(); //line 325 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm != null )) { //line 326 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm, wm, null)) ); } //line 330 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix.set44(wm); //line 332 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 333 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 333 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 333 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 333 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } } public haxe.at.dotpoint.math.vector.IMatrix44 calculateLocalMatrix() { //line 344 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 lm = this.worldMatrix; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm = null; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( ( ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent() != null ) && ( ! (( ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent().get_entity() == null )) ) )) { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.Transform<TEntity> _this = ((haxe.at.dotpoint.spatial.transform.Transform<TEntity>) (haxe.lang.Runtime.getField(((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent().get_entity(), "transform", true)) ); //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( _this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 wm = null; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( _this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.localMatrix.setComponents(_this.m_rotation, _this.m_scale, _this.m_position); //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_position.lazy.allowDispatchUpdate = true; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_rotation.lazy.allowDispatchUpdate = true; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_scale.lazy.allowDispatchUpdate = true; } } //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = _this.localMatrix; } //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm1 = _this.getParentWorldMatrix(); //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm1 != null )) { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm1, wm, null)) ); } //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.worldMatrix.set44(wm); //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_position.lazy.allowDispatchUpdate = true; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_rotation.lazy.allowDispatchUpdate = true; //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_scale.lazy.allowDispatchUpdate = true; } } //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" pm = _this.worldMatrix; } else { //line 345 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" pm = null; } //line 347 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm != null )) { //line 349 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" pm.inverse(); //line 350 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" lm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm, lm, null)) ); } //line 353 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return lm; } public final haxe.at.dotpoint.math.vector.IMatrix44 getParentWorldMatrix() { //line 361 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( ( ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent() != null ) && ( ! (( ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent().get_entity() == null )) ) )) { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.Transform<TEntity> _this = ((haxe.at.dotpoint.spatial.transform.Transform<TEntity>) (haxe.lang.Runtime.getField(((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ).get_parent().get_entity(), "transform", true)) ); //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( _this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 wm = null; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( _this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.INVALID )) { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.localMatrix.setComponents(_this.m_rotation, _this.m_scale, _this.m_position); //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_position.lazy.allowDispatchUpdate = true; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_rotation.lazy.allowDispatchUpdate = true; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_scale.lazy.allowDispatchUpdate = true; } } //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = _this.localMatrix; } //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IMatrix44 pm = _this.getParentWorldMatrix(); //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( pm != null )) { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" wm = ((haxe.at.dotpoint.math.vector.IMatrix44) (haxe.at.dotpoint.math.vector.Matrix44.multiply(pm, wm, null)) ); } //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.worldMatrix.set44(wm); //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_position.lazy.allowDispatchUpdate = true; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_rotation.lazy.allowDispatchUpdate = true; //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" _this.m_scale.lazy.allowDispatchUpdate = true; } } //line 362 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return _this.worldMatrix; } //line 364 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return null; } public final void onUpdateComponent() { //line 376 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 377 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 378 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; //line 380 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 380 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 380 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); } //line 381 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 381 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 381 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 381 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } } public final void resetComponentUpdate() { //line 389 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = true; //line 390 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = true; //line 391 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = true; } public final void validateLP() { //line 402 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.getPosition(this.m_position.value); //line 403 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; } public final void validateLS() { //line 411 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.getScale(this.m_scale.value); //line 412 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; } public final void validateLR() { //line 420 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix.getRotation(this.m_rotation.value); //line 421 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.VALID; } public final void invalidateComponents() { //line 433 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 434 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 435 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.status = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 437 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position.lazy.allowDispatchUpdate = false; //line 438 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation.lazy.allowDispatchUpdate = false; //line 439 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale.lazy.allowDispatchUpdate = false; } public final void invalidateLocalMatrix() { //line 447 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusLocalMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 449 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 450 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); } } public final void invalidateWorldMatrix() { //line 459 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 461 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 462 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 464 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } } public void invalidateChildren() { //line 473 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.get_entity() == null )) { //line 474 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ; } //line 478 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity> tree = ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ); //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" int _g = 0; //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.root.Array<haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>> _g1 = tree.get_children(); //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" while (( _g < _g1.length )) { //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity> child = _g1.__get(_g); //line 480 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" ++ _g; //line 482 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.spatial.transform.Transform<TEntity> transform = ((haxe.at.dotpoint.spatial.transform.Transform<TEntity>) (haxe.lang.Runtime.getField(child.get_entity(), "transform", true)) ); //line 483 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" transform.invalidateWorldMatrix(); } } } public void onSpatialTreeChanged(haxe.at.dotpoint.core.dispatcher.event.Event event) { //line 492 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( event.get_target() != ((haxe.at.dotpoint.core.datastructure.graph.TreeNode<TEntity>) (haxe.lang.Runtime.callField(this.get_entity(), "getSpatialNode", null)) ) )) { //line 493 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ; } //line 495 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( this.statusWorldMatrix == haxe.at.dotpoint.core.lazy.LazyStatus.VALID )) { //line 495 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = haxe.at.dotpoint.core.lazy.LazyStatus.INVALID; //line 495 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); //line 495 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } } public final void dispatchLocalChange() { //line 507 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.LOCAL)); } public final void dispatchWorldChange() { //line 515 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatch(haxe.at.dotpoint.spatial.event.SpatialEvent.getInstance(haxe.at.dotpoint.spatial.event.SpatialEvent.TRANSFORM_CHANGED, haxe.at.dotpoint.math.geom.Space.WORLD)); } public boolean hasRotation(haxe.at.dotpoint.math.geom.Space space) { //line 527 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space == null )) { //line 528 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" space = haxe.at.dotpoint.math.geom.Space.LOCAL; } //line 530 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IQuaternion m_rotation = null; //line 530 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space == haxe.at.dotpoint.math.geom.Space.LOCAL )) { //line 530 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" m_rotation = this.m_rotation; } else { //line 530 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" m_rotation = ((haxe.at.dotpoint.math.vector.IQuaternion) (this.worldMatrix.getRotation(null)) ); } //line 532 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_rotation.get_x() != 0 )) { //line 532 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 533 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_rotation.get_y() != 0 )) { //line 533 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 534 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_rotation.get_z() != 0 )) { //line 534 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 535 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_rotation.get_w() != 1 )) { //line 535 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 537 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return false; } public boolean hasScaling(haxe.at.dotpoint.math.geom.Space space) { //line 545 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space == null )) { //line 546 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" space = haxe.at.dotpoint.math.geom.Space.LOCAL; } //line 548 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" haxe.at.dotpoint.math.vector.IVector3 m_scale = null; //line 548 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( space == haxe.at.dotpoint.math.geom.Space.LOCAL )) { //line 548 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" m_scale = this.m_scale; } else { //line 548 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" m_scale = ((haxe.at.dotpoint.math.vector.IVector3) (this.worldMatrix.getScale(null)) ); } //line 550 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_scale.get_x() != 1 )) { //line 550 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 551 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_scale.get_y() != 1 )) { //line 551 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 552 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( m_scale.get_z() != 1 )) { //line 552 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return true; } //line 554 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return false; } @Override public java.lang.Object __hx_setField(java.lang.String field, java.lang.Object value, boolean handleProperties) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" boolean __temp_executeDef1 = true; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" switch (field.hashCode()) { case 109250890: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.set_scale(((haxe.at.dotpoint.math.vector.IVector3) (value) )); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 893187259: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_position = ((haxe.at.dotpoint.math.lazy.LazyVector3) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -40300674: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.set_rotation(((haxe.at.dotpoint.math.vector.IQuaternion) (value) )); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 105081616: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_rotation = ((haxe.at.dotpoint.math.lazy.LazyQuaternion) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 747804969: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.set_position(((haxe.at.dotpoint.math.vector.IVector3) (value) )); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 782673656: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.m_scale = ((haxe.at.dotpoint.math.lazy.LazyVector3) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -542902623: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("statusWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusWorldMatrix = ((haxe.at.dotpoint.core.lazy.LazyStatus) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1227876108: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("localMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.localMatrix = ((haxe.at.dotpoint.spatial.transform.TransformationMatrix) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -95243334: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("statusLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.statusLocalMatrix = ((haxe.at.dotpoint.core.lazy.LazyStatus) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 780216819: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("worldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.worldMatrix = ((haxe.at.dotpoint.spatial.transform.TransformationMatrix) (value) ); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return value; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (__temp_executeDef1) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return super.__hx_setField(field, value, handleProperties); } else { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" throw null; } } } @Override public java.lang.Object __hx_getField(java.lang.String field, boolean throwErrors, boolean isCheck, boolean handleProperties) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" boolean __temp_executeDef1 = true; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" switch (field.hashCode()) { case -351682675: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("hasScaling")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "hasScaling")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 893187259: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_position; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1460810696: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("hasRotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "hasRotation")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 105081616: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_rotation; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 623991048: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("dispatchWorldChange")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "dispatchWorldChange")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 782673656: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("m_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.m_scale; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1071650337: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("dispatchLocalChange")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "dispatchLocalChange")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1227876108: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("localMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.localMatrix; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -199685679: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onSpatialTreeChanged")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "onSpatialTreeChanged")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 780216819: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("worldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.worldMatrix; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1855555674: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateChildren")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "invalidateChildren")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -95243334: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("statusLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.statusLocalMatrix; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -474800712: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "invalidateWorldMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -542902623: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("statusWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.statusWorldMatrix; } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -27141423: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "invalidateLocalMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1732610942: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onEntityAdded")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "onEntityAdded")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1042120015: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateComponents")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "invalidateComponents")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 831724382: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onEntityRemoved")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "onEntityRemoved")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567844: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLR")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLR")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 747804969: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_position(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567843: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLS")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLS")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1175249934: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "get_position")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567846: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLP")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLP")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 373742694: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "set_position")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 943342295: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("resetComponentUpdate")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "resetComponentUpdate")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -40300674: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_rotation(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1622071723: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onUpdateComponent")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "onUpdateComponent")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1963355577: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "get_rotation")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1061739981: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getParentWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getParentWorldMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -414362949: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "set_rotation")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -21721146: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("calculateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "calculateLocalMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 109250890: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_scale(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 829181693: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateWorldMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1146200865: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "get_scale")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 139948221: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getWorldMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 931583789: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "set_scale")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1631787983: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "setWorldMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 400158403: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "setMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1276840982: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "validateLocalMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 614775479: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 587607510: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "getLocalMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1184128694: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return ((haxe.lang.Function) (new haxe.lang.Closure(this, "setLocalMatrix")) ); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (__temp_executeDef1) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return super.__hx_getField(field, throwErrors, isCheck, handleProperties); } else { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" throw null; } } } @Override public java.lang.Object __hx_invokeField(java.lang.String field, haxe.root.Array dynargs) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" int __temp_hash2 = field.hashCode(); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" boolean __temp_executeDef1 = true; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" switch (__temp_hash2) { case 831724382: case 1732610942: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (( (( ( __temp_hash2 == 831724382 ) && field.equals("onEntityRemoved") )) || field.equals("onEntityAdded") )) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return haxe.lang.Runtime.slowCallField(this, field, dynargs); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1175249934: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_position(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -351682675: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("hasScaling")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.hasScaling(((haxe.at.dotpoint.math.geom.Space) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 373742694: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_position")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.set_position(((haxe.at.dotpoint.math.vector.IVector3) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1460810696: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("hasRotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.hasRotation(((haxe.at.dotpoint.math.geom.Space) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1963355577: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_rotation(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 623991048: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("dispatchWorldChange")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatchWorldChange(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -414362949: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_rotation")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.set_rotation(((haxe.at.dotpoint.math.vector.IQuaternion) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1071650337: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("dispatchLocalChange")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.dispatchLocalChange(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1146200865: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("get_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.get_scale(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -199685679: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onSpatialTreeChanged")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.onSpatialTreeChanged(((haxe.at.dotpoint.core.dispatcher.event.Event) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 931583789: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("set_scale")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.set_scale(((haxe.at.dotpoint.math.vector.IVector3) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1855555674: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateChildren")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateChildren(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 400158403: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.setMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (dynargs.__get(0)) ), ((haxe.at.dotpoint.math.geom.Space) (dynargs.__get(1)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -474800712: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateWorldMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 614775479: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.getMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (dynargs.__get(0)) ), ((haxe.at.dotpoint.math.geom.Space) (dynargs.__get(1)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -27141423: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateLocalMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1184128694: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.setLocalMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1042120015: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("invalidateComponents")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.invalidateComponents(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 587607510: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.getLocalMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567844: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLR")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.validateLR(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 1276840982: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.validateLocalMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567843: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLS")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.validateLS(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1631787983: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("setWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.setWorldMatrix(((haxe.at.dotpoint.math.vector.IMatrix44) (dynargs.__get(0)) )); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -43567846: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateLP")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.validateLP(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 139948221: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.getWorldMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 943342295: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("resetComponentUpdate")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.resetComponentUpdate(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case 829181693: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("validateWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.validateWorldMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1622071723: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("onUpdateComponent")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" this.onUpdateComponent(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -21721146: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("calculateLocalMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.calculateLocalMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } case -1061739981: { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (field.equals("getParentWorldMatrix")) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" __temp_executeDef1 = false; //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return this.getParentWorldMatrix(); } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" break; } } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" if (__temp_executeDef1) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return super.__hx_invokeField(field, dynargs); } } //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" return null; } @Override public void __hx_getFields(haxe.root.Array<java.lang.String> baseArr) { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("scale"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("rotation"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("position"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("statusWorldMatrix"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("statusLocalMatrix"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("worldMatrix"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("localMatrix"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("m_scale"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("m_rotation"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" baseArr.push("m_position"); //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" { //line 28 "D:\\Projects\\Arbeit\\Greentube\\Hackathon\\Thnx\\lib\\dotCore\\src\\main\\haxe\\at\\dotpoint\\spatial\\transform\\Transform.hx" super.__hx_getFields(baseArr); } } }
58.541555
361
0.681522
bb74826400eec35fc75ca6b30c0127cf9928c904
2,835
// This file is auto-generated, don't edit it. Thanks. package com.alipay.easysdk.payment.common.models; import com.aliyun.tea.*; public class AlipayTradeFastpayRefundQueryResponse extends TeaModel { @NameInMap("http_body") @Validation(required = true) public String httpBody; @NameInMap("code") @Validation(required = true) public String code; @NameInMap("msg") @Validation(required = true) public String msg; @NameInMap("sub_code") @Validation(required = true) public String subCode; @NameInMap("sub_msg") @Validation(required = true) public String subMsg; @NameInMap("error_code") @Validation(required = true) public String errorCode; @NameInMap("gmt_refund_pay") @Validation(required = true) public String gmtRefundPay; @NameInMap("industry_sepc_detail") @Validation(required = true) public String industrySepcDetail; @NameInMap("out_request_no") @Validation(required = true) public String outRequestNo; @NameInMap("out_trade_no") @Validation(required = true) public String outTradeNo; @NameInMap("present_refund_buyer_amount") @Validation(required = true) public String presentRefundBuyerAmount; @NameInMap("present_refund_discount_amount") @Validation(required = true) public String presentRefundDiscountAmount; @NameInMap("present_refund_mdiscount_amount") @Validation(required = true) public String presentRefundMdiscountAmount; @NameInMap("refund_amount") @Validation(required = true) public String refundAmount; @NameInMap("refund_charge_amount") @Validation(required = true) public String refundChargeAmount; @NameInMap("refund_detail_item_list") @Validation(required = true) public java.util.List<TradeFundBill> refundDetailItemList; @NameInMap("refund_reason") @Validation(required = true) public String refundReason; @NameInMap("refund_royaltys") @Validation(required = true) public java.util.List<RefundRoyaltyResult> refundRoyaltys; @NameInMap("refund_settlement_id") @Validation(required = true) public String refundSettlementId; @NameInMap("refund_status") @Validation(required = true) public String refundStatus; @NameInMap("send_back_fee") @Validation(required = true) public String sendBackFee; @NameInMap("total_amount") @Validation(required = true) public String totalAmount; @NameInMap("trade_no") @Validation(required = true) public String tradeNo; public static AlipayTradeFastpayRefundQueryResponse build(java.util.Map<String, ?> map) throws Exception { AlipayTradeFastpayRefundQueryResponse self = new AlipayTradeFastpayRefundQueryResponse(); return TeaModel.build(map, self); } }
27
110
0.717108
af9c45314ef7f50f7a9948dde7ef10249c90c8d3
4,184
package io.github.novopashin; import io.github.novopashin.annotations.XmlAttribute; import io.github.novopashin.annotations.XmlObject; import io.github.novopashin.annotations.XmlTag; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; import java.io.FileOutputStream; public class Main { static Document serialized(Object object) throws Exception { if (!object.getClass().isAnnotationPresent(XmlObject.class)) { throw new Exception("Illegal object passed (not annotated)"); } var rootTag = object.getClass().getSimpleName(); var document = DocumentHelper.createDocument(); var root = document.addElement(rootTag); var fields = object.getClass().getDeclaredFields(); var methods = object.getClass().getDeclaredMethods(); for (var field : fields) { if (field.isAnnotationPresent(XmlTag.class)) { field.setAccessible(true); if (field.get(object).getClass().isAnnotationPresent(XmlObject.class)) { var serializedElement = serialized(field.get(object)).getRootElement(); root.add(serializedElement); continue; } var tagname = (field.getAnnotation(XmlTag.class)).name(); if (tagname.equals("UNDEFINED")) { root.addElement(field.getName()).addText(field.get(object).toString()); continue; } root.addElement(tagname).addText(field.get(object).toString()); } } for (var method : methods) { if (method.isAnnotationPresent(XmlTag.class)) { method.setAccessible(true); var tagname = (method.getAnnotation(XmlTag.class)).name(); if (tagname.equals("UNDEFINED")) { root.addElement(method.getName()).addText(method.invoke(object).toString()); continue; } root.addElement(tagname).addText(method.invoke(object).toString()); } } for (var field : fields) { if (field.isAnnotationPresent(XmlAttribute.class)) { field.setAccessible(true); var tagname = (field.getAnnotation(XmlAttribute.class)).tag(); if (tagname.equals("UNDEFINED")) { root.addAttribute(field.getName(), field.get(object).toString()); continue; } var node = (Element) document.selectSingleNode("//" + tagname); node.addAttribute(field.getName(), field.get(object).toString()); } } for (var method : methods) { if (method.isAnnotationPresent(XmlAttribute.class)) { method.setAccessible(true); var tagname = (method.getAnnotation(XmlAttribute.class)).tag(); if (tagname.equals("UNDEFINED")) { root.addAttribute(method.getName(), method.invoke(object).toString()); continue; } if (method.getReturnType() == Void.class) { throw new Exception("Impossible to serialize. Method returns void."); } if (method.getParameterCount() > 0) { throw new Exception("Impossible to serialize. Method has arguments."); } var node = (Element) document.selectSingleNode("//" + tagname); node.addAttribute(method.getName(), method.invoke(object).toString()); } } return document; } public static void main(String[] args) throws Exception { var person = new Person("Sergey", "RUS", 32); var serializedPerson = serialized(person); OutputFormat format = OutputFormat.createPrettyPrint(); var outputStream = new FileOutputStream("output.xml"); var writer = new XMLWriter(outputStream, format); writer.write(serializedPerson); } }
36.382609
96
0.576004
9fa0f9043e100fcfb7895ea935aff03359b43980
2,154
package com.lovecws.mumu.core.utils; import org.apache.commons.lang3.StringUtils; public class IPAddressUtil { /** * 将ip地址转换为二进制字符串 * @param ip 255.255.255.255 * @return */ public static final String toBinaryString(String ip) { if (ip == null || "".equals(ip)) { return null; } String[] ipAddress = StringUtils.split(ip, "."); StringBuilder builder = new StringBuilder(); for (String ipAdd : ipAddress) { String binaryString = Integer.toBinaryString(Integer.parseInt(ipAdd)); binaryString = StringUtils.leftPad(binaryString, 8, "0"); builder.append(binaryString); } return builder.toString(); } /** * 将二进制字符串转化为int * @param bi 11111111111111111111111111111111 * @return */ public static final long toLong(String bi) { int len = bi.length(); long sum = 0; int tmp, max = len - 1; for (int i = 0; i < len; ++i) { tmp = bi.charAt(i) - '0'; sum += tmp * Math.pow(2, max--); } return sum; } /** * 将ip地址转换为int * @param ip ip地址 * @return */ public static final long transformIpAddressToLong(String ip){ String binaryString = toBinaryString(ip); if(binaryString==null){ return 0; } return toLong(binaryString); } /** * int数字转换为ip地址 * @param ip ip地址 * @return */ public static final String transformLongToIpAddress(int intIpAddress){ String binaryString = Integer.toBinaryString(intIpAddress); binaryString = StringUtils.leftPad(binaryString, 32, "0"); StringBuilder ipAddress=new StringBuilder(); for (int i = 0; i < 4; i++) { String substring = binaryString.substring(i*8, (i+1)*8); ipAddress.append(toLong(substring)); if(i<3){ ipAddress.append("."); } } return ipAddress.toString(); } public static void main(String[] args) { //long transformIpAddressToInt = transformIpAddressToInt("128.0.0.0"); //10000000000000000000011111111111 2147483647 long transformIpAddressToInt = transformIpAddressToLong("255.255.255.255"); //10000000000000000000011111111111 2147483647 System.out.println(transformIpAddressToInt); String ipAddress = transformLongToIpAddress(2147483647); System.out.println(ipAddress); } }
25.046512
77
0.688022
298faec58084355c2b27a7ef8cd867bf43632c24
4,003
package com.netease.nim.avchatkit.teamavchat; import android.content.Context; import android.util.Pair; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.LinearLayout; import com.netease.nim.avchatkit.AVChatKit; import com.netease.nim.avchatkit.R; import com.netease.nim.avchatkit.common.dialog.CustomAlertDialog; import com.netease.nim.avchatkit.teamavchat.adapter.TeamAVChatVoiceMuteAdapter; import com.netease.nim.avchatkit.teamavchat.module.TeamAVChatVoiceMuteItem; import java.util.ArrayList; import java.util.List; /** * Created by hzchenkang on 2017/5/9. */ public class TeamAVChatVoiceMuteDialog extends CustomAlertDialog { private TeamAVChatVoiceMuteAdapter adapter; private TeamVoiceMuteListener listener; private List<Pair<String, Boolean>> beforeMutes; public TeamAVChatVoiceMuteDialog(Context context, String teamId, List<Pair<String, Boolean>> voiceMutes) { super(context, voiceMutes == null ? 0 : voiceMutes.size()); beforeMutes = voiceMutes; if (voiceMutes == null) { return; } setTitle("屏蔽音频"); setCanceledOnTouchOutside(false); List<TeamAVChatVoiceMuteItem> data = new ArrayList<>(); for (Pair<String, Boolean> voiceMute : voiceMutes) { TeamAVChatVoiceMuteItem item = new TeamAVChatVoiceMuteItem(); item.setAccount(voiceMute.first); item.setMute(voiceMute.second); item.setDisplayName(AVChatKit.getTeamDataProvider().getTeamMemberDisplayName(teamId, item.getAccount())); data.add(item); } adapter = new TeamAVChatVoiceMuteAdapter(context, data); setAdapter(adapter, new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TeamAVChatVoiceMuteItem item = (TeamAVChatVoiceMuteItem) adapter.getItem(position); if (item == null) { return; } item.setMute(!item.isMute()); adapter.notifyDataSetChanged(); } }); } public void setTeamVoiceMuteListener(TeamVoiceMuteListener listener) { this.listener = listener; } public interface TeamVoiceMuteListener { void onVoiceMuteChange(List<Pair<String, Boolean>> voiceMuteAccounts); } @Override protected void addFootView(LinearLayout parent) { View footView = getLayoutInflater().inflate(R.layout.nim_easy_alert_dialog_bottom_button, null); Button positiveButton = (Button) footView.findViewById(R.id.easy_dialog_positive_btn); positiveButton.setVisibility(View.VISIBLE); positiveButton.setText(getContext().getString(R.string.save)); Button negativeButton = (Button) footView.findViewById(R.id.easy_dialog_negative_btn); negativeButton.setVisibility(View.VISIBLE); positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { List<Pair<String, Boolean>> items = new ArrayList<>(); List<TeamAVChatVoiceMuteItem> afterItems = adapter.getItems(); for (int i = 0; i < afterItems.size(); i++) { if (afterItems.get(i).isMute() != beforeMutes.get(i).second) { items.add(new Pair<>(beforeMutes.get(i).first, !beforeMutes.get(i).second)); } } listener.onVoiceMuteChange(items); } dismiss(); } }); negativeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); parent.addView(footView); } }
37.411215
117
0.636772
6e2130842f1cee217f00ef329c09d742f190969d
10,149
/* * 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.cbn.transform.v20170912; import java.util.ArrayList; import java.util.List; import com.aliyuncs.cbn.model.v20170912.DescribeCenRouteMapsResponse; import com.aliyuncs.cbn.model.v20170912.DescribeCenRouteMapsResponse.RouteMap; import com.aliyuncs.transform.UnmarshallerContext; public class DescribeCenRouteMapsResponseUnmarshaller { public static DescribeCenRouteMapsResponse unmarshall(DescribeCenRouteMapsResponse describeCenRouteMapsResponse, UnmarshallerContext _ctx) { describeCenRouteMapsResponse.setRequestId(_ctx.stringValue("DescribeCenRouteMapsResponse.RequestId")); describeCenRouteMapsResponse.setTotalCount(_ctx.integerValue("DescribeCenRouteMapsResponse.TotalCount")); describeCenRouteMapsResponse.setPageNumber(_ctx.integerValue("DescribeCenRouteMapsResponse.PageNumber")); describeCenRouteMapsResponse.setPageSize(_ctx.integerValue("DescribeCenRouteMapsResponse.PageSize")); List<RouteMap> routeMaps = new ArrayList<RouteMap>(); for (int i = 0; i < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps.Length"); i++) { RouteMap routeMap = new RouteMap(); routeMap.setStatus(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].Status")); routeMap.setRouteMapId(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].RouteMapId")); routeMap.setCenId(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].CenId")); routeMap.setCenRegionId(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].CenRegionId")); routeMap.setDescription(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].Description")); routeMap.setMapResult(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MapResult")); routeMap.setPriority(_ctx.integerValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].Priority")); routeMap.setNextPriority(_ctx.integerValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].NextPriority")); routeMap.setCidrMatchMode(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].CidrMatchMode")); routeMap.setAsPathMatchMode(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].AsPathMatchMode")); routeMap.setCommunityMatchMode(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].CommunityMatchMode")); routeMap.setCommunityOperateMode(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].CommunityOperateMode")); routeMap.setPreference(_ctx.integerValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].Preference")); routeMap.setTransmitDirection(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].TransmitDirection")); routeMap.setSourceInstanceIdsReverseMatch(_ctx.booleanValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceInstanceIdsReverseMatch")); routeMap.setDestinationInstanceIdsReverseMatch(_ctx.booleanValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationInstanceIdsReverseMatch")); routeMap.setGatewayZoneId(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].GatewayZoneId")); routeMap.setMatchAddressType(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MatchAddressType")); routeMap.setTransitRouterRouteTableId(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].TransitRouterRouteTableId")); List<String> sourceInstanceIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceInstanceIds.Length"); j++) { sourceInstanceIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceInstanceIds["+ j +"]")); } routeMap.setSourceInstanceIds(sourceInstanceIds); List<String> destinationInstanceIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationInstanceIds.Length"); j++) { destinationInstanceIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationInstanceIds["+ j +"]")); } routeMap.setDestinationInstanceIds(destinationInstanceIds); List<String> sourceRouteTableIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceRouteTableIds.Length"); j++) { sourceRouteTableIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceRouteTableIds["+ j +"]")); } routeMap.setSourceRouteTableIds(sourceRouteTableIds); List<String> destinationRouteTableIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationRouteTableIds.Length"); j++) { destinationRouteTableIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationRouteTableIds["+ j +"]")); } routeMap.setDestinationRouteTableIds(destinationRouteTableIds); List<String> sourceRegionIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceRegionIds.Length"); j++) { sourceRegionIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceRegionIds["+ j +"]")); } routeMap.setSourceRegionIds(sourceRegionIds); List<String> sourceChildInstanceTypes = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceChildInstanceTypes.Length"); j++) { sourceChildInstanceTypes.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SourceChildInstanceTypes["+ j +"]")); } routeMap.setSourceChildInstanceTypes(sourceChildInstanceTypes); List<String> destinationChildInstanceTypes = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationChildInstanceTypes.Length"); j++) { destinationChildInstanceTypes.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationChildInstanceTypes["+ j +"]")); } routeMap.setDestinationChildInstanceTypes(destinationChildInstanceTypes); List<String> destinationCidrBlocks = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationCidrBlocks.Length"); j++) { destinationCidrBlocks.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationCidrBlocks["+ j +"]")); } routeMap.setDestinationCidrBlocks(destinationCidrBlocks); List<String> routeTypes = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].RouteTypes.Length"); j++) { routeTypes.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].RouteTypes["+ j +"]")); } routeMap.setRouteTypes(routeTypes); List<String> matchAsns = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MatchAsns.Length"); j++) { matchAsns.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MatchAsns["+ j +"]")); } routeMap.setMatchAsns(matchAsns); List<String> matchCommunitySet = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MatchCommunitySet.Length"); j++) { matchCommunitySet.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].MatchCommunitySet["+ j +"]")); } routeMap.setMatchCommunitySet(matchCommunitySet); List<String> operateCommunitySet = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].OperateCommunitySet.Length"); j++) { operateCommunitySet.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].OperateCommunitySet["+ j +"]")); } routeMap.setOperateCommunitySet(operateCommunitySet); List<String> prependAsPath = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].PrependAsPath.Length"); j++) { prependAsPath.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].PrependAsPath["+ j +"]")); } routeMap.setPrependAsPath(prependAsPath); List<String> destinationRegionIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationRegionIds.Length"); j++) { destinationRegionIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].DestinationRegionIds["+ j +"]")); } routeMap.setDestinationRegionIds(destinationRegionIds); List<String> originalRouteTableIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].OriginalRouteTableIds.Length"); j++) { originalRouteTableIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].OriginalRouteTableIds["+ j +"]")); } routeMap.setOriginalRouteTableIds(originalRouteTableIds); List<String> srcZoneIds = new ArrayList<String>(); for (int j = 0; j < _ctx.lengthValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SrcZoneIds.Length"); j++) { srcZoneIds.add(_ctx.stringValue("DescribeCenRouteMapsResponse.RouteMaps["+ i +"].SrcZoneIds["+ j +"]")); } routeMap.setSrcZoneIds(srcZoneIds); routeMaps.add(routeMap); } describeCenRouteMapsResponse.setRouteMaps(routeMaps); return describeCenRouteMapsResponse; } }
63.830189
156
0.751798
ad6d893323763ae83617fe3ee352fdd7babe05e2
12,873
/* * Copyright 2015 John Persano * 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 uk.org.crimetalk; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.view.View; import java.util.ArrayList; import java.util.List; import uk.org.crimetalk.adapters.NavigationDrawerAdapter; import uk.org.crimetalk.adapters.items.NavigationDrawerListItem; import uk.org.crimetalk.fragments.ErrorFragment; import uk.org.crimetalk.fragments.LibraryFragment; import uk.org.crimetalk.fragments.PagerFragment; import uk.org.crimetalk.fragments.PressCuttingsFragment; import uk.org.crimetalk.fragments.ShopFragment; import uk.org.crimetalk.utils.PreferenceUtils; import uk.org.crimetalk.utils.ThemeUtils; import uk.org.crimetalk.views.NavigationDrawerContainer; import uk.org.crimetalk.views.NavigationDrawerListView; /** * {@link android.app.Activity} that shows the main content. * * @see {@link uk.org.crimetalk.fragments.LibraryFragment} * @see {@link uk.org.crimetalk.fragments.PressCuttingsFragment} */ public class MainActivity extends ActionBarActivity implements PagerFragment.QuickNavFragment.QuickNavFragmentListener { // Start Activity for result request code for SettingsActivity private static final int SETTINGS_ACTIVITY_REQUEST_CODE = 1; private static final String ARGS_SELECTED_POSITION = "selected_position"; private static final String ARGS_TITLE = "title"; private ActionBarDrawerToggle mActionBarDrawerToggle; private DrawerLayout mDrawerLayout; private NavigationDrawerContainer mNavigationDrawerContainer; private int mCurrentSelectedPosition = -1; private boolean mUserLearnedNavigation; private CharSequence mTitle; @Override protected void onCreate(Bundle savedInstanceState) { ThemeUtils.setTheme(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Modify various attributes of the Toolbar setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); mUserLearnedNavigation = PreferenceUtils.getUserLearnedNavigation(MainActivity.this); mNavigationDrawerContainer = (NavigationDrawerContainer) findViewById(R.id.navigation_container); final NavigationDrawerAdapter navigationDrawerAdapter = new NavigationDrawerAdapter(MainActivity.this, R.layout.row_primary_navigation, getNavigationItems()); // Set up the DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.crimetalk_dark_red)); // Set up the ActionBarDrawerToggle mActionBarDrawerToggle = new ActionBarDrawerToggle(MainActivity.this, mDrawerLayout, R.string.navigation_drawer_open, R.string.navigation_drawer_close) { @Override public void onDrawerSlide(View drawerView, float slideOffset) { // Hacky way to stop hamburger icon to arrow animation if (drawerView != null) { super.onDrawerSlide(drawerView, 0); } } @Override public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); // When the user first opens the NavigationDrawer remember he/she learned it if (!mUserLearnedNavigation) { mUserLearnedNavigation = true; PreferenceUtils.setUserLearnedNavigation(MainActivity.this, true); } } }; // Show user the NavigationDrawer if it has never been seen before if (!mUserLearnedNavigation && savedInstanceState == null) { mDrawerLayout.openDrawer(mNavigationDrawerContainer); } mDrawerLayout.setDrawerListener(mActionBarDrawerToggle); // If new instance select the Library item if (savedInstanceState == null) { selectPrimaryItem(1); // Otherwise we are returning from a previous instance and should display the previous items } else { mCurrentSelectedPosition = savedInstanceState.getInt(ARGS_SELECTED_POSITION); mTitle = savedInstanceState.getString(ARGS_TITLE); getSupportActionBar().setTitle(mTitle); } // Set up a ListView specialized for NavigationDrawers final NavigationDrawerListView navigationDrawerListView = (NavigationDrawerListView) findViewById(R.id.navigation_list); navigationDrawerListView.setHeader(MainActivity.this, R.layout.header_navigation_drawer); navigationDrawerListView.setAdapter(navigationDrawerAdapter, mCurrentSelectedPosition > 0 ? mCurrentSelectedPosition : 1); navigationDrawerListView.setOnNavigationItemClickListener(new NavigationDrawerListView.OnNavigationItemClickListener() { @Override public void onPrimaryItemClick(int position) { selectPrimaryItem(position); } @Override public void onSecondaryItemClick(int position) { selectSecondaryItem(position); } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { // Open the drawer when the hamburger icon is clicked return mActionBarDrawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred mActionBarDrawerToggle.syncState(); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Save the selected primary item and the title outState.putInt(ARGS_SELECTED_POSITION, mCurrentSelectedPosition); outState.putCharSequence(ARGS_TITLE, mTitle); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mActionBarDrawerToggle.onConfigurationChanged(newConfig); } @Override public void onQuickNavSelected(int position) { // QuickNav was selected from the PressCuttingsFragment, navigate appropriately ((PagerFragment) getSupportFragmentManager().findFragmentById(R.id.container)).setViewPagerPosition(position); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { // The SettingsActivity will rigger this when the theme is changed if (requestCode == SETTINGS_ACTIVITY_REQUEST_CODE) { if (resultCode == RESULT_OK) { /* This is used when the user navigates back from changing the theme For information on the Handler, see http://stackoverflow.com/questions/13136263/concurrentmodificationexception-when-adding-entries-to-arraylist */ new Handler().postDelayed(new Runnable() { @Override public void run() { MainActivity.this.recreate(); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } }, 10); } } } /** * Private method. * Handles selection of primary navigation items * * Order of items in the list: * * 0 = NavigationDrawer header view * * 1 = LibraryFragment * 2 = PressCuttingsFragment * 3 = ShopFragment * * 4 = Separator * * 5 = SettingsActivity * 6 = AboutActivity */ private void selectPrimaryItem(int position) { // Let's not load anything if the user selects the same screen they're on if(mCurrentSelectedPosition == position) { if (mDrawerLayout != null) { mDrawerLayout.closeDrawer(mNavigationDrawerContainer); } return; } this.mCurrentSelectedPosition = position; // Adjust the position for the header view final int listPosition = position - 1; // Change the title this.mTitle = getNavigationItems().get(listPosition).getTitle(); this.getSupportActionBar().setTitle(mTitle); if (mDrawerLayout != null) { mDrawerLayout.closeDrawer(mNavigationDrawerContainer); } // The Fragment to be loaded Fragment fragment; /* Load the Fragment appropriate for the navigation selection. Note the case differentiation. This is because the header in the NavigationDrawer counts as item '0' so the first item in the list is actually item '1' */ switch (position) { case 1: fragment = new LibraryFragment(); break; case 2: fragment = new PressCuttingsFragment(); break; case 3: fragment = new ShopFragment(); break; default: fragment = new ErrorFragment(); break; } getSupportFragmentManager() .beginTransaction() .replace(R.id.container, fragment) .commit(); } /** * Private method. * Handles selection of secondary navigation items */ private void selectSecondaryItem(int position) { /* Load the Activity appropriate for the navigation selection. Note the case differentiation. Since the primary items are in the same list, these items must come after it. The numbers are further skewed by the header view and separator which both count as an item */ switch (position) { case 5: // Listen for result signifying theme was changed startActivityForResult(new Intent(this, SettingsActivity.class), SETTINGS_ACTIVITY_REQUEST_CODE); break; case 6: startActivity(new Intent(this, AboutActivity.class)); break; } } /** * Private method. * Used for the creation of a {@link uk.org.crimetalk.adapters.NavigationDrawerAdapter}. * * @return A {@link uk.org.crimetalk.adapters.items.NavigationDrawerListItem} {@link java.util.List} */ private List<NavigationDrawerListItem> getNavigationItems() { final List<NavigationDrawerListItem> navigationListItems = new ArrayList<>(); // Add primary navigation items navigationListItems.add(NavigationDrawerListItem.createPrimaryNavigationItem(getResources() .getString(R.string.library), R.drawable.ic_library_light)); navigationListItems.add(NavigationDrawerListItem.createPrimaryNavigationItem(getResources() .getString(R.string.press_cuttings), R.drawable.ic_world_light)); navigationListItems.add(NavigationDrawerListItem.createPrimaryNavigationItem(getResources() .getString(R.string.shop), R.drawable.ic_shop_light)); // Add separator navigationListItems.add(NavigationDrawerListItem.createSeparatorItem()); // Add secondary navigation items navigationListItems.add(NavigationDrawerListItem.createSecondaryNavigationItem(getResources() .getString(R.string.settings))); navigationListItems.add(NavigationDrawerListItem.createSecondaryNavigationItem(getResources() .getString(R.string.about))); return navigationListItems; } }
32.589873
131
0.676299
6f519be8e51cc6930397c2f17947df33cf971e1c
381
package com.mycompany.myapp.repository; import com.mycompany.myapp.domain.ShoppingCart; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the ShoppingCart entity. */ @SuppressWarnings("unused") @Repository public interface ShoppingCartRepository extends JpaRepository<ShoppingCart, Long> { }
25.4
83
0.811024
54d54ea174afb29060406a96dd45d62272c1a301
39,123
/* * #%L * de.metas.cucumber * %% * Copyright (C) 2022 metas GmbH * %% * This program 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 2 of the * License, or (at your option) any later version. * * This program 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/gpl-2.0.html>. * #L% */ package de.metas.cucumber.stepdefs.shipmentschedule; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import de.metas.common.rest_api.v2.JsonAttributeSetInstance; import de.metas.common.shipping.v2.JsonProduct; import de.metas.common.shipping.v2.shipmentcandidate.JsonCustomer; import de.metas.common.shipping.v2.shipmentcandidate.JsonResponseShipmentCandidate; import de.metas.common.shipping.v2.shipmentcandidate.JsonResponseShipmentCandidates; import de.metas.cucumber.stepdefs.AD_User_StepDefData; import de.metas.cucumber.stepdefs.C_BPartner_Location_StepDefData; import de.metas.cucumber.stepdefs.C_BPartner_StepDefData; import de.metas.cucumber.stepdefs.C_OrderLine_StepDefData; import de.metas.cucumber.stepdefs.C_Order_StepDefData; import de.metas.cucumber.stepdefs.DataTableUtil; import de.metas.cucumber.stepdefs.M_Product_StepDefData; import de.metas.cucumber.stepdefs.M_Shipper_StepDefData; import de.metas.cucumber.stepdefs.StepDefConstants; import de.metas.cucumber.stepdefs.StepDefUtil; import de.metas.cucumber.stepdefs.attribute.M_AttributeSetInstance_StepDefData; import de.metas.cucumber.stepdefs.context.TestContext; import de.metas.cucumber.stepdefs.shipment.M_InOut_StepDefData; import de.metas.handlingunits.shipmentschedule.api.GenerateShipmentsForSchedulesRequest; import de.metas.handlingunits.shipmentschedule.api.M_ShipmentSchedule_QuantityTypeToUse; import de.metas.handlingunits.shipmentschedule.api.ShipmentService; import de.metas.inout.InOutId; import de.metas.inout.ShipmentScheduleId; import de.metas.inoutcandidate.api.IShipmentScheduleHandlerBL; import de.metas.inoutcandidate.invalidation.IShipmentScheduleInvalidateBL; import de.metas.inoutcandidate.invalidation.IShipmentScheduleInvalidateRepository; import de.metas.inoutcandidate.model.I_M_ShipmentSchedule; import de.metas.inoutcandidate.model.I_M_ShipmentSchedule_ExportAudit; import de.metas.inoutcandidate.model.I_M_ShipmentSchedule_Recompute; import de.metas.material.event.commons.AttributesKey; import de.metas.order.OrderId; import de.metas.rest_api.v2.attributes.JsonAttributeService; import de.metas.util.Check; import de.metas.util.Services; import de.metas.util.StringUtils; import io.cucumber.datatable.DataTable; import io.cucumber.java.en.And; import io.cucumber.java.en.Then; import lombok.Builder; import lombok.NonNull; import lombok.Singular; import lombok.Value; import org.adempiere.ad.dao.ICompositeQueryUpdater; import org.adempiere.ad.dao.IQueryBL; import org.adempiere.ad.dao.IQueryBuilder; import org.adempiere.mm.attributes.AttributeSetInstanceId; import org.adempiere.mm.attributes.api.AttributesKeys; import org.adempiere.model.InterfaceWrapperHelper; import org.compiere.SpringContextHolder; import org.compiere.model.IQuery; import org.compiere.model.I_AD_User; import org.compiere.model.I_C_BPartner; import org.compiere.model.I_C_BPartner_Location; import org.compiere.model.I_C_Order; import org.compiere.model.I_C_OrderLine; import org.compiere.model.I_C_UOM; import org.compiere.model.I_M_AttributeSetInstance; import org.compiere.model.I_M_InOut; import org.compiere.model.I_M_Product; import org.compiere.model.I_M_Shipper; import org.compiere.util.Env; import javax.annotation.Nullable; import java.math.BigDecimal; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Supplier; import static de.metas.cucumber.stepdefs.StepDefConstants.TABLECOLUMN_IDENTIFIER; import static de.metas.inoutcandidate.model.I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID; import static de.metas.inoutcandidate.model.I_M_ShipmentSchedule_ExportAudit.COLUMNNAME_M_ShipmentSchedule_ExportAudit_ID; import static org.adempiere.model.InterfaceWrapperHelper.saveRecord; import static org.assertj.core.api.Assertions.*; import static org.compiere.model.I_C_OrderLine.COLUMNNAME_M_AttributeSetInstance_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class M_ShipmentSchedule_StepDef { private static final String SHIP_BPARTNER = "shipBPartner"; private static final String BILL_BPARTNER = "billBPartner"; private final ShipmentService shipmentService = SpringContextHolder.instance.getBean(ShipmentService.class); private final IShipmentScheduleInvalidateRepository shipmentScheduleInvalidateRepository = Services.get(IShipmentScheduleInvalidateRepository.class); private final IQueryBL queryBL = Services.get(IQueryBL.class); private final IShipmentScheduleHandlerBL shipmentScheduleHandlerBL = Services.get(IShipmentScheduleHandlerBL.class); private final AD_User_StepDefData userTable; private final C_BPartner_StepDefData bpartnerTable; private final C_BPartner_Location_StepDefData bpartnerLocationTable; private final C_Order_StepDefData orderTable; private final C_OrderLine_StepDefData orderLineTable; private final M_ShipmentSchedule_StepDefData shipmentScheduleTable; private final M_Shipper_StepDefData shipperTable; private final M_Product_StepDefData productTable; private final M_ShipmentSchedule_ExportAudit_StepDefData shipmentScheduleExportAuditTable; private final M_AttributeSetInstance_StepDefData attributeSetInstanceTable; private final M_InOut_StepDefData shipmentTable; private final TestContext testContext; private final JsonAttributeService jsonAttributeService; final ObjectMapper mapper = new ObjectMapper() .findAndRegisterModules() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE) .enable(MapperFeature.USE_ANNOTATIONS); public M_ShipmentSchedule_StepDef( @NonNull final AD_User_StepDefData userTable, @NonNull final C_BPartner_StepDefData bpartnerTable, @NonNull final C_BPartner_Location_StepDefData bpartnerLocationTable, @NonNull final C_Order_StepDefData orderTable, @NonNull final C_OrderLine_StepDefData orderLineTable, @NonNull final M_ShipmentSchedule_StepDefData shipmentScheduleTable, @NonNull final M_Shipper_StepDefData shipperTable, @NonNull final M_Product_StepDefData productTable, @NonNull final M_ShipmentSchedule_ExportAudit_StepDefData shipmentScheduleExportAuditTable, @NonNull final M_AttributeSetInstance_StepDefData attributeSetInstanceTable, @NonNull final M_InOut_StepDefData shipmentTable, @NonNull final TestContext testContext) { this.userTable = userTable; this.bpartnerTable = bpartnerTable; this.bpartnerLocationTable = bpartnerLocationTable; this.orderTable = orderTable; this.orderLineTable = orderLineTable; this.shipmentScheduleTable = shipmentScheduleTable; this.shipperTable = shipperTable; this.productTable = productTable; this.shipmentScheduleExportAuditTable = shipmentScheduleExportAuditTable; this.attributeSetInstanceTable = attributeSetInstanceTable; this.shipmentTable = shipmentTable; this.testContext = testContext; this.jsonAttributeService = SpringContextHolder.instance.getBean(JsonAttributeService.class); } /** * Match the shipment scheds and load them with their identifier into the shipmentScheduleTable. */ @Then("^after not more than (.*)s, M_ShipmentSchedules are found:$") public void thereAreShipmentSchedules(final int timeoutSec, @NonNull final DataTable dataTable) throws InterruptedException { // create query per table row; run the queries repeatedly until they succeed or the timeout is exceeded // if they succeed, put them into shipmentScheduleTable final ShipmentScheduleQueries shipmentScheduleQueries = createShipmentScheduleQueries(dataTable); final Supplier<Boolean> shipmentScheduleQueryExecutor = () -> { if (shipmentScheduleQueries.isAllDone()) { return true; } shipmentScheduleTable.putAll(shipmentScheduleQueries.executeAllRemaining()); return shipmentScheduleQueries.isAllDone(); }; StepDefUtil.tryAndWait(timeoutSec, 500, shipmentScheduleQueryExecutor); assertThat(shipmentScheduleQueries.isAllDone()).as("Not all M_ShipmentSchedules were created within the %s second timout", timeoutSec).isTrue(); } @And("^the shipment schedule identified by (.*) is processed after not more than (.*) seconds$") public void processedShipmentScheduleByIdentifier(@NonNull final String identifier, final int timeoutSec) throws InterruptedException { final I_M_ShipmentSchedule shipmentSchedule = shipmentScheduleTable.get(identifier); final Supplier<Boolean> isShipmentScheduleProcessed = () -> { final I_M_ShipmentSchedule record = queryBL .createQueryBuilder(I_M_ShipmentSchedule.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(COLUMNNAME_M_ShipmentSchedule_ID, shipmentSchedule.getM_ShipmentSchedule_ID()) .create() .firstOnlyNotNull(I_M_ShipmentSchedule.class); return record.isProcessed(); }; StepDefUtil.tryAndWait(timeoutSec, 500, isShipmentScheduleProcessed); assertThat(isShipmentScheduleProcessed.get()) .as("M_ShipmentSchedules with identifier %s was not processed within the %s second timout", identifier, timeoutSec) .isTrue(); } @Then("the shipment-schedule is closed") public void assertShipmentScheduleIsClosed(@NonNull final DataTable dataTable) { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> tableRow : tableRows) { assertShipmentScheduleIsClosed(tableRow); } } @And("validate that there are no M_ShipmentSchedule_Recompute records after no more than {int} seconds for order {string}") public void validate_no_records(final int timeoutSec, final String orderIdentifier) throws InterruptedException { final I_C_Order order = orderTable.get(orderIdentifier); final ImmutableList<Integer> shipmentScheduleIds = queryBL.createQueryBuilder(I_M_ShipmentSchedule.class) .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_C_Order_ID, order.getC_Order_ID()) .create() .stream() .map(I_M_ShipmentSchedule::getM_ShipmentSchedule_ID) .collect(ImmutableList.toImmutableList()); assertThat(shipmentScheduleIds.size()).isGreaterThan(0); final Supplier<Boolean> noRecords = () -> { final List<I_M_ShipmentSchedule_Recompute> records = queryBL.createQueryBuilder(I_M_ShipmentSchedule_Recompute.class) .addInArrayFilter(I_M_ShipmentSchedule_Recompute.COLUMNNAME_M_ShipmentSchedule_ID, shipmentScheduleIds) .create() .list(); return records.size() == 0; }; StepDefUtil.tryAndWait(timeoutSec, 500, noRecords); assertThat(noRecords.get()) .as("There are still records in M_ShipmentSchedules_Recompute after %s second timeout", timeoutSec) .isTrue(); } @And("shipment is generated for the following shipment schedule") public void generateShipmentForSchedule(@NonNull final DataTable dataTable) { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> tableRow : tableRows) { generateShipmentForSchedule(tableRow); } } @And("update shipment schedules") public void update_shipment_schedule(@NonNull final DataTable dataTable) { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> tableRow : tableRows) { alterShipmentSchedule(tableRow); } } @And("^after not more than (.*)s, validate shipment schedules:$") public void validate_shipment_schedule(final int timeoutSec, @NonNull final DataTable dataTable) throws InterruptedException { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> tableRow : tableRows) { validateShipmentSchedule(timeoutSec, tableRow); } } @And("recompute shipment schedules") public void recompute_shipment_schedules(@NonNull final DataTable dataTable) { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> row : tableRows) { final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + "." + StepDefConstants.TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule shipmentScheduleRecord = shipmentScheduleTable.get(shipmentScheduleIdentifier); shipmentScheduleInvalidateRepository.invalidateShipmentSchedules(ImmutableSet.of(ShipmentScheduleId.ofRepoId(shipmentScheduleRecord.getM_ShipmentSchedule_ID()))); } } @And("^after not more than (.*)s, shipment schedule is recomputed$") public void wait_for_recompute_to_finish(final int timeoutSec, @NonNull final DataTable dataTable) throws InterruptedException { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); for (final Map<String, String> row : tableRows) { final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + "." + StepDefConstants.TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule shipmentScheduleRecord = shipmentScheduleTable.get(shipmentScheduleIdentifier); final Supplier<Boolean> shipmentScheduleWasRecomputed = () -> !shipmentScheduleInvalidateRepository.isFlaggedForRecompute(ShipmentScheduleId.ofRepoId(shipmentScheduleRecord.getM_ShipmentSchedule_ID())); StepDefUtil.tryAndWait(timeoutSec, 500, shipmentScheduleWasRecomputed); } } @And("validate M_ShipmentSchedule:") public void validate_M_ShipmentSchedule(@NonNull final DataTable dataTable) { for (final Map<String, String> row : dataTable.asMaps()) { validateSchedule(row); } } @And("validate JsonResponseShipmentCandidates.JsonCustomer") public void validate_JsonCustomer(@NonNull final DataTable dataTable) throws JsonProcessingException { final JsonResponseShipmentCandidates jsonResponseShipmentCandidates = mapper.readValue(testContext.getApiResponse().getContent(), JsonResponseShipmentCandidates.class); assertThat(jsonResponseShipmentCandidates).isNotNull(); final List<JsonResponseShipmentCandidate> items = jsonResponseShipmentCandidates.getItems(); assertThat(items.size()).isEqualTo(1); final JsonResponseShipmentCandidate item = items.get(0); for (final Map<String, String> row : dataTable.asMaps()) { final String qualifier = DataTableUtil.extractStringForColumnName(row, "qualifier"); if (qualifier.equals(SHIP_BPARTNER)) { validateJsonCustomer(item.getShipBPartner(), row); } else if (qualifier.equals(BILL_BPARTNER)) { validateJsonCustomer(item.getBillBPartner(), row); } } } @And("validate JsonResponseShipmentCandidates") public void validate_JsonResponseShipmentCandidates(@NonNull final DataTable dataTable) throws JsonProcessingException { final JsonResponseShipmentCandidates jsonResponseShipmentCandidates = mapper.readValue(testContext.getApiResponse().getContent(), JsonResponseShipmentCandidates.class); assertThat(jsonResponseShipmentCandidates).isNotNull(); final List<JsonResponseShipmentCandidate> items = jsonResponseShipmentCandidates.getItems(); assertThat(items.size()).isEqualTo(1); final JsonResponseShipmentCandidate item = items.get(0); final Map<String, String> row = dataTable.asMaps().get(0); final I_M_ShipmentSchedule_ExportAudit scheduleExportAudit = queryBL.createQueryBuilder(I_M_ShipmentSchedule_ExportAudit.class) .addEqualsFilter(I_M_ShipmentSchedule_ExportAudit.COLUMNNAME_TransactionIdAPI, jsonResponseShipmentCandidates.getTransactionKey()) .create() .firstOnlyNotNull(I_M_ShipmentSchedule_ExportAudit.class); final String scheduleExportAuditIdentifier = DataTableUtil.extractStringForColumnName(row, COLUMNNAME_M_ShipmentSchedule_ExportAudit_ID + "." + TABLECOLUMN_IDENTIFIER); shipmentScheduleExportAuditTable.put(scheduleExportAuditIdentifier, scheduleExportAudit); final String scheduleIdentifier = DataTableUtil.extractStringForColumnName(row, COLUMNNAME_M_ShipmentSchedule_ID + "." + TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule schedule = shipmentScheduleTable.get(scheduleIdentifier); assertThat(item.getId().getValue()).isEqualTo(schedule.getM_ShipmentSchedule_ID()); //product final String productIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_Product.Table_Name + "." + TABLECOLUMN_IDENTIFIER); final I_M_Product product = productTable.get(productIdentifier); final JsonProduct jsonProduct = item.getProduct(); assertThat(jsonProduct.getProductNo()).isEqualTo(product.getValue()); assertThat(jsonProduct.getName()).isEqualTo(product.getName()); assertThat(jsonProduct.getDescription()).isEqualTo(product.getDescription()); assertThat(jsonProduct.isStocked()).isEqualTo(product.isStocked()); final String shipperIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_Shipper.Table_Name + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(shipperIdentifier)) { final I_M_Shipper shipper = shipperTable.get(shipperIdentifier); assertThat(item.getShipperInternalSearchKey()).isEqualTo(shipper.getInternalName()); } final String poReference = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_POReference); if (Check.isNotBlank(poReference)) { assertThat(item.getPoReference()).isEqualTo(poReference); } final BigDecimal orderedQty = DataTableUtil.extractBigDecimalOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_QtyOrdered); final String uomCode = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_C_UOM.COLUMNNAME_X12DE355); if (orderedQty != null) { assertThat(item.getOrderedQty()).isNotEmpty(); assertThat(item.getOrderedQty().get(0).getQty()).isEqualTo(orderedQty); assertThat(item.getOrderedQty().get(0).getUomCode()).isEqualTo(uomCode); } final int numberOfItemsForSameShipment = DataTableUtil.extractIntOrMinusOneForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_NrOfOLCandsWithSamePOReference); if (numberOfItemsForSameShipment > 0) { assertThat(item.getNumberOfItemsForSameShipment()).isEqualTo(numberOfItemsForSameShipment); } final String asiIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMN_M_AttributeSetInstance_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(asiIdentifier)) { final JsonAttributeSetInstance jsonAttributeSetInstance = item.getAttributeSetInstance(); final AttributeSetInstanceId actualASI = jsonAttributeService.computeAttributeSetInstanceFromJson(jsonAttributeSetInstance) .orElse(null); assertThat(actualASI).isNotNull(); final I_M_AttributeSetInstance expectedASI = attributeSetInstanceTable.get(asiIdentifier); assertThat(expectedASI).isNotNull(); final AttributesKey actualAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(actualASI).orElse(AttributesKey.NONE); final AttributesKey expectedAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(AttributeSetInstanceId.ofRepoId(expectedASI.getM_AttributeSetInstance_ID())) .orElse(AttributesKey.NONE); assertThat(actualAttributesKeys).isEqualTo(expectedAttributesKeys); } final BigDecimal orderedQtyNetPrice = DataTableUtil.extractBigDecimalOrNullForColumnName(row, "OPT.OrderedQtyNetPrice"); if (orderedQtyNetPrice != null) { assertThat(item.getOrderedQtyNetPrice()).isEqualByComparingTo(orderedQtyNetPrice); } final BigDecimal qtyToDeliverNetPrice = DataTableUtil.extractBigDecimalOrNullForColumnName(row, "OPT.QtyToDeliverNetPrice"); if (qtyToDeliverNetPrice != null) { assertThat(item.getQtyToDeliverNetPrice()).isEqualByComparingTo(qtyToDeliverNetPrice); } final BigDecimal deliveredQtyNetPrice = DataTableUtil.extractBigDecimalOrNullForColumnName(row, "OPT.DeliveredQtyNetPrice"); if (deliveredQtyNetPrice != null) { assertThat(item.getDeliveredQtyNetPrice()).isEqualByComparingTo(deliveredQtyNetPrice); } } @And("deactivate all M_ShipmentSchedule records") public void deactivate_M_ShipmentSchedule() { final ICompositeQueryUpdater<I_M_ShipmentSchedule> updater = queryBL .createCompositeQueryUpdater(I_M_ShipmentSchedule.class) .addSetColumnValue(I_M_ShipmentSchedule.COLUMNNAME_IsActive, false); queryBL.createQueryBuilder(I_M_ShipmentSchedule.class) .addOnlyActiveRecordsFilter() .create() .update(updater); } @And("^there is no M_ShipmentSchedule for C_Order (.*)$") public void validate_no_M_ShipmentSchedule_created(@NonNull final String orderIdentifier) { final I_C_Order order = orderTable.get(orderIdentifier); final OrderId orderId = OrderId.ofRepoId(order.getC_Order_ID()); validateNoShipmentScheduleCreatedForOrder(orderId); shipmentScheduleHandlerBL.createMissingCandidates(Env.getCtx()); validateNoShipmentScheduleCreatedForOrder(orderId); } private void validateNoShipmentScheduleCreatedForOrder(@NonNull final OrderId orderId) { final I_M_ShipmentSchedule schedule = queryBL.createQueryBuilder(I_M_ShipmentSchedule.class) .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_C_Order_ID, orderId.getRepoId()) .create() .firstOnlyOrNull(I_M_ShipmentSchedule.class); assertThat(schedule).isNull(); } private ShipmentScheduleQueries createShipmentScheduleQueries(@NonNull final DataTable dataTable) { final List<Map<String, String>> tableRows = dataTable.asMaps(String.class, String.class); final ShipmentScheduleQueries.ShipmentScheduleQueriesBuilder queries = ShipmentScheduleQueries.builder(); for (final Map<String, String> tableRow : tableRows) { final IQueryBuilder<I_M_ShipmentSchedule> queryBuilder = queryBL.createQueryBuilder(I_M_ShipmentSchedule.class); final String orderLineIdentifier = DataTableUtil.extractStringForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_C_OrderLine_ID + ".Identifier"); final I_C_OrderLine orderLine = orderLineTable.get(orderLineIdentifier); queryBuilder.addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_C_OrderLine_ID, orderLine.getC_OrderLine_ID()); final int warehouseId = DataTableUtil.extractIntOrMinusOneForColumnName(tableRow, "OPT.Warehouse_ID"); if (warehouseId > 0) { queryBuilder.addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_M_Warehouse_ID, warehouseId); } final IQuery<I_M_ShipmentSchedule> query = queryBuilder.create(); final String isToRecompute = DataTableUtil.extractStringOrNullForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_IsToRecompute); final ShipmentScheduleQuery shipmentScheduleQuery = ShipmentScheduleQuery.builder() .shipmentScheduleIdentifier(DataTableUtil.extractRecordIdentifier(tableRow, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID)) .query(query) .isToRecompute(StringUtils.toBoolean(isToRecompute, null)) .build(); queries.query(shipmentScheduleQuery); } return queries.build(); } private void assertShipmentScheduleIsClosed(@NonNull final Map<String, String> tableRow) { final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + ".Identifier"); final I_M_ShipmentSchedule shipmentSchedule = shipmentScheduleTable.get(shipmentScheduleIdentifier); final I_M_ShipmentSchedule refreshedSchedule = queryBL.createQueryBuilder(I_M_ShipmentSchedule.class) .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID, shipmentSchedule.getM_ShipmentSchedule_ID()) .create() .firstOnlyNotNull(I_M_ShipmentSchedule.class); assertNotNull(shipmentSchedule); assertEquals(Boolean.TRUE, refreshedSchedule.isClosed()); } private void generateShipmentForSchedule(@NonNull final Map<String, String> tableRow) { final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + "." + StepDefConstants.TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule shipmentScheduleRecord = shipmentScheduleTable.get(shipmentScheduleIdentifier); final String qtyTypeToUse = DataTableUtil.extractStringForColumnName(tableRow, "quantityTypeToUse"); final boolean isCompleteShipment = DataTableUtil.extractBooleanForColumnName(tableRow, "isCompleteShipment"); final ShipmentScheduleId shipmentScheduleId = ShipmentScheduleId.ofRepoId(shipmentScheduleRecord.getM_ShipmentSchedule_ID()); final GenerateShipmentsForSchedulesRequest generateShipmentsForSchedulesRequest = GenerateShipmentsForSchedulesRequest.builder() .scheduleIds(ImmutableSet.of(shipmentScheduleId)) .quantityTypeToUse(M_ShipmentSchedule_QuantityTypeToUse.ofCode(qtyTypeToUse)) .isCompleteShipment(isCompleteShipment) .build(); final String shipmentIdCandidate = DataTableUtil.extractStringForColumnName(tableRow, I_M_InOut.COLUMNNAME_M_InOut_ID + "." + StepDefConstants.TABLECOLUMN_IDENTIFIER); final ImmutableList<String> shipmentIdentifiers = StepDefUtil.extractIdentifiers(shipmentIdCandidate); final Set<InOutId> inOutIds = shipmentService.generateShipmentsForScheduleIds(generateShipmentsForSchedulesRequest); assertThat(inOutIds.size()).isEqualTo(shipmentIdentifiers.size()); final List<InOutId> oldestFirstInOutIds = inOutIds.stream() .sorted() .collect(ImmutableList.toImmutableList()); for (int shipmentIndex = 0; shipmentIndex < oldestFirstInOutIds.size(); shipmentIndex++) { shipmentTable.putOrReplace(shipmentIdentifiers.get(shipmentIndex), InterfaceWrapperHelper.load(oldestFirstInOutIds.get(shipmentIndex), I_M_InOut.class)); } } private void alterShipmentSchedule(@NonNull final Map<String, String> tableRow) { final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + "." + StepDefConstants.TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule shipmentScheduleRecord = shipmentScheduleTable.get(shipmentScheduleIdentifier); final BigDecimal qtyToDeliverOverride = DataTableUtil.extractBigDecimalOrNullForColumnName(tableRow, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override); if (qtyToDeliverOverride != null) { shipmentScheduleRecord.setQtyToDeliver_Override(qtyToDeliverOverride); } final BigDecimal qtyToDeliverCatchOverride = DataTableUtil.extractBigDecimalOrNullForColumnName(tableRow, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliverCatch_Override); if (qtyToDeliverCatchOverride != null) { shipmentScheduleRecord.setQtyToDeliverCatch_Override(qtyToDeliverCatchOverride); } saveRecord(shipmentScheduleRecord); } private void validateShipmentSchedule(final int timeoutSec, @NonNull final Map<String, String> tableRow) throws InterruptedException { final BigDecimal qtyOrdered = DataTableUtil.extractBigDecimalForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_QtyOrdered); final BigDecimal qtyToDeliver = DataTableUtil.extractBigDecimalForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver); final BigDecimal qtyToDeliverOverride = DataTableUtil.extractBigDecimalOrNullForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override); final BigDecimal qtyPicked = DataTableUtil.extractBigDecimalForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_QtyPickList); final BigDecimal qtyDelivered = DataTableUtil.extractBigDecimalForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_QtyDelivered); final boolean isProcessed = DataTableUtil.extractBooleanForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_Processed); final String shipmentScheduleIdentifier = DataTableUtil.extractStringForColumnName(tableRow, I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID + ".Identifier"); final I_M_ShipmentSchedule shipmentSchedule = shipmentScheduleTable.get(shipmentScheduleIdentifier); final Supplier<Boolean> isShipmentScheduleFound = () -> queryBL .createQueryBuilder(I_M_ShipmentSchedule.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_M_ShipmentSchedule_ID, shipmentSchedule.getM_ShipmentSchedule_ID()) .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver, qtyToDeliver) .addEqualsFilter(I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override, qtyToDeliverOverride) .create() .firstOnlyOptional(I_M_ShipmentSchedule.class) .isPresent(); StepDefUtil.tryAndWait(timeoutSec, 500, isShipmentScheduleFound); InterfaceWrapperHelper.refresh(shipmentSchedule); if (qtyToDeliverOverride != null) { assertThat(shipmentSchedule.getQtyToDeliver_Override().stripTrailingZeros()).isEqualTo(qtyToDeliverOverride.stripTrailingZeros()); } else { assertThat(InterfaceWrapperHelper.isNull(shipmentSchedule, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override)).isTrue(); } assertThat(shipmentSchedule.getQtyToDeliver().stripTrailingZeros()).isEqualTo(qtyToDeliver.stripTrailingZeros()); assertThat(shipmentSchedule.getQtyOrdered().stripTrailingZeros()).isEqualTo(qtyOrdered.stripTrailingZeros()); assertThat(shipmentSchedule.getQtyPickList().stripTrailingZeros()).isEqualTo(qtyPicked.stripTrailingZeros()); assertThat(shipmentSchedule.getQtyDelivered().stripTrailingZeros()).isEqualTo(qtyDelivered.stripTrailingZeros()); assertThat(shipmentSchedule.isProcessed()).isEqualTo(isProcessed); } @Value private static class ShipmentScheduleQueries { ImmutableList<ShipmentScheduleQuery> allQueries; HashSet<ShipmentScheduleQuery> remainingQueries; @Builder private ShipmentScheduleQueries(@Singular final ImmutableList<ShipmentScheduleQuery> queries) { this.allQueries = queries; this.remainingQueries = new HashSet<>(queries); } public Map<String, I_M_ShipmentSchedule> executeAllRemaining() { final ImmutableMap.Builder<String, I_M_ShipmentSchedule> result = ImmutableMap.builder(); for (final ShipmentScheduleQuery query : allQueries) { if (!remainingQueries.contains(query)) { continue; } final I_M_ShipmentSchedule shipmentSchedule = query.execute(); if (shipmentSchedule != null) { remainingQueries.remove(query); result.put(query.shipmentScheduleIdentifier, shipmentSchedule); } } return result.build(); } public boolean isAllDone() { return remainingQueries.isEmpty(); } } @Value @Builder private static class ShipmentScheduleQuery { String shipmentScheduleIdentifier; IQuery<I_M_ShipmentSchedule> query; Boolean isToRecompute; IShipmentScheduleInvalidateBL scheduleInvalidateBL = Services.get(IShipmentScheduleInvalidateBL.class); @Nullable public I_M_ShipmentSchedule execute() { final I_M_ShipmentSchedule shipmentScheduleRecord = query.firstOnly(I_M_ShipmentSchedule.class); if (shipmentScheduleRecord == null) { return null; } if (isToRecompute != null) { final ShipmentScheduleId shipmentScheduleId = ShipmentScheduleId.ofRepoId(shipmentScheduleRecord.getM_ShipmentSchedule_ID()); final boolean flaggedForRecompute = scheduleInvalidateBL.isFlaggedForRecompute(shipmentScheduleId); return flaggedForRecompute == isToRecompute ? shipmentScheduleRecord : null; } return shipmentScheduleRecord; } } private void validateSchedule(@NonNull final Map<String, String> row) { final String scheduleIdentifier = DataTableUtil.extractStringForColumnName(row, COLUMNNAME_M_ShipmentSchedule_ID + "." + TABLECOLUMN_IDENTIFIER); final I_M_ShipmentSchedule schedule = shipmentScheduleTable.get(scheduleIdentifier); InterfaceWrapperHelper.refresh(schedule); assertThat(schedule).isNotNull(); final String bpartnerIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_C_BPartner_ID + "." + TABLECOLUMN_IDENTIFIER); final I_C_BPartner bPartner = bpartnerTable.get(bpartnerIdentifier); assertThat(schedule.getC_BPartner_ID()).isEqualTo(bPartner.getC_BPartner_ID()); final String bpLocationIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_C_BPartner_Location_ID + "." + TABLECOLUMN_IDENTIFIER); final I_C_BPartner_Location bpLocation = bpartnerLocationTable.get(bpLocationIdentifier); assertThat(schedule.getC_BPartner_Location_ID()).isEqualTo(bpLocation.getC_BPartner_Location_ID()); final String billBPIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_Bill_BPartner_ID + "." + TABLECOLUMN_IDENTIFIER); final I_C_BPartner billBP = bpartnerTable.get(billBPIdentifier); assertThat(schedule.getBill_BPartner_ID()).isEqualTo(billBP.getC_BPartner_ID()); final String billBPLocationIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_Bill_Location_ID + "." + TABLECOLUMN_IDENTIFIER); final I_C_BPartner_Location billBPLocation = bpartnerLocationTable.get(billBPLocationIdentifier); assertThat(schedule.getBill_Location_ID()).isEqualTo(billBPLocation.getC_BPartner_Location_ID()); final String productIdentifier = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_M_Product_ID + "." + TABLECOLUMN_IDENTIFIER); final I_M_Product product = productTable.get(productIdentifier); assertThat(schedule.getM_Product_ID()).isEqualTo(product.getM_Product_ID()); final String exportStatus = DataTableUtil.extractStringForColumnName(row, I_M_ShipmentSchedule.COLUMNNAME_ExportStatus); assertThat(schedule.getExportStatus()).isEqualTo(exportStatus); final String orderIdentifier = DataTableUtil.extractStringForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_C_Order_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(orderIdentifier)) { final I_C_Order order = orderTable.get(orderIdentifier); assertThat(schedule.getC_Order_ID()).isEqualTo(order.getC_Order_ID()); } final String orderLineIdentifier = DataTableUtil.extractStringForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_C_OrderLine_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(orderLineIdentifier)) { final I_C_OrderLine orderLine = orderLineTable.get(orderLineIdentifier); assertThat(schedule.getC_OrderLine_ID()).isEqualTo(orderLine.getC_OrderLine_ID()); } final String userIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_AD_User_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(userIdentifier)) { final I_AD_User user = userTable.get(userIdentifier); assertThat(schedule.getAD_User_ID()).isEqualTo(user.getAD_User_ID()); } final String billUserIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_Bill_User_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(billUserIdentifier)) { final I_AD_User billUser = userTable.get(billUserIdentifier); assertThat(schedule.getBill_User_ID()).isEqualTo(billUser.getAD_User_ID()); } final String shipperIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + I_M_ShipmentSchedule.COLUMNNAME_M_Shipper_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(shipperIdentifier)) { final I_M_Shipper shipper = shipperTable.get(shipperIdentifier); assertThat(schedule.getM_Shipper_ID()).isEqualTo(shipper.getM_Shipper_ID()); } final String attributeSetInstanceIdentifier = DataTableUtil.extractStringOrNullForColumnName(row, "OPT." + COLUMNNAME_M_AttributeSetInstance_ID + "." + TABLECOLUMN_IDENTIFIER); if (Check.isNotBlank(attributeSetInstanceIdentifier)) { final I_M_AttributeSetInstance expectedASI = attributeSetInstanceTable.get(attributeSetInstanceIdentifier); final AttributesKey actualAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(AttributeSetInstanceId.ofRepoId(schedule.getM_AttributeSetInstance_ID())) .orElse(AttributesKey.NONE); final AttributesKey expectedAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(AttributeSetInstanceId.ofRepoId(expectedASI.getM_AttributeSetInstance_ID())) .orElse(AttributesKey.NONE); assertThat(actualAttributesKeys).isEqualTo(expectedAttributesKeys); } } private void validateJsonCustomer( @NonNull final JsonCustomer jsonCustomer, @NonNull final Map<String, String> row) { final String companyName = DataTableUtil.extractStringForColumnName(row, "companyName"); final String contactName = DataTableUtil.extractStringOrNullForColumnName(row, "contactName"); final String contactEmail = DataTableUtil.extractStringOrNullForColumnName(row, "contactEmail"); final String contactPhone = DataTableUtil.extractStringOrNullForColumnName(row, "contactPhone"); final String street = DataTableUtil.extractStringForColumnName(row, "street"); final String streetNo = DataTableUtil.extractStringForColumnName(row, "streetNo"); final String postal = DataTableUtil.extractStringForColumnName(row, "postal"); final String city = DataTableUtil.extractStringForColumnName(row, "city"); final String countryCode = DataTableUtil.extractStringForColumnName(row, "countryCode"); final String language = DataTableUtil.extractStringForColumnName(row, "language"); final boolean isCompany = DataTableUtil.extractBooleanForColumnName(row, "company"); assertThat(jsonCustomer.getStreet()).isEqualTo(street); assertThat(jsonCustomer.getStreetNo()).isEqualTo(streetNo); assertThat(jsonCustomer.getPostal()).isEqualTo(postal); assertThat(jsonCustomer.getCity()).isEqualTo(city); assertThat(jsonCustomer.getCountryCode()).isEqualTo(countryCode); assertThat(jsonCustomer.getContactName()).isEqualTo(contactName); assertThat(jsonCustomer.getContactEmail()).isEqualTo(contactEmail); assertThat(jsonCustomer.getContactPhone()).isEqualTo(contactPhone); assertThat(jsonCustomer.getLanguage()).isEqualTo(language); assertThat(jsonCustomer.isCompany()).isEqualTo(isCompany); assertThat(jsonCustomer.getCompanyName()).isEqualTo(companyName); } }
48.003681
205
0.819135
68d6c6b69d7f17559125494c295a66fa418005b6
562
package com.justandreyb.liquid_recipes.entity; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import org.hibernate.annotations.GenericGenerator; import lombok.Data; @MappedSuperclass @Data public abstract class BaseEntity { @Id @GeneratedValue(generator = "UUID") @GenericGenerator( name = "UUID", strategy = "org.hibernate.id.UUIDGenerator" ) @Column(name = "id", columnDefinition = "CHAR(36)") private String id; }
21.615385
55
0.736655
80c7efee01b355fe9f86090d00a0099f85e92d74
4,572
package com.example.libo.myapplication.Model; import android.support.annotation.NonNull; import android.util.Log; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.google.firebase.storage.FirebaseStorage; import static de.greenrobot.event.EventBus.TAG; /** * The type Users. */ public class Users { private String email; private String username; private String uid; /** * Gets photo. * * @return the photo */ public String getPhoto() { return photo; } /** * Sets photo. * * @param photo the photo */ public void setPhoto(String photo) { this.photo = photo; } private String photo; private int ownbooknum; private int commentnum; private int borrowbooknum = 0; /** * Instantiates a new Users. */ public Users(){ } /** * Instantiates a new Users. * * @param email the email * @param username the username * @param uid the uid */ public Users(String email, String username, String uid) { this.email = email; this.username = username; this.uid = uid; } /** * Instantiates a new Users. * * @param email the email * @param uid the uid */ public Users(String email, String uid) { this.email = email; this.uid = uid; } /** * Gets email. * * @return the email */ public String getEmail() { return email; } /** * Sets email. * * @param email the email */ public void setEmail(String email) { this.email = email; } /** * Gets username. * * @return the username */ public String getUsername() { return username; } /** * Sets username. * * @param username the username */ public void setUsername(String username) { this.username = username; } /** * Gets uid. * * @return the uid */ public String getUid() { return uid; } /** * Sets uid. * * @param uid the uid */ public void setUid(String uid) { this.uid = uid; } /** * Gets ownbooknum. * * @return the ownbooknum */ public int getOwnbooknum() { DatabaseReference storageRef = FirebaseDatabase.getInstance().getReference("books").child(this.getUid()); storageRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { ownbooknum = (int) dataSnapshot.getChildrenCount(); setOwnbooknum(ownbooknum); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); Log.d(TAG ,"Book num "+ this.ownbooknum); return this.ownbooknum; } /** * Sets ownbooknum. * * @param ownbooknum the ownbooknum */ public void setOwnbooknum(int ownbooknum) { this.ownbooknum = ownbooknum; } /** * Gets commentnum. * * @return the commentnum */ public int getCommentnum() { return this.commentnum; } /** * Sets commentnum. * * @param commentnum the commentnum */ public void setCommentnum(int commentnum) { this.commentnum = commentnum; } /** * Gets borrowbooknum. * * @return the borrowbooknum */ public int getBorrowbooknum() { DatabaseReference borrowedRef = FirebaseDatabase.getInstance().getReference("acceptedBook").child(this.getUid()); borrowbooknum = 0; borrowedRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { borrowbooknum = (int) dataSnapshot.getChildrenCount(); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); return borrowbooknum; } /** * Sets borrowbooknum. * * @param borrowbooknum the borrowbooknum */ public void setBorrowbooknum(int borrowbooknum) { this.borrowbooknum = borrowbooknum; } }
21.265116
121
0.575459
26835370c6e244fc761f76d359b6520e6128102f
11,438
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch 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.elasticsearch.node; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.Version; import org.elasticsearch.bootstrap.BootstrapCheck; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.InternalTestCluster; import org.elasticsearch.transport.MockTcpTransportPlugin; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasToString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; @LuceneTestCase.SuppressFileSystems(value = "ExtrasFS") public class NodeTests extends ESTestCase { public void testNodeName() throws IOException { final String name = randomBoolean() ? randomAlphaOfLength(10) : null; Settings.Builder settings = baseSettings(); if (name != null) { settings.put(Node.NODE_NAME_SETTING.getKey(), name); } try (Node node = new MockNode(settings.build(), Collections.singleton(MockTcpTransportPlugin.class))) { final Settings nodeSettings = randomBoolean() ? node.settings() : node.getEnvironment().settings(); if (name == null) { assertThat(Node.NODE_NAME_SETTING.get(nodeSettings), equalTo(node.getNodeEnvironment().nodeId().substring(0, 7))); } else { assertThat(Node.NODE_NAME_SETTING.get(nodeSettings), equalTo(name)); } } } public static class CheckPlugin extends Plugin { public static final BootstrapCheck CHECK = new BootstrapCheck() { @Override public boolean check() { return false; } @Override public String errorMessage() { return "boom"; } }; @Override public List<BootstrapCheck> getBootstrapChecks() { return Collections.singletonList(CHECK); } } public void testLoadPluginBootstrapChecks() throws IOException { final String name = randomBoolean() ? randomAlphaOfLength(10) : null; Settings.Builder settings = baseSettings(); if (name != null) { settings.put(Node.NODE_NAME_SETTING.getKey(), name); } AtomicBoolean executed = new AtomicBoolean(false); try (Node node = new MockNode(settings.build(), Arrays.asList(MockTcpTransportPlugin.class, CheckPlugin.class)) { @Override protected void validateNodeBeforeAcceptingRequests(Settings settings, BoundTransportAddress boundTransportAddress, List<BootstrapCheck> bootstrapChecks) throws NodeValidationException { assertEquals(1, bootstrapChecks.size()); assertSame(CheckPlugin.CHECK, bootstrapChecks.get(0)); executed.set(true); throw new NodeValidationException("boom"); } }) { expectThrows(NodeValidationException.class, () -> node.start()); assertTrue(executed.get()); } } public void testWarnIfPreRelease() { final Logger logger = mock(Logger.class); final int id = randomIntBetween(1, 9) * 1000000; final Version releaseVersion = Version.fromId(id + 99); final Version preReleaseVersion = Version.fromId(id + randomIntBetween(0, 98)); Node.warnIfPreRelease(releaseVersion, false, logger); verifyNoMoreInteractions(logger); reset(logger); Node.warnIfPreRelease(releaseVersion, true, logger); verify(logger).warn( "version [{}] is a pre-release version of Elasticsearch and is not suitable for production", releaseVersion + "-SNAPSHOT"); reset(logger); final boolean isSnapshot = randomBoolean(); Node.warnIfPreRelease(preReleaseVersion, isSnapshot, logger); verify(logger).warn( "version [{}] is a pre-release version of Elasticsearch and is not suitable for production", preReleaseVersion + (isSnapshot ? "-SNAPSHOT" : "")); } public void testNodeAttributes() throws IOException { String attr = randomAlphaOfLength(5); Settings.Builder settings = baseSettings().put(Node.NODE_ATTRIBUTES.getKey() + "test_attr", attr); try (Node node = new MockNode(settings.build(), Collections.singleton(MockTcpTransportPlugin.class))) { final Settings nodeSettings = randomBoolean() ? node.settings() : node.getEnvironment().settings(); assertEquals(attr, Node.NODE_ATTRIBUTES.get(nodeSettings).getAsMap().get("test_attr")); } // leading whitespace not allowed attr = " leading"; settings = baseSettings().put(Node.NODE_ATTRIBUTES.getKey() + "test_attr", attr); try (Node node = new MockNode(settings.build(), Collections.singleton(MockTcpTransportPlugin.class))) { fail("should not allow a node attribute with leading whitespace"); } catch (IllegalArgumentException e) { assertEquals("node.attr.test_attr cannot have leading or trailing whitespace [ leading]", e.getMessage()); } // trailing whitespace not allowed attr = "trailing "; settings = baseSettings().put(Node.NODE_ATTRIBUTES.getKey() + "test_attr", attr); try (Node node = new MockNode(settings.build(), Collections.singleton(MockTcpTransportPlugin.class))) { fail("should not allow a node attribute with trailing whitespace"); } catch (IllegalArgumentException e) { assertEquals("node.attr.test_attr cannot have leading or trailing whitespace [trailing ]", e.getMessage()); } } public void testDefaultPathDataSet() throws IOException { final Path zero = createTempDir().toAbsolutePath(); final Path one = createTempDir().toAbsolutePath(); final Path defaultPathData = createTempDir().toAbsolutePath(); final Settings settings = Settings.builder() .put("path.home", "/home") .put("path.data.0", zero) .put("path.data.1", one) .put("default.path.data", defaultPathData) .build(); try (NodeEnvironment nodeEnv = new NodeEnvironment(settings, new Environment(settings))) { final Path defaultPathDataWithNodesAndId = defaultPathData.resolve("nodes/0"); Files.createDirectories(defaultPathDataWithNodesAndId); final NodeEnvironment.NodePath defaultNodePath = new NodeEnvironment.NodePath(defaultPathDataWithNodesAndId); final boolean indexExists = randomBoolean(); final List<String> indices; if (indexExists) { indices = IntStream.range(0, randomIntBetween(1, 3)).mapToObj(i -> UUIDs.randomBase64UUID()).collect(Collectors.toList()); for (final String index : indices) { Files.createDirectories(defaultNodePath.indicesPath.resolve(index)); } } else { indices = Collections.emptyList(); } final Logger mock = mock(Logger.class); if (indexExists) { final IllegalStateException e = expectThrows( IllegalStateException.class, () -> Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock)); final String message = String.format( Locale.ROOT, "detected index data in default.path.data [%s] where there should not be any; check the logs for details", defaultPathData); assertThat(e, hasToString(containsString(message))); verify(mock) .error("detected index data in default.path.data [{}] where there should not be any", defaultNodePath.indicesPath); for (final String index : indices) { verify(mock).info( "index folder [{}] in default.path.data [{}] must be moved to any of {}", index, defaultNodePath.indicesPath, Arrays.stream(nodeEnv.nodePaths()).map(np -> np.indicesPath).collect(Collectors.toList())); } verifyNoMoreInteractions(mock); } else { Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock); verifyNoMoreInteractions(mock); } } } public void testDefaultPathDataNotSet() throws IOException { final Path zero = createTempDir().toAbsolutePath(); final Path one = createTempDir().toAbsolutePath(); final Settings settings = Settings.builder() .put("path.home", "/home") .put("path.data.0", zero) .put("path.data.1", one) .build(); try (NodeEnvironment nodeEnv = new NodeEnvironment(settings, new Environment(settings))) { final Logger mock = mock(Logger.class); Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock); verifyNoMoreInteractions(mock); } } private static Settings.Builder baseSettings() { final Path tempDir = createTempDir(); return Settings.builder() .put(ClusterName.CLUSTER_NAME_SETTING.getKey(), InternalTestCluster.clusterName("single-node-cluster", randomLong())) .put(Environment.PATH_HOME_SETTING.getKey(), tempDir) .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(NetworkModule.TRANSPORT_TYPE_KEY, "mock-socket-network") .put(Node.NODE_DATA_SETTING.getKey(), true); } }
46.877049
139
0.649414
61e49ffe88e7748b52d24f10d87509891cdd764f
4,372
/* * * Copyright 2012-2014 Eurocommercial Properties NV * * * 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.estatio.dom.geography; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.VersionStrategy; import org.apache.isis.applib.annotation.DomainObject; import org.apache.isis.applib.annotation.Editing; import org.apache.isis.applib.annotation.Property; import org.apache.isis.applib.annotation.Where; import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; import org.estatio.dom.EstatioDomainObject; import org.estatio.dom.JdoColumnLength; import org.estatio.dom.RegexValidation; import org.estatio.dom.WithNameUnique; import org.estatio.dom.WithReferenceComparable; import org.estatio.dom.WithReferenceUnique; import org.estatio.dom.apptenancy.ApplicationTenancyInvariantsService; import org.estatio.dom.apptenancy.WithApplicationTenancyGlobal; import org.estatio.dom.utils.TitleBuilder; import lombok.Getter; import lombok.Setter; /** * Represents a geographic {@link State} {@link #getCountry() within} a * {@link Country}. */ @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE) @javax.jdo.annotations.DatastoreIdentity( strategy = IdGeneratorStrategy.NATIVE, column = "id") @javax.jdo.annotations.Version( strategy = VersionStrategy.VERSION_NUMBER, column = "version") @javax.jdo.annotations.Uniques({ @javax.jdo.annotations.Unique( name = "Geography_reference_UNQ", members = "reference"), @javax.jdo.annotations.Unique( name = "Geography_name_UNQ", members = "name") }) @javax.jdo.annotations.Queries({ @javax.jdo.annotations.Query( name = "findByCountry", language = "JDOQL", value = "SELECT " + "FROM org.estatio.dom.geography.State " + "WHERE country == :country"), @javax.jdo.annotations.Query( name = "findByReference", language = "JDOQL", value = "SELECT " + "FROM org.estatio.dom.geography.State " + "WHERE reference == :reference") }) @DomainObject(editing = Editing.DISABLED) public class State extends EstatioDomainObject<State> implements WithReferenceComparable<State>, WithReferenceUnique, WithNameUnique, WithApplicationTenancyGlobal { public State() { super("reference"); } public String title() { return TitleBuilder.start() .withName(getName()) .withParent(getCountry()) .toString(); } @Property(hidden = Where.EVERYWHERE) public ApplicationTenancy getApplicationTenancy() { return securityApplicationTenancyRepository.findByPathCached(ApplicationTenancyInvariantsService.GLOBAL_APPLICATION_TENANCY_PATH); } // ////////////////////////////////////// /** * As per ISO standards for <a href= * "http://www.commondatahub.com/live/geography/country/iso_3166_country_codes" * >countries</a> and <a href= * "http://www.commondatahub.com/live/geography/state_province_region/iso_3166_2_state_codes" * >states</a>. */ @javax.jdo.annotations.Column(allowsNull = "false", length = JdoColumnLength.State.REFERENCE) @Property(regexPattern = RegexValidation.REFERENCE) @Getter @Setter private String reference; // ////////////////////////////////////// @javax.jdo.annotations.Column(allowsNull = "false", length = JdoColumnLength.NAME) @Getter @Setter private String name; // ////////////////////////////////////// @javax.jdo.annotations.Column(name = "countryId", allowsNull = "false") @Getter @Setter private Country country; }
35.836066
138
0.678408
081927423ece385c811ac240f9e3267c0cbcad18
6,362
package org.apache.nifi.marklogic.processor; import com.marklogic.client.document.JSONDocumentManager; import com.marklogic.client.io.DocumentMetadataHandle; import com.marklogic.client.io.StringHandle; import com.marklogic.client.io.DocumentMetadataHandle.DocumentCollections; import com.marklogic.junit5.spring.AbstractSpringMarkLogicTest; import org.apache.nifi.marklogic.controller.DefaultMarkLogicDatabaseClientService; import org.apache.nifi.marklogic.controller.MarkLogicDatabaseClientService; import org.apache.nifi.reporting.InitializationException; import org.apache.nifi.util.MockFlowFile; import org.apache.nifi.util.TestRunner; import org.apache.nifi.util.TestRunners; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import java.util.List; import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertEquals; /** * This just focuses on evaluating the collector script against MarkLogic, as that can't be done in * EvaluateCollectorMarkLogicTest. */ @ContextConfiguration(classes = {TestConfigDHF4.class}) public class EvaluateCollectorMarkLogicDHF4 extends AbstractSpringMarkLogicTest { @Autowired protected TestConfigDHF4 testConfig4; protected MarkLogicDatabaseClientService service; protected String databaseClientServiceIdentifier = "databaseClientService"; protected void addDatabaseClientService(TestRunner runner) { service = new DefaultMarkLogicDatabaseClientService(); try { runner.addControllerService(databaseClientServiceIdentifier, service); } catch (InitializationException e) { throw new RuntimeException(e); } runner.setProperty(service, DefaultMarkLogicDatabaseClientService.HOST, testConfig4.getHost()); runner.setProperty(service, DefaultMarkLogicDatabaseClientService.PORT, testConfig4.getRestPort().toString()); runner.setProperty(service, DefaultMarkLogicDatabaseClientService.USERNAME, testConfig4.getUsername()); runner.setProperty(service, DefaultMarkLogicDatabaseClientService.PASSWORD, testConfig4.getPassword()); runner.setProperty(service, DefaultMarkLogicDatabaseClientService.DATABASE,testConfig4.getDatabase()); runner.enableControllerService(service); } protected TestRunner getNewTestRunner(Class processor) { TestRunner runner = TestRunners.newTestRunner(processor); addDatabaseClientService(runner); assertTrue(runner.isControllerServiceEnabled(service)); runner.assertValid(service); runner.setProperty(AbstractMarkLogicProcessor.DATABASE_CLIENT_SERVICE, databaseClientServiceIdentifier); return runner; } @BeforeEach public void setup() { JSONDocumentManager mgr = getDatabaseClient().newJSONDocumentManager(); DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle(); DocumentCollections collections = metadataHandle.getCollections(); collections.add("EVALUATE-COLLECTOR-TEST"); metadataHandle.setCollections(collections); for (int i = 0; i < 10; i++) { mgr.write("/sample/dhf4/" + i + ".json", metadataHandle,new StringHandle(format("{\"test\":\"%d\"}", i))); } } @Test public void invokeCollector4() { TestRunner runner = getNewTestRunner(EvaluateCollectorMarkLogic.class); runner.setValidateExpressionUsage(false); runner.setProperty(EvaluateCollectorMarkLogic.ENTITY_NAME, "Person"); runner.setProperty(EvaluateCollectorMarkLogic.FLOW_NAME, "default"); runner.setProperty(EvaluateCollectorMarkLogic.BATCH_SIZE, "4"); runner.setProperty(EvaluateCollectorMarkLogic.DHF_VERSION, "4"); runner.setProperty(EvaluateCollectorMarkLogic.OPTIONS, "{\"entity\":\"Person\", \"flow\":\"default\", \"flowType\":\"harmonize\"}"); runner.run(); List<MockFlowFile> list = runner.getFlowFilesForRelationship(EvaluateCollectorMarkLogic.BATCHES); assertEquals(3, list.size(), "For 10 docs and a batch size of 4, 3 FlowFiles should have been created"); } @Test public void scriptWithOptions() { TestRunner runner = getNewTestRunner(EvaluateCollectorMarkLogic.class); runner.setValidateExpressionUsage(false); runner.setProperty(EvaluateCollectorMarkLogic.ENTITY_NAME, "Person"); runner.setProperty(EvaluateCollectorMarkLogic.FLOW_NAME, "default"); runner.setProperty(EvaluateCollectorMarkLogic.BATCH_SIZE, "2"); runner.setProperty(EvaluateCollectorMarkLogic.DHF_VERSION, "4"); runner.setProperty(EvaluateCollectorMarkLogic.OPTIONS, "{\"entity\":\"Person\", \"flow\":\"default\", \"flowType\":\"harmonize\", \"dhf.limit\":3}"); runner.run(); List<MockFlowFile> list = runner.getFlowFilesForRelationship(EvaluateCollectorMarkLogic.BATCHES); assertEquals(2, list.size(), "The options should have limited the collector to 3 URIs, and with a batch size of 2, should have created 2 FlowFiles"); } @Test public void customXqueryScript1() { TestRunner runner = getNewTestRunner(EvaluateCollectorMarkLogic.class); runner.setValidateExpressionUsage(false); runner.setProperty(EvaluateCollectorMarkLogic.BATCH_SIZE, "4"); runner.setProperty(EvaluateCollectorMarkLogic.SCRIPT_TYPE, EvaluateCollectorMarkLogic.SCRIPT_TYPE_JAVASCRIPT); runner.setProperty(EvaluateCollectorMarkLogic.SCRIPT_BODY, "const contentPlugin = require('/entities/Person/harmonize/default/collector.sjs'); contentPlugin.collect();"); runner.run(); List<MockFlowFile> list = runner.getFlowFilesForRelationship(EvaluateCollectorMarkLogic.BATCHES); assertEquals(3, list.size()); } @Test public void customXqueryScript2() { TestRunner runner = getNewTestRunner(EvaluateCollectorMarkLogic.class); runner.setValidateExpressionUsage(false); runner.setProperty(EvaluateCollectorMarkLogic.BATCH_SIZE, "4"); runner.setProperty(EvaluateCollectorMarkLogic.SCRIPT_TYPE, EvaluateCollectorMarkLogic.SCRIPT_TYPE_XQUERY); runner.setProperty(EvaluateCollectorMarkLogic.SCRIPT_BODY, "cts:uris((), (), cts:collection-query('EVALUATE-COLLECTOR-TEST'))[1 to 4]"); runner.run(); List<MockFlowFile> list = runner.getFlowFilesForRelationship(EvaluateCollectorMarkLogic.BATCHES); assertEquals(1, list.size()); } }
45.769784
151
0.782458
de922fa6f9d42d5b7de2055e81a9482ed92a0117
10,841
package tools; import static utils.FindFiles.delete; import static utils.FindFiles.findFiles; import static utils.FindFiles.getFilter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.EnumSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.yaml.snakeyaml.Yaml; import com.flagstone.translate.Profile; public class ActionscriptGenerator { private static final String RESOURCE_DIR = "src/test/resources/profiles"; private static final String REFERENCE_DIR = "src/test/resources/actionscript/reference"; private static final String SUITE_DIR = "src/test/resources/actionscript/models"; private static final String DEST_DIR = "resources"; private static final String PROFILE_OPT = "--profile"; private static final String CLEAN_OPT = "--clean"; private static final String PROFILES_ALL = "ALL"; private static final String ACTIONSCRIPT = "actionscript"; private static final String FLASH = "flash"; private static final String PLAYER = "player"; private static final String TYPE = "type"; private static final String PROFILES = "profiles"; private static final String IDENTIFIER = "id"; private static final String REFID = "refid"; private static final String ELEMENTS = "elements"; private static final String PARAMETERS = "parameters"; private static final String SCRIPT = "script"; private static final String SKIP = "skip"; private static final String FILE = "file"; private static boolean clean = false; private static final List<Profile> profiles = new ArrayList<Profile>(); private static final Map<String, List<String>> features = new LinkedHashMap<String, List<String>>(); public static void main(final String[] args) { final File modelDir; if (System.getProperty("test.suite") == null) { modelDir = new File(SUITE_DIR); } else { modelDir = new File(System.getProperty("test.suite")); } setOptions(args); loadReference(features, new File(REFERENCE_DIR)); if (clean) { delete(new File(DEST_DIR).listFiles()); } setup(); for (Profile profile : profiles) { setupProfile(profile); generateScripts(profile, modelDir); } } private static void setOptions(final String[] options) { for (int i = 0; i < options.length; i++) { if (PROFILE_OPT.equals(options[i])) { String name = options[++i].toUpperCase(); if (PROFILES_ALL.equals(name)) { profiles.clear(); profiles.addAll(EnumSet.allOf(Profile.class)); } else { Profile profile = Profile.fromName(name); if (profile == null) { throw new IllegalArgumentException( "Unsupported profile: " + name); } profiles.add(profile); } } else if (CLEAN_OPT.equals(options[i])) { clean = true; } else { throw new IllegalArgumentException( "Unrecognised argument: " + options[i]); } } } @SuppressWarnings("unchecked") private static void loadReference(final Map<String, List<String>> table, final File dir) { Yaml yaml = new Yaml(); List<String> files = new ArrayList<String>(); findFiles(files, dir, getFilter(".yaml")); FileInputStream stream = null; Map<String,Object> map; for (String yamlFile : files) { try { stream = new FileInputStream(yamlFile); for (Object entry : (List<Object>)yaml.load(stream)) { map = (Map<String,Object>) entry; if (map.containsKey(ELEMENTS)) { for (Object element : (List<Object>) map.get(ELEMENTS)) { loadProfile(table, (Map<String,Object>) element); } } else { loadProfile(table, (Map<String,Object>) entry); } } stream.close(); } catch (Exception e) { e.printStackTrace(); System.err.println(yamlFile + ": " + e.getMessage()); } } } @SuppressWarnings("unchecked") private static void loadProfile(final Map<String, List<String>> profiles, final Map<String,Object> entry) { if (!entry.containsKey(PROFILES)) { throw new IllegalArgumentException( "Missing profiles: " + entry.toString()); } profiles.put((String)entry.get(IDENTIFIER), (List<String>)entry.get(PROFILES)); } @SuppressWarnings("unchecked") private static void generateScripts(final Profile profile, final File dir) { Yaml yaml = new Yaml(); List<String> files = new ArrayList<String>(); findFiles(files, dir, getFilter(".yaml")); FileInputStream stream = null; for (String yamlFile : files) { try { stream = new FileInputStream(yamlFile); for (Object tests : (List<Object>)yaml.load(stream)) { generateScript(profile, (Map<String,Object>) tests); } stream.close(); } catch (Exception e) { e.printStackTrace(); System.err.println(yamlFile + ": " + e.getMessage()); } } } private static void setup() { final String[] TYPES = { "frame", "button", "movieclip" }; try { copyfile(new File(RESOURCE_DIR, "publish.jsfl"), new File(DEST_DIR, "publish.jsfl")); for (String type : TYPES) { copyfile(new File(RESOURCE_DIR, type + ".fla"), new File(DEST_DIR, type + ".fla")); } } catch (Exception e) { e.printStackTrace(); } } private static void setupProfile(Profile profile) { String publish; File dir; File file; try { File publishFile = new File(RESOURCE_DIR, "publish.xml"); Map<String,Object>map = new LinkedHashMap<String, Object>(); map.put(ACTIONSCRIPT, profile.getScriptVersion()); map.put(FLASH, profile.getFlashVersion()); map.put(PLAYER, profile.getPlayer()); publish = contentsOfFile(publishFile); publish = replaceTokens(map, publish); dir = new File(DEST_DIR, profile.name()); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Cannot create directory: " + dir.getPath()); } file = new File(dir, "publish.xml"); writeScript(file, publish); } catch (Exception e) { e.printStackTrace(); } } @SuppressWarnings("unchecked") private static void generateScript(final Profile profile, final Map<String,Object>list) throws IOException { String script = (String)list.get(SCRIPT); String reference = (String)list.get(REFID); if (reference == null) { throw new IOException("No reference defined in test."); } List<String> versions = features.get(reference); if (versions == null) { throw new IOException("No profiles defined for: " + reference); } List<Object> parameters = (List<Object>)list.get(PARAMETERS); String path; String type; if (list.containsKey(FILE)) { path = (String)list.get(FILE); } else if (list.containsKey(REFID)) { path = reference + ".as"; } else { throw new IllegalArgumentException("No file specified"); } if (script.startsWith("onClipEvent")) { type = "movieclip"; } else if (script.startsWith("on")) { type = "button"; } else { type = "frame"; } File dir; File file; int index; Map<String, Object> vars; if (versions.contains(profile.name())) { dir = dirForTest(profile.name(), type); index = 0; if (parameters == null) { if (!list.containsKey(SKIP)) { writeScript(new File(dir, path), script); } } else { for (Object set : parameters) { vars = (Map<String, Object>)set; if (vars.containsKey(SKIP)) { continue; } if (vars.containsKey(FILE)) { file = new File(dir, (String)vars.get(FILE)); } else if (vars.containsKey(REFID)) { file = new File(dir, (String)vars.get(REFID) + ".as"); } else { file = new File(dir, String.format(path, index++)); } script = replaceTokens(vars, script); writeScript(file, script); } } } } private static File dirForTest(String name, String type) throws IOException { Profile profile = Profile.fromName(name); if (profile == null) { throw new IOException("Invalid profile name: " + name); } String path = String.format("%s/%s", name, type); File dir = new File(DEST_DIR, path); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Cannot create directory: " + dir.getPath()); } return dir; } private static String replaceTokens(final Map<String,Object>values, final String script) { String str = script; for (Map.Entry<String, Object> set: values.entrySet()) { str = str.replaceAll("%"+set.getKey()+"%", set.getValue().toString()); } return str; } private static void writeScript(final File file, final String script) throws IOException { File dir = file.getParentFile(); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Cannot create directory: " + dir.getPath()); } PrintWriter writer = new PrintWriter(file); writer.write(script); writer.flush(); writer.close(); } private static String contentsOfFile(File file) throws FileNotFoundException, IOException { String script = ""; byte[] fileIn = new byte[(int)file.length()]; FileInputStream fileContents = new FileInputStream(file); fileContents.read(fileIn); script = new String(fileIn); fileContents.close(); return script; } private static void copyfile(File src, File dest) throws IOException { InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dest); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0){ out.write(buf, 0, len); } in.close(); out.close(); } }
30.366947
81
0.591182
f70b9ae9393fb8c7fcaedcc2aa2a23e4511b678a
16,045
package org.wikipedia.settings.languages; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.view.ActionMode; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import org.wikipedia.Constants; import org.wikipedia.R; import org.wikipedia.WikipediaApp; import org.wikipedia.language.LanguagesListActivity; import org.wikipedia.util.ResourceUtil; import org.wikipedia.views.DefaultViewHolder; import org.wikipedia.views.MultiSelectActionModeCallback; import java.util.ArrayList; import java.util.Collections; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; import static android.app.Activity.RESULT_OK; import static org.wikipedia.Constants.ACTIVITY_REQUEST_ADD_A_LANGUAGE; public class WikipediaLanguagesFragment extends Fragment implements WikipediaLanguagesItemView.Callback { @BindView(R.id.wikipedia_languages_recycler) RecyclerView recyclerView; private WikipediaApp app; private Unbinder unbinder; private ItemTouchHelper itemTouchHelper; private List<String> wikipediaLanguages = new ArrayList<>(); private WikipediaLanguageItemAdapter adapter; private ActionMode actionMode; private MultiSelectCallback multiSelectCallback = new MultiSelectCallback(); private List<String> selectedCodes = new ArrayList<>(); private static final int NUM_HEADERS = 1; private static final int NUM_FOOTERS = 1; public static final String ACTIVITY_RESULT_LANG_POSITION_DATA = "activity_result_lang_position_data"; @NonNull public static WikipediaLanguagesFragment newInstance() { return new WikipediaLanguagesFragment(); } @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_wikipedia_languages, container, false); app = WikipediaApp.getInstance(); unbinder = ButterKnife.bind(this, view); prepareWikipediaLanguagesList(); setupRecyclerView(); // TODO: add funnel? return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == ACTIVITY_REQUEST_ADD_A_LANGUAGE && resultCode == RESULT_OK) { prepareWikipediaLanguagesList(); requireActivity().invalidateOptionsMenu(); adapter.notifyDataSetChanged(); } } @Override public void onDestroyView() { recyclerView.setAdapter(null); unbinder.unbind(); unbinder = null; super.onDestroyView(); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_wikipedia_languages, menu); if (app.language().getAppLanguageCodes().size() <= 1) { MenuItem overflowMenu = menu.getItem(0); overflowMenu.setVisible(false); } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_wikipedia_languages_remove: beginRemoveLanguageMode(); return true; default: return super.onOptionsItemSelected(item); } } private void prepareWikipediaLanguagesList() { wikipediaLanguages.clear(); wikipediaLanguages.addAll(app.language().getAppLanguageCodes()); } private void setupRecyclerView() { recyclerView.setHasFixedSize(true); adapter = new WikipediaLanguageItemAdapter(); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); itemTouchHelper = new ItemTouchHelper(new RearrangeableItemTouchHelperCallback(adapter)); itemTouchHelper.attachToRecyclerView(recyclerView); } @Override public void onCheckedChanged(int position) { toggleSelectedLanguage(wikipediaLanguages.get(position)); } private void updateWikipediaLanguages() { app.language().setAppLanguageCodes(wikipediaLanguages); adapter.notifyDataSetChanged(); requireActivity().invalidateOptionsMenu(); } @SuppressWarnings("checkstyle:magicnumber") private final class WikipediaLanguageItemAdapter extends RecyclerView.Adapter<DefaultViewHolder> { private static final int VIEW_TYPE_HEADER = 0; private static final int VIEW_TYPE_ITEM = 1; private static final int VIEW_TYPE_FOOTER = 2; private boolean checkboxEnabled; @Override public int getItemViewType(int position) { if (position == 0) { return VIEW_TYPE_HEADER; } else if (position == getItemCount() - 1) { return VIEW_TYPE_FOOTER; } else { return VIEW_TYPE_ITEM; } } @Override public int getItemCount() { return wikipediaLanguages.size() + NUM_HEADERS + NUM_FOOTERS; } @Override public DefaultViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { Context context = parent.getContext(); LayoutInflater inflater = LayoutInflater.from(context); if (viewType == VIEW_TYPE_HEADER) { View view = inflater.inflate(R.layout.view_section_header, parent, false); return new HeaderViewHolder(view); } else if (viewType == VIEW_TYPE_FOOTER) { View view = inflater.inflate(R.layout.view_wikipedia_language_footer, parent, false); return new FooterViewHolder(view); } else { return new WikipediaLanguageItemHolder(new WikipediaLanguagesItemView(getContext())); } } @Override public void onBindViewHolder(@NonNull DefaultViewHolder holder, int pos) { if (holder instanceof WikipediaLanguageItemHolder) { if (launchedFromSearch()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { ((WikipediaLanguageItemHolder) holder).getView().setForeground(ContextCompat.getDrawable(requireContext(), ResourceUtil.getThemedAttributeId(requireContext(), R.attr.selectableItemBackground))); } ((WikipediaLanguageItemHolder) holder).getView().setOnClickListener(view -> { Intent resultIntent = new Intent(); resultIntent.putExtra(ACTIVITY_RESULT_LANG_POSITION_DATA, pos - NUM_HEADERS); requireActivity().setResult(RESULT_OK, resultIntent); requireActivity().finish(); }); } ((WikipediaLanguageItemHolder) holder).bindItem(wikipediaLanguages.get(pos - NUM_HEADERS), pos - NUM_FOOTERS); ((WikipediaLanguageItemHolder) holder).getView().setDragHandleEnabled(wikipediaLanguages.size() > 1); ((WikipediaLanguageItemHolder) holder).getView().setCheckBoxEnabled(checkboxEnabled); } } @Override public void onViewAttachedToWindow(@NonNull DefaultViewHolder holder) { super.onViewAttachedToWindow(holder); if (holder instanceof WikipediaLanguageItemHolder) { ((WikipediaLanguageItemHolder) holder).getView().setDragHandleTouchListener((v, event) -> { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: itemTouchHelper.startDrag(holder); break; case MotionEvent.ACTION_UP: v.performClick(); break; default: break; } return false; }); ((WikipediaLanguageItemHolder) holder).getView().setCallback(WikipediaLanguagesFragment.this); } else if (holder instanceof FooterViewHolder) { holder.getView().setVisibility(checkboxEnabled ? View.GONE : View.VISIBLE); holder.getView().setOnClickListener(v -> { startActivityForResult(new Intent(requireActivity(), LanguagesListActivity.class), ACTIVITY_REQUEST_ADD_A_LANGUAGE); finishActionMode(); }); } } @Override public void onViewDetachedFromWindow(@NonNull DefaultViewHolder holder) { if (holder instanceof WikipediaLanguageItemHolder) { ((WikipediaLanguageItemHolder) holder).getView().setCallback(null); ((WikipediaLanguageItemHolder) holder).getView().setDragHandleTouchListener(null); } super.onViewDetachedFromWindow(holder); } void onMoveItem(int oldPosition, int newPosition) { Collections.swap(wikipediaLanguages, oldPosition - NUM_HEADERS, newPosition - NUM_FOOTERS); notifyItemMoved(oldPosition, newPosition); } void onCheckboxEnabled(boolean enabled) { checkboxEnabled = enabled; } } private final class RearrangeableItemTouchHelperCallback extends ItemTouchHelper.Callback { private final WikipediaLanguageItemAdapter adapter; RearrangeableItemTouchHelperCallback(WikipediaLanguageItemAdapter adapter) { this.adapter = adapter; } @Override public boolean isLongPressDragEnabled() { return false; } @Override public boolean isItemViewSwipeEnabled() { return false; } @Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { } @Override public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { return viewHolder instanceof WikipediaLanguageItemHolder ? makeMovementFlags(ItemTouchHelper.UP | ItemTouchHelper.DOWN, 0) : -1; } @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) { if (target instanceof WikipediaLanguageItemHolder) { adapter.onMoveItem(source.getAdapterPosition(), target.getAdapterPosition()); } return true; } @Override public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { super.clearView(recyclerView, viewHolder); updateWikipediaLanguages(); } } // TODO: optimize and reuse the header view holder private class HeaderViewHolder extends DefaultViewHolder<View> { HeaderViewHolder(View itemView) { super(itemView); TextView sectionText = itemView.findViewById(R.id.section_header_text); sectionText.setText(R.string.wikipedia_languages_your_languages_text); } } private class WikipediaLanguageItemHolder extends DefaultViewHolder<WikipediaLanguagesItemView> { WikipediaLanguageItemHolder(WikipediaLanguagesItemView itemView) { super(itemView); } void bindItem(String languageCode, int position) { getView().setContents(app.language().getAppLanguageLocalizedName(languageCode), position); } } private class FooterViewHolder extends DefaultViewHolder<View> { FooterViewHolder(View itemView) { super(itemView); } } private boolean launchedFromSearch() { return requireActivity().getIntent().hasExtra(Constants.INTENT_EXTRA_LAUNCHED_FROM_SEARCH); } private void setMultiSelectEnabled(boolean enabled) { adapter.onCheckboxEnabled(enabled); adapter.notifyDataSetChanged(); requireActivity().invalidateOptionsMenu(); } private void finishActionMode() { if (actionMode != null) { actionMode.finish(); } } private void beginRemoveLanguageMode() { ((AppCompatActivity) requireActivity()).startSupportActionMode(multiSelectCallback); setMultiSelectEnabled(true); } private void toggleSelectedLanguage(String code) { if (selectedCodes.contains(code)) { selectedCodes.remove(code); } else { selectedCodes.add(code); } } private void unselectAllLanguages() { selectedCodes.clear(); adapter.notifyDataSetChanged(); } private void deleteSelectedLanguages() { app.language().removeAppLanguageCodes(selectedCodes); prepareWikipediaLanguagesList(); unselectAllLanguages(); } private class MultiSelectCallback extends MultiSelectActionModeCallback { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { super.onCreateActionMode(mode, menu); mode.setTitle(R.string.wikipedia_languages_remove_action_mode_title); mode.getMenuInflater().inflate(R.menu.menu_action_mode_wikipedia_languages, menu); actionMode = mode; selectedCodes.clear(); return super.onCreateActionMode(mode, menu); } @Override protected void onDeleteSelected() { showRemoveLanguagesDialog(); // TODO: add snackbar for undo action? } @Override public void onDestroyActionMode(ActionMode mode) { unselectAllLanguages(); setMultiSelectEnabled(false); actionMode = null; super.onDestroyActionMode(mode); } } @SuppressWarnings("checkstyle:magicnumber") public void showRemoveLanguagesDialog() { if (selectedCodes.size() > 0) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(requireActivity()); if (selectedCodes.size() < wikipediaLanguages.size()) { alertDialog .setTitle(getResources().getQuantityString(R.plurals.wikipedia_languages_remove_dialog_title, selectedCodes.size())) .setMessage(R.string.wikipedia_languages_remove_dialog_content) .setPositiveButton(android.R.string.ok, (dialog, i) -> { deleteSelectedLanguages(); finishActionMode(); }) .setNegativeButton(android.R.string.cancel, null); } else { alertDialog .setTitle(R.string.wikipedia_languages_remove_warning_dialog_title) .setMessage(R.string.wikipedia_languages_remove_warning_dialog_content) .setPositiveButton(android.R.string.ok, null); } AlertDialog dialog = alertDialog.show(); TextView text = dialog.findViewById(android.R.id.message); text.setLineSpacing(0, 1.3f); } } }
38.944175
140
0.652914
093efc2ab96eb8170e0ddbe3882d9162be8a8956
973
package problems.easy; /** * Created by sherxon on 6/3/17. */ public class CanPlaceFlowers { public boolean canPlaceFlowers(int[] a, int n) { if (n == 0) { return true; } //if(a.length/2 < n)return false; if (a.length == 0) { return false; } else if (a.length == 1) { if (a[0] == 0 && n == 1) { return true; } return false; } else if (a.length == 2) { if (a[0] == 1 || a[1] == 1 || n > 1) { return false; } return true; } else { for (int i = 0; i < a.length; i++) { if (i == 0) { if (a[i] == 0 && a[i + 1] == 0) { n--; a[i] = 1; } } else if (i == a.length - 1) { if (a[i - 1] == 0 && a[i] == 0) { n--; a[i] = 1; } } else if (a[i - 1] == 0 && a[i] == 0 && a[i + 1] == 0) { n--; a[i] = 1; } } } return n <= 0; } }
20.702128
65
0.35149
7a72cdbdd6cfd5785f0152afee98911e2d2de86c
6,019
/* * Copyright 2018-2021 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 dev.miku.r2dbc.mysql.codec; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.math.BigDecimal; import java.math.BigInteger; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static dev.miku.r2dbc.mysql.constant.MySqlType.BIGINT; import static dev.miku.r2dbc.mysql.constant.MySqlType.BIGINT_UNSIGNED; import static dev.miku.r2dbc.mysql.constant.MySqlType.DECIMAL; import static dev.miku.r2dbc.mysql.constant.MySqlType.DOUBLE; import static dev.miku.r2dbc.mysql.constant.MySqlType.FLOAT; import static dev.miku.r2dbc.mysql.constant.MySqlType.INT; import static dev.miku.r2dbc.mysql.constant.MySqlType.INT_UNSIGNED; import static dev.miku.r2dbc.mysql.constant.MySqlType.MEDIUMINT; import static dev.miku.r2dbc.mysql.constant.MySqlType.MEDIUMINT_UNSIGNED; import static dev.miku.r2dbc.mysql.constant.MySqlType.SMALLINT; import static dev.miku.r2dbc.mysql.constant.MySqlType.SMALLINT_UNSIGNED; import static dev.miku.r2dbc.mysql.constant.MySqlType.TINYINT; import static dev.miku.r2dbc.mysql.constant.MySqlType.TINYINT_UNSIGNED; import static dev.miku.r2dbc.mysql.constant.MySqlType.YEAR; import static org.assertj.core.api.Assertions.assertThat; /** * Unit tests for {@link BigIntegerCodec}. */ class BigIntegerCodecTest extends NumericCodecTestSupport<BigInteger> { private final BigInteger[] integers = { BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN, BigInteger.valueOf(-1), BigInteger.valueOf(-2021), BigInteger.valueOf(Long.MAX_VALUE), new BigInteger(Long.toUnsignedString(Long.MIN_VALUE)), // Max Int64 + 1 BigInteger.valueOf(Long.MIN_VALUE), BigInteger.valueOf(Long.MIN_VALUE).subtract(BigInteger.ONE), new BigInteger(Long.toUnsignedString(-1)), // Max Uint64 BigInteger.valueOf(Long.MAX_VALUE).pow(7), // Over than max Uint64 }; @Override public BigIntegerCodec getCodec(ByteBufAllocator allocator) { return new BigIntegerCodec(allocator); } @Override public BigInteger[] originParameters() { assertThat(new BigInteger(Long.toUnsignedString(Long.MIN_VALUE))) .isEqualTo(BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE)); return integers; } @Override public Object[] stringifyParameters() { return integers; } @Override public ByteBuf[] binaryParameters(Charset charset) { return Arrays.stream(integers).map(this::convert).toArray(ByteBuf[]::new); } @Override public Decoding[] decoding(boolean binary, Charset charset) { return decimals().flatMap(it -> { List<Decoding> d = new ArrayList<>(); BigInteger res = it.toBigInteger(); d.add(new Decoding(encodeAscii(it.toString()), res, DECIMAL)); float fv = it.floatValue(); if (Float.isFinite(fv) && BigDecimal.valueOf(fv).toBigInteger().equals(res)) { d.add(new Decoding(encodeFloat(fv, binary), res, FLOAT)); } double dv = it.doubleValue(); if (Double.isFinite(dv) && BigDecimal.valueOf(dv).toBigInteger().equals(res)) { d.add(new Decoding(encodeDouble(dv, binary), res, DOUBLE)); } int bitLength = res.bitLength(), sign = res.signum(); if (sign > 0) { if (bitLength <= Long.SIZE) { d.add(new Decoding(encodeUin64(res.longValue(), binary), res, BIGINT_UNSIGNED)); } if (bitLength <= Integer.SIZE) { d.add(new Decoding(encodeUint(res.intValue(), binary), res, INT_UNSIGNED)); } if (bitLength <= MEDIUM_SIZE) { d.add(new Decoding(encodeInt(res.intValue(), binary), res, MEDIUMINT_UNSIGNED)); } if (bitLength <= Short.SIZE) { d.add(new Decoding(encodeUint16(res.shortValue(), binary), res, SMALLINT_UNSIGNED)); } if (bitLength <= Byte.SIZE) { d.add(new Decoding(encodeUint8(res.byteValue(), binary), res, TINYINT_UNSIGNED)); } } if (bitLength < Long.SIZE) { d.add(new Decoding(encodeInt64(res.longValueExact(), binary), res, BIGINT)); } if (bitLength < Integer.SIZE) { d.add(new Decoding(encodeInt(res.intValueExact(), binary), res, INT)); } if (bitLength < MEDIUM_SIZE) { d.add(new Decoding(encodeInt(res.intValueExact(), binary), res, MEDIUMINT)); } if (bitLength < Short.SIZE) { d.add(new Decoding(encodeInt16(res.shortValueExact(), binary), res, SMALLINT)); d.add(new Decoding(encodeInt16(res.shortValueExact(), binary), res, YEAR)); } if (bitLength < Byte.SIZE) { d.add(new Decoding(encodeInt8(res.byteValueExact(), binary), res, TINYINT)); } return d.stream(); }).toArray(Decoding[]::new); } private ByteBuf convert(BigInteger it) { if (it.bitLength() < Long.SIZE) { return LongCodecTest.convert(it.longValueExact()); } else { return sized(it); } } }
36.92638
104
0.641469
b673d68d220d704e4f9d4e3c5bd5486954615e2a
1,666
package com.netflix.spinnaker.orca.locks; import com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties("locking") public class LockingConfigurationProperties { private boolean learningMode = true; private boolean enabled = false; private int ttlSeconds = 120; private int backoffBufferSeconds = 10; private final DynamicConfigService dynamicConfigService; @Autowired public LockingConfigurationProperties(DynamicConfigService dynamicConfigService) { this.dynamicConfigService = dynamicConfigService; } public boolean isLearningMode() { return dynamicConfigService.getConfig(Boolean.class, "locking.learningMode", learningMode); } public void setLearningMode(boolean learningMode) { this.learningMode = learningMode; } public boolean isEnabled() { return dynamicConfigService.isEnabled("locking", enabled); } public void setEnabled(boolean enabled) { this.enabled = enabled; } public int getTtlSeconds() { return dynamicConfigService.getConfig(Integer.class, "locking.ttlSeconds", ttlSeconds); } public void setTtlSeconds(int ttlSeconds) { this.ttlSeconds = ttlSeconds; } public int getBackoffBufferSeconds() { return dynamicConfigService.getConfig(Integer.class, "locking.backoffBufferSeconds", backoffBufferSeconds); } public void setBackoffBufferSeconds(int backoffBufferSeconds) { this.backoffBufferSeconds = backoffBufferSeconds; } }
30.851852
111
0.790516
865b46f7a8beac5ae148cab14d0b4a0a543d333b
31,301
package common; import fiji.InspectJar; import ij.plugin.PlugIn; import ij.IJ; import ij.gui.GenericDialog; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.KeyStroke; import javax.swing.AbstractAction; import javax.swing.BorderFactory; import javax.swing.DefaultFocusManager; import javax.swing.FocusManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.Dimension; import java.awt.Font; import java.awt.Component; import java.awt.Rectangle; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.ClipboardOwner; import java.awt.Toolkit; import java.awt.FileDialog; import javax.swing.JPopupMenu; import javax.swing.JMenuItem; import java.io.BufferedOutputStream; import java.io.PrintWriter; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.FileOutputStream; import java.io.BufferedReader; import java.io.PipedOutputStream; import java.io.PipedInputStream; import java.io.InputStreamReader; import java.io.File; import java.io.Writer; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Arrays; import java.util.Hashtable; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Iterator; import java.util.Collections; import java.util.regex.Pattern; import java.util.Scanner; import java.util.Set; public abstract class AbstractInterpreter implements PlugIn { final protected JFrame window = new JFrame("Interpreter"); final protected JTextArea screen = new JTextArea(); final protected JTextArea prompt = new JTextArea(1, 60);//new JTextField(60); protected int active_line = 0; final protected ArrayList al_lines = new ArrayList(); final protected ArrayList<Boolean> valid_lines = new ArrayList<Boolean>(); private PipedOutputStream pout = null; private BufferedReader readin = null; protected BufferedOutputStream out = null; protected PrintWriter print_out = null; Thread reader, writer; protected JPopupMenu popup_menu; String last_dir = System.getProperty("user.dir"); { try { last_dir = ij.Menus.getPlugInsPath();//ij.Prefs.getString(ij.Prefs.DIR_IMAGE); } catch (Exception e) { System.out.println("Could not retrieve Menus.getPlugInsPath()"); } } protected ExecuteCode runner; static final protected Hashtable<Class,AbstractInterpreter> instances = new Hashtable<Class,AbstractInterpreter>(); static { /* set the default class loader to ImageJ's PluginClassLoader */ if (IJ.getInstance() != null) Thread.currentThread() .setContextClassLoader(IJ.getClassLoader()); // Save history of all open interpreters even in the case of a call to System.exit(0), // which doesn't spawn windowClosing events. Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { for (Map.Entry<Class,AbstractInterpreter> e : new HashSet<Map.Entry<Class,AbstractInterpreter>>(instances.entrySet())) { e.getValue().closingWindow(); } }}); } /** Convenient System.out.prinln(text); */ protected void p(String msg) { System.out.println(msg); } protected void setTitle(String title) { window.setTitle(title); } public void run(String arghhh) { AbstractInterpreter instance = instances.get(getClass()); if (null != instance) { instance.window.setVisible(true); instance.window.toFront(); /* String name = instance.getClass().getName(); int idot = name.lastIndexOf('.'); if (-1 != idot) name = name.substring(idot); IJ.showMessage("The " + name.replace('_', ' ') + " is already open!"); */ return; } instances.put(getClass(), this); System.out.println("Open interpreters:"); for (Map.Entry<Class,AbstractInterpreter> e : instances.entrySet()) { System.out.println(e.getKey() + " -> " + e.getValue()); } ArrayList[] hv = readHistory(); al_lines.addAll(hv[0]); valid_lines.addAll(hv[1]); active_line = al_lines.size(); if (al_lines.size() != valid_lines.size()) { IJ.log("ERROR in parsing history!"); al_lines.clear(); valid_lines.clear(); active_line = 0; } runner = new ExecuteCode(); // Wait until runner is alive (then piped streams will exist) while (!runner.isAlive() || null == pout) { try { Thread.sleep(50); } catch (InterruptedException ie) {} } // start thread to write stdout and stderr to the screen reader = new Thread("out_reader") { public void run() { { try { readin = new BufferedReader(new InputStreamReader(new PipedInputStream(pout))); } catch (Exception ioe) { ioe.printStackTrace(); } } setPriority(Thread.NORM_PRIORITY); while (!isInterrupted()) { try { // Will block until it can print a full line: String s = new StringBuilder(readin.readLine()).append('\n').toString(); if (!window.isVisible()) continue; screen.append(s); screen.setCaretPosition(screen.getDocument().getLength()); } catch (IOException ioe) { // Write end dead p("Out reader quit reading."); return; } catch (Throwable e) { if (!isInterrupted() && window.isVisible()) e.printStackTrace(); else { p("Out reader terminated."); return; } } } } }; reader.start(); // make GUI makeGUI(); } protected void makeGUI() { //JPanel panel = new JPanel(); //panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); screen.setEditable(false); screen.setLineWrap(true); Font font = new Font("Courier", Font.PLAIN, 12); screen.setFont(font); popup_menu = new JPopupMenu(); ActionListener menu_listener = new ActionListener() { public void actionPerformed(ActionEvent ae) { String selection = screen.getSelectedText(); if (null == selection) return; String sel = filterSelection(); String command = ae.getActionCommand(); if (command.equals("Copy")) { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable transfer = new StringSelection(sel); cb.setContents(transfer, (ClipboardOwner)transfer); } else if (command.equals("Execute")) { runner.execute(sel); } else if (command.equals("Save")) { FileDialog fd = new FileDialog(window, "Save", FileDialog.SAVE); fd.setDirectory(last_dir); fd.setVisible(true); if (null != last_dir) last_dir = fd.getDirectory(); String file_name = fd.getFile(); if (null != file_name) { String path = last_dir + file_name; try { File file = new File(path); //this check is done anyway by the FileDialog, but just in case in some OSes it doesn't: while (file.exists()) { GenericDialog gd = new GenericDialog("File exists!"); gd.addMessage("File exists! Choose another name or overwrite."); gd.addStringField("New file name: ", file_name); gd.addCheckbox("Overwrite", false); gd.showDialog(); if (gd.wasCanceled()) return; file = new File(last_dir + gd.getNextString()); } DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file), sel.length())); dos.writeBytes(sel); dos.flush(); } catch (Exception e) { IJ.log("ERROR: " + e); } } } } }; addMenuItem(popup_menu, "Copy", menu_listener); addMenuItem(popup_menu, "Execute", menu_listener); addMenuItem(popup_menu, "Save", menu_listener); JScrollPane scroll_prompt = new JScrollPane(prompt); scroll_prompt.setPreferredSize(new Dimension(440, 35)); scroll_prompt.setVerticalScrollBarPolicy(JScrollPane .VERTICAL_SCROLLBAR_ALWAYS); prompt.setFont(font); prompt.setLineWrap(true); prompt.getInputMap().put(KeyStroke.getKeyStroke("DOWN"), "down"); prompt.getActionMap().put("down", new AbstractAction("down") { public void actionPerformed(ActionEvent ae) { int position = cursorUpDown(true); if (position < 0) { trySetNextPrompt(); } else { // Move down one line within a multiline prompt prompt.setCaretPosition(position); } } }); prompt.getInputMap().put(KeyStroke.getKeyStroke("UP"), "up"); prompt.getActionMap().put("up", new AbstractAction("up") { public void actionPerformed(ActionEvent ae) { int position = cursorUpDown(false); if (position < 0) { trySetPreviousPrompt(); } else { // Move down one line within a multiline prompt prompt.setCaretPosition(position); } } }); prompt.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK), "ctrl+p"); prompt.getActionMap().put("ctrl+p", new AbstractAction("ctrl+p") { public void actionPerformed(ActionEvent ae) { trySetPreviousPrompt(); } }); prompt.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK), "ctrl+n"); prompt.getActionMap().put("ctrl+n", new AbstractAction("ctrl+n") { public void actionPerformed(ActionEvent ae) { trySetNextPrompt(); } }); prompt.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), "shift+down"); prompt.getActionMap().put("shift+down", new AbstractAction("shift+down") { public void actionPerformed(ActionEvent ae) { //enable to scroll within lines when the prompt consists of multiple lines. doArrowDown(); } }); prompt.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), "shift+up"); prompt.getActionMap().put("shift+up", new AbstractAction("shift+up") { public void actionPerformed(ActionEvent ae) { //enable to scroll within lines when the prompt consists of multiple lines. doArrowUp(); } }); prompt.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "enter"); prompt.getActionMap().put("enter", new AbstractAction("enter") { public void actionPerformed(ActionEvent ae) { runner.executePrompt(); } }); prompt.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, ActionEvent.SHIFT_MASK), "shift+enter"); prompt.getActionMap().put("shift+enter", new AbstractAction("shift+enter") { public void actionPerformed(ActionEvent ae) { // allow multiline input on shift+enter int cp = prompt.getCaretPosition(); prompt.insert("\n", cp); } }); DefaultFocusManager manager = new DefaultFocusManager() { public void processKeyEvent(Component focusedComponent, KeyEvent ke) { if (focusedComponent == window && ke.getKeyCode() == KeyEvent.VK_TAB) { //cancelling TAB actions on focus issues return; } //for others call super super.processKeyEvent(focusedComponent, ke); } }; FocusManager.setCurrentManager(manager); prompt.getInputMap().put(KeyStroke.getKeyStroke("TAB"), "tab"); prompt.getActionMap().put("tab", new AbstractAction("tab") { public void actionPerformed(ActionEvent ae) { doTab(ae); } }); screen.addMouseListener( new MouseAdapter() { public void mouseReleased(MouseEvent me) { String selection = screen.getSelectedText(); //show popup menu if (null != selection && 0 < selection.length()) { popup_menu.show(screen, me.getX(), me.getY()); } //set focus to prompt prompt.requestFocus(); } }); //make scroll for the screen JScrollPane scroll = new JScrollPane(screen); scroll.setPreferredSize(new Dimension(440,400)); //set layout JSplitPane panel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scroll, scroll_prompt); panel.setBorder(BorderFactory.createEmptyBorder(4,4,4,4)); //add the panel to the window window.getContentPane().add(panel); //setup window display window.setSize(450, 450); window.pack(); //set location to bottom right corner Rectangle screenBounds = window.getGraphicsConfiguration().getBounds(); int x = screenBounds.width - window.getWidth() - 35; int y = screenBounds.height - window.getHeight() - 35; window.setLocation(x, y); //add windowlistener window.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent we) { closingWindow(); } public void windowClosed(WindowEvent we) { closingWindow(); } } ); //show the window window.setVisible(true); //set the focus to the input prompt prompt.requestFocus(); } /** Store current prompt content if not empty and is different than current active line; * will also set active line to last. */ private void tryStoreCurrentPrompt() { final String txt = prompt.getText(); if (null != txt && txt.trim().length() > 0) { if (active_line < al_lines.size() && txt.equals((String)al_lines.get(active_line))) return; al_lines.add(txt); valid_lines.add(false); // because it has never been executed yet // set active line to last, since we've added a new entry active_line = al_lines.size() -1; } } private void trySetPreviousPrompt() { // Try to set the previous prompt text final int size = al_lines.size(); if (0 == size) return; tryStoreCurrentPrompt(); if (active_line > 0) { if (prompt.getText().equals("") && size -1 == active_line) { active_line = size - 1; } else { active_line--; } } prompt.setText((String)al_lines.get(active_line)); } private void trySetNextPrompt() { // Try to set the next prompt text int size = al_lines.size(); if (0 == size) return; tryStoreCurrentPrompt(); if (active_line < size -1) { active_line++; } else if (active_line == size -1) { prompt.setText(""); //clear return; } final String text = (String)al_lines.get(active_line); prompt.setText(text); } /** get the position when moving one visible line forward or backward */ private int cursorUpDown(boolean forward) { try { int position = prompt.getCaretPosition(); int columns = prompt.getColumns(); int line = prompt.getLineOfOffset(position); int start = prompt.getLineStartOffset(line); int end = prompt.getLineEndOffset(line); int column = (position - start) % columns; int wrappedLineCount = (end + columns - 1 - start) / columns; int currentWrappedLine = (position - start) / columns; if (forward) { if ((position - start) / columns < (end - start) / columns) return Math.min(position + columns, end); start = prompt.getLineStartOffset(line + 1); end = prompt.getLineEndOffset(line + 1); return Math.min(start + column, end - 1); } // backward if ((position - start) / columns > 0) return position - columns; start = prompt.getLineStartOffset(line - 1); end = prompt.getLineEndOffset(line - 1); int endColumn = (end - start) % columns; return end - Math.max(1, endColumn - column); } catch (Exception e) { return -1; } } /** Move the prompt caret down one line in a multiline prompt, if possible. */ private void doArrowDown() { int position = cursorUpDown(true); if (position >= 0) prompt.setCaretPosition(position); } /** Move the prompt caret up one line in a multiline prompt, if possible. */ private void doArrowUp() { int position = cursorUpDown(false); if (position >= 0) prompt.setCaretPosition(position); } private void closingWindow() { // Check if not closed already if (!instances.containsKey(getClass())) { return; } // Before any chance to fail, remove from hashtable of instances: instances.remove(getClass()); // ... and store history saveHistory(); // AbstractInterpreter.this.windowClosing(); runner.quit(); Thread.yield(); reader.interrupt(); } void addMenuItem(JPopupMenu menu, String label, ActionListener listener) { JMenuItem item = new JMenuItem(label); item.addActionListener(listener); menu.add(item); } private class ExecuteCode extends Thread { private Object lock = new Object(); private boolean go = true; private String text = null; private boolean store = false; // only true when invoked from a prompt ExecuteCode() { setPriority(Thread.NORM_PRIORITY); try { setDaemon(true); } catch (Exception e) { e.printStackTrace(); } start(); } public void quit() { go = false; interrupt(); synchronized (this) { notify(); } } public void execute(String text) { this.text = text; this.store = false; synchronized (this) { notify(); } } public void executePrompt() { prompt.setEnabled(false); this.text = prompt.getText(); this.store = true; synchronized (this) { notify(); } } public void run() { try { pout = new PipedOutputStream(); out = new BufferedOutputStream(pout); print_out = new PrintWriter(out); } catch (Exception e) { e.printStackTrace(); } AbstractInterpreter.this.threadStarting(); while (go) { if (isInterrupted()) return; try { synchronized (this) { wait(); } if (!go) return; AbstractInterpreter.this.execute(text, store); } catch (InterruptedException ie) { return; } catch (Exception e) { e.printStackTrace(); } finally { if (!go) return; // this statement is reached when returning from the middle of the try/catch! window.setVisible(true); if (store) { prompt.setEnabled(true); prompt.requestFocus(); // set caret position at the end of the prompt tabs String mb = prompt.getText(); prompt.setCaretPosition(null == mb ? 0 : mb.length()); } text = null; store = false; } } AbstractInterpreter.this.threadQuitting(); try { print_out.flush(); print_out.close(); } catch (Exception e) {} } } protected String getPrompt() { return ">>>"; } boolean previous_line_empty = false; protected void execute(String text, boolean store) { if (null == text) return; int len = text.length(); if (len <= 0) { println(getPrompt()); return; } // store text if (len > 0 && store) { // only if different than last line if (al_lines.isEmpty() || !al_lines.get(al_lines.size()-1).equals(text)) { al_lines.add(text); valid_lines.add(false); } active_line = al_lines.size() -1; } // store in multiline if appropriate for later execution /* int i_colon = text.lastIndexOf(':'); if ((len > 0 && i_colon == len -1) || 0 != multiline.length()) { multiline += text + "\n"; // adjust indentation in prompt int n_tabs = 0; for (int i=0; i<len; i++) { if ('\t' != text.charAt(i)) { break; } n_tabs++; } // indent when sentence ends with a ':' if (-1 != i_colon) { n_tabs++; } if (1 == n_tabs) { prompt.setText("\t"); } else if (n_tabs > 1) { char[] tabs = new char[n_tabs]; for (int i=0; i <n_tabs; i++) { tabs[i] = '\t'; } prompt.setText(new String(tabs)); } // print to screen println("... " + fix(text)); // remove tabs from line: text = text.replaceAll("\\t", ""); len = text.length(); // refresh length // test for text contents if (0 == len) { if (previous_line_empty) { text = multiline; //execute below multiline = ""; previous_line_empty = false; } else { previous_line_empty = true; } } else { //don't eval/exec yet return; } } else { */ print(new StringBuilder(getPrompt()).append(' ').append(text).append('\n').toString()); /* } */ try { Object ob = eval(text); if (null != ob) { println(ob.toString()); } // if no error, mark as valid valid_lines.set(valid_lines.size() -1, true); } catch (Throwable e) { e.printStackTrace(print_out); } finally { print_out.write('\n'); print_out.flush(); //remove tabs from prompt prompt.setText(""); // reset tab expansion last_tab_expand = null; } } /** Prints to screen: will append a newline char to the text, and also scroll down. */ protected void println(String text) { print(text + "\n"); } /** Prints to screen and scrolls down. */ protected void print(String text) { screen.append(text); screen.setCaretPosition(screen.getDocument().getLength()); } abstract protected Object eval(String text) throws Throwable; /** Expects a '#' for python and ruby, a ';' for lisp, a '//' for javascript, etc. */ abstract protected String getLineCommentMark(); /** Executed when the interpreter window is being closed. */ protected void windowClosing() {} /** Executed inside the executer thread before anything else. */ protected void threadStarting() {} /** Executed inside the executer thread right before the thread will die. */ protected void threadQuitting() {} /** Insert a tab in the prompt (in replacement for Component focus)*/ synchronized protected void doTab(ActionEvent ae) { String prompt_text = prompt.getText(); int cp = prompt.getCaretPosition(); if (cp > 0) { char cc = prompt_text.charAt(cp-1); if ('t' == cc || '\n' == cc) { prompt.setText(prompt_text.substring(0, cp) + "\t" + prompt_text.substring(cp)); return; } } int len = prompt_text.length(); boolean add_tab = true; for (int i=0; i<len; i++) { char c = prompt_text.charAt(i); if ('\t' != c) { add_tab = false; break; } } if (add_tab) { prompt.append("\t"); } else { // attempt to expand the variable name, if possible expandName(prompt_text, ae); } } /** Optional word expansion. */ protected ArrayList expandStub(String stub) { return new ArrayList(); // empty } private String extractWordStub(final String prompt_text, final int caret_position) { final char[] c = new char[]{' ', '.', '(', ',', '['}; final int[] cut = new int[c.length]; for (int i=0; i<cut.length; i++) { cut[i] = prompt_text.lastIndexOf(c[i], caret_position); } Arrays.sort(cut); int ifirst = cut[cut.length-1] + 1; if (-1 == ifirst) return null; //p(ifirst + "," + caret_position + ", " + prompt_text.length()); return prompt_text.substring(ifirst, caret_position); } private void expandName(String prompt_text, ActionEvent ae) { if (null != last_tab_expand) { last_tab_expand.cycle(ae); return; } if (null == prompt_text) prompt_text = prompt.getText(); int ilast = prompt.getCaretPosition() -1; // check preconditions if (ilast <= 0) return; char last = prompt_text.charAt(ilast); if (' ' == last || '\t' == last) { p("last char is space or tab"); return; } // parse last word stub String stub = extractWordStub(prompt_text, ilast+1); ArrayList al = expandStub(stub); if (al.size() > 0) { last_tab_expand = new TabExpand(al, ilast - stub.length() + 1, stub); } else { last_tab_expand = null; } } private TabExpand last_tab_expand = null; private class TabExpand { ArrayList al = new ArrayList(); int i = 0; int istart; // stub starting index int len_prev; // length of previously set word String stub; TabExpand(ArrayList al, int istart, String stub) { this.al.addAll(al); this.istart = istart; this.stub = stub; this.len_prev = stub.length(); cycle(null); } void cycle(ActionEvent ae) { if (null == ae) { // first time set(); return; } /* p("##\nlen_prev: " + len_prev); p("i : " + i); p("prompt.getText(): " + prompt.getText()); p("prompt.getText().length(): " + prompt.getText().length()); p("istart: " + istart + "\n##"); */ int plen = prompt.getText().length(); String stub = extractWordStub(prompt.getText(), this.istart + len_prev > plen ? plen : this.istart + len_prev); // may be null if (this.stub.equals(stub) || al.get(i).equals(stub)) { // ok } else { // can't expand, remake last_tab_expand = null; expandName(prompt.getText(), ae); return; } // check preconditions if (0 == al.size()) { p("No elems to expand to"); return; } // ok set prompt to next i += ( 0 != (ae.getModifiers() & ActionEvent.SHIFT_MASK) ? -1 : 1); if (al.size() == i) i = 0; if (-1 == i) i = al.size() -1; set(); } private void set() { String pt = prompt.getText(); if (i > 0) p("set to " + al.get(i)); prompt.setText(pt.substring(0, istart) + al.get(i).toString() + pt.substring(istart + len_prev)); len_prev = ((String)al.get(i)).length(); } } private String filterSelection() { String sel = screen.getSelectedText().trim(); StringBuffer sb = new StringBuffer(); int istart = 0; int inl = sel.indexOf('\n'); int len = sel.length(); String sprompt = getPrompt(); Pattern pat = Pattern.compile("^" + sprompt + " .*$"); while (true) { if (-1 == inl) inl = len -1; // process line: String line = sel.substring(istart, inl+1); if (pat.matcher(line).matches()) { line = line.substring(sprompt.length() + 1); // + 1 to reach the first char after the space after the prompt text. } sb.append(line); // quit if possible if (len -1 == inl) break; // prepate next istart = inl+1; inl = sel.indexOf('\n', istart); }; if (0 == sb.length()) return sel; return sb.toString(); } private void saveHistory() { String path = ij.Prefs.getPrefsDir() + "/" + getClass().getName() + ".log"; File f = new File(path); if (!f.getParentFile().canWrite()) { IJ.log("Could not save history for " + getClass().getName() + "\nat path: " + path); return; } Writer writer = null; try { writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f)), "8859_1"); final int MAX_LINES = 2000; // Write all lines up to MAX_LINES int first = al_lines.size() - MAX_LINES; if (first < 0) first = 0; String rep = new StringBuffer().append('\n').append(getLineCommentMark()).toString(); String separator = getLineCommentMark() + "\n"; for (int i=first; i<al_lines.size(); i++) { // Separate executed code blocks with a empty comment line: writer.write(separator); String block = (String)al_lines.get(i); // If block threw an Exception when executed, save it as commented out: if (!valid_lines.get(i)) { block = getLineCommentMark() + block; block = block.replaceAll("\n", rep); } if (!block.endsWith("\n")) block += "\n"; writer.write(block); } writer.flush(); } catch (Throwable e) { IJ.log("Could NOT save history log file!"); IJ.log(e.toString()); } finally { try { writer.close(); } catch (java.io.IOException ioe) { ioe.printStackTrace(); } } } private ArrayList[] readHistory() { String path = ij.Prefs.getPrefsDir() + "/" + getClass().getName() + ".log"; File f = new File(path); ArrayList blocks = new ArrayList(); ArrayList valid = new ArrayList(); if (!f.exists()) { System.out.println("No history exists yet for " + getClass().getName()); return new ArrayList[]{blocks, valid}; } final String sep = getLineCommentMark() + "\n"; Scanner scanner = null; try { scanner = new Scanner(new File(path), "8859_1").useDelimiter(sep); while (scanner.hasNext()) { String block = scanner.next(); int inl = block.lastIndexOf('\n'); int end = block.length() == inl + 1 ? inl : block.length(); if (0 == block.indexOf(sep)) block = block.substring(sep.length(), end); else block = block.substring(0, end); blocks.add(block); valid.add(true); // all valid, even if they were not: the invalid ones are commented out } } catch (Throwable e) { IJ.log("Could NOT read history log file!"); IJ.log(e.toString()); } finally { scanner.close(); } return new ArrayList[]{blocks, valid}; } protected static boolean hasPrefix(String subject, Set<String> prefixes) { for (String prefix : prefixes) if (subject.startsWith(prefix)) return true; return false; } protected abstract String getImportStatement(String packageName, Iterable<String> classNames); public String getImportStatement() { StringBuffer buffer = new StringBuffer(); Map<String, List<String>> classNames = getDefaultImports(); for (String packageName : classNames.keySet()) buffer.append(getImportStatement(packageName, classNames.get(packageName))); return buffer.toString(); } /** pre-import all ImageJ java classes and TrakEM2 java classes */ public void importAll() { if (System.getProperty("jnlp") != null) { println("Because Fiji was started via WebStart, no packages were imported implicitly"); return; } String statement = getImportStatement(); try { eval(statement); } catch (Throwable e) { RefreshScripts.printError(e); return; } println("All ImageJ and java.lang" + (statement.indexOf("trakem2") > 0 ? " and TrakEM2" : "") + " classes imported."); } protected static Map<String, List<String>> defaultImports; public static Map<String, List<String>> getDefaultImports() { if (defaultImports != null) return defaultImports; final String[] classNames = { "ij.IJ", "java.lang.String", "ini.trakem2.Project", "script.imglib.math.Compute" }; InspectJar inspector = new InspectJar(); for (String className : classNames) try { String baseName = className.substring(className.lastIndexOf('.') + 1); URL url = Class.forName(className).getResource(baseName + ".class"); inspector.addJar(url); } catch (Exception e) { if (IJ.debugMode) IJ.log("Warning: class " + className + " was not found!"); } defaultImports = new HashMap<String, List<String>>(); Set<String> prefixes = new HashSet<String>(); prefixes.add("script."); for (String className : classNames) prefixes.add(className.substring(0, className.lastIndexOf('.'))); for (String className : inspector.classNames(true)) { if (!hasPrefix(className, prefixes)) continue; int dot = className.lastIndexOf('.'); String packageName = dot < 0 ? "" : className.substring(0, dot); String baseName = className.substring(dot + 1); List<String> list = defaultImports.get(packageName); if (list == null) { list = new ArrayList<String>(); defaultImports.put(packageName, list); } list.add(baseName); } // remove non-unique class names Map<String, String> reverse = new HashMap<String, String>(); for (String packageName : defaultImports.keySet()) { Iterator<String> iter = defaultImports.get(packageName).iterator(); while (iter.hasNext()) { String className = iter.next(); if (reverse.containsKey(className)) { if (IJ.debugMode) IJ.log("Not auto-importing " + className + " (is in both " + packageName + " and " + reverse.get(className) + ")"); iter.remove(); defaultImports.get(reverse.get(className)).remove(className); } else reverse.put(className, packageName); } } return defaultImports; } }
30.448444
129
0.658541
aa1fdef1e90a4cda4647d40d5d585d497e7d15f3
388
package jsettlers.graphics.image.reader.shadowmap; public class ShadowMapping1 implements ShadowMapping { @Override public int getShadowIndex(int settlerIndex) { if(settlerIndex == 26) { return -1; } else if(settlerIndex > 26) { settlerIndex--; } if(settlerIndex == 32) { return -1; } else if(settlerIndex > 32) { settlerIndex--; } return settlerIndex; } }
19.4
54
0.685567
da075e68fcd7384993d5a5c1c949e38eeaa72327
1,721
package club.qqtim.util.lambda; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; /** * @title: GenerateUtil * @Author lijie78 * @Date: 2021/1/17 * @Version 1.0.0 */ public final class GenerateUtil { private GenerateUtil() {} /** * list 要求已经排序 * 返回构造的层级 * CommonUtil.generateTree(constantVals, ConstantVal::getId, ConstantVal::getParentId, ConstantVal::getChildren, ConstantVal::setChildren); */ public static <T> List<T> generateTree(List<T> list, Function<T, Long> getId, Function<T, Long> getParentId, Function<T, List<T>> getChildren, BiConsumer<T, List<T>> setChildren) { final Map<Long, T> idMapObj = list.stream() .collect(Collectors.toMap(getId, Function.identity(), (o, n) -> n)); List<T> result = new ArrayList<>(); list.forEach(obj -> { final Long parentId = getParentId.apply(obj); // getParentId.apply(obj) == null || if (idMapObj.get(parentId) == null) { result.add(obj); } else { final T parent = idMapObj.get(parentId); List<T> children = getChildren.apply(parent); if (children == null) { children = new ArrayList<>(); } children.add(obj); setChildren.accept(parent, children); } }); return result; } }
31.87037
143
0.529343
171af55878377c31e9f4faa7d270f55e93bc6ee5
1,675
package engine.physics; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * class for force, extends vector, super for all forces * * @author Ben * */ public abstract class Force extends Vector implements Iterable<String> { protected double myForceValue; protected Map<String, Double> myValues; public Force(double x, double y, Scalar... scalar) { super(x, y); myValues = new HashMap<String, Double>(); initializeMap(scalar); setDefaultValues(); calculateForce(); } /** * other constructor, used to solve a problem we had */ public Force(Scalar... scalar) { this(0, 0, scalar); } @Override protected void calculateMagnitude() { myMagnitude = myForceValue; } public void addOrChangeValue(Scalar cur) { myValues.put(cur.toString(), cur.getValue()); calculateForce(); calculateMagnitude(); } protected void initializeMap(Scalar[] scalar) { for (Scalar cur : scalar) { myValues.put(cur.toString(), cur.getValue()); } } // following two methods are to add a direction to the force. for example, // if you want to make gravity in both x and y when it's only in y, just // pass through 1 to x /** * abstract method that is used in force subclasses to calculate force based * on instance variables * * @return value of force */ public Iterator<String> iterator() { return myValues.keySet().iterator(); } @Override public double getX() { return myXComponent * myForceValue; } @Override public double getY() { return myYComponent * myForceValue; } protected abstract void calculateForce(); protected abstract void setDefaultValues(); }
21.474359
77
0.703881
765cb267cefb806b6578065ec03541adac58d4b4
9,968
/* * $Id$ * $URL$ * * ==================================================================== * Ikasan Enterprise Integration Platform * * Distributed under the Modified BSD License. * Copyright notice: The copyright for this software and a full listing * of individual contributors are as shown in the packaged copyright.txt * file. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - 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. * * - Neither the name of the ORGANIZATION nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * 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 org.ikasan.jca.base.outbound; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.resource.ResourceException; import javax.resource.spi.*; import javax.security.auth.Subject; import java.io.PrintWriter; import java.io.Serializable; import java.util.Set; /** * This is the abstract factory class which extends the ManagedConnectionFactory * for obtaining real physical connections to the associated EIS. * * This class is central to the creation of ConnectionFactories and * ManagedConnections. * * This (and extensions thereof) is the first class that the application server * will instantiate. * * All the other classes in the resource adapter are instantiated, directly or * indirectly, by this one. * * @author Ikasan Development Team */ public abstract class EISManagedConnectionFactory implements ManagedConnectionFactory, Serializable { /** Logger */ private static Logger logger = LoggerFactory.getLogger(EISManagedConnectionFactory.class); /** default serial version uid */ private static final long serialVersionUID = 1L; /** Print writer */ private PrintWriter writer = null; /** non transactional session factory */ protected String sessionFactoryName; /** local transaction session factory */ protected String localSessionFactoryName; /** XA transaction session factory */ protected String xaSessionFactoryName; /** * The application server calls this method to create a new EIS-specific * ConnectionFactory. * * The extending class must implement this for the specific EIS. * * @param connectionManager - The connection manager to use for this connection factory * @return ConnectionFactory - The connection factory * @throws javax.resource.ResourceException - Exception if creation fails */ public abstract Object createConnectionFactory(final ConnectionManager connectionManager) throws ResourceException; /** * The application server or stand-alone client calls this method to create * a new EIS-specific ConnectionFactory. * * The extending class must implement this for the specific EIS. */ public abstract Object createConnectionFactory() throws ResourceException; /** * The application server calls this method to create a new physical (real) * connection to the EIS. * * The extending class must implement this for the specific EIS. */ public abstract ManagedConnection createManagedConnection(final Subject subject, final ConnectionRequestInfo cri) throws ResourceException; /** * hashCode() uses specific instance properties to generate a hashcode which * can be used to uniquely identify this class instance. * * The extending class must implement this for the specific EIS. */ @Override public abstract int hashCode(); /** * equals() is used to determine whether two instances of this class are set * with the same configuration properties. * * The extending class must implement this for the specific EIS. */ @Override public abstract boolean equals(final Object object); /** * This method is called by the application server when the client asks for * a new connection. The application server passes in a Set of all the * active virtual connections, and this object must pick one that is * currently handling a physical connection that can be shared to support * the new client request. Typically this sharing will be allowed if the * security attributes and properties of the new request match an existing * physical connection. * * If nothing is available, the method must return null, so that the * application server knows it has to create a new physical connection. */ public abstract ManagedConnection matchManagedConnections(final Set connections, final Subject subject, final ConnectionRequestInfo cri); /** * Standard getter for the logWriter * * @see javax.resource.spi.ManagedConnectionFactory#getLogWriter() */ public PrintWriter getLogWriter() { logger.debug("Getting logWriter..."); //$NON-NLS-1$ return this.writer; } /** * Standard setter for the logWriter * * @see javax.resource.spi.ManagedConnectionFactory#setLogWriter(java.io.PrintWriter) */ public void setLogWriter(PrintWriter writer) { this.writer = writer; logger.debug("Setting logWriter..."); //$NON-NLS-1$ } /** * Getter for the sessionFactoryName * * @return the sessionFactoryName */ public String getSessionFactoryName() { logger.debug("Getting dataSource [" + this.sessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ return this.sessionFactoryName; } /** * Setter for the sessionFactoryName * * @param sessionFactoryName the sessionFactoryName to set */ public void setSessionFactoryName(String sessionFactoryName) { this.sessionFactoryName = sessionFactoryName; logger.debug("Setting sessionFactoryName [" + this.sessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } /** * Getter for the localSessionFactoryName * * @return the localSessionFactoryName */ public String getLocalSessionFactoryName() { logger.debug("Getting localSessionFactoryName [" + this.localSessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ return this.localSessionFactoryName; } /** * Setter for the localSessionFactoryName * * @param localSessionFactoryName the localSessionFactoryName to set */ public void setLocalSessionFactoryName(String localSessionFactoryName) { this.localSessionFactoryName = localSessionFactoryName; logger.debug("Setting localSessionFactoryName [" + this.localSessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } /** * Getter for the xaSessionFactoryName * * @return the xaSessionFactoryName */ public String getXASessionFactoryName() { logger.debug("Getting xaSessionFactoryName [" + this.xaSessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ return this.xaSessionFactoryName; } /** * Setter for the xaSessionFactoryName * * @param xaSessionFactoryName the xaSessionFactoryName to set */ public void setXASessionFactoryName(String xaSessionFactoryName) { this.xaSessionFactoryName = xaSessionFactoryName; logger.debug("Setting xaSessionFactoryName [" + this.xaSessionFactoryName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } /** * Validate standard properties required for all connections. * * @throws javax.resource.spi.InvalidPropertyException - Exception if hte proprty is invalid */ protected void validateConnectionProperties() throws InvalidPropertyException { if (this.sessionFactoryName == null) { logger.warn("Connector property 'sessionFactoryName' is [" //$NON-NLS-1$ + this.sessionFactoryName + "]. " //$NON-NLS-1$ + "You will not be able to use a non-transactional data source!"); //$NON-NLS-1$ } if (this.localSessionFactoryName == null) { logger.warn("Connector property 'localSessionFactoryName' is [" //$NON-NLS-1$ + this.localSessionFactoryName + "]. " //$NON-NLS-1$ + "You will not be able to use a local transactional data source!"); //$NON-NLS-1$ } if (this.xaSessionFactoryName == null) { logger.warn("Connector property 'xaSessionFactoryName' is [" //$NON-NLS-1$ + this.xaSessionFactoryName + "]. " //$NON-NLS-1$ + "You will not be able to use an XA transactional data source!"); //$NON-NLS-1$ } } }
38.045802
143
0.680778
4d365931ce39022a8d19bc481cd40016bc98b081
355
package org.alfasoftware.astra.core.refactoring.methods.methodInvocation; import java.util.Optional; import org.alfasoftware.astra.exampleTypes.A; @SuppressWarnings("unused") public class InvocationChainedWrappedExample { Optional<A> wrappedA = Optional.of(new A()); private void a() { wrappedA.get().first().second(); } }
20.882353
74
0.71831
e4e339eed3375a8752f150658c281dfd4847d1c6
931
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package accounting; import javax.swing.JFrame; /** * * @author dkdks,harsh,abhishek */ public class Accounting extends frame { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here frame obj=new frame(); obj.fn(); } } class frame extends javax.swing.JPanel{ static JFrame global_frame=new JFrame(); void fn(){ global_frame.setResizable(false); global_frame.setSize(1360, 730); global_frame.getContentPane().add(new login()); global_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); global_frame.setVisible(true); } }
25.861111
80
0.632653
9240cc3fe16a911467685d278b0f8ba6bc816206
476
package global.module; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; public class Test { public static void main(String[] args) throws JsonProcessingException { HashMap<String, String> map = new HashMap<>(); map.put("key", "asdfklasjdfl"); map.put("aa", "Asdfkj3"); ObjectMapper mapper = new ObjectMapper(); System.out.println(mapper.writeValueAsString(map)); } }
23.8
70
0.745798
8d7c5ce41547e14e2e0ae43941e9792e33f1b592
1,980
/* * 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.sgw.transform.v20180511; import com.aliyuncs.sgw.model.v20180511.DescribeAccountConfigResponse; import com.aliyuncs.transform.UnmarshallerContext; public class DescribeAccountConfigResponseUnmarshaller { public static DescribeAccountConfigResponse unmarshall(DescribeAccountConfigResponse describeAccountConfigResponse, UnmarshallerContext _ctx) { describeAccountConfigResponse.setRequestId(_ctx.stringValue("DescribeAccountConfigResponse.RequestId")); describeAccountConfigResponse.setMessage(_ctx.stringValue("DescribeAccountConfigResponse.Message")); describeAccountConfigResponse.setIsSupportServerSideEncryption(_ctx.booleanValue("DescribeAccountConfigResponse.IsSupportServerSideEncryption")); describeAccountConfigResponse.setIsSupportClientSideEncryption(_ctx.booleanValue("DescribeAccountConfigResponse.IsSupportClientSideEncryption")); describeAccountConfigResponse.setCode(_ctx.stringValue("DescribeAccountConfigResponse.Code")); describeAccountConfigResponse.setIsSupportGatewayLogging(_ctx.booleanValue("DescribeAccountConfigResponse.IsSupportGatewayLogging")); describeAccountConfigResponse.setSuccess(_ctx.booleanValue("DescribeAccountConfigResponse.Success")); describeAccountConfigResponse.setIsSupportElasticGatewayBeta(_ctx.booleanValue("DescribeAccountConfigResponse.IsSupportElasticGatewayBeta")); return describeAccountConfigResponse; } }
55
148
0.840909
a1c9fdbb7edcbf3078417ca5f8434fd992c068b6
16,545
package com.netopyr.wurmloch.vectorclock; import com.netopyr.wurmloch.vectorclock.VectorClock; import org.testng.annotations.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; public class VectorClockTest { public static final String ID_1 = "ID_1"; public static final String ID_2 = "ID_2"; @Test public void shouldBeEqualToItself() { // given final VectorClock vectorClock0 = new VectorClock(); // then assertThat(vectorClock0.compareTo(vectorClock0), is(0)); // when final VectorClock vectorClock1 = vectorClock0.increment(ID_1); // then assertThat(vectorClock1.compareTo(vectorClock1), is(0)); // when final VectorClock vectorClock11 = vectorClock1.increment(ID_1); // then assertThat(vectorClock11.compareTo(vectorClock11), is(0)); } @Test public void shouldBeEqualToItselfMerged() { // given final VectorClock vectorClock0 = new VectorClock(); // when final VectorClock mergedClock0 = vectorClock0.merge(vectorClock0); // then assertThat(vectorClock0.compareTo(mergedClock0), is(0)); assertThat(mergedClock0.compareTo(vectorClock0), is(0)); // when final VectorClock vectorClock1 = vectorClock0.increment(ID_1); final VectorClock mergedClock1 = vectorClock1.merge(vectorClock1); // then assertThat(vectorClock1.compareTo(mergedClock1), is(0)); assertThat(mergedClock1.compareTo(vectorClock1), is(0)); // when final VectorClock vectorClock11 = vectorClock1.increment(ID_1); final VectorClock mergedClock11 = vectorClock11.merge(vectorClock11); // then assertThat(vectorClock11.compareTo(mergedClock11), is(0)); assertThat(mergedClock11.compareTo(vectorClock11), is(0)); } @Test public void newVectorClocksShouldBeEqual() { // given final VectorClock vectorClock1 = new VectorClock(); final VectorClock vectorClock2 = new VectorClock(); // then assertThat(vectorClock1.compareTo(vectorClock2), is (0)); assertThat(vectorClock2.compareTo(vectorClock1), is (0)); } @Test public void newVectorClocksShouldBeEqualToThemselvesMerged() { // given final VectorClock vectorClock1 = new VectorClock(); final VectorClock vectorClock2 = new VectorClock(); // when final VectorClock mergedClock = vectorClock1.merge(vectorClock2); // then assertThat(vectorClock1.compareTo(mergedClock), is(0)); assertThat(mergedClock.compareTo(vectorClock1), is(0)); assertThat(vectorClock2.compareTo(mergedClock), is(0)); assertThat(mergedClock.compareTo(vectorClock2), is(0)); } @Test public void shouldBeGreaterWhenIncremented() { // given final VectorClock vectorClock1 = new VectorClock(); // when final VectorClock vectorClock2 = vectorClock1.increment(ID_1); final VectorClock vectorClock3 = vectorClock2.increment(ID_1); // then assertThat(vectorClock1.compareTo(vectorClock1), is(equalTo(0))); assertThat(vectorClock1.compareTo(vectorClock2), is(lessThan(0))); assertThat(vectorClock1.compareTo(vectorClock3), is(lessThan(0))); assertThat(vectorClock2.compareTo(vectorClock1), is(greaterThan(0))); assertThat(vectorClock2.compareTo(vectorClock2), is(equalTo(0))); assertThat(vectorClock2.compareTo(vectorClock3), is(lessThan(0))); assertThat(vectorClock3.compareTo(vectorClock1), is(greaterThan(0))); assertThat(vectorClock3.compareTo(vectorClock2), is(greaterThan(0))); assertThat(vectorClock3.compareTo(vectorClock3), is(equalTo(0))); } @Test public void shouldBeEqualToGreaterWhenMerged() { // given final VectorClock vectorClock1 = new VectorClock(); final VectorClock vectorClock2 = vectorClock1.increment(ID_1); final VectorClock vectorClock3 = vectorClock2.increment(ID_1); // when final VectorClock mergedClock1_2 = vectorClock1.merge(vectorClock2); final VectorClock mergedClock1_3 = vectorClock1.merge(vectorClock3); final VectorClock mergedClock2_1 = vectorClock2.merge(vectorClock1); final VectorClock mergedClock2_3 = vectorClock2.merge(vectorClock3); final VectorClock mergedClock3_1 = vectorClock3.merge(vectorClock1); final VectorClock mergedClock3_2 = vectorClock3.merge(vectorClock2); // then assertThat(mergedClock1_2.compareTo(mergedClock1_2), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock1_2), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock1_2), is(equalTo(0))); assertThat(vectorClock3.compareTo(mergedClock1_2), is(greaterThan(0))); assertThat(mergedClock1_2.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock1_2.compareTo(vectorClock2), is(equalTo(0))); assertThat(mergedClock1_2.compareTo(vectorClock3), is(lessThan(0))); assertThat(mergedClock1_3.compareTo(mergedClock1_3), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock1_3), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock1_3), is(lessThan(0))); assertThat(vectorClock3.compareTo(mergedClock1_3), is(equalTo(0))); assertThat(mergedClock1_3.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock1_3.compareTo(vectorClock2), is(greaterThan(0))); assertThat(mergedClock1_3.compareTo(vectorClock3), is(equalTo(0))); assertThat(mergedClock2_1.compareTo(mergedClock2_1), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock2_1), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock2_1), is(equalTo(0))); assertThat(vectorClock3.compareTo(mergedClock2_1), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(vectorClock2), is(equalTo(0))); assertThat(mergedClock2_1.compareTo(vectorClock3), is(lessThan(0))); assertThat(mergedClock2_3.compareTo(mergedClock2_3), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock2_3), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock2_3), is(lessThan(0))); assertThat(vectorClock3.compareTo(mergedClock2_3), is(equalTo(0))); assertThat(mergedClock2_3.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock2_3.compareTo(vectorClock2), is(greaterThan(0))); assertThat(mergedClock2_3.compareTo(vectorClock3), is(equalTo(0))); assertThat(mergedClock3_1.compareTo(mergedClock3_1), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock3_1), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock3_1), is(lessThan(0))); assertThat(vectorClock3.compareTo(mergedClock3_1), is(equalTo(0))); assertThat(mergedClock3_1.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock3_1.compareTo(vectorClock2), is(greaterThan(0))); assertThat(mergedClock3_1.compareTo(vectorClock3), is(equalTo(0))); assertThat(mergedClock3_2.compareTo(mergedClock3_2), is(equalTo(0))); assertThat(vectorClock1.compareTo(mergedClock3_2), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock3_2), is(lessThan(0))); assertThat(vectorClock3.compareTo(mergedClock3_2), is(equalTo(0))); assertThat(mergedClock3_2.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock3_2.compareTo(vectorClock2), is(greaterThan(0))); assertThat(mergedClock3_2.compareTo(vectorClock3), is(equalTo(0))); } @Test public void shouldBeEqualWhenIncrementedAtDifferentNodes() { // given final VectorClock vectorClock0 = new VectorClock(); // when final VectorClock vectorClock1 = vectorClock0.increment(ID_1); final VectorClock vectorClock11 = vectorClock1.increment(ID_1); final VectorClock vectorClock2 = vectorClock0.increment(ID_2); final VectorClock vectorClock22 = vectorClock2.increment(ID_2); // then assertThat(vectorClock0.compareTo(vectorClock1), is(lessThan(0))); assertThat(vectorClock0.compareTo(vectorClock11), is(lessThan(0))); assertThat(vectorClock0.compareTo(vectorClock2), is(lessThan(0))); assertThat(vectorClock0.compareTo(vectorClock22), is(lessThan(0))); assertThat(vectorClock1.compareTo(vectorClock0), is(greaterThan(0))); assertThat(vectorClock1.compareTo(vectorClock11), is(lessThan(0))); assertThat(vectorClock1.compareTo(vectorClock2), is(equalTo(0))); assertThat(vectorClock1.compareTo(vectorClock22), is(equalTo(0))); assertThat(vectorClock11.compareTo(vectorClock0), is(greaterThan(0))); assertThat(vectorClock11.compareTo(vectorClock1), is(greaterThan(0))); assertThat(vectorClock11.compareTo(vectorClock2), is(equalTo(0))); assertThat(vectorClock11.compareTo(vectorClock22), is(equalTo(0))); assertThat(vectorClock2.compareTo(vectorClock0), is(greaterThan(0))); assertThat(vectorClock2.compareTo(vectorClock1), is(equalTo(0))); assertThat(vectorClock2.compareTo(vectorClock11), is(equalTo(0))); assertThat(vectorClock2.compareTo(vectorClock22), is(lessThan(0))); assertThat(vectorClock22.compareTo(vectorClock0), is(greaterThan(0))); assertThat(vectorClock22.compareTo(vectorClock1), is(equalTo(0))); assertThat(vectorClock22.compareTo(vectorClock11), is(equalTo(0))); assertThat(vectorClock22.compareTo(vectorClock2), is(greaterThan(0))); } @Test public void shouldBeGreaterWhenIncrementedAtDifferentNodesAndMerged() { // given final VectorClock vectorClock0 = new VectorClock(); final VectorClock vectorClock1 = vectorClock0.increment(ID_1); final VectorClock vectorClock2 = vectorClock0.increment(ID_2); // when final VectorClock mergedClock1_2 = vectorClock1.merge(vectorClock2); final VectorClock mergedClock2_1 = vectorClock2.merge(vectorClock1); // then assertThat(vectorClock0.compareTo(mergedClock1_2), is(lessThan(0))); assertThat(vectorClock0.compareTo(mergedClock2_1), is(lessThan(0))); assertThat(vectorClock1.compareTo(mergedClock1_2), is(lessThan(0))); assertThat(vectorClock1.compareTo(mergedClock2_1), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock1_2), is(lessThan(0))); assertThat(vectorClock2.compareTo(mergedClock2_1), is(lessThan(0))); assertThat(mergedClock1_2.compareTo(vectorClock0), is(greaterThan(0))); assertThat(mergedClock1_2.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock1_2.compareTo(vectorClock2), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(vectorClock0), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(vectorClock1), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(vectorClock2), is(greaterThan(0))); } @Test public void shouldBeGreaterWhenMergedAndIncrementedAtDifferentNodes() { // given final VectorClock vectorClock0 = new VectorClock(); final VectorClock vectorClock1 = vectorClock0.increment(ID_1); final VectorClock vectorClock2 = vectorClock0.increment(ID_2); final VectorClock mergedClock1_2 = vectorClock1.merge(vectorClock2); final VectorClock mergedClock2_1 = vectorClock2.merge(vectorClock1); // when final VectorClock clock1_2_1 = mergedClock1_2.increment(ID_1); final VectorClock clock1_2_2 = mergedClock1_2.increment(ID_2); final VectorClock clock2_1_1 = mergedClock2_1.increment(ID_1); final VectorClock clock2_1_2 = mergedClock2_1.increment(ID_2); // then assertThat(mergedClock1_2.compareTo(clock1_2_1), is(lessThan(0))); assertThat(mergedClock1_2.compareTo(clock1_2_2), is(lessThan(0))); assertThat(mergedClock1_2.compareTo(clock2_1_1), is(lessThan(0))); assertThat(mergedClock1_2.compareTo(clock2_1_2), is(lessThan(0))); assertThat(clock1_2_1.compareTo(mergedClock1_2), is(greaterThan(0))); assertThat(clock1_2_2.compareTo(mergedClock1_2), is(greaterThan(0))); assertThat(clock2_1_1.compareTo(mergedClock1_2), is(greaterThan(0))); assertThat(clock2_1_2.compareTo(mergedClock1_2), is(greaterThan(0))); assertThat(mergedClock2_1.compareTo(clock1_2_1), is(lessThan(0))); assertThat(mergedClock2_1.compareTo(clock1_2_2), is(lessThan(0))); assertThat(mergedClock2_1.compareTo(clock2_1_1), is(lessThan(0))); assertThat(mergedClock2_1.compareTo(clock2_1_2), is(lessThan(0))); assertThat(clock1_2_1.compareTo(mergedClock2_1), is(greaterThan(0))); assertThat(clock1_2_2.compareTo(mergedClock2_1), is(greaterThan(0))); assertThat(clock2_1_1.compareTo(mergedClock2_1), is(greaterThan(0))); assertThat(clock2_1_2.compareTo(mergedClock2_1), is(greaterThan(0))); assertThat(clock1_2_1.compareTo(clock1_2_1), is(equalTo(0))); assertThat(clock1_2_1.compareTo(clock1_2_2), is(equalTo(0))); assertThat(clock1_2_1.compareTo(clock2_1_1), is(equalTo(0))); assertThat(clock1_2_1.compareTo(clock2_1_2), is(equalTo(0))); assertThat(clock1_2_2.compareTo(clock1_2_1), is(equalTo(0))); assertThat(clock1_2_2.compareTo(clock1_2_2), is(equalTo(0))); assertThat(clock1_2_2.compareTo(clock2_1_1), is(equalTo(0))); assertThat(clock1_2_2.compareTo(clock2_1_2), is(equalTo(0))); assertThat(clock2_1_1.compareTo(clock1_2_1), is(equalTo(0))); assertThat(clock2_1_1.compareTo(clock1_2_2), is(equalTo(0))); assertThat(clock2_1_1.compareTo(clock2_1_1), is(equalTo(0))); assertThat(clock2_1_1.compareTo(clock2_1_2), is(equalTo(0))); assertThat(clock2_1_2.compareTo(clock1_2_1), is(equalTo(0))); assertThat(clock2_1_2.compareTo(clock1_2_2), is(equalTo(0))); assertThat(clock2_1_2.compareTo(clock2_1_1), is(equalTo(0))); assertThat(clock1_2_2.compareTo(clock2_1_2), is(equalTo(0))); } @Test public void shouldCalculateIdentical() { // given final VectorClock vectorClock0 = new VectorClock(); final VectorClock vectorClock1 = vectorClock0.increment(ID_1); final VectorClock vectorClock11 = vectorClock1.increment(ID_1); final VectorClock vectorClock2 = vectorClock0.increment(ID_2); final VectorClock vectorClock1_2 = vectorClock1.merge(vectorClock2); final VectorClock vectorClock2_1 = vectorClock2.merge(vectorClock1); final VectorClock vectorClock1_2_1 = vectorClock1_2.increment(ID_1); // then assertThat(vectorClock0.equals(vectorClock0), is(true)); assertThat(vectorClock1.equals(vectorClock1), is(true)); assertThat(vectorClock11.equals(vectorClock11), is(true)); assertThat(vectorClock1_2.equals(vectorClock1_2), is(true)); assertThat(vectorClock1_2_1.equals(vectorClock1_2_1), is(true)); assertThat(vectorClock0.equals(vectorClock1), is(false)); assertThat(vectorClock1.equals(vectorClock0), is(false)); assertThat(vectorClock1.equals(vectorClock11), is(false)); assertThat(vectorClock11.equals(vectorClock1), is(false)); assertThat(vectorClock1.equals(vectorClock2), is(false)); assertThat(vectorClock2.equals(vectorClock1), is(false)); assertThat(vectorClock1.equals(vectorClock1_2), is(false)); assertThat(vectorClock1_2.equals(vectorClock1), is(false)); assertThat(vectorClock1.equals(vectorClock2_1), is(false)); assertThat(vectorClock2_1.equals(vectorClock1), is(false)); assertThat(vectorClock1_2.equals(vectorClock1_2_1), is(false)); assertThat(vectorClock1_2_1.equals(vectorClock1_2), is(false)); assertThat(vectorClock1_2.equals(vectorClock2_1), is(true)); assertThat(vectorClock2_1.equals(vectorClock1_2), is(true)); } }
47.956522
79
0.709519
3481d8d7e3ec4ef851d39ed9e09f8e8322d20ff0
351
import java.io.*; public class Cricket { class batsman { int brun; int totalrun=0; void getData(int x) { brun=x; totalrun=totalrun + brun; System.out.println("the runs scored by this team in the innings is:: " +totalrun ); } } class bowler {} public static void main() { } }
14.625
88
0.549858
1e48943c7e6ef44e24c80b889c6e0f68df1d6b4d
186
package org.apache.avro.perf.test.generic.jmh_generated; public class GenericWithOutOfOrderTest_TestStateDecode_jmhType extends GenericWithOutOfOrderTest_TestStateDecode_jmhType_B3 { }
37.2
125
0.897849
6a0944f70767a6eaab86d147881dec20c0d9503d
1,936
/* * Copyright 2020-2021 B2i Healthcare Pte Ltd, http://b2i.sg * * 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.b2international.snowowl.core.request; import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collections; import java.util.List; import com.b2international.commons.http.ExtendedLocale; import com.b2international.commons.options.Options; import com.b2international.commons.options.OptionsBuilder; import com.b2international.snowowl.core.ServiceProvider; /** * @since 7.7 */ public abstract class ResourceExpander { public static final int DEFAULT_LIMIT = 50; private final ServiceProvider context; private final Options expand; private final List<ExtendedLocale> locales; protected ResourceExpander(ServiceProvider context, Options expand, List<ExtendedLocale> locales) { this.context = checkNotNull(context, "context"); this.expand = expand == null ? OptionsBuilder.newBuilder().build() : expand; this.locales = locales == null ? Collections.<ExtendedLocale>emptyList() : locales; } protected final Options expand() { return expand; } protected ServiceProvider context() { return context; } protected final List<ExtendedLocale> locales() { return locales; } protected final int getLimit(final Options expandOptions) { return expandOptions.containsKey("limit") ? expandOptions.get("limit", Integer.class) : DEFAULT_LIMIT; } }
31.225806
104
0.76343
6ae838c15bd90d0f5ae8c71abd6b6e2b2db6550a
3,888
package com.github.athi.athifx.injector.injection; import com.github.athi.athifx.injector.log.Log; import com.google.inject.Binder; import com.google.inject.Injector; import org.reflections.Reflections; import javax.enterprise.inject.Instance; import javax.enterprise.util.TypeLiteral; import javax.ws.rs.NotSupportedException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Iterator; import java.util.Set; /** * Created by Athi */ class AthiFXInstance<T> implements Instance<T> { private static final Log LOGGER = Log.getLogger(AthiFXInstance.class); private ArrayDeque<T> instances = new ArrayDeque<>(); public AthiFXInstance(Type genericType, Binder binder) { Reflections reflections = AthiFXInjector.getReflections(); Class genericClass = ((Class) genericType); Set<Class<T>> subTypesOfGeneric = reflections.getSubTypesOf(genericClass); fillInstancesCollection(subTypesOfGeneric, binder); } private AthiFXInstance(ArrayDeque<T> newInstancesDeque) { this.instances = newInstancesDeque; } private void fillInstancesCollection(Set<Class<T>> subTypeOfGeneric, Binder binder) { subTypeOfGeneric.forEach(genericClass -> { try { T instance = genericClass.newInstance(); binder.requestInjection(instance); instances.push(instance); } catch (InstantiationException | IllegalAccessException e) { LOGGER.error(e.getMessage(), e); } }); } private ArrayDeque<T> newInstancesDequeByAnnotations(Annotation... annotations) { ArrayDeque<T> newInstancesDeque = new ArrayDeque<>(); instances.iterator().forEachRemaining(instance -> { for (Annotation annotation : instance.getClass().getAnnotations()) { if (Arrays.asList(annotations).contains(annotation)) { newInstancesDeque.push(instance); } } }); return newInstancesDeque; } @Override public Instance<T> select(Annotation... annotations) { ArrayDeque<T> newInstancesDeque = newInstancesDequeByAnnotations(annotations); return new AthiFXInstance<>(newInstancesDeque); } @Override public <U extends T> Instance<U> select(Class<U> aClass, Annotation... annotations) { ArrayDeque<U> newInstancesDeque = (ArrayDeque<U>) newInstancesDequeByAnnotations(annotations); Iterator<U> descendingIterator = newInstancesDeque.descendingIterator(); while (descendingIterator.hasNext()) { if (!descendingIterator.next().getClass().isAssignableFrom(aClass)) { descendingIterator.remove(); } } return new AthiFXInstance<>(newInstancesDeque); } @Override public <U extends T> Instance<U> select(TypeLiteral<U> typeLiteral, Annotation... annotations) { ArrayDeque<U> newInstancesDeque = (ArrayDeque<U>) newInstancesDequeByAnnotations(annotations); Iterator<U> descendingIterator = newInstancesDeque.descendingIterator(); while (descendingIterator.hasNext()) { if (!descendingIterator.next().getClass().equals(typeLiteral.getType())) { descendingIterator.remove(); } } return new AthiFXInstance<>(newInstancesDeque); } @Override public boolean isUnsatisfied() { return false; } @Override public boolean isAmbiguous() { return false; } @Override public void destroy(T t) { throw new NotSupportedException(); } @Override public Iterator<T> iterator() { return instances.iterator(); } @Override public T get() { return instances.getFirst(); } }
33.230769
102
0.664095
40712f04b7d1796e425646790aa23f695d86b407
5,864
package com.oilfoot.senshi.items.throwables.shuriken; import com.oilfoot.senshi.Senshi; import com.oilfoot.senshi.registry.ModEntities; import com.oilfoot.senshi.registry.ModItems; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.mob.EndermiteEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.PersistentProjectileEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.Packet; import net.minecraft.particle.ParticleTypes; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.world.GameRules; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; public class enderShurikenEntity extends PersistentProjectileEntity { public boolean isStopped = false; @Override protected void initDataTracker() { super.initDataTracker(); } @Override protected ItemStack asItemStack() { return new ItemStack(ModItems.ENDER_SHURIKEN); } public enderShurikenEntity(EntityType<? extends enderShurikenEntity> entityType, World world) { super(entityType, world); } public enderShurikenEntity(World world, double x, double y, double z) { super(ModEntities.ENDER_SHURIKEN_ENTITY_ENTITY_TYPE, x, y, z, world); } public enderShurikenEntity(World world) { super(ModEntities.ENDER_SHURIKEN_ENTITY_ENTITY_TYPE, world); } public enderShurikenEntity(World world, LivingEntity owner) { super(ModEntities.ENDER_SHURIKEN_ENTITY_ENTITY_TYPE, owner, world); } @Override public Packet<?> createSpawnPacket() { return EntitySpawnPacket.create(this, Senshi.PacketID); } protected void onEntityHit(EntityHitResult entityHitResult) { // called on entity hit. super.onEntityHit(entityHitResult); Entity entityHit = entityHitResult.getEntity(); // sets a new Entity instance as the EntityHitResult (victim) Entity entity = this.getOwner(); if (entity instanceof LivingEntity) // sets i to 3 if the Entity instance is an instance of BlazeEntity { entityHit.damage(DamageSource.thrownProjectile(this, this.getOwner()), 0f); // deals damage ((LivingEntity) entityHit).addStatusEffect((new StatusEffectInstance(StatusEffects.BLINDNESS, 20 * 3, 0))); // applies a status effect ((LivingEntity) entityHit).addStatusEffect((new StatusEffectInstance(StatusEffects.SLOWNESS, 20 * 3, 2))); // applies a status effect entityHit.playSound(Senshi.SHURIKEN_LAND_EVENT, 2F, 1F); // plays a sound for the entity hit only if (!this.world.isClient && !this.removed) { if (entity instanceof ServerPlayerEntity serverPlayerEntity) { if (serverPlayerEntity.networkHandler.getConnection().isOpen() && serverPlayerEntity.world == this.world) { serverPlayerEntity.isSleeping(); } if (entity.hasVehicle()) { entity.stopRiding(); } entity.requestTeleport(this.getX(), this.getY(), this.getZ()); entity.fallDistance = 0.0F; entity.damage(DamageSource.FALL, 0.0F); } } else { entity.requestTeleport(this.getX(), this.getY(), this.getZ()); entity.fallDistance = 0.0F; } } } protected void onCollision(HitResult hitResult) { // called on collision with a block super.onCollision(hitResult); } @Override protected void onBlockCollision(BlockState state) { super.onBlockCollision(state); } @Override protected void onBlockHit(BlockHitResult blockHitResult) { super.onBlockHit(blockHitResult); this.isStopped = true; this.playSound(Senshi.SHURIKEN_LAND_EVENT, 2F, 1F); Entity entity = this.getOwner(); for(int i = 0; i < 32; ++i) { this.world.addParticle(ParticleTypes.PORTAL, this.getX(), this.getY() + this.random.nextDouble() * 2.0D, this.getZ(), this.random.nextGaussian(), 0.0D, this.random.nextGaussian()); } if (!this.world.isClient && !this.removed) { if (entity instanceof ServerPlayerEntity serverPlayerEntity) { if (serverPlayerEntity.networkHandler.getConnection().isOpen() && serverPlayerEntity.world == this.world) { serverPlayerEntity.isSleeping(); } if (entity.hasVehicle()) { entity.stopRiding(); } entity.requestTeleport(this.getX(), this.getY(), this.getZ()); entity.fallDistance = 0.0F; entity.damage(DamageSource.FALL, 0.0F); } } else if (entity != null) { entity.requestTeleport(this.getX(), this.getY(), this.getZ()); entity.fallDistance = 0.0F; } this.remove(); } public void tick() { Entity entity = this.getOwner(); if (entity instanceof PlayerEntity && !entity.isAlive()) { this.remove(); } else { super.tick(); } } @Nullable public Entity moveToWorld(ServerWorld destination) { Entity entity = this.getOwner(); return super.moveToWorld(destination); } }
38.578947
192
0.658083
7d25c44e0aa005b1f81c5f22a1817bbf7cb3b345
4,674
package frames; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.List; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import jdbc.dao.Adocao; import jdbc.dao.ListarPet; import jdbc.modelo.Pets; import net.miginfocom.swing.MigLayout; public class Adotar { DefaultTableModel modelo = new DefaultTableModel(); FichaDeAdocao ficha = new FichaDeAdocao(); private JFrame frame; private JPanel panel; private JScrollPane scrollPane; private JTable table; private JLabel lblNome; private JLabel lblRaca; private JLabel lblIdade; private JLabel lblSexo; private JLabel lblAnimal; private JLabel bdAnimal; private JLabel bdNome; private JLabel bdRaca; private JLabel bdIdade; private JLabel bdSexo; private JLabel lblDeficiencia; private JLabel bdDeficiencia; private JButton btnAbrirFicha; /** * Launch the application. */ public void adotar() { // public void listarAdotar() { EventQueue.invokeLater(new Runnable() { public void run() { try { Adotar window = new Adotar(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public Adotar() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 780, 420); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); panel = new JPanel(); frame.getContentPane().add(panel, BorderLayout.CENTER); panel.setLayout(new MigLayout("", "[21.00][100.00][133.00][286.00][73.00,grow][71.00,grow]", "[][130.00][15.00][][][][][25.00][33.00][29.00,grow]")); scrollPane = new JScrollPane(); panel.add(scrollPane, "cell 1 1 3 9,grow"); table = new JTable(modelo); scrollPane.setViewportView(table); lblAnimal = new JLabel("Animal:"); panel.add(lblAnimal, "cell 4 2"); bdAnimal = new JLabel(""); panel.add(bdAnimal, "cell 5 2"); lblNome = new JLabel("Nome:"); panel.add(lblNome, "cell 4 3"); bdNome = new JLabel(""); panel.add(bdNome, "cell 5 3"); lblRaca = new JLabel("Raça:"); panel.add(lblRaca, "cell 4 4"); bdRaca = new JLabel(""); panel.add(bdRaca, "cell 5 4"); lblIdade = new JLabel("Idade:"); panel.add(lblIdade, "cell 4 5"); bdIdade = new JLabel(""); panel.add(bdIdade, "cell 5 5"); lblSexo = new JLabel("Sexo:"); panel.add(lblSexo, "cell 4 6"); bdSexo = new JLabel(""); panel.add(bdSexo, "cell 5 6"); lblDeficiencia = new JLabel("Deficiência:"); panel.add(lblDeficiencia, "cell 4 7"); lblDeficiencia.setEnabled(false); bdDeficiencia = new JLabel(""); panel.add(bdDeficiencia, "cell 5 7"); btnAbrirFicha = new JButton("Abrir Ficha de Adoção"); panel.add(btnAbrirFicha, "cell 4 8 2 1,alignx center"); modelo.addColumn("ID"); modelo.addColumn("Animal"); modelo.addColumn("Nome"); modelo.addColumn("Raça"); modelo.addColumn("Idade"); modelo.addColumn("Sexo"); modelo.addColumn("Deficiencia"); table.getColumnModel().getColumn(0).setPreferredWidth(0); carregarTabela(); table.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { int linha = table.getSelectedRow(); bdAnimal.setText(modelo.getValueAt(linha, 1).toString()); bdNome.setText(modelo.getValueAt(linha, 2).toString()); bdRaca.setText(modelo.getValueAt(linha, 3).toString()); bdIdade.setText(modelo.getValueAt(linha, 4).toString()); bdSexo.setText(modelo.getValueAt(linha, 5).toString()); Adocao apropriar = new Adocao(); Pets pet = new Pets(); pet.setIdPet(Integer.parseInt(modelo.getValueAt(table.getSelectedRow(), 0).toString())); apropriar.apropriar(pet); } public void mouseEntered(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseExited(MouseEvent e) { } }); btnAbrirFicha.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ficha.fichaDeAdocao(); } }); } public void carregarTabela() { ListarPet listar = new ListarPet(); List<Pets> lista = listar.listar(); for (Pets pet : lista) { modelo.addRow(new Object[] { pet.getIdPet(), pet.getPet(), pet.getNome(), pet.getRaca(), pet.getIdade(), pet.getSexo(), pet.getDeficiencia() }); } } }
23.725888
107
0.690415
2c2f91f63583ad0816604096d4f5a946b765c50c
421
package com.evolved.automata.parser.math; import java.util.*; public interface Argument { public enum ARGUMENT_TYPE { SIMPLE_DOUBLE, BINARY_OPERATOR, FUNCTION } public LinkedList<Argument> evaluate(LinkedList<Argument> evaluationStack); public Argument evaluateBinary(BinaryOperator operator, Argument me, Argument next); public Argument evaluateFunction(Function function, Argument ... remaining); }
23.388889
85
0.786223
b64e022601a753f33a25655ad096017370a1dc56
481
package com.abocode.jfaster.api.system; import lombok.Data; /** * Description: * * @author: guanxf * @date: 2020/9/8 */ @Data public class UserDto { private String id;// 用户名 private String username;// 用户名 private String realName;// 真实姓名 private String password;//用户密码 private String signature;// 签名 private Short status;// 状态1:在线,2:离线,0:禁用 private String mobilePhone;// 手机 private String officePhone;// 办公电话 private String email;// 邮箱 }
20.041667
44
0.671518
46e72f702a10e4bb28e5ab194c1330b997264032
1,848
package ch4.ex2; import java.util.Arrays; import java.util.function.Function; public class Demo07_FilterRectangle { public static void main(String[] args) { Rectangle[] rectangles = { new Rectangle(10, 10, 50, 75), new Rectangle(30, 40, 30, 45), new Rectangle(110, 70, 70, 15), new Rectangle(50, 10, 45, 35) }; Function<Rectangle, Integer> rectToX = r -> r.getX(); Function<Integer, Boolean> greaterThanTen = n -> n > 10; Arrays.stream(rectangles) .filter(rectToX.andThen(greaterThanTen)::apply) .forEach(System.out::println); } } class Rectangle { private int x; private int y; private int height; private int width; public Rectangle(int x, int y, int height, int width) { super(); this.x = x; this.y = y; this.height = height; this.width = width; } public Rectangle scale(double percent) { this.height = (int) (height * (1.0d + percent)); this.width = (int) (width * (1.0d + percent)); return this; } public int getArea() { return this.height * this.width; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public String toString() { return "X: " + x + " Y: " + y + " Height: " + height + " Width: " + width; } }
23.692308
64
0.521104
56c3a8df091c3b91e10fe0373b71b432e04575bd
2,100
package com.lambdaschool.oktafoundation.services; import com.lambdaschool.oktafoundation.models.RoleType; import com.lambdaschool.oktafoundation.models.User; import com.lambdaschool.oktafoundation.models.ValidationError; import java.util.List; /** * Class contains helper functions - functions that are needed throughout the application. The class can be autowired * into any class. */ public interface HelperFunctions { /** * Searches to see if the exception has any constraint violations to report * * @param cause the exception to search * * @return constraint violations formatted for sending to the client */ List<ValidationError> getConstraintViolation(Throwable cause); /** * Checks to see if the authenticated user has access to modify the requested user's information * * @param username The user name of the user whose data is requested to be changed. This should either match the authenticated user * or the authenticate must have the role ADMIN * * @return true if the user can make the modifications, otherwise an exception is thrown */ boolean isAuthorizedToMakeChange(String username); RoleType getCurrentPriorityRole(); User getCallingUser(); // THIS may be a good/simple/customizable solution to adding // some granularity & consistency to the permissions in our app // // boolean isAuthorizedToMakeChange(RoleType role); // boolean isAuthorizedToMakeChange( // String username, // User user // ); // boolean isAuthorizedToMakeChange( // String username, // Program program // ); // boolean isAuthorizedToMakeChange( // String username, // Course course // ); // boolean isAuthorizedToMakeChange( // String username, // Module module // ); // boolean isAuthorizedToMakeChange( // RoleType role, // User user // ); // boolean isAuthorizedToMakeChange( // RoleType role, // Program program // ); // boolean isAuthorizedToMakeChange( // RoleType role, // Course course // ); // boolean isAuthorizedToMakeChange( // RoleType role, // Module module // ); }
26.582278
132
0.72381
707325a27c7b7de523e159d6795bee1b27e56136
2,577
package mage.cards.i; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; import mage.abilities.effects.common.discard.DiscardHandAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; /** * * @author emerald000 */ public final class IllGottenGains extends CardImpl { public IllGottenGains(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); // Exile Ill-Gotten Gains. this.getSpellAbility().addEffect(new ExileSpellEffect()); // Each player discards their hand, this.getSpellAbility().addEffect(new DiscardHandAllEffect()); //then returns up to three cards from their graveyard to their hand. this.getSpellAbility().addEffect(new IllGottenGainsEffect()); } private IllGottenGains(final IllGottenGains card) { super(card); } @Override public IllGottenGains copy() { return new IllGottenGains(this); } } class IllGottenGainsEffect extends OneShotEffect { IllGottenGainsEffect() { super(Outcome.ReturnToHand); this.staticText = ", then returns up to three cards from their graveyard to their hand."; } IllGottenGainsEffect(final IllGottenGainsEffect effect) { super(effect); } @Override public IllGottenGainsEffect copy() { return new IllGottenGainsEffect(this); } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { Target target = new TargetCardInYourGraveyard(0, 3, new FilterCard()); if (target.choose(Outcome.ReturnToHand, player.getId(), source.getSourceId(), game)) { player.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game); } } } return true; } return false; } }
30.678571
106
0.668995
b87ae69f221e6903b0a0b53786733e7055a5d40f
1,574
package xyz.lius.andy.expression.ast; import xyz.lius.andy.core.Definition; import xyz.lius.andy.expression.*; import xyz.lius.andy.expression.context.ExpressionContext; import xyz.lius.andy.expression.operator.ColonExpression; import xyz.lius.andy.expression.operator.DefineExpression; import java.util.ArrayList; import java.util.List; /** * e.g. {...} */ public class CurlyBracketExpression extends BracketExpression { private List<Expression> fields = new ArrayList<>(); private List<Expression> codes = new ArrayList<>(); public CurlyBracketExpression(Expression... expressions) { super(expressions); } @Override public void add(Expression expression) { //record the order of the origin file super.add(expression); if (expression instanceof DefineExpression || expression instanceof ColonExpression) { this.fields.add(expression); } else { this.codes.add(expression); } } @Override public Complex eval(Context<Name, Expression> context) { Context<Name, Expression> selfContext = new ExpressionContext(context); for (Expression expression : this.fields) { expression.eval(selfContext); } Complex complex = ExpressionFactory.complex(selfContext); complex.setCodes(this.codes.toArray(new Expression[this.codes.size()])); selfContext.add(Definition.SELF, complex); return complex; } @Override public String toString() { return "{" + super.toString() + "}"; } }
29.148148
94
0.675985
6b7ab58591eb8758390b2e324c26369c520f6854
9,679
package com.tobe.client; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.StatusRuntimeException; import io.grpc.netty.NettyChannelBuilder; import org.tensorflow.framework.DataType; import org.tensorflow.framework.TensorProto; import org.tensorflow.framework.TensorShapeProto; import tensorflow.serving.Model; import tensorflow.serving.Predict; import tensorflow.serving.PredictionServiceGrpc; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; /** * The sparse predict client for TensorFlow models and a8a data. */ public class SparsePredictClient { private static final Logger logger = Logger.getLogger(SparsePredictClient.class.getName()); private final ManagedChannel channel; private final PredictionServiceGrpc.PredictionServiceBlockingStub blockingStub; // Initialize gRPC client public SparsePredictClient(String host, int port) { //channel = ManagedChannelBuilder.forAddress(host, port) channel = NettyChannelBuilder.forAddress(host, port) // Channels are secure by default (via SSL/TLS). For the example we disable TLS to avoid // needing certificates. .usePlaintext(true) .maxMessageSize(100 * 1024 * 1024) .build(); blockingStub = PredictionServiceGrpc.newBlockingStub(channel); } public static void main(String[] args) { System.out.println("Start the predict client"); String host = "127.0.0.1"; int port = 9000; String modelName = "sparse"; long modelVersion = 1; // Parse command-line arguments if (args.length == 4) { host = args[0]; port = Integer.parseInt(args[1]); modelName = args[2]; modelVersion = Long.parseLong(args[3]); } // Run predict client to send request SparsePredictClient client = new SparsePredictClient(host, port); try { client.predict_example(modelName, modelVersion); } catch (Exception e) { System.out.println(e); } finally { try { client.shutdown(); } catch (Exception e) { System.out.println(e); } } System.out.println("End of predict client"); } public void shutdown() throws InterruptedException { channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); } public void predict_example(String modelName, long modelVersion) { /* Example data: 0 5:1 6:1 17:1 21:1 35:1 40:1 53:1 63:1 71:1 73:1 74:1 76:1 80:1 83:1 1 5:1 7:1 17:1 22:1 36:1 40:1 51:1 63:1 67:1 73:1 74:1 76:1 81:1 83:1 */ // Generate keys TensorProto int[][] keysTensorData = new int[][]{ {1}, {2} }; TensorProto.Builder keysTensorBuilder = TensorProto.newBuilder(); for (int i = 0; i < keysTensorData.length; ++i) { for (int j = 0; j < keysTensorData[i].length; ++j) { keysTensorBuilder.addIntVal(keysTensorData[i][j]); } } TensorShapeProto.Dim keysDim1 = TensorShapeProto.Dim.newBuilder().setSize(2).build(); TensorShapeProto.Dim keysDim2 = TensorShapeProto.Dim.newBuilder().setSize(1).build(); TensorShapeProto keysShape = TensorShapeProto.newBuilder().addDim(keysDim1).addDim(keysDim2).build(); keysTensorBuilder.setDtype(org.tensorflow.framework.DataType.DT_INT32).setTensorShape(keysShape); TensorProto keysTensorProto = keysTensorBuilder.build(); // Generate indexs TensorProto // Example: [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [0, 8], [0, 9], [0, 10], [0, 11], [0, 12], [0, 13], [1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [1, 10], [1, 11], [1, 12], [1, 13]] long[][] indexsTensorData = new long[][]{ {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8}, {0, 9}, {0, 10}, {0, 11}, {0, 12}, {0, 13}, {1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8}, {1, 9}, {1, 10}, {1, 11}, {1, 12}, {1, 13} }; TensorProto.Builder indexsTensorBuilder = TensorProto.newBuilder(); for (int i = 0; i < indexsTensorData.length; ++i) { for (int j = 0; j < indexsTensorData[i].length; ++j) { indexsTensorBuilder.addInt64Val(indexsTensorData[i][j]); } } TensorShapeProto.Dim indexsDim1 = TensorShapeProto.Dim.newBuilder().setSize(28).build(); TensorShapeProto.Dim indexsDim2 = TensorShapeProto.Dim.newBuilder().setSize(2).build(); TensorShapeProto indexsShape = TensorShapeProto.newBuilder().addDim(indexsDim1).addDim(indexsDim2).build(); indexsTensorBuilder.setDtype(DataType.DT_INT64).setTensorShape(indexsShape); TensorProto indexsTensorProto = indexsTensorBuilder.build(); // Generate ids TensorProto // Example: [5, 6, 17, 21, 35, 40, 53, 63, 71, 73, 74, 76, 80, 83, 5, 7, 17, 22, 36, 40, 51, 63, 67, 73, 74, 76, 81, 83] long[] idsTensorData = new long[]{ 5, 6, 17, 21, 35, 40, 53, 63, 71, 73, 74, 76, 80, 83, 5, 7, 17, 22, 36, 40, 51, 63, 67, 73, 74, 76, 81, 83 }; TensorProto.Builder idsTensorBuilder = TensorProto.newBuilder(); for (int i = 0; i < idsTensorData.length; ++i) { idsTensorBuilder.addInt64Val(idsTensorData[i]); } TensorShapeProto.Dim idsDim1 = TensorShapeProto.Dim.newBuilder().setSize(28).build(); TensorShapeProto idsShape = TensorShapeProto.newBuilder().addDim(idsDim1).build(); idsTensorBuilder.setDtype(DataType.DT_INT64).setTensorShape(idsShape); TensorProto idsTensorProto = idsTensorBuilder.build(); // Generate values TensorProto // Example: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] float[] valuesTensorData = new float[]{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; TensorProto.Builder valuesTensorBuilder = TensorProto.newBuilder(); for (int i = 0; i < valuesTensorData.length; ++i) { valuesTensorBuilder.addFloatVal(valuesTensorData[i]); } TensorShapeProto.Dim valuesDim1 = TensorShapeProto.Dim.newBuilder().setSize(28).build(); TensorShapeProto valuesShape = TensorShapeProto.newBuilder().addDim(valuesDim1).build(); valuesTensorBuilder.setDtype(DataType.DT_FLOAT).setTensorShape(valuesShape); TensorProto valuesTensorProto = valuesTensorBuilder.build(); // Generate shape TensorProto // Example: [3, 124] long[] shapeTensorData = new long[]{ 2, 124 }; TensorProto.Builder shapeTensorBuilder = TensorProto.newBuilder(); for (int i = 0; i < shapeTensorData.length; ++i) { shapeTensorBuilder.addInt64Val(shapeTensorData[i]); } TensorShapeProto.Dim shapeDim1 = TensorShapeProto.Dim.newBuilder().setSize(2).build(); TensorShapeProto shapeShape = TensorShapeProto.newBuilder().addDim(shapeDim1).build(); shapeTensorBuilder.setDtype(DataType.DT_INT64).setTensorShape(shapeShape); TensorProto shapeTensorProto = shapeTensorBuilder.build(); predict(modelName, modelVersion, keysTensorProto, indexsTensorProto, idsTensorProto, valuesTensorProto, shapeTensorProto); } public void predict(String modelName, long modelVersion, TensorProto keysTensorProto, TensorProto indexsTensorProto, TensorProto idsTensorProto, TensorProto valuesTensorProto, TensorProto shapeTensorProto) { // Generate gRPC request com.google.protobuf.Int64Value version = com.google.protobuf.Int64Value.newBuilder().setValue(modelVersion).build(); Model.ModelSpec modelSpec = Model.ModelSpec.newBuilder().setName(modelName).setVersion(version).build(); Predict.PredictRequest request = Predict.PredictRequest.newBuilder().setModelSpec(modelSpec).putInputs("keys", keysTensorProto).putInputs("indexs", indexsTensorProto).putInputs("ids", idsTensorProto).putInputs("values", valuesTensorProto).putInputs("shape", shapeTensorProto).build(); // Request gRPC server Predict.PredictResponse response; try { response = blockingStub.withDeadlineAfter(10, TimeUnit.SECONDS).predict(request); java.util.Map<java.lang.String, org.tensorflow.framework.TensorProto> outputs = response.getOutputs(); for (java.util.Map.Entry<java.lang.String, org.tensorflow.framework.TensorProto> entry : outputs.entrySet()) { System.out.println("Response with the key: " + entry.getKey() + ", value: " + entry.getValue()); } } catch (StatusRuntimeException e) { logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus()); return; } } }
42.827434
292
0.599649
69575e829e4a28e072e3ad66b334f6cb69a48a9b
1,092
package arekkuusu.implom.api.capability.data; import arekkuusu.implom.api.IPMApi; import net.minecraft.nbt.NBTBase; import net.minecraftforge.common.util.INBTSerializable; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; public interface INBTData<T extends NBTBase> extends INBTSerializable<NBTBase> { void deserialize(T nbt); T serialize(); default boolean canDeserialize() { return true; } default void markDirty() { IPMApi.getInstance().markWorldDirty(); } @Override default NBTBase serializeNBT() { return serialize(); } @Override @SuppressWarnings("unchecked") default void deserializeNBT(NBTBase nbt) { deserialize((T) nbt); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @interface NBTHolder { /** * The unique mod Identifier of this mod. */ String modId(); /** * The unique Identifier of the saved data. * It mustn't change so the data persists even if you rename the class */ String name(); } }
21
80
0.741758
99e4ae5b43c8afa893aecce4cea4fb7c2634525d
342
package com.tjudream.designpattern.iterator.general; /** * 描述: * <p> * Created by mengxiansen on 2018-11-30 14:40 * * @author [email protected] */ public interface Aggregate { //是容器必然有元素的增加 public void add(Object object); //减少元素 public void remove(Object object); //用迭代器来遍历元素 public Iterator iterator(); }
19
52
0.678363
b6d17f6cd86fc1ff0d2a5f5ed017927592184def
163
package com.example.WalPP.dto.request; public class BalanceRequest { public Integer getUserId() { return userId; } private Integer userId; }
16.3
38
0.680982
7408528406ec3d29c12f59ae55e19bde76155783
1,635
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.databox.implementation; import com.azure.resourcemanager.databox.fluent.models.ValidationResponseInner; import com.azure.resourcemanager.databox.models.OverallValidationStatus; import com.azure.resourcemanager.databox.models.ValidationInputResponse; import com.azure.resourcemanager.databox.models.ValidationResponse; import java.util.Collections; import java.util.List; public final class ValidationResponseImpl implements ValidationResponse { private ValidationResponseInner innerObject; private final com.azure.resourcemanager.databox.DataBoxManager serviceManager; ValidationResponseImpl( ValidationResponseInner innerObject, com.azure.resourcemanager.databox.DataBoxManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } public OverallValidationStatus status() { return this.innerModel().status(); } public List<ValidationInputResponse> individualResponseDetails() { List<ValidationInputResponse> inner = this.innerModel().individualResponseDetails(); if (inner != null) { return Collections.unmodifiableList(inner); } else { return Collections.emptyList(); } } public ValidationResponseInner innerModel() { return this.innerObject; } private com.azure.resourcemanager.databox.DataBoxManager manager() { return this.serviceManager; } }
35.543478
111
0.75474
5dc1100591bd0505ff794ffe7fbfe7c47db07a3c
1,515
package com.carpool.weixin.templateMessage; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * 模板消息返回结果 * * @author bjsonghongxu * @create 2018-02-28 15:27 **/ public class TemplateMsgResult implements Serializable { /*{ "errcode":0, "errmsg":"ok", }*/ private Integer errcode; private String errmsg; private String tips; public TemplateMsgResult() { } public TemplateMsgResult(Integer errcode, String tips) { this.errcode = errcode; this.tips = tips; } /* 返回码 说明 40037 template_id不正确 41028 form_id不正确,或者过期 41029 form_id已被使用 41030 page不正确 45009 接口调用超过限额(目前默认每个帐号日调用限额为100万)*/ private static final Map<Integer,String> statuMap = new HashMap<Integer,String>(){{ put(0,"发送成功"); put(40037,"template_id不正确"); put(41028,"form_id不正确,或者过期"); put(41029,"form_id已被使用"); put(41030,"page不正确"); put(45009,"接口调用超过限额"); }}; public Integer getErrcode() { return errcode; } public void setErrcode(Integer errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getTips() { return tips; } public void setTips(String tips) { this.tips = (null != errcode) ? statuMap.get(errcode) : ""; } }
20.472973
89
0.592079
cc7ae18d0598c5b9e6748d866cb891e537c61462
1,136
package pl.edu.agh.to2.acesandkings.game; import com.google.inject.AbstractModule; import pl.edu.agh.to2.acesandkings.common.model.GamePlayer; import pl.edu.agh.to2.acesandkings.game.api.*; import pl.edu.agh.to2.acesandkings.game.apiImpl.*; import pl.edu.agh.to2.acesandkings.game.model.CardStackRepository; import pl.edu.agh.to2.acesandkings.game.apiImpl.GameManagerImpl; import pl.edu.agh.to2.acesandkings.player.Player.GamePlayerImpl; public class GameModule extends AbstractModule { @Override protected void configure() { bind(CardStackRepository.class).toInstance(new CardStackRepository()); bind(ActiveCardsManipulator.class).to(ActiveCardsManipulatorImpl.class); bind(CardsInHandManipulator.class).to(CardsInHandManipulatorImpl.class); bind(CardsMovePossibilityGuard.class).to(CardsMovePossibilityGuardImpl.class); bind(CardStackManager.class).to(CardStackManagerImpl.class); bind(GameActionManager.class).to(GameActionManagerImpl.class); bind(GameManager.class).to(GameManagerImpl.class); bind(GamePlayer.class).toInstance(new GamePlayerImpl()); } }
47.333333
86
0.77993
6c9452baa181baf56be218bdf232a4e93bc752f2
8,475
// // ======================================================================== // Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd. // ------------------------------------------------------------------------ // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 // and Apache License v2.0 which accompanies this distribution. // // The Eclipse Public License is available at // http://www.eclipse.org/legal/epl-v10.html // // The Apache License v2.0 is available at // http://www.opensource.org/licenses/apache2.0.php // // You may elect to redistribute this code under either of these licenses. // ======================================================================== // package org.eclipse.jetty.http; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Ignore; import org.junit.Test; /** * */ public class PathMapTest { @Test @Ignore public void testPathMap() throws Exception { PathMap<String> p = new PathMap<>(); p.put("/abs/path", "1"); p.put("/abs/path/longer", "2"); p.put("/animal/bird/*", "3"); p.put("/animal/fish/*", "4"); p.put("/animal/*", "5"); p.put("*.tar.gz", "6"); p.put("*.gz", "7"); p.put("/", "8"); p.put("/XXX:/YYY", "9"); p.put("", "10"); p.put("/\u20ACuro/*", "11"); String[][] tests = { { "/abs/path", "1"}, { "/abs/path/xxx", "8"}, { "/abs/pith", "8"}, { "/abs/path/longer", "2"}, { "/abs/path/", "8"}, { "/abs/path/xxx", "8"}, { "/animal/bird/eagle/bald", "3"}, { "/animal/fish/shark/grey", "4"}, { "/animal/insect/bug", "5"}, { "/animal", "5"}, { "/animal/", "5"}, { "/animal/x", "5"}, { "/animal/*", "5"}, { "/suffix/path.tar.gz", "6"}, { "/suffix/path.gz", "7"}, { "/animal/path.gz", "5"}, { "/Other/path", "8"}, { "/\u20ACuro/path", "11"}, { "/", "10"}, }; for (String[] test : tests) { assertEquals(test[0], test[1], p.getMatch(test[0]).getValue()); } assertEquals("Get absolute path", "1", p.get("/abs/path")); assertEquals("Match absolute path", "/abs/path", p.getMatch("/abs/path").getKey()); assertEquals("all matches", "[/animal/bird/*=3, /animal/*=5, *.tar.gz=6, *.gz=7, /=8]", p.getMatches("/animal/bird/path.tar.gz").toString()); assertEquals("Dir matches", "[/animal/fish/*=4, /animal/*=5, /=8]", p.getMatches("/animal/fish/").toString()); assertEquals("Dir matches", "[/animal/fish/*=4, /animal/*=5, /=8]", p.getMatches("/animal/fish").toString()); assertEquals("Root matches", "[=10, /=8]",p.getMatches("/").toString()); assertEquals("Dir matches", "[/=8]", p.getMatches("").toString()); assertEquals("pathMatch exact", "/Foo/bar", PathMap.pathMatch("/Foo/bar", "/Foo/bar")); assertEquals("pathMatch prefix", "/Foo", PathMap.pathMatch("/Foo/*", "/Foo/bar")); assertEquals("pathMatch prefix", "/Foo", PathMap.pathMatch("/Foo/*", "/Foo/")); assertEquals("pathMatch prefix", "/Foo", PathMap.pathMatch("/Foo/*", "/Foo")); assertEquals("pathMatch suffix", "/Foo/bar.ext", PathMap.pathMatch("*.ext", "/Foo/bar.ext")); assertEquals("pathMatch default", "/Foo/bar.ext", PathMap.pathMatch("/", "/Foo/bar.ext")); assertEquals("pathInfo exact", null, PathMap.pathInfo("/Foo/bar", "/Foo/bar")); assertEquals("pathInfo prefix", "/bar", PathMap.pathInfo("/Foo/*", "/Foo/bar")); assertEquals("pathInfo prefix", "/*", PathMap.pathInfo("/Foo/*", "/Foo/*")); assertEquals("pathInfo prefix", "/", PathMap.pathInfo("/Foo/*", "/Foo/")); assertEquals("pathInfo prefix", null, PathMap.pathInfo("/Foo/*", "/Foo")); assertEquals("pathInfo suffix", null, PathMap.pathInfo("*.ext", "/Foo/bar.ext")); assertEquals("pathInfo default", null, PathMap.pathInfo("/", "/Foo/bar.ext")); assertEquals("multi paths", "9", p.getMatch("/XXX").getValue()); assertEquals("multi paths", "9", p.getMatch("/YYY").getValue()); p.put("/*", "0"); assertEquals("Get absolute path", "1", p.get("/abs/path")); assertEquals("Match absolute path", "/abs/path", p.getMatch("/abs/path").getKey()); assertEquals("Match absolute path", "1", p.getMatch("/abs/path").getValue()); assertEquals("Mismatch absolute path", "0", p.getMatch("/abs/path/xxx").getValue()); assertEquals("Mismatch absolute path", "0", p.getMatch("/abs/pith").getValue()); assertEquals("Match longer absolute path", "2", p.getMatch("/abs/path/longer").getValue()); assertEquals("Not exact absolute path", "0", p.getMatch("/abs/path/").getValue()); assertEquals("Not exact absolute path", "0", p.getMatch("/abs/path/xxx").getValue()); assertEquals("Match longest prefix", "3", p.getMatch("/animal/bird/eagle/bald").getValue()); assertEquals("Match longest prefix", "4", p.getMatch("/animal/fish/shark/grey").getValue()); assertEquals("Match longest prefix", "5", p.getMatch("/animal/insect/bug").getValue()); assertEquals("mismatch exact prefix", "5", p.getMatch("/animal").getValue()); assertEquals("mismatch exact prefix", "5", p.getMatch("/animal/").getValue()); assertEquals("Match longest suffix", "0", p.getMatch("/suffix/path.tar.gz").getValue()); assertEquals("Match longest suffix", "0", p.getMatch("/suffix/path.gz").getValue()); assertEquals("prefix rather than suffix", "5", p.getMatch("/animal/path.gz").getValue()); assertEquals("default", "0", p.getMatch("/Other/path").getValue()); assertEquals("pathMatch /*", "", PathMap.pathMatch("/*", "/xxx/zzz")); assertEquals("pathInfo /*", "/xxx/zzz", PathMap.pathInfo("/*", "/xxx/zzz")); assertTrue("match /", PathMap.match("/", "/anything")); assertTrue("match /*", PathMap.match("/*", "/anything")); assertTrue("match /foo", PathMap.match("/foo", "/foo")); assertTrue("!match /foo", !PathMap.match("/foo", "/bar")); assertTrue("match /foo/*", PathMap.match("/foo/*", "/foo")); assertTrue("match /foo/*", PathMap.match("/foo/*", "/foo/")); assertTrue("match /foo/*", PathMap.match("/foo/*", "/foo/anything")); assertTrue("!match /foo/*", !PathMap.match("/foo/*", "/bar")); assertTrue("!match /foo/*", !PathMap.match("/foo/*", "/bar/")); assertTrue("!match /foo/*", !PathMap.match("/foo/*", "/bar/anything")); assertTrue("match *.foo", PathMap.match("*.foo", "anything.foo")); assertTrue("!match *.foo", !PathMap.match("*.foo", "anything.bar")); assertEquals("match / with ''", "10", p.getMatch("/").getValue()); assertTrue("match \"\"", PathMap.match("", "/")); } /** * See JIRA issue: JETTY-88. */ @Test public void testPathMappingsOnlyMatchOnDirectoryNames() throws Exception { String spec = "/xyz/*"; assertMatch(spec, "/xyz"); assertMatch(spec, "/xyz/"); assertMatch(spec, "/xyz/123"); assertMatch(spec, "/xyz/123/"); assertMatch(spec, "/xyz/123.txt"); assertNotMatch(spec, "/xyz123"); assertNotMatch(spec, "/xyz123;jessionid=99"); assertNotMatch(spec, "/xyz123/"); assertNotMatch(spec, "/xyz123/456"); assertNotMatch(spec, "/xyz.123"); assertNotMatch(spec, "/xyz;123"); // as if the ; was encoded and part of the path assertNotMatch(spec, "/xyz?123"); // as if the ? was encoded and part of the path } private void assertMatch(String spec, String path) { boolean match = PathMap.match(spec, path); assertTrue("PathSpec '" + spec + "' should match path '" + path + "'", match); } private void assertNotMatch(String spec, String path) { boolean match = PathMap.match(spec, path); assertFalse("PathSpec '" + spec + "' should not match path '" + path + "'", match); } }
46.565934
118
0.543009
d01cb8bb6bc6c3b74f65c2cf88d60fa65ba09ece
2,592
package objects.definitions; import java.io.Serializable; import engine.DeepCloner; import saveLoad.Definition; public class GameObjectDef extends Definition implements Serializable { private static final long serialVersionUID = 4862610181700766923L; public final String jGameGraphicPath; public final String originalGraphicPath; public final int collisionID; public final String name; public final int x; public final int y; public final int row; public final int col; public final boolean isMovable; public final boolean isCollectible; public final String type; public final String objName; /** * GameObject constructor. No team ID for game objects (non-unit objects) * because putting trees in teams makes no sense. * @param collisionID - collision ID of object * @param name - name of object * @param JGameGraphicsName - name of image associated with object * @param x - x-coordinate of object * @param y - y-coordinate of object * @param tileSize - number of pixels along one edge of a tile * @param type - player/enemy/terrain/item (tags in Constant) * @param originalPath - original graphics path * @param isMovable - whether or not the GameObject is movable * @param isCollectible - whether or not the GameObject is collectible */ public GameObjectDef(final int collisionID, final String name, final String JGameGraphicsName, final int x, final int y, final int row, final int col, final String type, final String originalPath, final boolean isMovable, final boolean isCollectible, final String objName) { this.jGameGraphicPath = JGameGraphicsName; this.originalGraphicPath = originalPath; this.collisionID = collisionID; this.name = name; this.type = type; this.x = x; this.y = y; this.row = row; this.col = col; this.isMovable = isMovable; this.isCollectible = isCollectible; this.objName = objName; } public GameObjectDef clone() { try { return (GameObjectDef) DeepCloner.deepCopy(this); } catch (Exception e) { e.printStackTrace(); } return null; } public boolean equals(Object o) { if (o == null || !(o instanceof GameObjectDef)) return false; GameObjectDef obj = (GameObjectDef)o; return this.name.equals(obj.name) && this.objName.equals(obj.objName) && this.type.equals(obj.type); } public String toString() { return name + " " + type + " " + collisionID + " " + jGameGraphicPath + " " + originalGraphicPath + " " + objName + " " + x + " " + y + " " + row + " " + col + " " + isMovable + " " + isCollectible; } }
29.123596
102
0.706019
d1e9b62bb1ec564d684bfca7111cffeb73389b41
3,158
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * 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,<br> * software distributed under the License is distributed on an "AS IS" BASIS, <br> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> * See the License for the specific language governing permissions and <br> * limitations under the License. * <p> * Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> * University of Zurich, Switzerland. * <hr> * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * This file has been modified by the OpenOLAT community. Changes are licensed * under the Apache 2.0 license as the original file. */ package org.olat.shibboleth.util; import java.io.UnsupportedEncodingException; import java.util.regex.Pattern; import org.olat.core.logging.AssertException; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; import org.olat.core.util.StringHelper; /** * Description:<br> * Represents a shibboleth attribut, which may contain values delimited by ";". * * * <P> * Initial Date: Oct 27, 2010 <br> * @author patrick */ public final class ShibbolethAttribute{ private static final OLog log = Tracing.createLoggerFor(ShibbolethAttribute.class); private static final Pattern SPLITTER = Pattern.compile(";"); private final String attributeName; private final String originalValue; private final String[] splittedValues; private final static ShibbolethAttribute INVALID_ATTRIBUTE = new ShibbolethAttribute("INVALIDMARKED","INVALIDMARKED"); ShibbolethAttribute(String name, String value) { if(isInvalidValue(value)){ throw new IllegalArgumentException("value must be not null and not empty"); } this.attributeName = name; this.originalValue = value; this.splittedValues = SPLITTER.split(value); } public String getName(){ return attributeName; } public String getValueString(){ return originalValue; } public String[] getValues(){ return splittedValues; } String getFirstValue(){ return splittedValues[0]; } public boolean isValid(){ return this != INVALID_ATTRIBUTE; } public static ShibbolethAttribute createFromUserRequestValue(String name, String rawRequestValue){ if(isInvalidValue(rawRequestValue)){ if(log.isDebug()){ log.debug("invalid attribute: " + name + " attributeValue: " + rawRequestValue); } return INVALID_ATTRIBUTE; } try { String utf8Value = new String(rawRequestValue.getBytes("ISO-8859-1"), "UTF-8"); return new ShibbolethAttribute(name, utf8Value); } catch (UnsupportedEncodingException e) { //bad luck throw new AssertException("ISO-8859-1, or UTF-8 Encoding not supported",e); } } private static boolean isInvalidValue(String value){ return ( ! StringHelper.containsNonWhitespace(value)); } }
28.709091
119
0.735275
5070df200a0db4842fbf210b0263889473fe96b9
961
package com.rakuten.tech.mobile.perf.rewriter.classes; public class ClassWriter extends org.objectweb.asm.ClassWriter { private final ClassProvider _classProvider; public ClassWriter(ClassProvider classProvider, int arg0) { super(arg0); _classProvider = classProvider; } @Override protected String getCommonSuperClass(final String type1, final String type2) { Class<?> c, d; try { c = _classProvider.getClass(type1.replace('/', '.')); d = _classProvider.getClass(type2.replace('/', '.')); } catch (Exception e) { throw new RuntimeException(e.toString()); } if (c.isAssignableFrom(d)) { return type1; } if (d.isAssignableFrom(c)) { return type2; } if (c.isInterface() || d.isInterface()) { return "java/lang/Object"; } else { do { c = c.getSuperclass(); } while (!c.isAssignableFrom(d)); return c.getName().replace('.', '/'); } } }
25.972973
80
0.62539
31e0726e87bb6777f9706164d8624fe22b57703b
1,513
package br.com.zupacademy.isadora.proposta.cartao; import br.com.zupacademy.isadora.proposta.proposta.Proposta; import br.com.zupacademy.isadora.proposta.proposta.PropostaRepository; import br.com.zupacademy.isadora.proposta.proposta.PropostaStatus; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.List; @Component public class CartaoPropostaScheduled { private PropostaRepository repository; private ClienteCartao clienteCartao; public CartaoPropostaScheduled(PropostaRepository repository, ClienteCartao clienteCartao) { this.repository = repository; this.clienteCartao = clienteCartao; } public CartaoResponse criaCartao(Proposta proposta) { CartaoRequest cartaoRequest = new CartaoRequest(proposta.getDocumento(), proposta.getNome(), proposta.getId().toString()); return clienteCartao.criaCartao(cartaoRequest); } @Scheduled(fixedDelay = 5000) protected void verifica(){ List<Proposta> naoPossuemCartao = repository.findAllByStatusAndCartaoIsNull(PropostaStatus.ELEGIVEL); adicionaCartao(naoPossuemCartao); } private void adicionaCartao(List<Proposta> propostas) { propostas.stream().forEach(proposta -> { CartaoResponse cartaoCriado = criaCartao(proposta); Cartao cartao = cartaoCriado.convert(); proposta.adicionaCartao(cartao); repository.save(proposta); }); } }
35.186047
130
0.745539
6c26e13ed324067118f03b60a33dbe46834da60c
178
package com.nulabinc.backlog4j; import java.util.List; /** * The interface for response list. * * @author nulab-inc */ public interface ResponseList<T> extends List<T> { }
14.833333
50
0.707865
c22bb25ba09ebbbe3e8d9fc1eb89ea80d6b71932
1,157
package io.hefuyi.zhihudaily.api; import io.hefuyi.zhihudaily.mvp.model.DailyStories; import io.hefuyi.zhihudaily.mvp.model.StartImage; import io.hefuyi.zhihudaily.mvp.model.Story; import io.hefuyi.zhihudaily.mvp.model.Theme; import io.hefuyi.zhihudaily.mvp.model.Themes; import retrofit2.http.GET; import retrofit2.http.Path; import rx.Observable; /** * Created by hefuyi on 16/8/16. */ public interface ApiService { @GET("start-image/{width}*{height}") Observable<StartImage> getStartImage(@Path("width") int width, @Path("height") int height); @GET("themes") Observable<Themes> getThemes(); @GET("news/latest") Observable<DailyStories> getLatestDailyStories(); @GET("news/before/{date}") Observable<DailyStories> getBeforeDailyStories(@Path("date") String date); @GET("theme/{themeId}") Observable<Theme> getTheme(@Path("themeId") String themeId); @GET("theme/{themeId}/before/{storyId}") Observable<Theme> getThemeBeforeStory(@Path("themeId") String themeId, @Path("storyId") String storyId); @GET("news/{storyId}") Observable<Story> getStoryDetail(@Path("storyId") String storyId); }
29.666667
108
0.722558
51b1f0078ce2397947a1eba5f587e1f00ff6363e
1,234
package co.casterlabs.rakurai.io.http.server; import java.io.File; import java.util.Arrays; import java.util.List; import org.jetbrains.annotations.Nullable; import co.casterlabs.rakurai.io.http.TLSVersion; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import lombok.experimental.Accessors; @Getter @Accessors(chain = true) public class SSLConfiguration { private @NonNull TLSVersion[] enabledTlsVersions = TLSVersion.values(); private @Nullable List<String> enabledCipherSuites; private @Setter int DHSize = 2048; private @Setter int port; private File keystoreLocation; private char[] keystorePassword; public SSLConfiguration(@NonNull File keystoreLocation, @NonNull char[] keystorePassword) { this.keystoreLocation = keystoreLocation; this.keystorePassword = keystorePassword; } public SSLConfiguration setEnabledTlsVersions(@NonNull TLSVersion... enabledTlsVersions) { this.enabledTlsVersions = enabledTlsVersions; return this; } public SSLConfiguration setEnabledCipherSuites(@Nullable String... enabledCipherSuites) { this.enabledCipherSuites = Arrays.asList(enabledCipherSuites); return this; } }
27.422222
95
0.752026
dc5f6bae5665b7c443360d5e13c6e96fcbd7b6a4
472
package psidev.psi.mi.jami.datasource; import psidev.psi.mi.jami.binary.BinaryInteractionEvidence; /** * A Data source of binary interaction evidences giving only a stream of interactions. * It is not possible to get a full collection of interactions. * * @author Marine Dumousseau ([email protected]) * @version $Id$ * @since <pre>09/07/13</pre> */ public interface BinaryInteractionEvidenceStream extends InteractionEvidenceStream<BinaryInteractionEvidence> { }
31.466667
111
0.777542
2f62a9c6c344c18d2c99bb5010a53111e5b9ef8e
4,655
/* * Copyright 2017 Red Hat 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 io.vertx.mqtt.test.client; import io.netty.handler.codec.mqtt.MqttQoS; import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import io.vertx.mqtt.MqttClient; import io.vertx.mqtt.MqttClientOptions; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import java.util.Arrays; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @RunWith(VertxUnitRunner.class) public class MqttClientTopicValidationTest { private static final Logger log = LoggerFactory.getLogger(MqttClientTopicValidationTest.class); private static final String MQTT_MESSAGE = "Hello Vert.x MQTT Client"; private static final int MAX_TOPIC_LEN = 65535; private static final String goodTopic; private static final String badTopic; static { char[] topic = new char[MAX_TOPIC_LEN + 1]; Arrays.fill(topic, 'h'); badTopic = new String(topic); goodTopic = new String(topic, 0, MAX_TOPIC_LEN); } @Test public void topicNameValidation(TestContext context) { testPublish("/", true, context); testPublish("/hello", true, context); testPublish("sport/tennis/player1", true, context); testPublish("sport/tennis/player1#", false, context); testPublish("sport/tennis/+/player1#", false, context); testPublish("#", false, context); testPublish("+", false, context); testPublish("", false, context); testPublish(goodTopic, true, context); testPublish(badTopic, false, context); } @Test public void topicFilterValidation(TestContext context) { testSubscribe("#", true, context); testSubscribe("+", true, context); testSubscribe("+/tennis/#", true, context); testSubscribe("sport/+/player1", true, context); testSubscribe("+/+", true, context); testSubscribe("sport+", false, context); testSubscribe("sp#ort", false, context); testSubscribe("+/tennis#", false, context); testSubscribe(goodTopic, true, context); testSubscribe(badTopic, false, context); } /** * Execute a test of topic validation on public * * @param topicName topic name * @param mustBeValid if it should be valid or not * @param context */ public void testPublish(String topicName, boolean mustBeValid, TestContext context) { log.info(String.format("test publishing in \"%s\" topic", topicName)); Async async = context.async(2); MqttClient client = MqttClient.create(Vertx.vertx()); client.connect(TestUtil.BROKER_PORT, TestUtil.BROKER_ADDRESS, c -> { Assert.assertTrue(c.succeeded()); client.publish( topicName, Buffer.buffer(MQTT_MESSAGE.getBytes()), MqttQoS.AT_MOST_ONCE, false, false, ar1 -> { assertThat(ar1.succeeded(), is(mustBeValid)); log.info("publishing message id = " + ar1.result()); async.countDown(); client .disconnect(ar -> { Assert.assertTrue(ar.succeeded()); async.countDown(); }); }); }); async.await(); } public void testSubscribe(String topicFilter, boolean mustBeValid, TestContext context) { log.info(String.format("test subscribing for \"%s\" topic", topicFilter)); Async async = context.async(2); MqttClient client = MqttClient.create(Vertx.vertx()); client.connect(TestUtil.BROKER_PORT, TestUtil.BROKER_ADDRESS, c -> { Assert.assertTrue(c.succeeded()); client.subscribe( topicFilter, 0, ar -> { assertThat(ar.succeeded(), is(mustBeValid)); log.info("subscribe message id = " + ar.result()); async.countDown(); client .disconnect(ar1 -> { Assert.assertTrue(ar1.succeeded()); async.countDown(); }); }); }); async.await(); } }
31.241611
97
0.671321
90106499be35ff1024082baede95fdc9871f9dc6
2,765
package hicp.message.event; import java.util.Arrays; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; import hicp.HeaderMap; import hicp.message.Message; import hicp.message.HeaderEnum; public class EventInfo { private static final Logger LOGGER = Logger.getLogger( EventInfo.class.getName() ); //LOGGER.log(Level.FINE, " " + ); // debug public static enum Event { AUTHENTICATE("authenticate"), CHANGED("changed"), CLOSE("close"), CLICK("click"), CONNECT("connect"); public final String name; private static final Map<String, Event> messageNameMap = Arrays.stream(Event.values()) .collect( Collectors.toMap( eventEnum -> eventEnum.name, eventEnum -> eventEnum ) ); Event(final String newMessageName) { name = newMessageName; } public static Event getEnum(String name) { return messageNameMap.get(name); } } public Event event; private ItemInfo _itemInfo = null; private AuthenticateInfo _authenticateInfo = null; private ConnectInfo _connectInfo = null; private HeaderMap _headerMap = Message.DEFAULT_HEADER_MAP; public EventInfo() { } public EventInfo(final Event newEvent) { event = newEvent; } public EventInfo(final HeaderMap headerMap) { _headerMap = headerMap; event = Event.getEnum( headerMap.getString(HeaderEnum.EVENT) ); } public EventInfo updateHeaderMap( final HeaderMap headerMap ) { if (null != event) { headerMap.putString(HeaderEnum.EVENT, event.name); } if (null != _itemInfo) { _itemInfo.updateHeaderMap(headerMap); } if (null != _authenticateInfo) { _authenticateInfo.updateHeaderMap(headerMap); } if (null != _connectInfo) { _connectInfo.updateHeaderMap(headerMap); } return this; } public ItemInfo getItemInfo() { if (null == _itemInfo) { _itemInfo = new ItemInfo(_headerMap); } return _itemInfo; } public AuthenticateInfo getAuthenticateInfo() { if (null == _authenticateInfo) { _authenticateInfo = new AuthenticateInfo(_headerMap); } return _authenticateInfo; } public ConnectInfo getConnectInfo() { if (null == _connectInfo) { _connectInfo = new ConnectInfo(_headerMap); } return _connectInfo; } }
25.366972
65
0.585895
31dd9aa4ffb66dd520704a8d37fb593dfee66d90
2,052
/* * Copyright 2016-present Open Networking Laboratory * * 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.onosproject.openstacknetworking; import org.onosproject.openstackinterface.OpenstackNetwork; import org.onosproject.openstackinterface.OpenstackPort; import org.onosproject.openstackinterface.OpenstackSubnet; import java.util.Map; /** * Handles port management REST API from Openstack for VMs. */ public interface OpenstackSwitchingService { /** * Store the port information created by Openstack. * * @param openstackPort port information */ void createPorts(OpenstackPort openstackPort); /** * Removes flow rules corresponding to the port removed by Openstack. * * @param uuid UUID */ void removePort(String uuid); /** * Updates flow rules corresponding to the port information updated by Openstack. * * @param openstackPort OpenStack port */ void updatePort(OpenstackPort openstackPort); /** * Stores the network information created by openstack. * * @param openstackNetwork network information */ void createNetwork(OpenstackNetwork openstackNetwork); /** * Stores the subnet information created by openstack. * * @param openstackSubnet subnet information */ void createSubnet(OpenstackSubnet openstackSubnet); /** * Retruns OpenstackPortInfo map. * * @return OpenstackPortInfo map */ Map<String, OpenstackPortInfo> openstackPortInfo(); }
28.5
85
0.71345
b24e8590c4a4551db8ce74614750478c92a7edd1
2,154
package cz.xtf.openshift.util.openshift; import cz.xtf.openshift.OpenShiftUtil; import io.fabric8.openshift.api.model.ImageStream; import io.fabric8.openshift.api.model.ImageStreamBuilder; import org.assertj.core.api.Assertions; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import java.net.MalformedURLException; // Integration tests with ocp util working with projects // To run tests comment out @Ignore and setup url, username and password. @Ignore public class ImageStreamsTest { private static final String defaultTestNamespace = "is-default-test-namespace"; private static final String customTestNamespace = "is-custom-test-namespace"; private static OpenShiftUtil getInstance() { try { String url = null; String username = null; String password = null; return new OpenShiftUtil(url, defaultTestNamespace, username, password); } catch (MalformedURLException e) { throw new IllegalStateException("Malformed OpenShift URL unabled to execute tests"); } } @BeforeClass public static void prepareProjects() { OpenShiftUtil openshift = getInstance(); openshift.createProjectRequest(); openshift.createProjectRequest(customTestNamespace); } @AfterClass public static void deleteProjects() { OpenShiftUtil openshift = getInstance(); openshift.deleteProject(); openshift.deleteProject(customTestNamespace); } @Test public void crdInDefaultNamespaceTest() { OpenShiftUtil openshift = getInstance(); String streamName = "is-1"; ImageStream created = openshift.createImageStream(new ImageStreamBuilder().withNewMetadata().withName(streamName).endMetadata().build()); Assertions.assertThat(created.getMetadata().getName()).isEqualTo(streamName); Assertions.assertThat(created.getMetadata().getCreationTimestamp()).isNotNull(); ImageStream is = openshift.getImageStream(streamName); Assertions.assertThat(is.getMetadata().getName()).isEqualTo(streamName); boolean deleted = openshift.deleteImageStream(is); Assertions.assertThat(deleted).isTrue(); Assertions.assertThat(openshift.getImageStream(streamName)).isNull(); } }
33.138462
139
0.784587
e83c46393956f2a1f85715dce6ac22e0fb950dbe
1,111
package org.snomed.snowstorm.core.data.services.postcoordination; import org.snomed.languages.scg.SCGException; import org.snomed.languages.scg.SCGExpressionParser; import org.snomed.languages.scg.SCGObjectFactory; import org.snomed.languages.scg.domain.model.Expression; import org.snomed.snowstorm.core.data.services.ServiceException; import org.snomed.snowstorm.core.data.services.postcoordination.model.ComparableExpression; import org.springframework.stereotype.Service; import static java.lang.String.format; @Service public class ExpressionParser { private final SCGExpressionParser expressionParser; public ExpressionParser() { expressionParser = new SCGExpressionParser(new SCGObjectFactory()); } public ComparableExpression parseExpression(String expressionString) throws ServiceException { try { Expression expression = expressionParser.parseExpression(expressionString); return new ComparableExpression(expression); } catch (SCGException e) { throw new ServiceException(format("Failed to parse expression \"%s\" due to: %s", expressionString, e.getMessage()), e); } } }
34.71875
123
0.812781
ade49c582bb7903d2f44bf2c51aeb8cb988133be
1,679
package com.multi.datasource; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Application.class) public class ApplicationJdbcTests { @Autowired @Qualifier("jdbcTemplatePrimary") private JdbcTemplate jdbcTemplatePrimary; @Autowired @Qualifier("jdbcTemplateSecondary") private JdbcTemplate jdbcTemplateSecondary; @Autowired @Qualifier("jdbcTemplateSqlServer") private JdbcTemplate jdbcTemplateSqlServer; @Before public void setup() { // jdbcTemplatePrimary.update("DELETE FROM USER"); // jdbcTemplateSecondary.update("DELETE FROM USER"); jdbcTemplateSqlServer.execute("DELETE FROM [dbo].[user]"); } @Test public void test() { // jdbcTemplatePrimary.update("INSERT INTO USER VALUE(?, ?, ?)", 1, "张三", 11); // jdbcTemplatePrimary.update("INSERT INTO USER VALUE(?, ?, ?)", 2, "李四", 22); // // jdbcTemplateSecondary.update("INSERT INTO USER VALUE(?, ?, ?)", 1, "张三", 11); // // Assert.assertEquals("2", jdbcTemplatePrimary.queryForObject("SELECT COUNT(*) FROM USER", String.class)); // Assert.assertEquals("1", jdbcTemplateSecondary.queryForObject("SELECT COUNT(*) FROM USER", String.class)); jdbcTemplateSqlServer.execute("INSERT INTO [dbo].[user] values(4, 'fuc')"); } }
39.97619
111
0.745086
5326a3858e49e6c6c39efb1d469accdf435ee4a8
1,206
/* * Copyright 2019 StreamSets 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.streamsets.pipeline.lib.jdbc; import com.streamsets.pipeline.api.StageException; @FunctionalInterface public interface JdbcTableCreator { /** * Creates the sql table if it does not exist yet * * @param schema the Schema name where the table belongs to * @param table the table name * @return true if table is created, false otherwise. If table already exists it should return false. * @throws StageException Exception thrown when running the sql create table query another exception is thrown */ boolean create(String schema, String table) throws StageException; }
34.457143
112
0.748756
e842ea5a5a1d958b977ec3eb51468e00859db2a4
2,759
/* * Copyright 2018 - 2021 Blazebit. * * 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.blazebit.job.view.model; import java.io.Serializable; import java.util.Collection; import java.util.Iterator; /** * A {@link Collection} implementation that delegates all calls. * * @param <T> The element type * @author Christian Beikov * @since 1.0.0 */ public class DelegatingCollection<T> implements Collection<T>, Serializable { private final Collection<T> delegate; /** * Creates a new delegating collection. * * @param delegate The delegate */ public DelegatingCollection(Collection<T> delegate) { this.delegate = delegate; } /** * Returns the delegate. * * @return the delegate */ public Collection<T> getDelegate() { return delegate; } @Override public int size() { return delegate.size(); } @Override public boolean isEmpty() { return delegate.isEmpty(); } @Override public boolean contains(Object o) { return delegate.contains(o); } @Override public Iterator<T> iterator() { return delegate.iterator(); } @Override public Object[] toArray() { return delegate.toArray(); } @Override public <T1> T1[] toArray(T1[] a) { return delegate.toArray(a); } @Override public boolean add(T t) { return delegate.add(t); } @Override public boolean remove(Object o) { return delegate.remove(o); } @Override public boolean containsAll(Collection<?> c) { return delegate.containsAll(c); } @Override public boolean addAll(Collection<? extends T> c) { return delegate.addAll(c); } @Override public boolean retainAll(Collection<?> c) { return delegate.retainAll(c); } @Override public boolean removeAll(Collection<?> c) { return delegate.removeAll(c); } @Override public void clear() { delegate.clear(); } @Override public boolean equals(Object o) { return delegate.equals(o); } @Override public int hashCode() { return delegate.hashCode(); } }
21.724409
77
0.628489
727e56decee6a89f0f0d7a35e085525765c9a3ca
613
package bzh.medek.server.json.user; public class JsonUser { private Integer id; private String login; private String mail; public JsonUser() { super(); } public JsonUser(Integer id, String login, String mail) { super(); this.id = id; this.login = login; this.mail = mail; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } }
13.931818
57
0.65416
2bad79381a061cdc512bf19b3ccfe40169bc2393
726
package java8lambda.main01; import java.util.List; import java8lambda.商品; public class Main_01 { /** * バブルソートで原価の昇順にソート * @param alist * @return */ private static List<商品> sort原価昇順(List<商品> alist){ List<商品> list = alist; for(int i=0 ; i<alist.size();i++){ for(int j=i+1 ; j<alist.size();j++){ if(list.get(i).get原価()>list.get(j).get原価()){ 商品 wk商品 = list.get(i); list.set(i, list.get(j)); list.set(j, wk商品); } } } return list; } public static List<商品> main(List<商品> list){ // ソート処理を呼び出す sort原価昇順(list); // 結果を出力(実は今日の最終形その1) list.forEach(System.out::println); // これと同じ // for(商品 i : list){ // System.out.println(i); // } return list; } }
15.446809
50
0.581267
ee58cb84301da5d6c07a7f177b1334edf354463e
11,432
/** * Copyright 2011-2013 FoundationDB, LLC * * 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. */ /* The original from which this derives bore the following: */ /* Derby - Class org.apache.derby.impl.sql.compile.CreateAliasNode 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 com.foundationdb.sql.parser; import com.foundationdb.sql.StandardException; import com.foundationdb.sql.types.AliasInfo; import com.foundationdb.sql.types.DataTypeDescriptor; import com.foundationdb.sql.types.RoutineAliasInfo; import com.foundationdb.sql.types.SynonymAliasInfo; import com.foundationdb.sql.types.UDTAliasInfo; import java.util.List; /** * A CreateAliasNode represents a CREATE ALIAS statement. * */ public class CreateAliasNode extends DDLStatementNode { // indexes into routineElements public static final int PARAMETER_ARRAY = 0; public static final int TABLE_NAME = PARAMETER_ARRAY + 1; public static final int DYNAMIC_RESULT_SET_COUNT = TABLE_NAME + 1; public static final int LANGUAGE = DYNAMIC_RESULT_SET_COUNT + 1; public static final int EXTERNAL_NAME = LANGUAGE + 1; public static final int PARAMETER_STYLE = EXTERNAL_NAME + 1; public static final int SQL_CONTROL = PARAMETER_STYLE + 1; public static final int DETERMINISTIC = SQL_CONTROL + 1; public static final int NULL_ON_NULL_INPUT = DETERMINISTIC + 1; public static final int RETURN_TYPE = NULL_ON_NULL_INPUT + 1; public static final int ROUTINE_SECURITY_DEFINER = RETURN_TYPE + 1; public static final int INLINE_DEFINITION = ROUTINE_SECURITY_DEFINER + 1; // Keep ROUTINE_ELEMENT_COUNT last (determines set cardinality). // Note: Remember to also update the map ROUTINE_CLAUSE_NAMES in // SQLGrammar.jj when elements are added. public static final int ROUTINE_ELEMENT_COUNT = INLINE_DEFINITION + 1; private String javaClassName; private String methodName; private boolean createOrReplace; private AliasInfo.Type aliasType; private AliasInfo aliasInfo; private String definition; /** * Initializer for a CreateAliasNode * * @param aliasName The name of the alias * @param targetObject Target name * @param methodName The method name * @param aliasType The alias type * * @exception StandardException Thrown on error */ public void init(Object aliasName, Object targetObject, Object methodName, Object aliasSpecificInfo, Object aliasType, Object createOrReplace) throws StandardException { TableName qn = (TableName)aliasName; this.aliasType = (AliasInfo.Type)aliasType; this.createOrReplace = (Boolean)createOrReplace; initAndCheck(qn); switch (this.aliasType) { case UDT: this.javaClassName = (String)targetObject; aliasInfo = new UDTAliasInfo(); implicitCreateSchema = true; break; case PROCEDURE: case FUNCTION: { //routineElements contains the description of the procedure. // // 0 - Object[] 3 element array for parameters // 1 - TableName - specific name // 2 - Integer - dynamic result set count // 3 - String language // 4 - String external name (also passed directly to create alias node - ignore // 5 - ParameterStyle parameter style // 6 - SQLAllowed - SQL control // 7 - Boolean - CALLED ON NULL INPUT (always TRUE for procedures) // 8 - DataTypeDescriptor - return type (always NULL for procedures) // 9 - Boolean - definers rights // 10 - String - inline definition Object[] routineElements = (Object[])aliasSpecificInfo; Object[] parameters = (Object[])routineElements[PARAMETER_ARRAY]; int paramCount = ((List)parameters[0]).size(); String[] names = null; DataTypeDescriptor[] types = null; int[] modes = null; if (paramCount != 0) { names = new String[paramCount]; ((List<String>)parameters[0]).toArray(names); types = new DataTypeDescriptor[paramCount]; ((List<DataTypeDescriptor>)parameters[1]).toArray(types); modes = new int[paramCount]; for (int i = 0; i < paramCount; i++) { int currentMode = ((List<Integer>)parameters[2]).get(i).intValue(); modes[i] = currentMode; } if (paramCount > 1) { String[] dupNameCheck = new String[paramCount]; System.arraycopy(names, 0, dupNameCheck, 0, paramCount); java.util.Arrays.sort(dupNameCheck); for (int dnc = 1; dnc < dupNameCheck.length; dnc++) { if (! dupNameCheck[dnc].equals("") && dupNameCheck[dnc].equals(dupNameCheck[dnc - 1])) throw new StandardException("Duplicate parameter name"); } } } Integer drso = (Integer)routineElements[DYNAMIC_RESULT_SET_COUNT]; int drs = drso == null ? 0 : drso.intValue(); RoutineAliasInfo.SQLAllowed sqlAllowed = (RoutineAliasInfo.SQLAllowed)routineElements[SQL_CONTROL]; Boolean isDeterministicO = (Boolean)routineElements[DETERMINISTIC]; boolean isDeterministic = (isDeterministicO == null) ? false : isDeterministicO.booleanValue(); Boolean definersRightsO = (Boolean)routineElements[ROUTINE_SECURITY_DEFINER]; boolean definersRights = (definersRightsO == null) ? false : definersRightsO.booleanValue(); Boolean calledOnNullInputO = (Boolean)routineElements[NULL_ON_NULL_INPUT]; boolean calledOnNullInput = (calledOnNullInputO == null) ? false : calledOnNullInputO.booleanValue(); DataTypeDescriptor returnType = (DataTypeDescriptor)routineElements[RETURN_TYPE]; String language = (String)routineElements[LANGUAGE]; String pstyle = (String)routineElements[PARAMETER_STYLE]; this.definition = (String)routineElements[INLINE_DEFINITION]; this.javaClassName = (String)targetObject; this.methodName = (String)methodName; aliasInfo = new RoutineAliasInfo(this.methodName, paramCount, names, types, modes, drs, language, pstyle, sqlAllowed, isDeterministic, definersRights, calledOnNullInput, returnType); implicitCreateSchema = true; } break; case SYNONYM: String targetSchema = null; implicitCreateSchema = true; TableName t = (TableName)targetObject; if (t.getSchemaName() != null) targetSchema = t.getSchemaName(); aliasInfo = new SynonymAliasInfo(targetSchema, t.getTableName()); break; default: assert false : "Unexpected value for aliasType " + aliasType; } } public String getJavaClassName() { return javaClassName; } public String getMethodName() { return methodName; } public String getExternalName() { if (javaClassName == null) return methodName; else if (methodName == null) return javaClassName; else return javaClassName + "." + methodName; } public boolean isCreateOrReplace() { return createOrReplace; } public AliasInfo.Type getAliasType() { return aliasType; } public AliasInfo getAliasInfo() { return aliasInfo; } public String getDefinition() { return definition; } /** * Convert this object to a String. See comments in QueryTreeNode.java * for how this should be done for tree printing. * * @return This object as a String */ public String toString() { return "aliasType: " + aliasType + "\n" + "aliasInfo: " + aliasInfo + "\n" + "createOrReplace: " + createOrReplace + "\n" + ((definition != null) ? ("definition: " + definition + "\n") : ("javaClassName: " + javaClassName + "\n" + "methodName: " + methodName + "\n")) + super.toString(); } /** * Fill this node with a deep copy of the given node. */ public void copyFrom(QueryTreeNode node) throws StandardException { super.copyFrom(node); CreateAliasNode other = (CreateAliasNode)node; this.javaClassName = other.javaClassName; this.methodName = other.methodName; this.definition = other.definition; this.aliasType = other.aliasType; this.aliasInfo = other.aliasInfo; // TODO: Clone? } public String statementToString() { switch (this.aliasType) { case UDT: return "CREATE TYPE"; case PROCEDURE: return "CREATE PROCEDURE"; case SYNONYM: return "CREATE SYNONYM"; default: return "CREATE FUNCTION"; } } }
38.234114
117
0.585987
0deb0eadea7d6e47335d4539bd5884d5732d9e71
13,384
package com.shareworx.ezfm.device.fmdata.service; import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import com.shareworx.ezfm.device.fmdata_eq.model.YJWYEqSysModel; import com.shareworx.ezfm.util.StringUtil; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSONArray; import com.shareworx.platform.business.BusinessService; import com.shareworx.platform.model.ModelAndResult; import com.shareworx.platform.persist.Condition; import com.shareworx.platform.persist.Query; import com.shareworx.platform.persist.QueryContents; import com.shareworx.ezfm.device.fmdata.dao.YJWYFmDataDao; import com.shareworx.ezfm.device.fmdata.model.YJWYCsiModel; import com.shareworx.ezfm.device.fmdata.model.YJWYEqModel; import com.shareworx.ezfm.device.fmdata.model.YJWYPmpModel; import com.shareworx.ezfm.device.fmdata.model.YJWYPmpsModel; import com.shareworx.ezfm.device.fmdata.model.YJWYRoomModel; import com.shareworx.ezfm.device.fmdata.model.YJWYSiteModel; import com.shareworx.ezfm.device.util.DeviceUtil; import com.shareworx.ezfm.system.crop.model.CropModel; import com.shareworx.ezfm.system.crop.service.ICropService; import com.shareworx.ezfm.webservice.CxfClientUtil; import com.shareworx.ezfm.webservice.fm.out.IBasisDataService; /** * FM数据同步业务操作实现 * * @author jin.li * */ @Service(YJWYFmDataService.ID) @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true) public class YJWYFmDataServiceImpl implements YJWYFmDataService { @Autowired @Qualifier(YJWYFmDataDao.ID) private YJWYFmDataDao yjwyFmDataDao; public void setYjwyFmDataDao(YJWYFmDataDao yjwyFmDataDao) { this.yjwyFmDataDao = yjwyFmDataDao; } @Autowired @Qualifier(YJWYEqBusinessService.ID) private YJWYEqBusinessService eqService; @Autowired @Qualifier(YJWYEqDomainService.ID) YJWYEqDomainService yjwyEqDomainService; @Autowired @Qualifier(YJWYCsiBusinessService.ID) private YJWYCsiBusinessService csiService; @Autowired @Qualifier(YJWYRoomBusinessService.ID) private YJWYRoomBusinessService roomService; @Autowired @Qualifier(YJWYPmpBusinessService.ID) private YJWYPmpBusinessService pmpService; @Autowired @Qualifier(YJWYPmpsBusinessService.ID) private YJWYPmpsBusinessService pmpsService; @Autowired @Qualifier(YJWYSiteBusinessService.ID) private YJWYSiteBusinessService siteService; public void setSiteService(YJWYSiteBusinessService siteService) { this.siteService = siteService; } public void setEqService(YJWYEqBusinessService eqService) { this.eqService = eqService; } public void setCsiService(YJWYCsiBusinessService csiService) { this.csiService = csiService; } public void setRoomService(YJWYRoomBusinessService roomService) { this.roomService = roomService; } public void setPmpService(YJWYPmpBusinessService pmpService) { this.pmpService = pmpService; } public void setPmpsService(YJWYPmpsBusinessService pmpsService) { this.pmpsService = pmpsService; } @Autowired @Qualifier(ICropService.ID) private ICropService cropService; public void setCropService(ICropService cropService) { this.cropService = cropService; } /** * 查询最大更新时间 */ public String queryLastUpdateTime(String localTable) { if (localTable == null) { return null; } String sql = "select MAX(dms_update_time) from " + localTable; return yjwyFmDataDao.queryLastUpdateTime(sql); } /** * 查询表内数据总数 */ public Long queryCount(String localTable) { if (localTable == null) { return null; } String sql = "select count(*) from " + localTable; return yjwyFmDataDao.queryCount(sql); } /** * * @param list * @return */ @Override public Long queryCountBySysId(List<YJWYEqSysModel> list) { Query query = new Query(); query.addFrom(YJWYEqModel.META_ID); query.addSelect("count(*)"); String[] data = new String[list.size()]; StringBuilder sb = new StringBuilder(); for(int i = 0 ;i < list.size();i++){ if(i == 0){ sb.append("( fk_eq_sys_id = '"); }else{ sb.append(" or fk_eq_sys_id = '"); } sb.append(list.get(i).getEq_sys_id()); sb.append("'"); } sb.append(" ) and flag = 1 "); String sql = query.toString()+" where "+sb.toString(); return yjwyFmDataDao.queryCount(sql); } /** * FM数据同步入口 * * @return * @throws Exception */ public ModelAndResult synchro(String address, String crop_code) throws Exception { if (DeviceUtil.stringIsEmpty(address) || DeviceUtil.stringIsEmpty(crop_code)) { return new ModelAndResult(false, "FM系统同步地址或企业编码不能为空"); } CropModel cropModel = cropService.queryForObject(crop_code); if (null == cropModel) { return new ModelAndResult(false, "企业编码不正确,请检查"); } String pk_crop = cropModel.getPk_crop(); System.out.println("【FM数据同步】-yjwy_fmdata_eq【开始】"); this.synchroData(address, pk_crop, new YJWYEqModel(), eqService, "yjwy_fmdata_eq", null, "V_DMS_EQ", 1); System.out.println("【FM数据同步】-yjwy_fmdata_eq【结束】"); System.out.println("【FM数据同步】-yjwy_fmdata_csi【开始】"); this.synchroData(address, pk_crop, new YJWYCsiModel(), csiService, "yjwy_fmdata_csi", null, "V_DMS_CSI", 1); System.out.println("【FM数据同步】-yjwy_fmdata_csi【结束】"); System.out.println("【FM数据同步】-yjwy_fmdata_room【开始】"); this.synchroData(address, pk_crop, new YJWYRoomModel(), roomService, "yjwy_fmdata_room", null, "V_DMS_ROOM", 1); System.out.println("【FM数据同步】-yjwy_fmdata_room【结束】"); System.out.println("【FM数据同步】-yjwy_fmdata_pmp【开始】"); this.synchroData(address, pk_crop, new YJWYPmpModel(), pmpService, null, null, "pmp", 1); System.out.println("【FM数据同步】-yjwy_fmdata_pmp【结束】"); System.out.println("【FM数据同步】-yjwy_fmdata_pmps【开始】"); this.synchroData(address, pk_crop, new YJWYPmpsModel(), pmpsService, "yjwy_fmdata_pmps", null, "pmps", 1); System.out.println("【FM数据同步】-yjwy_fmdata_pmps【结束】"); System.out.println("【FM数据同步】-yjwy_fmdata_site【开始】"); this.synchroData(address, pk_crop, new YJWYSiteModel(), siteService, "yjwy_fmdata_site", null, "site", 1); System.out.println("【FM数据同步】-yjwy_fmdata_site【结束】"); return new ModelAndResult(); } /** * 封装调用FM系统接口获取数据 * * @param tableName * @param lastUpdateTime * @param pageNum * @return */ private String getFmData(String address, String tableName, String lastUpdateTime, Integer pageNum) { final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setAddress(address); factory.setServiceClass(IBasisDataService.class); IBasisDataService hw = (IBasisDataService) factory.create(); // 超时设置 CxfClientUtil.configTimeout(hw); return hw.getBasisDateList(tableName, lastUpdateTime, pageNum); } /** * 封装FM数据同步方法 * * @param object * @param service * @param tableName * @param pageNum * @throws Exception */ private void synchroData(String address, String pk_crop, Object object, BusinessService service, String localTable, String lastUpdateTime, String tableName, Integer pageNum) throws Exception { Class<?> clazz = object.getClass(); if (localTable != null) { if (this.queryCount(localTable) == 0) { lastUpdateTime = "1980-01-01 00:00:00.000"; } if (lastUpdateTime == null || lastUpdateTime == "") { lastUpdateTime = this.queryLastUpdateTime(localTable); } } // 获取数据集 System.out.println("【FM数据同步】-开始读取表【" + tableName + "】数据"); String fmData = this.getFmData(address, tableName, lastUpdateTime, pageNum); System.out.println("【FM数据同步】-表【" + tableName + "】数据读取完毕"); // 判断是否有数据 if (fmData != null && fmData != "") { // 字符串转集合 JSONArray resultList = JSONArray.parseArray(fmData); // 声明数据对象model Object model = null; // 声明map对象,存放list遍历元素 Map<String, Object> map = null; // 创建数据对象数组,用于一次性对数据库持久化操作 List<Object> updateList = new ArrayList<>(); List<Object> saveList = new ArrayList<>(); // 获取实体类信息对象 BeanInfo beanInfo = Introspector.getBeanInfo(clazz); // 实体类属性集合 PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); // map的键集合 Set<String> set = null; // set方法 Method setMethod = null; // 实体类属性所属类型class对象 Class<?> paramTypeClazz = null; // map中的值 Object value = null; // map值的数据类型 String valueType = null; // 实体类属性数据类型 String paramType = null; for (int i = 0; i < resultList.size(); i++) { // 获取单条记录map map = (Map<String, Object>) resultList.get(i); // 对象实例化 model = clazz.newInstance(); // 获取map的键集合 set = map.keySet(); // 循环map键并给model赋值 for (String string : set) { for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { // 获取和map键相同的属性名 if (string.equals(propertyDescriptor.getName())) { // 获取set方法 setMethod = propertyDescriptor.getWriteMethod(); // 获取参数的class对象 paramTypeClazz = propertyDescriptor.getPropertyType(); // 获取map的value值 value = map.get(string); if (value != null) { // 获取value类型 valueType = value.getClass().getName(); } // 实体类属性数据类型获取 paramType = paramTypeClazz.getName(); // 判断属性类型和value类型是否相同 if (!paramType.equals(valueType) && value != null) { // 将value类型转为属性类型 if ("java.lang.String".equals(paramType)) { value = value.toString(); } if ("java.lang.Integer".equals(paramType)) { value = new Integer(value.toString()); } } // 可直接赋值的参数 setMethod.invoke(model, value); } } } // 获取主键的值 Method getPrimaryKey = clazz.getMethod("getPrimaryKey"); String primaryKey = (String) getPrimaryKey.invoke(model); Method getMethod = clazz.getMethod("get" + DeviceUtil.toUpperCaseFirstOne(primaryKey)); Object id = getMethod.invoke(model); // 获取元数据名称 Method getMetaName = clazz.getMethod("getMetaName"); String metaName = (String) getMetaName.invoke(model); // 查询是否已有记录 Query query = Query.from(metaName); query.where(new Condition(primaryKey, QueryContents.TYPE_EQ, id)); Object[] objects = service.query(query); if (objects != null && objects.length > 0) { // 已存在,执行修改 updateList.add(model); } else { // 不存在,执行保存 saveList.add(model); } } this.persist(clazz, saveList, service, "save", pk_crop); this.persist(clazz, updateList, service, "update", pk_crop); pageNum++; this.synchroData(address, pk_crop, object, service, localTable, lastUpdateTime, tableName, pageNum); } } @Transactional(propagation = Propagation.REQUIRED, rollbackFor = java.lang.Exception.class) private void persist(Class clazz, List<Object> list, BusinessService service, String flag, String pk_crop) { String clazzName = clazz.getName(); int i = clazzName.lastIndexOf("."); int j = clazzName.length(); String str = clazzName.substring(i + 1, j); System.out.println("【FM数据同步】-持久化" + str + "数据【开始】"); int count = list.size(); if (count == 0) { return; } if ("YJWYEqModel".equals(str)) { YJWYEqModel[] eqModels = new YJWYEqModel[count]; for (int k = 0; k < count; k++) { eqModels[k] = (YJWYEqModel) list.get(k); eqModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(eqModels); } else { service.update(eqModels); } } else if ("YJWYCsiModel".equals(str)) { YJWYCsiModel[] csiModels = new YJWYCsiModel[count]; for (int k = 0; k < count; k++) { csiModels[k] = (YJWYCsiModel) list.get(k); csiModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(csiModels); } else { service.update(csiModels); } } else if ("YJWYRoomModel".equals(str)) { YJWYRoomModel[] roomModels = new YJWYRoomModel[count]; for (int k = 0; k < count; k++) { roomModels[k] = (YJWYRoomModel) list.get(k); roomModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(roomModels); } else { service.update(roomModels); } } else if ("YJWYPmpModel".equals(str)) { YJWYPmpModel[] pmpModels = new YJWYPmpModel[count]; for (int k = 0; k < count; k++) { pmpModels[k] = (YJWYPmpModel) list.get(k); pmpModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(pmpModels); } else { service.update(pmpModels); } } else if ("YJWYPmpsModel".equals(str)) { YJWYPmpsModel[] pmpsModels = new YJWYPmpsModel[count]; for (int k = 0; k < count; k++) { pmpsModels[k] = (YJWYPmpsModel) list.get(k); pmpsModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(pmpsModels); } else { service.update(pmpsModels); } } else if ("YJWYSiteModel".equals(str)) { YJWYSiteModel[] siteModels = new YJWYSiteModel[count]; for (int k = 0; k < count; k++) { siteModels[k] = (YJWYSiteModel) list.get(k); siteModels[k].setPk_crop(pk_crop); } if ("save".equals(flag)) { service.save(siteModels); } else { service.update(siteModels); } } System.out.println("【FM数据同步】-持久化" + str + "数据【完毕】"); } }
31.640662
193
0.702779
164d8291ebf11b66416fcc561f607b1f4a71c71b
362
package io.nebula.leaf.genid; import io.nebula.kernel.exchange.ResponseEntity; import io.nebula.leaf.feign.LeafService; import lombok.Data; /** * @author nebula */ @Data public class LeafZKGenId extends AbstractGenId { @Override protected ResponseEntity<Long> generate(LeafService client, String key) { return client.segmentZK(key); } }
20.111111
77
0.737569
6bcdfa49a58778fbd7719fa05e90438735c3eb8a
819
package wooteco.subway.path; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import wooteco.subway.path.domain.fare.distance.DefaultDistance; import wooteco.subway.path.domain.fare.distance.DistanceChain; import wooteco.subway.path.domain.fare.distance.SecondDistance; import wooteco.subway.path.domain.fare.distance.ThirdDistance; @Configuration public class DistanceChainConfig { private static final int FIRST_THRESHOLD = 10; private static final int SECOND_THRESHOLD = 50; @Bean public DistanceChain defaultChain() { DistanceChain third = new ThirdDistance(); DistanceChain second = new SecondDistance(third, SECOND_THRESHOLD - FIRST_THRESHOLD); return new DefaultDistance(second, FIRST_THRESHOLD); } }
37.227273
93
0.791209
f24d3caf6e8b90e59c320aecf737630d3c9b0ab4
2,373
/********************************************************************* * * Copyright (C) 2002 Andrew Khan * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ package jxl.write.biff; import java.util.ArrayList; import jxl.Cell; import jxl.Range; import jxl.biff.IntegerHelper; import jxl.biff.Type; import jxl.biff.WritableRecordData; /** * A number record. This is stored as 8 bytes, as opposed to the * 4 byte RK record */ public class MergedCellsRecord extends WritableRecordData { /** * The ranges of all the cells which are merged on this sheet */ private ArrayList ranges; /** * Constructs a merged cell record * * @param ws the sheet containing the merged cells */ protected MergedCellsRecord(ArrayList mc) { super(Type.MERGEDCELLS); ranges = mc; } /** * Gets the raw data for output to file * * @return the data to write to file */ public byte[] getData() { byte[] data = new byte[ranges.size() * 8 + 2]; // Set the number of ranges IntegerHelper.getTwoBytes(ranges.size(), data, 0); int pos = 2; Range range = null; for (int i = 0; i < ranges.size() ; i++) { range = (Range) ranges.get(i); // Set the various cell records Cell tl = range.getTopLeft(); Cell br = range.getBottomRight(); IntegerHelper.getTwoBytes(tl.getRow(), data, pos); IntegerHelper.getTwoBytes(br.getRow(), data, pos+2); IntegerHelper.getTwoBytes(tl.getColumn(), data, pos+4); IntegerHelper.getTwoBytes(br.getColumn(), data, pos+6); pos += 8; } return data; } }
25.244681
76
0.634218
de1e503b878eb217ed4d3664eb296deff858bd96
695
// This file is part of CPAchecker, // a tool for configurable software verification: // https://cpachecker.sosy-lab.org // // SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> // // SPDX-License-Identifier: Apache-2.0 package org.sosy_lab.cpachecker.cpa.arg.counterexamples; import org.sosy_lab.cpachecker.core.counterexample.CounterexampleInfo; /** * Dummy implementation of {@link CounterexampleFilter} * that does not filter any counterexamples. */ public class NullCounterexampleFilter implements CounterexampleFilter { public NullCounterexampleFilter() {} @Override public boolean isRelevant(CounterexampleInfo pCounterexample) { return true; } }
26.730769
74
0.772662
5584a6eb58fbe4882ef89a677266c5690ffdf9a1
3,765
package com.mapbox.mapboxsdk.utils; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.View; import java.io.ByteArrayOutputStream; /** * Utility class for creating bitmaps */ public class BitmapUtils { /** * Convert a view to a bitmap. * * @param view the view to convert * @return the converted bitmap */ public static Bitmap createBitmapFromView(@NonNull View view) { view.setDrawingCacheEnabled(true); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); view.buildDrawingCache(); if (view.getDrawingCache() == null) { return null; } Bitmap snapshot = Bitmap.createBitmap(view.getDrawingCache()); view.setDrawingCacheEnabled(false); view.destroyDrawingCache(); return snapshot; } /** * Create a bitmap from a background and a foreground bitmap * * @param background The bitmap placed in the background * @param foreground The bitmap placed in the foreground * @return the merged bitmap */ public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) { Bitmap result = Bitmap.createBitmap(background.getWidth(), background.getHeight(), background.getConfig()); Canvas canvas = new Canvas(result); canvas.drawBitmap(background, 0f, 0f, null); canvas.drawBitmap(foreground, 10, 10, null); return result; } /** * Extract an underlying bitmap from a drawable * * @param sourceDrawable The source drawable * @return The underlying bitmap */ @Nullable public static Bitmap getBitmapFromDrawable(@Nullable Drawable sourceDrawable) { if (sourceDrawable == null) { return null; } if (sourceDrawable instanceof BitmapDrawable) { return ((BitmapDrawable) sourceDrawable).getBitmap(); } else { //copying drawable object to not manipulate on the same reference Drawable.ConstantState constantState = sourceDrawable.getConstantState(); if (constantState == null) { return null; } Drawable drawable = constantState.newDrawable().mutate(); Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); return bitmap; } } /** * Create a byte array out of drawable * * @param drawable The source drawable * @return The byte array of source drawable */ @Nullable public static byte[] getByteArrayFromDrawable(@Nullable Drawable drawable) { if (drawable == null) { return null; } Bitmap bitmap = getBitmapFromDrawable(drawable); if (bitmap == null) { return null; } ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream); return stream.toByteArray(); } /** * Decode byte array to drawable object * * @param context Context to obtain {@link android.content.res.Resources} * @param array The source byte array * @return The drawable created from source byte array */ @Nullable public static Drawable getDrawableFromByteArray(@NonNull Context context, @Nullable byte[] array) { if (array == null) { return null; } Bitmap compass = BitmapFactory.decodeByteArray(array, 0, array.length); return new BitmapDrawable(context.getResources(), compass); } }
30.12
111
0.705976
3cc2143b68f5a084ab2573c955a9fa4f0774e6c6
697
package parser.decorators.expressions; import java.util.Set; import de.be4.classicalb.core.parser.node.ABooleanTrueExpression; import de.be4.classicalb.core.parser.node.PExpression; public class MyABooleanTrueExpression extends MyExpressionDecorator { private ABooleanTrueExpression booleanTrueExpression; public MyABooleanTrueExpression(ABooleanTrueExpression booleanTrueExpression) { this.booleanTrueExpression = booleanTrueExpression; } @Override public PExpression getNode() { return this.booleanTrueExpression; } @Override public Set<String> getVariables() { return super.getVariables(); } @Override public String toString() { return "TRUE"; } }
17.425
80
0.781923
fe62e368b05bd8a12b9897564eac5475a1aa2620
170
package org.javaturk.oofp.ch03.flyer.vehicle; public interface Vehicle { public void turnOn(); public void turnOff(); public void go(); public void stop(); }
12.142857
45
0.7
d087d3f93112cce3c5f7493293c176c1d6b71424
1,821
package com.esmooc.legion.core.common.limit; //import com.esmooc.legion.core.common.annotation.RateLimiter; import com.esmooc.legion.core.common.constant.CommonConstant; import com.google.common.util.concurrent.RateLimiter; import lombok.extern.slf4j.Slf4j; import org.redisson.api.RRateLimiter; import org.redisson.api.RateIntervalUnit; import org.redisson.api.RateType; import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.concurrent.TimeUnit; /** * 令牌桶算法限流 * * @author DaiMao */ @Slf4j @Component public class RedisRaterLimiter { @Autowired private RedissonClient redisson; private RateLimiter guavaRateLimiter = RateLimiter.create(Double.MAX_VALUE); /** * 基于Redis令牌桶算法 * * @param name 限流标识(限流点) * @param rate 限制的数量 速率 * @param rateInterval 单位时间内(毫秒) * @return */ public Boolean acquireByRedis(String name, Long rate, Long rateInterval) { boolean getToken; try { RRateLimiter rateLimiter = redisson.getRateLimiter(CommonConstant.LIMIT_PRE + name); rateLimiter.trySetRate(RateType.OVERALL, rate, rateInterval, RateIntervalUnit.MILLISECONDS); getToken = rateLimiter.tryAcquire(); rateLimiter.expireAsync(rateInterval * 2, TimeUnit.MILLISECONDS); } catch (Exception e) { getToken = true; } return getToken; } /** * 基于内存令牌桶算法 * * @param permitsPerSecond 1秒内限制的数量(QPS) * @return */ public Boolean acquireByGuava(Double permitsPerSecond) { guavaRateLimiter.setRate(permitsPerSecond); boolean getToken = guavaRateLimiter.tryAcquire(); return getToken; } }
26.391304
104
0.692477
92bbcab9dab7463eff2ea4b1fa46103799bb0a8c
398
package com.zh; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @MapperScan("com.zh.dao") @SpringBootApplication public class SecurityDemoApplication { public static void main(String[] args) { SpringApplication.run(SecurityDemoApplication.class, args); } }
24.875
68
0.79397
61dbac88362d83d47ed92ecc487804d4a71e52d2
1,753
package com.dragontalker.bean; public class Dept { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column dept.did * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ private Integer did; /** * This field was generated by MyBatis Generator. * This field corresponds to the database column dept.dname * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ private String dname; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column dept.did * * @return the value of dept.did * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ public Integer getDid() { return did; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column dept.did * * @param did the value for dept.did * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ public void setDid(Integer did) { this.did = did; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column dept.dname * * @return the value of dept.dname * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ public String getDname() { return dname; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column dept.dname * * @param dname the value for dept.dname * * @mbggenerated Tue Jul 13 09:44:32 EDT 2021 */ public void setDname(String dname) { this.dname = dname == null ? null : dname.trim(); } }
26.164179
70
0.608671
eb83eaff8f565a7d753f29992b267bba21b394b0
1,057
package net.strongdesign.balsa.breezefile; import java.util.Iterator; import java.util.LinkedList; import java.util.TreeMap; public class BreezeChannelListElement extends AbstractBreezeElement { private static final long serialVersionUID = 8933781235650293491L; TreeMap<Integer, BreezeChannelElement> channels = new TreeMap<Integer, BreezeChannelElement>(); @SuppressWarnings("unchecked") public BreezeChannelListElement(LinkedList<Object> list) { Iterator<Object> it = list.iterator(); it.next(); int number = 1; // starting with 1 while (it.hasNext()) { LinkedList<Object> cur = (LinkedList<Object>)it.next(); channels.put(number++, new BreezeChannelElement(cur)); } } public void output() { System.out.print("\n (channels"); for (java.util.Map.Entry<Integer, BreezeChannelElement> be: channels.entrySet()) { System.out.print("\n"); indent(4); be.getValue().output(); System.out.print(" ; "+be.getKey()); } System.out.print("\n )"); } }
24.581395
98
0.673605
2f725d9e2d4d25e25a79d013b28c47c46a1f560e
1,303
package com.jd.management.dao; import java.util.List; import org.springframework.stereotype.Repository; import com.jd.management.condition.ResourcesCondition; import com.jd.management.domain.Resources; /** * 资源Dao * @author jiaodong * @Date 2017-01-06 15:05:16 */ @Repository("resourcesDao") public class ResourcesDao extends BaseDao{ /** * 获取资源 * * @param id 主键ID * @return the Resources */ public Resources getResourcesById(Long id) { return getSqlSession().selectOne(this.getSqlId("getResourcesById"), id); } /** * 插入资源 * @param resources */ public Integer insertResources(Resources resources) { return getSqlSession().insert(this.getSqlId("insertResources"), resources); } /** * 更新资源 * @param resources */ public Integer updateResources(Resources resources) { return getSqlSession().update(this.getSqlId("updateResources"), resources); } /** * 删除资源 * @param id */ public Integer deleteResources(Long id) { return getSqlSession().update(this.getSqlId("deleteResources"), id); } /** * @Description: 按条件获取资源列表 * @param page * @param user * @return */ public List<Resources> findResourcesList(ResourcesCondition resourcesCondition) { return getSqlSession().selectList(this.getSqlId("findResourcesList"), resourcesCondition); } }
22.084746
92
0.718342
757afa1667b3d4c4b3f6fe4572e3785b00289638
565
package org.eaSTars.z80asm.assembler.visitors.oneparam; import org.eaSTars.z80asm.ast.instructions.oneparam.PUSH; import org.eaSTars.z80asm.parser.Z80AssemblerParser.InstructionPUSHPOPparametersContext; import org.eaSTars.z80asm.parser.Z80AssemblerParser.PUSHContext; public class PUSHVisitor extends PUSHPOPVisitor<PUSH, PUSHContext> { @Override protected PUSH getInstruction() { return new PUSH(); } @Override protected InstructionPUSHPOPparametersContext getInstructionParameters(PUSHContext ctx) { return ctx.instructionPUSHPOPparameters(); } }
28.25
90
0.828319
d8aff25b582feda5646b384d2d128385b2fe0112
376
package fr.maif.jdbc; import akka.actor.ActorSystem; import fr.maif.akka.AkkaExecutionContext; public class JdbcExecutionContext extends AkkaExecutionContext { public JdbcExecutionContext(ActorSystem system) { this(system, "jdbc-execution-context"); } public JdbcExecutionContext(ActorSystem system, String name) { super(system, name); } }
23.5
66
0.739362
50300c5c280fd42e72235503c6102e55c84276b2
2,645
/* Copyright (c) 2010, Carl Burch. License information is located in the * logisim_src.Main source code and at www.cburch.com/logisim/. */ package draw.undo; import java.util.LinkedList; import logisim_src.util.EventSourceWeakSupport; public class UndoLog { private static final int MAX_UNDO_SIZE = 64; private EventSourceWeakSupport<UndoLogListener> listeners; private LinkedList<Action> undoLog; private LinkedList<Action> redoLog; private int modCount; public UndoLog() { this.listeners = new EventSourceWeakSupport<UndoLogListener>(); this.undoLog = new LinkedList<Action>(); this.redoLog = new LinkedList<Action>(); this.modCount = 0; } // // listening methods // public void addProjectListener(UndoLogListener what) { listeners.add(what); } public void removeProjectListener(UndoLogListener what) { listeners.remove(what); } private void fireEvent(int action, Action actionObject) { UndoLogEvent e = null; for (UndoLogListener listener : listeners) { if (e == null) e = new UndoLogEvent(this, action, actionObject); listener.undoLogChanged(e); } } // // accessor methods // public Action getUndoAction() { if (undoLog.size() == 0) { return null; } else { return undoLog.getLast(); } } public Action getRedoAction() { if (redoLog.size() == 0) { return null; } else { return redoLog.getLast(); } } public boolean isModified() { return modCount != 0; } // // mutator methods // public void doAction(Action act) { if (act == null) return; act.doIt(); logAction(act); } public void logAction(Action act) { redoLog.clear(); if (!undoLog.isEmpty()) { Action prev = undoLog.getLast(); if (act.shouldAppendTo(prev)) { if (prev.isModification()) --modCount; Action joined = prev.append(act); if (joined == null) { fireEvent(UndoLogEvent.ACTION_DONE, act); return; } act = joined; } while (undoLog.size() > MAX_UNDO_SIZE) { undoLog.removeFirst(); } } undoLog.add(act); if (act.isModification()) ++modCount; fireEvent(UndoLogEvent.ACTION_DONE, act); } public void undoAction() { if (undoLog.size() > 0) { Action action = undoLog.removeLast(); if (action.isModification()) --modCount; action.undo(); redoLog.add(action); fireEvent(UndoLogEvent.ACTION_UNDONE, action); } } public void redoAction() { if (redoLog.size() > 0) { Action action = redoLog.removeLast(); if (action.isModification()) ++modCount; action.doIt(); undoLog.add(action); fireEvent(UndoLogEvent.ACTION_DONE, action); } } public void clearModified() { modCount = 0; } }
21.680328
72
0.675614
0a850dfba71df25d33a18da0556df822bdddcd21
8,274
/** * 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.hadoop.io; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; public abstract class CompatibleWritable implements Writable { /** Initial version number */ public static final int INITIAL_VERSION = 0; /** Default size of buffer which we use as a temporary storage for serialization */ private static final int SERIALIZER_BUFFER_SIZE = 1024; /** * Encoded length of a message if it's initial version. For initial version we don't need to * write actual length, since the reader cannot be older than initial version. */ private static final int INITIAL_VERSION_LENGTH = -1; private static final ThreadLocal<byte[]> serializerBuffers = new ThreadLocal<byte[]>() { @Override protected byte[] initialValue() { return new byte[SERIALIZER_BUFFER_SIZE]; } }; /** * Returns current version of an object, initial version is {@link #INITIAL_VERSION} (this is * important for optimizations). If we implement new, extended object (with new fields), * we have to increment version (that means add EXACTLY one). */ protected int getVersion() { return INITIAL_VERSION; } /** * Returns good estimate (in the perfect scenario a tight upper bound) on the size of * serialized structure. Default implementation ensures that default sized buffer can be * retrieved from cache. */ protected int getSizeEstimate() { return SERIALIZER_BUFFER_SIZE; } /** * Returns temporary buffer for serialization, note that if your {@link CompatibleWritable} * contains another {@link CompatibleWritable} you have to ensure that returned buffers are * unique. Default implementation is safe (maintains above property). */ protected byte[] getBuffer(int size) { byte[] buffer; if (size > SERIALIZER_BUFFER_SIZE) { buffer = new byte[size]; } else { buffer = serializerBuffers.get(); serializerBuffers.remove(); } return buffer; } /** Frees acquired buffer. */ protected void freeBuffer(byte[] buffer) { if (buffer.length <= SERIALIZER_BUFFER_SIZE) { serializerBuffers.set(buffer); } } /** * Actual implementation of {@link Writable#write(DataOutput)} for this type. * Must call super#writeCompatible(DataOutputBuffer). */ protected abstract void writeCompatible(DataOutput out) throws IOException; /** * Actual implementation of {@link Writable#readFields(DataInput)} for this type, * must check if {@link DataInputBuffer#canReadNextVersion()} before reading to ensure * compatibility. * Must call super#readCompatible(DataInputBuffer). */ protected abstract void readCompatible(CompatibleDataInput in) throws IOException; @Override public final void write(DataOutput realOut) throws IOException { final int localVersion = getVersion(); WritableUtils.writeVInt(realOut, localVersion); if (localVersion == INITIAL_VERSION) { WritableUtils.writeVInt(realOut, INITIAL_VERSION_LENGTH); writeCompatible(realOut); } else { final byte[] buffer = getBuffer(getSizeEstimate()); try { DataOutputBuffer out = new DataOutputBuffer(buffer); // Write object writeCompatible(out); WritableUtils.writeVInt(realOut, out.getLength()); realOut.write(out.getData(), 0, out.getLength()); } finally { freeBuffer(buffer); } } } @Override public final void readFields(DataInput realIn) throws IOException { final int localVersion = getVersion(); final int remoteVersion = WritableUtils.readVInt(realIn); if (remoteVersion <= localVersion) { // Discard length WritableUtils.readVInt(realIn); CompatibleDataInput in = new CompatibleDataInputWrapper(realIn, remoteVersion); readCompatible(in); } else { final int length = WritableUtils.readVInt(realIn); final byte[] buffer = getBuffer(length); try { realIn.readFully(buffer, 0, length); DataInputBuffer in = new DataInputBuffer(); in.reset(buffer, length); // Read object readCompatible(in); } finally { freeBuffer(buffer); } } } /** * Provides calls to read data and check for possible compatibility problems. * Used to wrap {@link DataInput} in the case when the reader version is newer than the writer * version for object deserialization. This class provides information when the deserialization * needs to be stopped in such case, and the default values need to be assigned for the fields * that could not be deserialized. */ public static interface CompatibleDataInput extends DataInput { /** * This function needs to be used when the reader is newer that the writer. * The reader reads fields, and for every version increment that occurred between the writer * and the reader, the reader needs to call this function to see if there is more data * available to be deserialized. * Please see {@link TestCompatibleWritable} for example. */ boolean canReadNextVersion(); } private static class CompatibleDataInputWrapper implements CompatibleDataInput { private final DataInput input; private final int serializedObjectVersion; private int currentVersion; public CompatibleDataInputWrapper(DataInput input, int serializedObjectVersion) { this.input = input; this.serializedObjectVersion = serializedObjectVersion; this.currentVersion = INITIAL_VERSION; } @Override public boolean canReadNextVersion() { if (currentVersion < serializedObjectVersion) { currentVersion++; return true; } else { return false; } } //////////////////////////////////////// // DataInput //////////////////////////////////////// @Override public void readFully(byte[] bytes) throws IOException { input.readFully(bytes); } @Override public void readFully(byte[] bytes, int i, int i2) throws IOException { input.readFully(bytes, i, i2); } @Override public int skipBytes(int i) throws IOException { return input.skipBytes(i); } @Override public boolean readBoolean() throws IOException { return input.readBoolean(); } @Override public byte readByte() throws IOException { return input.readByte(); } @Override public int readUnsignedByte() throws IOException { return input.readUnsignedByte(); } @Override public short readShort() throws IOException { return input.readShort(); } @Override public int readUnsignedShort() throws IOException { return input.readUnsignedShort(); } @Override public char readChar() throws IOException { return input.readChar(); } @Override public int readInt() throws IOException { return input.readInt(); } @Override public long readLong() throws IOException { return input.readLong(); } @Override public float readFloat() throws IOException { return input.readFloat(); } @Override public double readDouble() throws IOException { return input.readDouble(); } @Override public String readLine() throws IOException { return input.readLine(); } @Override public String readUTF() throws IOException { return input.readUTF(); } } }
31.701149
97
0.685158
07edff4ac7e6c567be6e7a99867c9bac51b393fe
2,816
package home.java; import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject; import java.util.Date; public class EntreStock extends RecursiveTreeObject<EntreStock> { private int id; private int typeProduit; private String nom; private int quantite; private double prix; private Date dateFab; private Date dateExp; private String fournisseur; private double prixTotale; public EntreStock(int id, int typeProduit, String nom, int quantite, double prix, Date dateFab, Date dateExp, String fournisseur, Double prixTotale) { this.id=id; this.typeProduit = typeProduit; this.nom=nom; this.quantite=quantite; this.prix=prix; this.dateFab=dateFab; this.dateExp=dateExp; this.fournisseur=fournisseur; this.prixTotale=prixTotale; } public EntreStock(){ } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNom() { return nom; } public void setNom(String nom) { this.nom = nom; } public int getQuantite() { return quantite; } public void setQuantite(int quantite) { this.quantite = quantite; } public double getPrix() { return prix; } public void setPrix(double prix) { this.prix = prix; } public Date getDateFab() { return dateFab; } public void setDateFab(Date dateFab) { this.dateFab = dateFab; } public Date getDateExp() { return dateExp; } public void setDateExp(Date dateExp) { this.dateExp = dateExp;} public String getFournisseur() { return fournisseur; } public void setFournisseur(String fournisseur) { this.fournisseur = fournisseur; } public double getPrixTotale() { return prixTotale; } public void setPrixTotale(double prixTotale) { this.prixTotale = prixTotale; } public int getTypeProduit() { return typeProduit; } public void setTypeProduit(int typeProduit) { this.typeProduit = typeProduit; } public String getProdectName() { String name = null; if (typeProduit == 1) name = "طعام"; else if (typeProduit == 2) name = "كتب و كراريس"; else if (typeProduit == 3) name = "أخرى"; return name; } public int getProdect(String item) { int name = -1; switch (item) { case "طعام": name = 1; break; case "كتب و كراريس": name = 2; break; case "أخرى": name = 3; break; } return name; } }
21.661538
154
0.572443
645e9d32248fc6dbe8f1670aaee72efe7a198150
5,566
// ============================================================================ // // Copyright (C) 2006-2021 Talend Inc. - www.talend.com // // This source code is available under agreement available at // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt // // You should have received a copy of the agreement // along with this program; if not, write to Talend SA // 9 rue Pages 92150 Suresnes, France // // ============================================================================ package org.talend.dataquality.common.inference; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import org.talend.dataquality.common.exception.DQCommonRuntimeException; /** * A {@link List} that can resize to a given maximum size and ensure that all index in list have an instance of * <i>T</i>. <b>Important:</b>type <i>T</i> must have a public zero args constructor. * * @param <T> A class with a zero-arg constructor. * @see #resize(int) */ public class ResizableList<T> implements List<T>, Serializable { private static final long serialVersionUID = -4643753633617225999L; private Class<T> itemClass; private List<T> innerList; /** * Creates a list with explicit {@link #resize(int) resize} that contains instances of <i>T</i>. * * @param itemClass The class of <i>T</i>. * @throws IllegalArgumentException If <code>itemClass</code> does not have a zero args constructor. */ public ResizableList(Class<T> itemClass) { try { itemClass.getConstructor(); } catch (NoSuchMethodException e) { throw new IllegalArgumentException("Item class must have a zero arg constructor.", e); //$NON-NLS-1$ } this.itemClass = itemClass; this.innerList = new ArrayList<T>(); } /** * Creates a list with a copy of list. * * @param copyOfList list to be initialized. */ public ResizableList(List<T> copyOfList) { this.innerList = copyOfList; } /** * Resize the list so it contains <code>size</code> instances of <i>T</i>. Method only scales up, never down. * * @param size The new size for the list. Must be a positive number. * @return <code>true</code> if new elements were added to the list (i.e. list was resized), <code>false</code> if * no new elements were added. */ public boolean resize(int size) { try { if (size < 0) { throw new IllegalArgumentException("Size must be a positive number."); } final int missing = size - innerList.size(); boolean addedMissing = missing > 0; for (int i = 0; i < missing; i++) { innerList.add(itemClass.newInstance()); } return addedMissing; } catch (Exception e) { throw new DQCommonRuntimeException("Unable to resize list of items.", e); } } @Override public int size() { return innerList.size(); } @Override public boolean isEmpty() { return innerList.isEmpty(); } @Override public boolean contains(Object o) { return innerList.contains(o); } @Override public Iterator<T> iterator() { return innerList.iterator(); } @Override public Object[] toArray() { return innerList.toArray(); } @Override public <Q> Q[] toArray(Q[] qs) { return innerList.toArray(qs); } @Override public boolean add(T t) { return innerList.add(t); } @Override public boolean remove(Object o) { return innerList.remove(o); } @Override public boolean containsAll(Collection<?> collection) { return innerList.containsAll(collection); } @Override public boolean addAll(Collection<? extends T> collection) { return innerList.addAll(collection); } @Override public boolean addAll(int i, Collection<? extends T> collection) { return innerList.addAll(i, collection); } @Override public boolean removeAll(Collection<?> collection) { return innerList.removeAll(collection); } @Override public boolean retainAll(Collection<?> collection) { return innerList.retainAll(collection); } @Override public void clear() { innerList.clear(); } @Override public boolean equals(Object o) { return innerList.equals(o); } @Override public int hashCode() { return innerList.hashCode(); } @Override public T get(int i) { return innerList.get(i); } @Override public T set(int i, T t) { return innerList.set(i, t); } @Override public void add(int i, T t) { innerList.add(i, t); } @Override public T remove(int i) { return innerList.remove(i); } @Override public int indexOf(Object o) { return innerList.indexOf(o); } @Override public int lastIndexOf(Object o) { return innerList.lastIndexOf(o); } @Override public ListIterator<T> listIterator() { return innerList.listIterator(); } @Override public ListIterator<T> listIterator(int i) { return innerList.listIterator(i); } @Override public List<T> subList(int i, int i1) { return innerList.subList(i, i1); } }
26.131455
118
0.600252
26e15d0d69872d2ced62ad2ca507d14e0fcc73ea
474
package optifine; import java.util.Comparator; public class CustomItemsComparator implements Comparator { public int compare(Object o1, Object o2) { CustomItemProperties p1 = (CustomItemProperties)o1; CustomItemProperties p2 = (CustomItemProperties)o2; return p1.weight != p2.weight ? p2.weight - p1.weight : (!Config.equals(p1.basePath, p2.basePath) ? p1.basePath.compareTo(p2.basePath) : p1.name.compareTo(p2.name)); } }
33.857143
174
0.698312
78704480f3aafd7cfde975da2ce0ae4f9a89909f
1,943
package com.infoDiscover.solution.builder.vo; /** * Created by sun on 7/24/17. */ public class DataDateMappingVO { private String relationMappingType; private String sourceDataTypeKind; private String sourceDataTypeName; private String sourceDataPropertyName; private String relationTypeName; private String relationDirection; private String dateDimensionTypePrefix; public String getRelationMappingType() { return relationMappingType; } public void setRelationMappingType(String relationMappingType) { this.relationMappingType = relationMappingType; } public String getSourceDataTypeKind() { return sourceDataTypeKind; } public void setSourceDataTypeKind(String sourceDataTypeKind) { this.sourceDataTypeKind = sourceDataTypeKind; } public String getSourceDataTypeName() { return sourceDataTypeName; } public void setSourceDataTypeName(String sourceDataTypeName) { this.sourceDataTypeName = sourceDataTypeName; } public String getSourceDataPropertyName() { return sourceDataPropertyName; } public void setSourceDataPropertyName(String sourceDataPropertyName) { this.sourceDataPropertyName = sourceDataPropertyName; } public String getRelationTypeName() { return relationTypeName; } public void setRelationTypeName(String relationTypeName) { this.relationTypeName = relationTypeName; } public String getRelationDirection() { return relationDirection; } public void setRelationDirection(String relationDirection) { this.relationDirection = relationDirection; } public String getDateDimensionTypePrefix() { return dateDimensionTypePrefix; } public void setDateDimensionTypePrefix(String dateDimensionTypePrefix) { this.dateDimensionTypePrefix = dateDimensionTypePrefix; } }
26.256757
76
0.72877
d344d872023d6197ae0f7dd776a871c0f34bacb1
2,276
package com.skcraft.plume.module.backtrack; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; public class LoggerConfig { @Setting(comment = "Configure how search works") public Search search = new Search(); @Setting(comment = "Configure how the near command works") public Near near = new Near(); @Setting(comment = "Configure the events that will be logged") public Events events = new Events(); @Setting(comment = "Configure how rollback or replay works") public Playback playback = new Playback(); @ConfigSerializable public static class Search { @Setting(comment = "The maximum number of results to return, by default") public int defaultLimit = 2000; @Setting(comment = "The maximum number of results that can be returned") public int maxLimit = 10000; } @ConfigSerializable public static class Near { @Setting(comment = "The default parameters for the near query") public String defaultParameters = "near 20 since 1w"; } @ConfigSerializable public static class Playback { @Setting(comment = "The maximum amount of time (in ms) that rollback or replay may take up in a single tick (which itself is 20ms)") public int maxTimePerTick = 5; @Setting(comment = "The interval (in ms) between status updates on a rollback or replay") public int updateInterval = 5000; @Setting(comment = "Require a time or player to be specified to rollback or replay if -y is not specified in the command") public boolean confirmNoDateNoPlayer = true; } @ConfigSerializable public static class Events { @Setting public boolean blockBreak = true; @Setting public boolean blockPlace = true; @Setting public boolean bucketFill = true; @Setting public boolean entityDamage = true; @Setting public boolean explosion = true; @Setting public boolean itemDrop = true; @Setting public boolean itemPickup = true; @Setting public boolean playerChat = true; @Setting public boolean playerCommand = true; @Setting public boolean playerDeath = true; } }
36.709677
140
0.689807
cce8ee1fe0b50668dcb50cc06031812263e16932
2,415
package mx.uam.archinaut.services; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import mx.uam.archinaut.data.nameprocessing.NameProcessor; import mx.uam.archinaut.model.DesignStructureMatrix; import mx.uam.archinaut.model.MatrixElement; @SpringBootTest class DesignStructureMatrixServiceTest extends AbstractServiceTest { @Autowired private DesignStructureMatrixService designStructureMatrixService; @Autowired private NameProcessor nameProcessor; @Test void loadMatrixFromJSONTest() { String[] filenames = {"main.java.com.uam.spaceinvaders.App_java", "main.java.com.uam.spaceinvaders.audio.Audio_java", "main.java.com.uam.spaceinvaders.entities.Sandbag_java", "main.java.com.uam.spaceinvaders.entities.Spaceship_java", "main.java.com.uam.spaceinvaders.entities.aliens.Alien_java", "main.java.com.uam.spaceinvaders.entities.aliens.GreenAlien_java", "main.java.com.uam.spaceinvaders.entities.aliens.RedAlien_java", "main.java.com.uam.spaceinvaders.entities.aliens.WhiteAlien_java", "main.java.com.uam.spaceinvaders.entities.aliens.YellowAlien_java", "main.java.com.uam.spaceinvaders.entities.interfaces.MovableComponent_java", "main.java.com.uam.spaceinvaders.entities.projectiles.AlienProjectile_java", "main.java.com.uam.spaceinvaders.entities.projectiles.Projectile_java", "main.java.com.uam.spaceinvaders.entities.projectiles.SpaceshipProjectile_java", "main.java.com.uam.spaceinvaders.levels.LevelOne_java", "main.java.com.uam.spaceinvaders.levels.Level_java", "main.java.com.uam.spaceinvaders.presentation.GameFrame_java", "main.java.com.uam.spaceinvaders.presentation.GamePanel_java"}; DesignStructureMatrix matrix = designStructureMatrixService.loadMatrixFromJSON(dependsConfigurationEntry); assertNotNull(matrix); assertEquals(17, matrix.getElementsCount()); int i = 0; for (MatrixElement m : matrix.getElements()) { String filename = nameProcessor.processName(dependsConfigurationEntry.getRenaming(), filenames[i]); assertEquals(true, filename.contains(m.getFullName())); i++; } } }
38.333333
108
0.773085
a75ec1eb57674f83d6db748270c2f89144d91c7e
412
package de.libal.holidayapiclient.domain; import java.util.ArrayList; import java.util.List; public class ResponseWrapperLanguage { private List<Language> languages = new ArrayList<>(); public List<Language> getLanguages() { return languages; } public ResponseWrapperLanguage setLanguages(List<Language> languages) { this.languages = languages; return this; } }
20.6
75
0.703883
3c2a6a49f10962370683160418b7069595974e8b
1,377
package com.bettercloud.kadmin.api.kafka; import com.bettercloud.kadmin.kafka.QueuedKafkaMessageHandler; import lombok.Builder; import lombok.Data; import lombok.NonNull; import java.util.Collection; /** * Created by davidesposito on 7/23/16. */ @Data @Builder public class KadminConsumerGroupContainer { @NonNull private final KadminConsumerGroup consumer; @NonNull private final QueuedKafkaMessageHandler queue; /** * Must return the id of the contained consumer. Merely a delegate method for {@link KadminConsumerGroup#getClientId()}. * @return The consumers unique client id */ public String getId() { return getConsumer().getClientId(); } public KadminConsumerGroup getConsumer() { return consumer; } /** * The Cached queue of the contained consumer. Note that this {@link QueuedKafkaMessageHandler} will be included in the * {@link KadminConsumerGroupContainer#getHandlers()} return values. * @return */ public QueuedKafkaMessageHandler getQueue() { return queue; } /** * Must return the handlers list of the contained consumer. Merely a delegate method for {@link KadminConsumerGroup#getHandlers()}. * @return The consumers handlers */ public Collection<MessageHandler> getHandlers() { return getConsumer().getHandlers(); } }
28.102041
135
0.705882
c6e8dad1df725f6080ce9e168b7dcd08945b9fe8
6,154
package com.roden.study.redis.jedis; import org.junit.BeforeClass; import org.junit.Test; import redis.clients.jedis.Jedis; import java.util.Set; import java.util.concurrent.TimeUnit; /** * @Test:将一个普通方法修饰成一个测试方法 * @Test(excepted=xx.class): xx.class表示异常类,表示测试的方法抛出此异常时,认为是正常的测试通过的 * @Test(timeout=毫秒数) :测试方法执行时间是否符合预期 * @BeforeClass:会在所有的方法执行前被执行,static方法 * @AfterClass:会在所有的方法执行之后进行执行,static方法 * @Before:会在每一个测试方法被运行前执行一次 * @After:会在每一个测试方法运行后被执行一次` * @Ignore:所修饰的测试方法会被测试运行器忽略 * @RunWith:可以更改测试运行器org.junit.runner.Runner * Parameters:参数化注解 * * */ public class JedisCommandsTest { static Jedis jedis; @BeforeClass public static void beforeClass(){ jedis=JedisUtil.getJedis(); } /** * set key value 设置一个key 值为 value    * get key 获得key值得value Set KEY VALUE //设置给定key的值,如果key不存在则添加,如果存在则更新值 SETEX key Seconds VALUE //为指定的 key 设置值及其过期时间。如果 key 已经存在, SETEX命令将会替换旧的值。 Get KEY //获取指定 key 的值 GETRANGE KEY start end //获取存储在指定 key 中字符串的子字符串。字符串的截取范围由 start 和 end 两个偏移量决定(包括 start 和 end 在内)。 GETSET KEY VALUE //设置给定key的值,并返回旧值 SETNX KEY VALUE //给定key不存在时,为key设定值 MSET key1 value1 key2 value2 .. keyN valueN //同时设定多个值 INCR KEY //给定key的值+1 key对应的值不是整型会报错,value is not an integer or out of range DECR KEY //给定key的值-1 key对应的值不是整型会报错,value is not an integer or out of range */ @Test public void str(){ //注意:redis中的Key和Value时区分大小写的,命令不区分大小写, redis是单线程 不适合存储大容量的数据 jedis.set("hello","328"); //incr key ---对应的value 自增1,如果没有这个key值 自动给你创建创建 并赋值为1 //decr key ---对应的value 自减1 //注意:自增的value是可以转成数字的 jedis.incr("hello"); System.out.println(jedis.get("hello")); System.out.println(jedis.decr("hello")); jedis.del("hello"); } /** * 相当于1个key 对应一个map * hset key filed value 设置值 * hget key filed  获取值 * * Hset key field value //设置给定key 的field的value * Hmset Key field1 value1 field2 value 2 //同时设置多个 field value * Hget key field //获取key中指定feild的value值 * Hmget key feild1 feild2 //获取多个feild的值 */ @Test public void hash(){ jedis.hset("user","name","zhangsan"); jedis.hset("user","age","18"); System.out.println(jedis.hget("user","name")); System.out.println(jedis.del("user")); } /**   List 有顺序可重复    lpush list 1 2 3 4 从左添加元素   rpush list 1 2 3 4 从右添加元素  lrange list 0 -1 (从0 到-1 元素查看:也就表示查看所有,lrange右闭合,也就是包含end下标所代表的项)  lpop list (从左边取,删除)  rpop list (从右边取,删除) Lpush key value1 value2 //将一个或多个值插入List的头部(左) Rpush key value1 value2 //将一个或多个值插入List的尾部(右) Lpop key //移除列表头的元素 Rpop key //移除列表尾元素 BLpop key timeut//移除列表头的元素,如果没有元素会阻塞直到发现可弹出元素或者超时 LREM key count value //根据参数 COUNT 的值,移除列表中与参数 VALUE 相等的元素。 count> 0 从列表头向尾检索移除count个与value相等的元素并移除;count < 0 从尾向头检索移除count个与value相等的元素并移除;count = 0,移除所有与value相等的元素 */ @Test public void list(){ System.out.println(jedis.lpush("list","1","2")); jedis.rpush("list","3","4"); System.out.println(jedis.lrange("list",0,-1)); System.out.println(jedis.lpop("list")); System.out.println(jedis.rpop("list")); jedis.del("list"); } /** Set 无顺序,不能重复    sadd set1 a b c d d (向set1中添加元素) 元素不重复 smembers set1 (查询元素) srem set1 a (删除元素) SADD KEY member1 member2 //向集合中添加一个或多个成员 SPOP KEY //移除并返回集合中的一个随机元素 SRem KEY member1 member2 //移除集合中一个或多个成员 SInter key1 key2 //返回给定集合的交集 SUnion key1 key2 //返回给定集合的并集 SDiff key1 key2 //返回给定集合的差集 Smembers Key //返回集合中所有member Sismember Key member //判断member是否在集合中 */ @Test public void set(){ jedis.sadd("set","a","b","c","d","d"); System.out.println(jedis.smembers("set")); System.out.println(jedis.srem("set","a")); System.out.println(jedis.smembers("set")); jedis.del("set"); } /** 有顺序,不能重复   适合做排行榜 排序需要一个分数属性   zadd zset1 9 a 8 c 10 d 1 e (添加元素 zadd key score member )   (ZRANGE key start stop [WITHSCORES])(查看所有元素:zrange key 0 -1 withscores)   如果要查看分数,加上withscores.   zrange zset1 0 -1 (从小到大)   zrevrange zset1 0 -1 (从大到小)   zincrby zset2 score member (对元素member 增加 score) ZAdd Key score1 member1 score2 member2 //向一个集合添加成员,如果成员存在就更新分数 ZCount Key min max //获取指定分数区号的成员数量,包括min和max ZRANGE Key start stop [WITHSCORES]//获取指定下标范围的有序成员列表 按照分数排序 ZREVRANGE Key start stop [WITHSCORES]//获取指定下标范围的有序成员列表 按照分数倒序 */ @Test //SortedSet(zset) public void zset(){ jedis.zadd("zset1",8,"a"); jedis.zadd("zset1",4,"b"); jedis.zadd("zset1",5,"c"); jedis.zadd("zset1",1,"d"); System.out.println(jedis.zrange("zset1",0,-1)); jedis.zadd("zset1",9,"a"); System.out.println(jedis.zrange("zset1",0,-1)); System.out.println(jedis.zrangeWithScores("zset1",0,-1)); System.out.println(jedis.zrevrange("zset1",0,-1)); System.out.println(jedis.zincrby("zset1",1,"a")); System.out.println(jedis.zrevrangeWithScores("zset1",0,-1)); jedis.del("zset1"); } /** expire key second (设置key的过期时间)   ttl key (查看剩余时间)(-2 表示不存在,-1 表示已被持久化,正数表示剩余的时间)   persist key (清除过期时间,也即是持久化 持久化成功体提示 1 不成功0)。   del key: 删除key   select 0 表示:选择0号数据库。默认是0号数据库 redis 通配符说明:* 0到任意多个字符 ? 1个字符 */ @Test public void key() throws InterruptedException { jedis.set("hello","world"); Set<String> set = jedis.keys("*l?"); set.forEach(obj-> System.out.print(obj+":"+jedis.get(obj)+"\t")); jedis.expire("hello",2); System.out.println(jedis.get("hello")); TimeUnit.SECONDS.sleep(3); System.out.println(jedis.get("hello")); jedis.set("hello","world"); jedis.expire("hello",10); TimeUnit.SECONDS.sleep(3); System.out.println(jedis.ttl("hello")); System.out.println(jedis.persist("hello")); System.out.println(jedis.ttl("hello")); System.out.println(jedis.del("hello")); } }
32.909091
169
0.628372