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
|
---|---|---|---|---|---|
ecdc0d66e105d15fe1eeb622f3aa6046fe3f513f | 1,220 | package common.controllers;
import io.sphere.sdk.models.Base;
public final class SunrisePageData extends Base implements PageData {
private PageHeader header;
private PageFooter footer;
private PageContent content;
private PageMeta meta;
public SunrisePageData() {
}
public SunrisePageData(final PageHeader header, final PageFooter footer, final PageContent content, final PageMeta meta) {
this.header = header;
this.footer = footer;
this.content = content;
this.meta = meta;
}
@Override
public PageHeader getHeader() {
return header;
}
public void setHeader(final PageHeader header) {
this.header = header;
}
@Override
public PageFooter getFooter() {
return footer;
}
public void setFooter(final PageFooter footer) {
this.footer = footer;
}
@Override
public PageContent getContent() {
return content;
}
public void setContent(final PageContent content) {
this.content = content;
}
@Override
public PageMeta getMeta() {
return meta;
}
public void setMeta(final PageMeta meta) {
this.meta = meta;
}
}
| 21.403509 | 126 | 0.641803 |
268f963a5168348e9889d17e79469d9daded2c38 | 8,058 | /*
* Copyright (c) 2017 Stephan D. Cote' - All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which accompanies this distribution, and is
* available at http://creativecommons.org/licenses/MIT/
*
* Contributors:
* Stephan D. Cote
* - Initial concept and implementation
*/
package coyote.responder;
import java.net.InetAddress;
import java.util.Iterator;
import java.util.Map;
import coyote.commons.DateUtil;
import coyote.commons.StringUtil;
import coyote.commons.WebServer;
import coyote.commons.network.http.IHTTPSession;
import coyote.commons.network.http.Response;
import coyote.commons.network.http.auth.Auth;
import coyote.commons.network.http.responder.Resource;
import coyote.commons.network.http.responder.Responder;
import coyote.dataframe.DataFrame;
import coyote.i13n.ArmMaster;
import coyote.i13n.Counter;
import coyote.i13n.Gauge;
import coyote.i13n.StatBoard;
import coyote.i13n.State;
import coyote.i13n.TimingMaster;
import coyote.loader.cfg.Config;
import coyote.loader.log.Log;
/**
* This provides access to all the stats in the for the loader(server).
*
* <p>This is expected to the added to the WebServer thusly:<pre>
* "/api/stat/" : { "Class" : "systems.coyote.handler.StatBoardHandler" },
* "/api/stat/:metric" : { "Class" : "systems.coyote.handler.StatBoardHandler" },
* "/api/stat/:metric/:name" : { "Class" : "systems.coyote.handler.StatBoardHandler" },
* </pre>
* If no metric or name is given, then the entire statistics board is
* serialized as a response. If a metric is given, but no name then all the
* metrics of that type are returned. Otherwise just the named metric is returned.
*/
@Auth
public class StatBoardResponder extends AbstractJsonResponder implements Responder {
private static final String ARM = "ARM";
private static final String TIMER = "Timer";
private static final String GAUGE = "Gauge";
private static final String STATUS = "Status";
private static final String COUNTER = "Counter";
private static final String VERSION = "Version";
private static final String HOSTNAME = "DnsName";
private static final String OS_ARCH = "OSArch";
private static final String OS_NAME = "OSName";
private static final String OS_VERSION = "OSVersion";
private static final String RUNTIME_NAME = "RuntimeName";
private static final String RUNTIME_VENDOR = "RuntimeVendor";
private static final String RUNTIME_VERSION = "RuntimeVersion";
private static final String STARTED = "Started";
private static final String STATE = "State";
private static final String USER_NAME = "Account";
private static final String VM_AVAIL_MEM = "AvailableMemory";
private static final String VM_CURR_HEAP = "CurrentHeap";
private static final String VM_FREE_HEAP = "FreeHeap";
private static final String VM_FREE_MEM = "FreeMemory";
private static final String VM_HEAP_PCT = "HeapPercentage";
private static final String VM_MAX_HEAP = "MaxHeapSize";
private static final String FIXTURE_ID = "InstanceId";
private static final String FIXTURE_NAME = "InstanceName";
private static final String HOSTADDR = "IpAddress";
private static final String NAME = "Name";
private static final String UPTIME = "Uptime";
/**
*
*/
@Override
public Response get( Resource resource, Map<String, String> urlParams, IHTTPSession session ) {
WebServer loader = resource.initParameter( 0, WebServer.class );
Config config = resource.initParameter( 1, Config.class );
// Get the command from the URL parameters specified when we were registered with the router
String metric = urlParams.get( "metric" );
String name = urlParams.get( "name" );
// we are going to format the output
setFormattingJson( true );
if ( loader.getStats() != null ) {
if ( StringUtil.isNotBlank( metric ) ) {
if ( StringUtil.isNotBlank( name ) ) {
// TODO: get just the named metric of that type (e.g. 'counters' with a specific name )
} else {
// TODO: return all the metrics of type (e.g. all 'counters')
}
} else {
results.merge( createStatus( loader ) );
}
}
// create a response using the superclass methods
return Response.createFixedLengthResponse( getStatus(), getMimeType(), getText() );
}
private DataFrame createStatus( WebServer loader ) {
StatBoard statboard = loader.getStats();
DataFrame retval = new DataFrame();
retval.add( NAME, STATUS );
// Add information from the statboard fixture
retval.add( FIXTURE_ID, statboard.getId() );
retval.add( FIXTURE_NAME, loader.getName() );
retval.add( OS_NAME, System.getProperty( "os.name" ) );
retval.add( OS_ARCH, System.getProperty( "os.arch" ) );
retval.add( OS_VERSION, System.getProperty( "os.version" ) );
retval.add( RUNTIME_VERSION, System.getProperty( "java.version" ) );
retval.add( RUNTIME_VENDOR, System.getProperty( "java.vendor" ) );
retval.add( RUNTIME_NAME, "Java" );
retval.add( STARTED, DateUtil.ISO8601Format( statboard.getStartedTime() ) );
retval.add( UPTIME, DateUtil.formatSignificantElapsedTime( ( System.currentTimeMillis() - statboard.getStartedTime() ) / 1000 ) );
retval.add( USER_NAME, System.getProperty( "user.name" ) );
retval.add( VM_AVAIL_MEM, new Long( statboard.getAvailableMemory() ) );
retval.add( VM_CURR_HEAP, new Long( statboard.getCurrentHeapSize() ) );
retval.add( VM_FREE_HEAP, new Long( statboard.getFreeHeapSize() ) );
retval.add( VM_FREE_MEM, new Long( statboard.getFreeMemory() ) );
retval.add( VM_MAX_HEAP, new Long( statboard.getMaxHeapSize() ) );
retval.add( VM_HEAP_PCT, new Float( statboard.getHeapPercentage() ) );
String text = statboard.getHostname();
retval.add( HOSTNAME, ( text == null ) ? "unknown" : text );
InetAddress addr = statboard.getHostIpAddress();
retval.add( HOSTADDR, ( addr == null ) ? "unknown" : addr.getHostAddress() );
DataFrame childPacket = new DataFrame();
// get the list of component versions registered with the statboard
Map<String, String> versions = statboard.getVersions();
for ( String key : versions.keySet() ) {
childPacket.add( key, versions.get( key ) );
}
retval.add( VERSION, childPacket );
// Get all counters
childPacket.clear();
for ( Iterator<Counter> it = statboard.getCounterIterator(); it.hasNext(); ) {
Counter counter = it.next();
childPacket.add( counter.getName(), new Long( counter.getValue() ) );
}
retval.add( COUNTER, childPacket );
// Get all states
childPacket.clear();
for ( Iterator<State> it = statboard.getStateIterator(); it.hasNext(); ) {
State state = it.next();
if ( state.getValue() != null ) {
childPacket.add( state.getName(), state.getValue() );
} else {
Log.info( "State " + state.getName() + " is null" );
}
}
retval.add( STATE, childPacket );
childPacket.clear();
for ( Iterator<Gauge> it = statboard.getGaugeIterator(); it.hasNext(); ) {
DataFrame packet = it.next().toFrame();
if ( packet != null ) {
childPacket.add( packet );
}
}
retval.add( GAUGE, childPacket );
childPacket.clear();
for ( Iterator<TimingMaster> it = statboard.getTimerIterator(); it.hasNext(); ) {
DataFrame cap = it.next().toFrame();
if ( cap != null ) {
childPacket.add( cap );
}
}
retval.add( TIMER, childPacket );
childPacket.clear();
for ( Iterator<ArmMaster> it = statboard.getArmIterator(); it.hasNext(); ) {
DataFrame cap = it.next().toFrame();
if ( cap != null ) {
childPacket.add( cap );
}
}
retval.add( ARM, childPacket );
return retval;
}
}
| 39.307317 | 135 | 0.670017 |
884ee9a13881d950358696714b224916667ce95d | 758 | package com.fast.ilumer.gank.model;
/**
* Created by ${ilumer} on 2/2/17.
*/
public class SearchRepo {
private String showItem;
private int tag;
private String Uri;
public SearchRepo(String showItem, int tag, String uri) {
this.showItem = showItem;
this.tag = tag;
this.Uri = uri;
}
public SearchRepo() {
}
public String getShowItem() {
return showItem;
}
public void setShowItem(String showItem) {
this.showItem = showItem;
}
public int getTag() {
return tag;
}
public void setTag(int tag) {
this.tag = tag;
}
public String getUri() {
return Uri;
}
public void setUri(String uri) {
Uri = uri;
}
}
| 16.844444 | 61 | 0.564644 |
657a65934d3259646e736bff4462ed320576c70d | 2,086 | /*
* Created on Mar 7, 2005
*/
package compiler.analizer;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import compiler.constants.Words;
import compiler.exception.AnalizerException;
/**
*
*/
public class ForAnalizer extends BlockAnalizer {
/**
* The equal string
*/
private static final String EQUAL_STRING = "=";
/**
*
*/
public ForAnalizer() {
super();
}
/**
* @param text
* @throws AnalizerException
*/
public ForAnalizer(String text) throws AnalizerException {
super(text);
}
/*
* (non-Javadoc)
*
* @see compiler.analizer.Analizer#getAnalizeResult()
*/
public List getAnalizeResult() {
return result;
}
/*
* (non-Javadoc)
*
* @see compiler.analizer.BlockInstructionsAnalizer#getInstructionId()
*/
protected String getInstructionId() {
return Words.FOR_ID;
}
/*
* (non-Javadoc)
*
* @see compiler.analizer.BlockInstructionsAnalizer#createTopInfo(java.lang.
* String)
*/
protected List analizeTopInfo(String text) throws AnalizerException {
StringTokenizer tokenizer = new StringTokenizer(text, BLANKS);
if (tokenizer.countTokens() != 5) {
throw new AnalizerException();
}
String iterator = tokenizer.nextToken();
String is = tokenizer.nextToken();
String start = tokenizer.nextToken();
String to = tokenizer.nextToken();
String end = tokenizer.nextToken();
if (validateVariableName(iterator) && is.equals(EQUAL_STRING) && validateOperand(start)
&& to.equals(Words.TO_ID) && validateOperand(end)) {
List list = new ArrayList();
list.add(iterator);
list.add(start);
list.add(end);
return list;
} else {
throw new AnalizerException();
}
}
/**/
} | 23.704545 | 96 | 0.563279 |
df7d57cd5f506b29bc8e6f6a915a1bcc375eaf41 | 352 | import java.util.Scanner;
class PowerOfCryptography {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n;
double p;
while (in.hasNextInt()) {
n = in.nextInt();
p = in.nextDouble();
System.out.println((int) Math.round(Math.pow(Math.E, Math.log(p) / n)));
}
in.close();
}
}
| 18.526316 | 76 | 0.59375 |
b54e9dfe6ad984e2d7f07ab777ab941c607f6e92 | 1,369 | package com.mynamaneet.dolmodloader.file_classes;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class TweeFile {
public TweeFile (File _filePath, String _name, String _parent){
this.filePath = _filePath;
this.name = _name;
this.parent = _parent;
}
public TweeFile (File _filePath, String _name, String _parent, boolean _hasChanged){
this.filePath = _filePath;
this.name = _name;
this.parent = _parent;
this.hasChanged = _hasChanged;
}
private File filePath;
private String name;
private String parent = "";
private ArrayList<DolPassage> passages = new ArrayList<>();
private boolean hasChanged = false;
private boolean overwriten = false;
public File getPath(){
return filePath;
}
public String getName(){
return name;
}
public String getParent(){
return parent;
}
public List<DolPassage> getPassages(){
return passages;
}
public boolean hasChanged(){
return hasChanged;
}
public boolean isOverwriten(){
return overwriten;
}
public void addPassage(DolPassage pass){
passages.add(pass);
}
public void setHasChanged(){
hasChanged = true;
}
public void setOverwriten(){
overwriten = true;
}
}
| 24.017544 | 88 | 0.633309 |
d092376bf3bca85ad3a2262881e83163843539b3 | 332 | package test.call_graph.implement;
/**
* @author adrninistrator
* @date 2021/8/10
* @description:
*/
public class ImplClassL2_1 extends AbstractClassL2 {
@Override
public void f1() {
System.out.println("");
}
@Override
public void f2() {
System.getProperty("");
}
}
| 16.6 | 53 | 0.575301 |
2218d2feb166e4f1754c1279308372d1cb60d956 | 1,367 | package io.appform.databuilderframework.cmplxscenariotest.builders;
import io.appform.databuilderframework.annotations.DataBuilderInfo;
import io.appform.databuilderframework.cmplxscenariotest.ThreadUtils;
import io.appform.databuilderframework.cmplxscenariotest.data.DataA;
import io.appform.databuilderframework.cmplxscenariotest.data.DataA2;
import io.appform.databuilderframework.engine.DataBuilder;
import io.appform.databuilderframework.engine.DataBuilderContext;
import io.appform.databuilderframework.engine.DataBuilderException;
import io.appform.databuilderframework.engine.DataSetAccessor;
import io.appform.databuilderframework.engine.DataValidationException;
import io.appform.databuilderframework.model.Data;
import io.appform.databuilderframework.model.DataSet;
@DataBuilderInfo(name = "BuilderA2", consumes = {"A"}, produces = "A2")
public class BuilderA2 extends DataBuilder{
@Override
public Data process(DataBuilderContext context)
throws DataBuilderException, DataValidationException {
DataSetAccessor dataSetAccessor = DataSet.accessor(context.getDataSet());
DataA dataA = dataSetAccessor.get("A", DataA.class);
String name = Thread.currentThread().getName();
if(dataA.val > 7){ // this builder will run when BuilderA1 is not running
ThreadUtils.INSTANCE.putToSleep(20, "A2");
return new DataA2();
}
return null ;
}
}
| 42.71875 | 75 | 0.822238 |
7881ece10fd7302ae4e94a12fcf78b741fd8d508 | 286 | //API Credentials
//Create at https://dashboard.veridu.com
public class Settings {
// API Key (from https://dashboard.veridu.com/api)
public static final String CLIENT = "";
// API Secret (from https://dashboard.veridu.com/api)
public static final String SECRET = "";
}
| 31.777778 | 57 | 0.688811 |
8bedcfa2a74f86832d4658da2bb16d348041af1a | 6,385 | /*
* Copyright 2018 Nikita Shakarun
*
* 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.mascotcapsule.micro3d.v3;
import android.widget.Toast;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.ViewHandler;
import javax.microedition.util.ContextHolder;
public class Graphics3D {
public static final int COMMAND_AFFINE_INDEX = -2030043136;
public static final int COMMAND_AMBIENT_LIGHT = -1610612736;
public static final int COMMAND_ATTRIBUTE = -2097152000;
public static final int COMMAND_CENTER = -2063597568;
public static final int COMMAND_CLIP = -2080374784;
public static final int COMMAND_DIRECTION_LIGHT = -1593835520;
public static final int COMMAND_END = Integer.MIN_VALUE;
public static final int COMMAND_FLUSH = -2113929216;
public static final int COMMAND_LIST_VERSION_1_0 = -33554431;
public static final int COMMAND_NOP = -2130706432;
public static final int COMMAND_PARALLEL_SCALE = -1879048192;
public static final int COMMAND_PARALLEL_SIZE = -1862270976;
public static final int COMMAND_PERSPECTIVE_FOV = -1845493760;
public static final int COMMAND_PERSPECTIVE_WH = -1828716544;
public static final int COMMAND_TEXTURE_INDEX = -2046820352;
public static final int COMMAND_THRESHOLD = -1358954496;
public static final int ENV_ATTR_LIGHTING = 1;
public static final int ENV_ATTR_SEMI_TRANSPARENT = 8;
public static final int ENV_ATTR_SPHERE_MAP = 2;
public static final int ENV_ATTR_TOON_SHADING = 4;
public static final int PATTR_BLEND_ADD = 64;
public static final int PATTR_BLEND_HALF = 32;
public static final int PATTR_BLEND_NORMAL = 0;
public static final int PATTR_BLEND_SUB = 96;
public static final int PATTR_COLORKEY = 16;
public static final int PATTR_LIGHTING = 1;
public static final int PATTR_SPHERE_MAP = 2;
public static final int PDATA_COLOR_NONE = 0;
public static final int PDATA_COLOR_PER_COMMAND = 1024;
public static final int PDATA_COLOR_PER_FACE = 2048;
public static final int PDATA_NORMAL_NONE = 0;
public static final int PDATA_NORMAL_PER_FACE = 512;
public static final int PDATA_NORMAL_PER_VERTEX = 768;
public static final int PDATA_POINT_SPRITE_PARAMS_PER_CMD = 4096;
public static final int PDATA_POINT_SPRITE_PARAMS_PER_FACE = 8192;
public static final int PDATA_POINT_SPRITE_PARAMS_PER_VERTEX = 12288;
public static final int PDATA_TEXURE_COORD = 12288;
public static final int PDATA_TEXURE_COORD_NONE = 0;
public static final int POINT_SPRITE_LOCAL_SIZE = 0;
public static final int POINT_SPRITE_NO_PERS = 2;
public static final int POINT_SPRITE_PERSPECTIVE = 0;
public static final int POINT_SPRITE_PIXEL_SIZE = 1;
public static final int PRIMITVE_LINES = 33554432;
public static final int PRIMITVE_POINTS = 16777216;
public static final int PRIMITVE_POINT_SPRITES = 83886080;
public static final int PRIMITVE_QUADS = 67108864;
public static final int PRIMITVE_TRIANGLES = 50331648;
private static int ID = 0;
private static boolean mIsBound = false;
private Graphics mGraphics;
private final void checkTargetIsValid() throws IllegalStateException {
if (this.mGraphics == null) {
throw new IllegalStateException("No target is bound");
}
}
public Graphics3D() {
}
public final synchronized void bind(Graphics graphics) throws IllegalStateException, NullPointerException {
if (mIsBound) {
throw new IllegalStateException("Target already bound");
}
this.mGraphics = graphics;
mIsBound = true;
}
public final synchronized void release(Graphics graphics) throws IllegalArgumentException, NullPointerException {
if (graphics != this.mGraphics) {
throw new IllegalArgumentException("Unknown target");
} else if (graphics == this.mGraphics && mIsBound) {
this.mGraphics = null;
mIsBound = false;
}
}
public final void renderPrimitives(Texture texture, int x, int y, FigureLayout layout, Effect3D effect, int command, int numPrimitives, int[] vertexCoords, int[] normals, int[] textureCoords, int[] colors) {
if (layout == null || effect == null) {
throw new NullPointerException();
} else if (vertexCoords == null || normals == null || textureCoords == null || colors == null) {
throw new NullPointerException();
} else if (command < 0) {
throw new IllegalArgumentException();
} else if (numPrimitives <= 0 || numPrimitives >= 256) {
throw new IllegalArgumentException();
}
}
public final void drawCommandList(Texture[] textures, int x, int y, FigureLayout layout, Effect3D effect, int[] commandList) {
if (layout == null || effect == null) {
throw new NullPointerException();
}
if (textures != null) {
for (Texture texture : textures) {
if (texture == null) {
throw new NullPointerException();
}
}
}
if (commandList == null) {
throw new NullPointerException();
}
}
public final void drawCommandList(Texture texture, int x, int y, FigureLayout layout, Effect3D effect, int[] commandList) {
Texture[] ta = null;
if (texture != null) {
ta = new Texture[]{texture};
}
drawCommandList(ta, x, y, layout, effect, commandList);
}
public final void renderFigure(Figure figure, int x, int y, FigureLayout layout, Effect3D effect) throws IllegalStateException {
checkTargetIsValid();
if (figure == null || layout == null || effect == null) {
throw new NullPointerException();
}
}
public final void drawFigure(Figure figure, int x, int y, FigureLayout layout, Effect3D effect) throws IllegalStateException {
checkTargetIsValid();
if (figure == null || layout == null || effect == null) {
throw new NullPointerException();
}
}
public final void flush() throws IllegalStateException {
checkTargetIsValid();
}
public final void dispose() {
}
static {
ViewHandler.postEvent(
() -> Toast.makeText(ContextHolder.getActivity(),
"Mascot Capsule 3D!",
Toast.LENGTH_LONG).show());
}
}
| 38.233533 | 208 | 0.753015 |
9493c5eb48791734e50ca1be87e05300a25a1144 | 1,579 | package travel_agency.users;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class ClientTest {
private Client client;
private Address address;
private final double EPSILON=0.01;
@Before
public void setUp(){
address= new Address("Via Roma", 12, 23600);
client=new Client("Mario Rossi", address, 1200);
}
@Test
public void testClientCreation() {
client=new Client("Dario Rossi", address);
assertEquals(0, client.getBudget(),EPSILON);
}
@Test
public void testGetBudget() {
assertEquals(1200, client.getBudget(),EPSILON);
}
@Test
public void testSetBudget() {
client.setBudget(1000);
assertEquals(1000, client.getBudget(),EPSILON);
}
@Test
public void testGetName() {
assertEquals("Mario Rossi", client.getName());
}
@Test
public void testSetName() {
client.setName("Gino Bianchi");
assertEquals("Gino Bianchi", client.getName());
}
@Test
public void testGetAddress() {
assertEquals(address, client.getAddress());
}
@Test
public void testSetAddress() {
address=new Address("Via Strozzi", 53, 83560);
client.setAddress(address);
assertEquals(address, client.getAddress());
}
@Test
public void testPay() {
client.pay(200);
assertEquals(1000, client.getBudget(), EPSILON);
}
@Test
public void testRechargeBudget() {
client.rechargeBudget(123.23);
assertEquals(1323.23, client.getBudget(), EPSILON);
}
@Test
public void testToString(){
assertEquals("[Client"+"/"+"Mario Rossi"+"/"+address.toString()+"/Budget:"+1200.0+"]", client.toString());
}
}
| 20.506494 | 108 | 0.699177 |
9b8a8e2563436ca902f0fd03983032db23c92a13 | 77 | package com.example.administrator.lphfirst;
public class DEl {
// 333个
}
| 12.833333 | 43 | 0.727273 |
6cf0172d903e260de2219f05ca9833ce73526b15 | 873 | package org.example.config;
import org.example.properties.DemoProperties;
import org.example.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(DemoProperties.class)
@ConditionalOnProperty(
prefix = "demo",
name = "isOpen",
havingValue = "true"
)
public class DemoConfig {
@Autowired
private DemoProperties demoProperties;
@Bean(name = "demo")
public DemoService demoService() {
return new DemoService(demoProperties.getSayWhat(), demoProperties.getToWho());
}
}
| 30.103448 | 87 | 0.783505 |
ea861f75494371859394f8d7b9e2c224aa03f86b | 1,045 | package cn.chuanwise.xiaoming.language;
import cn.chuanwise.toolkit.preservable.Preservable;
import cn.chuanwise.util.MapUtil;
import cn.chuanwise.xiaoming.language.sentence.Sentence;
import cn.chuanwise.xiaoming.object.PluginObject;
import java.io.File;
import java.util.Map;
import java.util.Optional;
/**
* 小明的提示文本管理器
* @author Chuanwise
*/
public interface Language extends Preservable, PluginObject {
Map<String, Sentence> getSentences();
default Optional<Sentence> getSentence(String identifier) {
return MapUtil.get(getSentences(), identifier).toOptional();
}
default String getSentenceValue(String identifier) {
return getSentence(identifier).map(Sentence::getValue).orElse(identifier);
}
default void addSentence(String identifier, Sentence sentence) {
getSentences().put(identifier, sentence);
}
default void addSentence(String identifier, String defaultValue, String... customValues) {
addSentence(identifier, new Sentence(defaultValue, customValues));
}
} | 30.735294 | 94 | 0.750239 |
25764e8fa8983e9969fdee884d93343d3cc3233e | 10,100 | /*
* Original author: Daniel Jaschob <djaschob .at. uw.edu>
*
* Copyright 2018 University of Washington - Seattle, WA
*
* 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.yeastrc.limelight.limelight_webapp.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.yeastrc.limelight.limelight_webapp.db.Limelight_JDBC_Base;
import org.yeastrc.limelight.limelight_webapp.db_dto.SearchDataLookupParametersLookupDTO;
import org.yeastrc.limelight.limelight_webapp.exceptions.LimelightInternalErrorException;
/**
* table search_data_lookup_parameters
*
*/
@Component
public class SearchDataLookupParametersLookupDAO extends Limelight_JDBC_Base implements SearchDataLookupParametersLookupDAO_IF {
private static final Logger log = LoggerFactory.getLogger( SearchDataLookupParametersLookupDAO.class );
/**
* @param id
* @return
* @throws SQLException
*/
@Override
public SearchDataLookupParametersLookupDTO getPartialForId( int id ) throws SQLException {
SearchDataLookupParametersLookupDTO result = null;
final String querySQL = "SELECT * FROM search_data_lookup_parameters WHERE id = ?";
try ( Connection dbConnection = super.getDBConnection();
PreparedStatement preparedStatement = dbConnection.prepareStatement( querySQL ) ) {
preparedStatement.setInt( 1, id );
try ( ResultSet rs = preparedStatement.executeQuery() ) {
if ( rs.next() ) {
result = populatePartialFromResultSet( rs );
}
}
} catch ( RuntimeException e ) {
String msg = "SQL: " + querySQL;
log.error( msg, e );
throw e;
} catch ( SQLException e ) {
String msg = "SQL: " + querySQL;
log.error( msg, e );
throw e;
}
return result;
}
/**
* @param hashOfMainParams
* @return
* @throws SQLException
*/
@Override
public List<SearchDataLookupParametersLookupDTO> getPartialForHashOfMainParams( String hashOfMainParams ) throws SQLException {
List<SearchDataLookupParametersLookupDTO> resultList = new ArrayList<>();
final String querySQL = "SELECT * FROM search_data_lookup_parameters WHERE hash_of_main_params = ?";
try ( Connection dbConnection = super.getDBConnection();
PreparedStatement preparedStatement = dbConnection.prepareStatement( querySQL ) ) {
preparedStatement.setString( 1, hashOfMainParams );
try ( ResultSet rs = preparedStatement.executeQuery() ) {
while ( rs.next() ) {
SearchDataLookupParametersLookupDTO result = populatePartialFromResultSet( rs );
resultList.add( result );
}
}
} catch ( RuntimeException e ) {
String msg = "SQL: " + querySQL;
log.error( msg, e );
throw e;
} catch ( SQLException e ) {
String msg = "SQL: " + querySQL;
log.error( msg, e );
throw e;
}
return resultList;
}
private final static String querySQL_getFor_HashOfMainParams_HashCollisionIndex =
"SELECT * FROM search_data_lookup_parameters "
+ " WHERE hash_of_main_params = ? AND hash_collision_index = ?";
/**
* @param hashOfMainParams
* @param hashCollisitionIndex
* @return
* @throws SQLException
*/
@Override
public List<SearchDataLookupParametersLookupDTO> getPartialFor_HashOfMainParams_HashCollisionIndex(
String hashOfMainParams, int hashCollisionIndex ) throws SQLException {
List<SearchDataLookupParametersLookupDTO> resultList = new ArrayList<>();
try ( Connection dbConnection = super.getDBConnection();
PreparedStatement preparedStatement = dbConnection.prepareStatement( querySQL_getFor_HashOfMainParams_HashCollisionIndex ) ) {
preparedStatement.setString( 1, hashOfMainParams );
preparedStatement.setInt( 2, hashCollisionIndex );
try ( ResultSet rs = preparedStatement.executeQuery() ) {
while ( rs.next() ) {
SearchDataLookupParametersLookupDTO result = populatePartialFromResultSet( rs );
resultList.add( result );
}
}
} catch ( RuntimeException e ) {
String msg = "SQL: " + querySQL_getFor_HashOfMainParams_HashCollisionIndex;
log.error( msg, e );
throw e;
} catch ( SQLException e ) {
String msg = "SQL: " + querySQL_getFor_HashOfMainParams_HashCollisionIndex;
log.error( msg, e );
throw e;
}
return resultList;
}
/**
* @param rs
* @return
* @throws SQLException
*/
public SearchDataLookupParametersLookupDTO populatePartialFromResultSet( ResultSet rs ) throws SQLException {
SearchDataLookupParametersLookupDTO result = new SearchDataLookupParametersLookupDTO();
result.setId( rs.getInt( "id" ) );
result.setHashOfMainParams( rs.getString( "hash_of_main_params" ) );
result.setHashCollisionIndex( rs.getInt( "hash_collision_index" ) );
result.setLookupParametersJSONMainData( rs.getString( "lookup_parameters_json__main_data" ) );
result.setVersionNumber( rs.getInt( "version_number_main_json" ) );
result.setRootIdsOnlyJSON( rs.getString( "root_ids_only_json" ) );
return result;
}
private static final String INSERT_SQL =
"INSERT INTO search_data_lookup_parameters "
+ " ( "
+ " hash_of_main_params, hash_collision_index, "
+ " root_id_type_id, root_ids_only_json, "
+ " lookup_parameters_json__main_data, version_number_main_json, "
+ " created_by_user_id, created_by_user_type, created_date_time, created_by_remote_ip "
+ " ) "
+ " VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ? )";
/* (non-Javadoc)
* @see org.yeastrc.limelight.limelight_webapp.dao.SearchDataLookupParametersLookupDAO_IF#save(org.yeastrc.limelight.limelight_webapp.db_dto.SearchDataLookupParametersLookupDTO)
*/
@Override
// Spring DB Transactions
@Transactional( propagation = Propagation.MANDATORY ) // Do NOT throw checked exceptions, they don't trigger rollback in Spring Transactions
public void save( SearchDataLookupParametersLookupDTO item ) {
// Use Spring JdbcTemplate so Transactions work properly
// How to get the auto-increment primary key for the inserted record
try {
KeyHolder keyHolder = new GeneratedKeyHolder();
int rowsUpdated = this.getJdbcTemplate().update(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement pstmt =
connection.prepareStatement( INSERT_SQL, Statement.RETURN_GENERATED_KEYS );
int counter = 0;
counter++;
pstmt.setString( counter, item.getHashOfMainParams() );
counter++;
pstmt.setInt( counter, item.getHashCollisionIndex() );
counter++;
pstmt.setInt( counter, item.getRootIdType().value() );
counter++;
pstmt.setString( counter, item.getRootIdsOnlyJSON() );
counter++;
pstmt.setString( counter, item.getLookupParametersJSONMainData() );
counter++;
pstmt.setInt( counter, item.getVersionNumber() );
counter++;
if ( item.getCreatedByUserId() != null ) {
pstmt.setInt( counter, item.getCreatedByUserId() );
} else {
pstmt.setNull(counter, java.sql.Types.INTEGER );
}
counter++;
pstmt.setString( counter, item.getCreatedByUserType().value() );
counter++;
pstmt.setString( counter, item.getCreatedByRemoteIP() );
return pstmt;
}
},
keyHolder);
Number insertedKey = keyHolder.getKey();
long insertedKeyLong = insertedKey.longValue();
if ( insertedKeyLong > Integer.MAX_VALUE ) {
String msg = "Inserted key is too large, is > Integer.MAX_VALUE. insertedKey: " + insertedKey;
log.error( msg );
throw new LimelightInternalErrorException( msg );
}
item.setId( (int) insertedKeyLong ); // Inserted auto-increment primary key for the inserted record
} catch ( RuntimeException e ) {
String msg = "SearchDataLookupParametersLookupDTO: " + item + ", SQL: " + INSERT_SQL;
log.error( msg, e );
throw e;
}
}
////
private static final String UPDATE_LAST_ACCESSED_SQL =
"UPDATE search_data_lookup_parameters "
+ " SET last_accessed = NOW() WHERE id = ?";
// Spring DB Transactions
@Transactional( propagation = Propagation.REQUIRED ) // Do NOT throw checked exceptions, they don't trigger rollback in Spring Transactions
@Override
/*
* SET last_accessed = NOW() WHERE id = ?
*/
public void updateLastAccessed( int id ) {
// Use Spring JdbcTemplate so Transactions work properly
// How to get the auto-increment primary key for the inserted record
try {
int rowsUpdated = this.getJdbcTemplate().update(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement pstmt =
connection.prepareStatement( UPDATE_LAST_ACCESSED_SQL );
int counter = 0;
counter++;
pstmt.setInt( counter, id );
return pstmt;
}
});
} catch ( RuntimeException e ) {
String msg = "id: " + id + ", SQL: " + UPDATE_LAST_ACCESSED_SQL;
log.error( msg, e );
throw e;
}
}
}
| 32.899023 | 178 | 0.716436 |
30f2a81e478e11c04e9b8327d189eeae80781300 | 1,486 | package main;
import com.andrewmagid.gui.ParentWindow;
import processing.core.PApplet;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
public class Helper {
public static ArrayList<Integer> unsortedArr = new ArrayList<>();
public static Random r = new Random();
public static ArrayList<ArrayList<Integer>> sorted;
// public static ArrayList<ArrayList<Integer>> indicesHighlighted;
public static ArrayList<ArrayList<Map.Entry<Integer, int[]>>> indicesHighlighted;
public static boolean isAlgoRunning = false;
public static PApplet p;
public static int originalUnsortedSize;
//global arrays
public static int cardinality = ParentWindow.INIT_CARDINALITY;
public static int upperBd = ParentWindow.INIT_UPPERBD;
Helper(PApplet p) {
Helper.p = p;
}
public static void setRunningAlgoStateTrue() {
isAlgoRunning = true;
}
public static void setRunningAlgoStateFalse() {
isAlgoRunning = false;
}
public static void generateNewDataset(int size, int upperbd) {
unsortedArr.clear();
for (int i = 0; i < size; i++) {
unsortedArr.add(r.nextInt(upperbd) + 1);
}
}
public static void startLoop() {
p.loop();
}
public static void generateDatasetAndDisplay() {
Helper.setRunningAlgoStateFalse();
Helper.generateNewDataset(Helper.cardinality, Helper.upperBd);
Helper.startLoop();
}
}
| 27.518519 | 85 | 0.682369 |
6b8d33febfa0251f2f63d239df147713a2bf6edf | 760 | package com.springdataapi.model.jpa;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
@Entity
public class Entidade {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long entidadeId;
private String nome;
@Transient
private String estado;
public Long getEntidadeId() {
return entidadeId;
}
public void setEntidadeId(Long entidadeId) {
this.entidadeId = entidadeId;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
}
| 17.272727 | 52 | 0.751316 |
602e68854f74f36549321602bd3ca1812a081ad6 | 158 | package getta.gettaroo;
public class Constants {
public static final String MOD_ID = "gettaroo";
public static final int INVENTORY_ROW_SLOTS = 9;
}
| 19.75 | 52 | 0.740506 |
a7b70d1c2d26c168830b20986bbb6f628066dbe3 | 5,761 | package WeightLearner;
import org.ejml.data.SingularMatrixException;
import org.ejml.simple.SimpleMatrix;
import java.util.*;
public class LARS {
/**
* r,u,w都是列向量,即列数(column)为 1
*/
static SimpleMatrix r;
static SimpleMatrix u;
static SimpleMatrix w;
static SimpleMatrix X;
// public LARS(SimpleMatrix m0,int numPositive, int numNegative){
// SimpleMatrix positive = new SimpleMatrix(numPositive,1);
// SimpleMatrix negitive = new SimpleMatrix(numNegative,1);
// positive.set(1);
// negitive.set(-1);
// LARS.r = positive.combine(numPositive,0,negitive);
// LARS.w = new SimpleMatrix(1,1);
//
// r.print();
// w.print();
// }
public static void initialize (SimpleMatrix m0,int numPositive, int numNegative){
SimpleMatrix positive = new SimpleMatrix(numPositive,1);
SimpleMatrix negitive = new SimpleMatrix(numNegative,1);
positive.set(1);
negitive.set(-1);
LARS.r = positive.combine(numPositive,0,negitive);
LARS.w = new SimpleMatrix(1,1);
X = new SimpleMatrix(m0);
r.print();
w.print();
X.print();
}
/**
* 根据特征向量mk与特征矩阵X(包含mk,即不需要再做X=XU{mk}了)以及上一次迭代的残差r0,计算r,u,w
* @param mk
*/
public static boolean calculate(SimpleMatrix mk){
SimpleMatrix oldX = new SimpleMatrix(X);
X = X.combine(0,X.numCols(),mk);
System.out.println("X: " + X);
SimpleMatrix XTX = X.transpose().mult(X);
System.out.println("XTX: " + XTX);
SimpleMatrix OneVector = new SimpleMatrix(X.numCols(),1);
OneVector.set(1);
SimpleMatrix OneMatrix;
try{
System.out.println("OneVector: " + OneVector );
OneMatrix = OneVector.transpose().mult(XTX.invert()).mult(OneVector);
System.out.println("invert: " + XTX.invert());
System.out.println("OneMatrix: " + OneMatrix);
}catch (SingularMatrixException e){
OneMatrix = OneVector.transpose().mult(XTX.pseudoInverse()).mult(OneVector);
// OneMatrix.print();
}
assert OneMatrix.numRows()==1&&OneMatrix.numCols()==1;
double scale = OneMatrix.get(0,0);
if (scale < 0){
X = oldX;
return false;
}
scale = Math.sqrt(scale);
try {
LARS.u = XTX.transpose().invert().scale(scale).mult(OneVector);
// LARS.u.print();
}catch (SingularMatrixException e){
LARS.u = XTX.transpose().pseudoInverse().scale(scale).mult(OneVector);
// LARS.u.print();
}
double corr = cosine(mk,LARS.r);
ArrayList<Double> Gama = new ArrayList<Double>();
for (int j=0;j < X.numCols()-1;j++){
double cos = cosine(X.cols(j,j+1),LARS.r);
SimpleMatrix MjTU = X.cols(j,j+1).transpose().mult(X.mult(LARS.u));
assert MjTU.numRows()==1&&MjTU.numCols()==1;
double mjTu = MjTU.get(0,0);
double minus = (corr-cos)/(scale-mjTu);
double plus = (corr+cos)/(scale+mjTu);
double min = Math.min(minus,plus);
if (min > 0){
Gama.add(min);
// System.out.println("add a min:"+min);
}
}
double gama;
if (Gama.size()>0){
gama = Collections.min(Gama);
// System.out.println("gama = "+gama);
}else {
gama = 0;
// System.out.println("gama = "+gama);
}
LARS.r = LARS.r .minus(X.mult(LARS.u).scale(gama));
LARS.w = LARS.w.combine(LARS.w.numRows(),0,new SimpleMatrix(1,1));
LARS.w = LARS.w .plus(LARS.u.scale(gama));
// System.out.println("***************");
// u.print();
// r.print();
// w.print();
// X.print();
// System.out.println("***************");
return true;
}
public static double cosine(SimpleMatrix vector1, SimpleMatrix vector2){
assert vector1.numCols()==1&&vector2.numCols()==1&&vector1.numRows()==vector2.numRows();
double dot = 0;
for(int i = 0; i < vector1.numRows();i++){
dot +=vector1.get(i)*vector2.get(i);
}
return dot/(vector1.normF()*vector2.normF());
}
/**
*
* 将r中元素以list的形式返回
*/
public static List<Double> getR(){
ArrayList<Double> R = new ArrayList<Double>();
for(int i = 0; i < LARS.r.numRows();i++ ){
R.add(LARS.r.get(i));
}
return R;
}
/**
*
* 将w中元素以list的形式返回
*/
public static List<Double> getW(){
ArrayList<Double> W = new ArrayList<Double>();
for(int i = 0; i < LARS.w.numRows();i++ ){
W.add(LARS.w.get(i));
}
return W;
}
public static List<List<Double>> getX(){
ArrayList<List<Double>> listX = new ArrayList<List<Double>>();
for(int i = 0;i < LARS.X.numCols();i++){
ArrayList<Double> column = new ArrayList<Double>();
for (int j = 0;j < LARS.X.numRows();j++){
column.add(LARS.X.get(j,i));
}
listX.add(column);
}
return listX;
}
public static void main(String[] args){
double[][] mk0 = {{0.0014903129657228018}, {0.0014903129657228018}, {0.0}, {0.0}};
SimpleMatrix m0 = new SimpleMatrix(mk0);
LARS.initialize(m0,2,2);
double[][] mk1 = {{0.6014903129657228018}, {0.6014903129657228018}, {0.0}, {0.0}};
SimpleMatrix m1 = new SimpleMatrix(mk1);
System.out.println(LARS.calculate(m1));
System.out.println(getR());
// LARS.r.print();
// System.out.println(LARS.getX());
}
}
| 33.888235 | 96 | 0.540184 |
43c4637489fe86400f257fbce67867f51eb1bb00 | 1,243 | /*
* Apache License 2.0 见 LICENSE 文档
*
* https://github.com/srctar/bconfig-client
*/
package com.qyp.raft.hook;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
/**
* 用于集中管理系统里面的待销毁对象。
*
* @author yupeng.qin
* @since 2017-07-04
*/
public class DestroyAdaptor {
private final static DestroyAdaptor DA = new DestroyAdaptor();
private final List<Destroyable> destroyAbles = new LinkedList();
private DestroyAdaptor() {
// 双重保险. 在Servlet环境和普通Java环境中
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
List<Destroyable> list = get();
if (list.size() > 0) {
Iterator<Destroyable> it = list.iterator();
while (it.hasNext()) {
it.next().destroy();
it.remove();
}
}
}
}));
}
public static DestroyAdaptor getInstance() {
return DA;
}
public void add(Destroyable destroyable) {
destroyAbles.add(destroyable);
}
public synchronized List<Destroyable> get() {
return destroyAbles;
}
}
| 23.018519 | 72 | 0.558327 |
c2ee54cd9b29a83f5c8897e5586cb77929324458 | 2,811 | package xyz.jpenilla.wanderingtrades.command;
import cloud.commandframework.Command;
import cloud.commandframework.meta.CommandMeta;
import com.google.common.collect.ImmutableList;
import java.util.stream.Stream;
import org.bukkit.command.CommandSender;
import xyz.jpenilla.jmplib.Chat;
import xyz.jpenilla.wanderingtrades.WanderingTrades;
import xyz.jpenilla.wanderingtrades.config.Lang;
public class CommandWanderingTrades implements WTCommand {
private final WanderingTrades wanderingTrades;
private final CommandManager mgr;
private final Chat chat;
public CommandWanderingTrades(WanderingTrades wanderingTrades, CommandManager mgr) {
this.wanderingTrades = wanderingTrades;
this.mgr = mgr;
this.chat = wanderingTrades.chat();
}
@Override
public void register() {
final Command.Builder<CommandSender> wt = mgr.commandBuilder("wt");
/* About Command */
final Command<CommandSender> about = wt
.meta(CommandMeta.DESCRIPTION, wanderingTrades.langConfig().get(Lang.COMMAND_WT_ABOUT))
.literal("about")
.handler(context -> Stream.of(
"<strikethrough><gradient:white:blue>-------------</gradient><gradient:blue:white>-------------",
"<hover:show_text:'<rainbow>click me!'><click:open_url:" + wanderingTrades.getDescription().getWebsite() + ">" + wanderingTrades.getName() + " <gradient:blue:green>" + wanderingTrades.getDescription().getVersion(),
"<gray>By <gradient:gold:yellow>jmp",
"<strikethrough><gradient:white:blue>-------------</gradient><gradient:blue:white>-------------"
).map(Chat::getCenteredMessage).forEach(string -> chat.send(context.getSender(), string))).build();
/* Reload Command */
final Command<CommandSender> reload = wt
.meta(CommandMeta.DESCRIPTION, wanderingTrades.langConfig().get(Lang.COMMAND_WT_RELOAD))
.literal("reload")
.permission("wanderingtrades.reload")
.handler(c -> mgr.taskRecipe().begin(c).synchronous(context -> {
chat.sendParsed(context.getSender(), Chat.getCenteredMessage(wanderingTrades.langConfig().get(Lang.COMMAND_RELOAD)));
wanderingTrades.config().load();
wanderingTrades.langConfig().load();
wanderingTrades.listeners().reload();
this.wanderingTrades.storedPlayers().updateCacheTimerState();
chat.sendParsed(context.getSender(), Chat.getCenteredMessage(wanderingTrades.langConfig().get(Lang.COMMAND_RELOAD_DONE)));
}).execute()).build();
mgr.register(ImmutableList.of(about, reload));
}
}
| 50.196429 | 238 | 0.647101 |
dbf13612f3bc5c65bf42fed45c84f3c684d45c91 | 1,993 | /*
* Copyright 2020 Justified Solutions
* SPDX-License-Identifier: Apache-2.0
*/
package com.justifiedsolutions.justpdf.pdf.doc;
import com.justifiedsolutions.justpdf.pdf.object.PDFIndirectObject;
import com.justifiedsolutions.justpdf.pdf.object.PDFInteger;
import com.justifiedsolutions.justpdf.pdf.object.PDFNull;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.*;
public class PDFTrailerTest {
@Test
public void hasInfo() {
PDFTrailer trailer = new PDFTrailer();
assertFalse(trailer.hasInfo());
PDFIndirectObject indirectObject = new PDFIndirectObject(PDFNull.NULL);
trailer.setInfo(indirectObject.getReference());
assertTrue(trailer.hasInfo());
}
@Test
public void writeToPDF() throws IOException {
PDFTrailer trailer = new PDFTrailer();
PDFIndirectObject info = new PDFIndirectObject(PDFNull.NULL);
PDFIndirectObject catalog = new PDFIndirectObject(PDFNull.NULL);
PDFInteger size = new PDFInteger(3);
PDFInteger totalBytes = new PDFInteger(42);
ByteArrayOutputStream expected = new ByteArrayOutputStream();
expected.writeBytes("trailer\n<</Info ".getBytes(StandardCharsets.US_ASCII));
info.getReference().writeToPDF(expected);
expected.writeBytes("/Root ".getBytes(StandardCharsets.US_ASCII));
catalog.getReference().writeToPDF(expected);
expected.writeBytes("/Size 3>>\nstartxref\n42\n%%EOF".getBytes(StandardCharsets.US_ASCII));
trailer.setInfo(info.getReference());
trailer.setRoot(catalog.getReference());
trailer.setSize(size);
trailer.setTotalBytes(totalBytes);
ByteArrayOutputStream actual = new ByteArrayOutputStream();
trailer.writeToPDF(actual);
assertArrayEquals(expected.toByteArray(), actual.toByteArray());
}
} | 36.236364 | 99 | 0.723532 |
c686a223b2240f16ff0883c40ac7ecfece0fd829 | 240,751 | /**
* JacobGen generated file --- do not edit
*
* (http://www.sourceforge.net/projects/jacob-project */
package com.jacobgen.microsoft.msword;
import com.jacob.com.*;
public class _Application extends Dispatch {
public static final String componentName = "Word._Application";
public _Application() {
super(componentName);
}
/**
* This constructor is used instead of a case operation to
* turn a Dispatch object into a wider object - it must exist
* in every wrapper class whose instances may be returned from
* method calls wrapped in VT_DISPATCH Variants.
*/
public _Application(Dispatch d) {
// take over the IDispatch pointer
m_pDispatch = d.m_pDispatch;
// null out the input's pointer
d.m_pDispatch = 0;
}
public _Application(String compName) {
super(compName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Application
*/
public Application getApplication() {
return new Application(Dispatch.get(this, "Application").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getCreator() {
return Dispatch.get(this, "Creator").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Object
*/
public Object getParent() {
return Dispatch.get(this, "Parent");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getName() {
return Dispatch.get(this, "Name").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Documents
*/
public Documents getDocuments() {
return new Documents(Dispatch.get(this, "Documents").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Windows
*/
public Windows getWindows() {
return new Windows(Dispatch.get(this, "Windows").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Document
*/
public Document getActiveDocument() {
return new Document(Dispatch.get(this, "ActiveDocument").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Window
*/
public Window getActiveWindow() {
return new Window(Dispatch.get(this, "ActiveWindow").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Selection
*/
public Selection getSelection() {
return new Selection(Dispatch.get(this, "Selection").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Object
*/
public Object getWordBasic() {
return Dispatch.get(this, "WordBasic");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type RecentFiles
*/
public RecentFiles getRecentFiles() {
return new RecentFiles(Dispatch.get(this, "RecentFiles").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Template
*/
public Template getNormalTemplate() {
return new Template(Dispatch.get(this, "NormalTemplate").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type System
*/
public System getSystem() {
return new System(Dispatch.get(this, "System").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type AutoCorrect
*/
public AutoCorrect getAutoCorrect() {
return new AutoCorrect(Dispatch.get(this, "AutoCorrect").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type FontNames
*/
public FontNames getFontNames() {
return new FontNames(Dispatch.get(this, "FontNames").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type FontNames
*/
public FontNames getLandscapeFontNames() {
return new FontNames(Dispatch.get(this, "LandscapeFontNames").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type FontNames
*/
public FontNames getPortraitFontNames() {
return new FontNames(Dispatch.get(this, "PortraitFontNames").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Languages
*/
public Languages getLanguages() {
return new Languages(Dispatch.get(this, "Languages").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Assistant
*/
public Assistant getAssistant() {
return new Assistant(Dispatch.get(this, "Assistant").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Browser
*/
public Browser getBrowser() {
return new Browser(Dispatch.get(this, "Browser").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type FileConverters
*/
public FileConverters getFileConverters() {
return new FileConverters(Dispatch.get(this, "FileConverters").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MailingLabel
*/
public MailingLabel getMailingLabel() {
return new MailingLabel(Dispatch.get(this, "MailingLabel").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Dialogs
*/
public Dialogs getDialogs() {
return new Dialogs(Dispatch.get(this, "Dialogs").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type CaptionLabels
*/
public CaptionLabels getCaptionLabels() {
return new CaptionLabels(Dispatch.get(this, "CaptionLabels").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type AutoCaptions
*/
public AutoCaptions getAutoCaptions() {
return new AutoCaptions(Dispatch.get(this, "AutoCaptions").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type AddIns
*/
public AddIns getAddIns() {
return new AddIns(Dispatch.get(this, "AddIns").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getVisible() {
return Dispatch.get(this, "Visible").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param visible an input-parameter of type boolean
*/
public void setVisible(boolean visible) {
Dispatch.put(this, "Visible", new Variant(visible));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getVersion() {
return Dispatch.get(this, "Version").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getScreenUpdating() {
return Dispatch.get(this, "ScreenUpdating").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param screenUpdating an input-parameter of type boolean
*/
public void setScreenUpdating(boolean screenUpdating) {
Dispatch.put(this, "ScreenUpdating", new Variant(screenUpdating));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getPrintPreview() {
return Dispatch.get(this, "PrintPreview").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param printPreview an input-parameter of type boolean
*/
public void setPrintPreview(boolean printPreview) {
Dispatch.put(this, "PrintPreview", new Variant(printPreview));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Tasks
*/
public Tasks getTasks() {
return new Tasks(Dispatch.get(this, "Tasks").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayStatusBar() {
return Dispatch.get(this, "DisplayStatusBar").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayStatusBar an input-parameter of type boolean
*/
public void setDisplayStatusBar(boolean displayStatusBar) {
Dispatch.put(this, "DisplayStatusBar", new Variant(displayStatusBar));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getSpecialMode() {
return Dispatch.get(this, "SpecialMode").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getUsableWidth() {
return Dispatch.get(this, "UsableWidth").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getUsableHeight() {
return Dispatch.get(this, "UsableHeight").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getMathCoprocessorAvailable() {
return Dispatch.get(this, "MathCoprocessorAvailable").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getMouseAvailable() {
return Dispatch.get(this, "MouseAvailable").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param index an input-parameter of type int
* @return the result is of type Variant
*/
public Variant getInternational(int index) {
return Dispatch.call(this, "International", new Variant(index));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getBuild() {
return Dispatch.get(this, "Build").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getCapsLock() {
return Dispatch.get(this, "CapsLock").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getNumLock() {
return Dispatch.get(this, "NumLock").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getUserName() {
return Dispatch.get(this, "UserName").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param userName an input-parameter of type String
*/
public void setUserName(String userName) {
Dispatch.put(this, "UserName", userName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getUserInitials() {
return Dispatch.get(this, "UserInitials").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param userInitials an input-parameter of type String
*/
public void setUserInitials(String userInitials) {
Dispatch.put(this, "UserInitials", userInitials);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getUserAddress() {
return Dispatch.get(this, "UserAddress").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param userAddress an input-parameter of type String
*/
public void setUserAddress(String userAddress) {
Dispatch.put(this, "UserAddress", userAddress);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Object
*/
public Object getMacroContainer() {
return Dispatch.get(this, "MacroContainer");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayRecentFiles() {
return Dispatch.get(this, "DisplayRecentFiles").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayRecentFiles an input-parameter of type boolean
*/
public void setDisplayRecentFiles(boolean displayRecentFiles) {
Dispatch.put(this, "DisplayRecentFiles", new Variant(displayRecentFiles));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type CommandBars
*/
public CommandBars getCommandBars() {
return new CommandBars(Dispatch.get(this, "CommandBars").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @return the result is of type SynonymInfo
*/
public SynonymInfo getSynonymInfo(String word) {
return new SynonymInfo(Dispatch.call(this, "SynonymInfo", word).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param word an input-parameter of type String
* @param languageID an input-parameter of type Variant
* @return the result is of type SynonymInfo
*/
public SynonymInfo getSynonymInfo(String word, Variant languageID) {
SynonymInfo result_of_SynonymInfo = new SynonymInfo(Dispatch.call(this, "SynonymInfo", word, languageID).toDispatch());
return result_of_SynonymInfo;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type VBE
*/
public VBE getVBE() {
return new VBE(Dispatch.get(this, "VBE").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getDefaultSaveFormat() {
return Dispatch.get(this, "DefaultSaveFormat").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param defaultSaveFormat an input-parameter of type String
*/
public void setDefaultSaveFormat(String defaultSaveFormat) {
Dispatch.put(this, "DefaultSaveFormat", defaultSaveFormat);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type ListGalleries
*/
public ListGalleries getListGalleries() {
return new ListGalleries(Dispatch.get(this, "ListGalleries").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getActivePrinter() {
return Dispatch.get(this, "ActivePrinter").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param activePrinter an input-parameter of type String
*/
public void setActivePrinter(String activePrinter) {
Dispatch.put(this, "ActivePrinter", activePrinter);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Templates
*/
public Templates getTemplates() {
return new Templates(Dispatch.get(this, "Templates").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Object
*/
public Object getCustomizationContext() {
return Dispatch.get(this, "CustomizationContext");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param customizationContext an input-parameter of type Object
*/
public void setCustomizationContext(Object customizationContext) {
Dispatch.put(this, "CustomizationContext", customizationContext);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type KeyBindings
*/
public KeyBindings getKeyBindings() {
return new KeyBindings(Dispatch.get(this, "KeyBindings").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param keyCategory an input-parameter of type int
* @param command an input-parameter of type String
* @return the result is of type KeysBoundTo
*/
public KeysBoundTo getKeysBoundTo(int keyCategory, String command) {
return new KeysBoundTo(Dispatch.call(this, "KeysBoundTo", new Variant(keyCategory), command).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param keyCategory an input-parameter of type int
* @param command an input-parameter of type String
* @param commandParameter an input-parameter of type Variant
* @return the result is of type KeysBoundTo
*/
public KeysBoundTo getKeysBoundTo(int keyCategory, String command, Variant commandParameter) {
KeysBoundTo result_of_KeysBoundTo = new KeysBoundTo(Dispatch.call(this, "KeysBoundTo", new Variant(keyCategory), command, commandParameter).toDispatch());
return result_of_KeysBoundTo;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param keyCode an input-parameter of type int
* @return the result is of type KeyBinding
*/
public KeyBinding getFindKey(int keyCode) {
return new KeyBinding(Dispatch.call(this, "FindKey", new Variant(keyCode)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param keyCode an input-parameter of type int
* @param keyCode2 an input-parameter of type Variant
* @return the result is of type KeyBinding
*/
public KeyBinding getFindKey(int keyCode, Variant keyCode2) {
KeyBinding result_of_FindKey = new KeyBinding(Dispatch.call(this, "FindKey", new Variant(keyCode), keyCode2).toDispatch());
return result_of_FindKey;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getCaption() {
return Dispatch.get(this, "Caption").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param caption an input-parameter of type String
*/
public void setCaption(String caption) {
Dispatch.put(this, "Caption", caption);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getPath() {
return Dispatch.get(this, "Path").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayScrollBars() {
return Dispatch.get(this, "DisplayScrollBars").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayScrollBars an input-parameter of type boolean
*/
public void setDisplayScrollBars(boolean displayScrollBars) {
Dispatch.put(this, "DisplayScrollBars", new Variant(displayScrollBars));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getStartupPath() {
return Dispatch.get(this, "StartupPath").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param startupPath an input-parameter of type String
*/
public void setStartupPath(String startupPath) {
Dispatch.put(this, "StartupPath", startupPath);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getBackgroundSavingStatus() {
return Dispatch.get(this, "BackgroundSavingStatus").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getBackgroundPrintingStatus() {
return Dispatch.get(this, "BackgroundPrintingStatus").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getLeft() {
return Dispatch.get(this, "Left").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param left an input-parameter of type int
*/
public void setLeft(int left) {
Dispatch.put(this, "Left", new Variant(left));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getTop() {
return Dispatch.get(this, "Top").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param top an input-parameter of type int
*/
public void setTop(int top) {
Dispatch.put(this, "Top", new Variant(top));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getWidth() {
return Dispatch.get(this, "Width").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param width an input-parameter of type int
*/
public void setWidth(int width) {
Dispatch.put(this, "Width", new Variant(width));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getHeight() {
return Dispatch.get(this, "Height").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param height an input-parameter of type int
*/
public void setHeight(int height) {
Dispatch.put(this, "Height", new Variant(height));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getWindowState() {
return Dispatch.get(this, "WindowState").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param windowState an input-parameter of type int
*/
public void setWindowState(int windowState) {
Dispatch.put(this, "WindowState", new Variant(windowState));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayAutoCompleteTips() {
return Dispatch.get(this, "DisplayAutoCompleteTips").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayAutoCompleteTips an input-parameter of type boolean
*/
public void setDisplayAutoCompleteTips(boolean displayAutoCompleteTips) {
Dispatch.put(this, "DisplayAutoCompleteTips", new Variant(displayAutoCompleteTips));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Options
*/
public Options getOptions() {
return new Options(Dispatch.get(this, "Options").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getDisplayAlerts() {
return Dispatch.get(this, "DisplayAlerts").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayAlerts an input-parameter of type int
*/
public void setDisplayAlerts(int displayAlerts) {
Dispatch.put(this, "DisplayAlerts", new Variant(displayAlerts));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Dictionaries
*/
public Dictionaries getCustomDictionaries() {
return new Dictionaries(Dispatch.get(this, "CustomDictionaries").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getPathSeparator() {
return Dispatch.get(this, "PathSeparator").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param statusBar an input-parameter of type String
*/
public void setStatusBar(String statusBar) {
Dispatch.put(this, "StatusBar", statusBar);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getMAPIAvailable() {
return Dispatch.get(this, "MAPIAvailable").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayScreenTips() {
return Dispatch.get(this, "DisplayScreenTips").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayScreenTips an input-parameter of type boolean
*/
public void setDisplayScreenTips(boolean displayScreenTips) {
Dispatch.put(this, "DisplayScreenTips", new Variant(displayScreenTips));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getEnableCancelKey() {
return Dispatch.get(this, "EnableCancelKey").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param enableCancelKey an input-parameter of type int
*/
public void setEnableCancelKey(int enableCancelKey) {
Dispatch.put(this, "EnableCancelKey", new Variant(enableCancelKey));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getUserControl() {
return Dispatch.get(this, "UserControl").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type FileSearch
*/
public FileSearch getFileSearch() {
return new FileSearch(Dispatch.get(this, "FileSearch").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getMailSystem() {
return Dispatch.get(this, "MailSystem").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getDefaultTableSeparator() {
return Dispatch.get(this, "DefaultTableSeparator").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param defaultTableSeparator an input-parameter of type String
*/
public void setDefaultTableSeparator(String defaultTableSeparator) {
Dispatch.put(this, "DefaultTableSeparator", defaultTableSeparator);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getShowVisualBasicEditor() {
return Dispatch.get(this, "ShowVisualBasicEditor").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param showVisualBasicEditor an input-parameter of type boolean
*/
public void setShowVisualBasicEditor(boolean showVisualBasicEditor) {
Dispatch.put(this, "ShowVisualBasicEditor", new Variant(showVisualBasicEditor));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getBrowseExtraFileTypes() {
return Dispatch.get(this, "BrowseExtraFileTypes").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param browseExtraFileTypes an input-parameter of type String
*/
public void setBrowseExtraFileTypes(String browseExtraFileTypes) {
Dispatch.put(this, "BrowseExtraFileTypes", browseExtraFileTypes);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param object an input-parameter of type Object
* @return the result is of type boolean
*/
public boolean getIsObjectValid(Object object) {
return Dispatch.call(this, "IsObjectValid", object).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type HangulHanjaConversionDictionaries
*/
public HangulHanjaConversionDictionaries getHangulHanjaDictionaries() {
return new HangulHanjaConversionDictionaries(Dispatch.get(this, "HangulHanjaDictionaries").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MailMessage
*/
public MailMessage getMailMessage() {
return new MailMessage(Dispatch.get(this, "MailMessage").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getFocusInMailHeader() {
return Dispatch.get(this, "FocusInMailHeader").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param saveChanges an input-parameter of type Variant
* @param originalFormat an input-parameter of type Variant
*/
public void quit(Variant saveChanges, Variant originalFormat) {
Dispatch.call(this, "Quit", saveChanges, originalFormat);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param saveChanges an input-parameter of type Variant
*/
public void quit(Variant saveChanges) {
Dispatch.call(this, "Quit", saveChanges);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void quit() {
Dispatch.call(this, "Quit");
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param saveChanges an input-parameter of type Variant
* @param originalFormat an input-parameter of type Variant
* @param routeDocument an input-parameter of type Variant
*/
public void quit(Variant saveChanges, Variant originalFormat, Variant routeDocument) {
Dispatch.call(this, "Quit", saveChanges, originalFormat, routeDocument);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void screenRefresh() {
Dispatch.call(this, "ScreenRefresh");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages) {
Dispatch.callN(this, "PrintOutOld", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies) {
Dispatch.call(this, "PrintOutOld", background, append, range, outputFileName, from, to, item, copies);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item) {
Dispatch.call(this, "PrintOutOld", background, append, range, outputFileName, from, to, item);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to) {
Dispatch.call(this, "PrintOutOld", background, append, range, outputFileName, from, to);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName, Variant from) {
Dispatch.call(this, "PrintOutOld", background, append, range, outputFileName, from);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range, Variant outputFileName) {
Dispatch.call(this, "PrintOutOld", background, append, range, outputFileName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append, Variant range) {
Dispatch.call(this, "PrintOutOld", background, append, range);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
*/
public void printOutOld(Variant background, Variant append) {
Dispatch.call(this, "PrintOutOld", background, append);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
*/
public void printOutOld(Variant background) {
Dispatch.call(this, "PrintOutOld", background);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void printOutOld() {
Dispatch.call(this, "PrintOutOld");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type String
*/
public void lookupNameProperties(String name) {
Dispatch.call(this, "LookupNameProperties", name);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param unavailableFont an input-parameter of type String
* @param substituteFont an input-parameter of type String
*/
public void substituteFont(String unavailableFont, String substituteFont) {
Dispatch.call(this, "SubstituteFont", unavailableFont, substituteFont);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param times an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean repeat(Variant times) {
return Dispatch.call(this, "Repeat", times).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean repeat() {
return Dispatch.call(this, "Repeat").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param channel an input-parameter of type int
* @param command an input-parameter of type String
*/
public void dDEExecute(int channel, String command) {
Dispatch.call(this, "DDEExecute", new Variant(channel), command);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param app an input-parameter of type String
* @param topic an input-parameter of type String
* @return the result is of type int
*/
public int dDEInitiate(String app, String topic) {
return Dispatch.call(this, "DDEInitiate", app, topic).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param channel an input-parameter of type int
* @param item an input-parameter of type String
* @param data an input-parameter of type String
*/
public void dDEPoke(int channel, String item, String data) {
Dispatch.call(this, "DDEPoke", new Variant(channel), item, data);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param channel an input-parameter of type int
* @param item an input-parameter of type String
* @return the result is of type String
*/
public String dDERequest(int channel, String item) {
return Dispatch.call(this, "DDERequest", new Variant(channel), item).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param channel an input-parameter of type int
*/
public void dDETerminate(int channel) {
Dispatch.call(this, "DDETerminate", new Variant(channel));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void dDETerminateAll() {
Dispatch.call(this, "DDETerminateAll");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param arg1 an input-parameter of type int
* @param arg2 an input-parameter of type Variant
* @param arg3 an input-parameter of type Variant
* @param arg4 an input-parameter of type Variant
* @return the result is of type int
*/
public int buildKeyCode(int arg1, Variant arg2, Variant arg3, Variant arg4) {
return Dispatch.call(this, "BuildKeyCode", new Variant(arg1), arg2, arg3, arg4).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param arg1 an input-parameter of type int
* @param arg2 an input-parameter of type Variant
* @param arg3 an input-parameter of type Variant
* @return the result is of type int
*/
public int buildKeyCode(int arg1, Variant arg2, Variant arg3) {
return Dispatch.call(this, "BuildKeyCode", new Variant(arg1), arg2, arg3).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param arg1 an input-parameter of type int
* @param arg2 an input-parameter of type Variant
* @return the result is of type int
*/
public int buildKeyCode(int arg1, Variant arg2) {
return Dispatch.call(this, "BuildKeyCode", new Variant(arg1), arg2).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param arg1 an input-parameter of type int
* @return the result is of type int
*/
public int buildKeyCode(int arg1) {
return Dispatch.call(this, "BuildKeyCode", new Variant(arg1)).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param keyCode an input-parameter of type int
* @param keyCode2 an input-parameter of type Variant
* @return the result is of type String
*/
public String keyString(int keyCode, Variant keyCode2) {
return Dispatch.call(this, "KeyString", new Variant(keyCode), keyCode2).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param keyCode an input-parameter of type int
* @return the result is of type String
*/
public String keyString(int keyCode) {
return Dispatch.call(this, "KeyString", new Variant(keyCode)).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param source an input-parameter of type String
* @param destination an input-parameter of type String
* @param name an input-parameter of type String
* @param object an input-parameter of type int
*/
public void organizerCopy(String source, String destination, String name, int object) {
Dispatch.call(this, "OrganizerCopy", source, destination, name, new Variant(object));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param source an input-parameter of type String
* @param name an input-parameter of type String
* @param object an input-parameter of type int
*/
public void organizerDelete(String source, String name, int object) {
Dispatch.call(this, "OrganizerDelete", source, name, new Variant(object));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param source an input-parameter of type String
* @param name an input-parameter of type String
* @param newName an input-parameter of type String
* @param object an input-parameter of type int
*/
public void organizerRename(String source, String name, String newName, int object) {
Dispatch.call(this, "OrganizerRename", source, name, newName, new Variant(object));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param tagID an input-parameter of type SafeArray
* @param value an input-parameter of type SafeArray
*/
public void addAddress(SafeArray tagID, SafeArray value) {
Dispatch.call(this, "AddAddress", tagID, value);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @param displaySelectDialog an input-parameter of type Variant
* @param selectDialog an input-parameter of type Variant
* @param checkNamesDialog an input-parameter of type Variant
* @param recentAddressesChoice an input-parameter of type Variant
* @param updateRecentAddresses an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText, Variant displaySelectDialog, Variant selectDialog, Variant checkNamesDialog, Variant recentAddressesChoice, Variant updateRecentAddresses) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText, displaySelectDialog, selectDialog, checkNamesDialog, recentAddressesChoice, updateRecentAddresses).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @param displaySelectDialog an input-parameter of type Variant
* @param selectDialog an input-parameter of type Variant
* @param checkNamesDialog an input-parameter of type Variant
* @param recentAddressesChoice an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText, Variant displaySelectDialog, Variant selectDialog, Variant checkNamesDialog, Variant recentAddressesChoice) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText, displaySelectDialog, selectDialog, checkNamesDialog, recentAddressesChoice).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @param displaySelectDialog an input-parameter of type Variant
* @param selectDialog an input-parameter of type Variant
* @param checkNamesDialog an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText, Variant displaySelectDialog, Variant selectDialog, Variant checkNamesDialog) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText, displaySelectDialog, selectDialog, checkNamesDialog).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @param displaySelectDialog an input-parameter of type Variant
* @param selectDialog an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText, Variant displaySelectDialog, Variant selectDialog) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText, displaySelectDialog, selectDialog).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @param displaySelectDialog an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText, Variant displaySelectDialog) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText, displaySelectDialog).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @param useAutoText an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties, Variant useAutoText) {
return Dispatch.call(this, "GetAddress", name, addressProperties, useAutoText).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @param addressProperties an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name, Variant addressProperties) {
return Dispatch.call(this, "GetAddress", name, addressProperties).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type Variant
* @return the result is of type String
*/
public String getAddress(Variant name) {
return Dispatch.call(this, "GetAddress", name).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getAddress() {
return Dispatch.call(this, "GetAddress").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param string an input-parameter of type String
* @return the result is of type boolean
*/
public boolean checkGrammar(String string) {
return Dispatch.call(this, "CheckGrammar", string).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @param customDictionary9 an input-parameter of type Variant
* @param customDictionary10 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8, Variant customDictionary9, Variant customDictionary10) {
return Dispatch.callN(this, "CheckSpelling", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8, customDictionary9, customDictionary10}).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @param customDictionary9 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8, Variant customDictionary9) {
return Dispatch.callN(this, "CheckSpelling", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8, customDictionary9}).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8) {
return Dispatch.callN(this, "CheckSpelling", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8}).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7) {
return Dispatch.callN(this, "CheckSpelling", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7}).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6) {
return Dispatch.callN(this, "CheckSpelling", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6}).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4, customDictionary5).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3, customDictionary4).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2, Variant customDictionary3) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2, customDictionary3).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant customDictionary2) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase, mainDictionary, customDictionary2).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase, mainDictionary).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary, Variant ignoreUppercase) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary, ignoreUppercase).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @return the result is of type boolean
*/
public boolean checkSpelling(String word, Variant customDictionary) {
return Dispatch.call(this, "CheckSpelling", word, customDictionary).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @return the result is of type boolean
*/
public boolean checkSpelling(String word) {
return Dispatch.call(this, "CheckSpelling", word).changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void resetIgnoreAll() {
Dispatch.call(this, "ResetIgnoreAll");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @param customDictionary9 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8, Variant customDictionary9) {
return new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8, customDictionary9}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8) {
return new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7) {
return new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6) {
return new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5) {
return new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase, mainDictionary).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary, ignoreUppercase).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word, customDictionary).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param word an input-parameter of type String
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word) {
return new SpellingSuggestions(Dispatch.call(this, "GetSpellingSuggestions", word).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param word an input-parameter of type String
* @param customDictionary an input-parameter of type Variant
* @param ignoreUppercase an input-parameter of type Variant
* @param mainDictionary an input-parameter of type Variant
* @param suggestionMode an input-parameter of type Variant
* @param customDictionary2 an input-parameter of type Variant
* @param customDictionary3 an input-parameter of type Variant
* @param customDictionary4 an input-parameter of type Variant
* @param customDictionary5 an input-parameter of type Variant
* @param customDictionary6 an input-parameter of type Variant
* @param customDictionary7 an input-parameter of type Variant
* @param customDictionary8 an input-parameter of type Variant
* @param customDictionary9 an input-parameter of type Variant
* @param customDictionary10 an input-parameter of type Variant
* @return the result is of type SpellingSuggestions
*/
public SpellingSuggestions getSpellingSuggestions(String word, Variant customDictionary, Variant ignoreUppercase, Variant mainDictionary, Variant suggestionMode, Variant customDictionary2, Variant customDictionary3, Variant customDictionary4, Variant customDictionary5, Variant customDictionary6, Variant customDictionary7, Variant customDictionary8, Variant customDictionary9, Variant customDictionary10) {
SpellingSuggestions result_of_GetSpellingSuggestions = new SpellingSuggestions(Dispatch.callN(this, "GetSpellingSuggestions", new Object[] { word, customDictionary, ignoreUppercase, mainDictionary, suggestionMode, customDictionary2, customDictionary3, customDictionary4, customDictionary5, customDictionary6, customDictionary7, customDictionary8, customDictionary9, customDictionary10}).toDispatch());
return result_of_GetSpellingSuggestions;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void goBack() {
Dispatch.call(this, "GoBack");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param helpType an input-parameter of type Variant
*/
public void help(Variant helpType) {
Dispatch.call(this, "Help", helpType);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void automaticChange() {
Dispatch.call(this, "AutomaticChange");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void showMe() {
Dispatch.call(this, "ShowMe");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void helpTool() {
Dispatch.call(this, "HelpTool");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Window
*/
public Window newWindow() {
return new Window(Dispatch.call(this, "NewWindow").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param listAllCommands an input-parameter of type boolean
*/
public void listCommands(boolean listAllCommands) {
Dispatch.call(this, "ListCommands", new Variant(listAllCommands));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void showClipboard() {
Dispatch.call(this, "ShowClipboard");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param when an input-parameter of type Variant
* @param name an input-parameter of type String
* @param tolerance an input-parameter of type Variant
*/
public void onTime(Variant when, String name, Variant tolerance) {
Dispatch.call(this, "OnTime", when, name, tolerance);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param when an input-parameter of type Variant
* @param name an input-parameter of type String
*/
public void onTime(Variant when, String name) {
Dispatch.call(this, "OnTime", when, name);
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param when an input-parameter of type Variant
* @param name an input-parameter of type String
* @param tolerance an input-parameter of type Variant
*/
public void onTime(Variant when, String name, Variant tolerance) {
Dispatch.call(this, "OnTime", when, name, tolerance);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void nextLetter() {
Dispatch.call(this, "NextLetter");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param zone an input-parameter of type String
* @param server an input-parameter of type String
* @param volume an input-parameter of type String
* @param user an input-parameter of type Variant
* @param userPassword an input-parameter of type Variant
* @param volumePassword an input-parameter of type Variant
* @return the result is of type short
*/
public short mountVolume(String zone, String server, String volume, Variant user, Variant userPassword, Variant volumePassword) {
return Dispatch.call(this, "MountVolume", zone, server, volume, user, userPassword, volumePassword).changeType(Variant.VariantShort).getShort();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param zone an input-parameter of type String
* @param server an input-parameter of type String
* @param volume an input-parameter of type String
* @param user an input-parameter of type Variant
* @param userPassword an input-parameter of type Variant
* @return the result is of type short
*/
public short mountVolume(String zone, String server, String volume, Variant user, Variant userPassword) {
return Dispatch.call(this, "MountVolume", zone, server, volume, user, userPassword).changeType(Variant.VariantShort).getShort();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param zone an input-parameter of type String
* @param server an input-parameter of type String
* @param volume an input-parameter of type String
* @param user an input-parameter of type Variant
* @return the result is of type short
*/
public short mountVolume(String zone, String server, String volume, Variant user) {
return Dispatch.call(this, "MountVolume", zone, server, volume, user).changeType(Variant.VariantShort).getShort();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param zone an input-parameter of type String
* @param server an input-parameter of type String
* @param volume an input-parameter of type String
* @return the result is of type short
*/
public short mountVolume(String zone, String server, String volume) {
return Dispatch.call(this, "MountVolume", zone, server, volume).changeType(Variant.VariantShort).getShort();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param string an input-parameter of type String
* @return the result is of type String
*/
public String cleanString(String string) {
return Dispatch.call(this, "CleanString", string).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void sendFax() {
Dispatch.call(this, "SendFax");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param path an input-parameter of type String
*/
public void changeFileOpenDirectory(String path) {
Dispatch.call(this, "ChangeFileOpenDirectory", path);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
*/
public void runOld(String macroName) {
Dispatch.call(this, "RunOld", macroName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void goForward() {
Dispatch.call(this, "GoForward");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param left an input-parameter of type int
* @param top an input-parameter of type int
*/
public void move(int left, int top) {
Dispatch.call(this, "Move", new Variant(left), new Variant(top));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param width an input-parameter of type int
* @param height an input-parameter of type int
*/
public void resize(int width, int height) {
Dispatch.call(this, "Resize", new Variant(width), new Variant(height));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param inches an input-parameter of type float
* @return the result is of type float
*/
public float inchesToPoints(float inches) {
return Dispatch.call(this, "InchesToPoints", new Variant(inches)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param centimeters an input-parameter of type float
* @return the result is of type float
*/
public float centimetersToPoints(float centimeters) {
return Dispatch.call(this, "CentimetersToPoints", new Variant(centimeters)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param millimeters an input-parameter of type float
* @return the result is of type float
*/
public float millimetersToPoints(float millimeters) {
return Dispatch.call(this, "MillimetersToPoints", new Variant(millimeters)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param picas an input-parameter of type float
* @return the result is of type float
*/
public float picasToPoints(float picas) {
return Dispatch.call(this, "PicasToPoints", new Variant(picas)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param lines an input-parameter of type float
* @return the result is of type float
*/
public float linesToPoints(float lines) {
return Dispatch.call(this, "LinesToPoints", new Variant(lines)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToInches(float points) {
return Dispatch.call(this, "PointsToInches", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToCentimeters(float points) {
return Dispatch.call(this, "PointsToCentimeters", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToMillimeters(float points) {
return Dispatch.call(this, "PointsToMillimeters", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToPicas(float points) {
return Dispatch.call(this, "PointsToPicas", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToLines(float points) {
return Dispatch.call(this, "PointsToLines", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void activate() {
Dispatch.call(this, "Activate");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @param fVertical an input-parameter of type Variant
* @return the result is of type float
*/
public float pointsToPixels(float points, Variant fVertical) {
return Dispatch.call(this, "PointsToPixels", new Variant(points), fVertical).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param points an input-parameter of type float
* @return the result is of type float
*/
public float pointsToPixels(float points) {
return Dispatch.call(this, "PointsToPixels", new Variant(points)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param points an input-parameter of type float
* @param fVertical an input-parameter of type Variant
* @return the result is of type float
*/
public float pointsToPixels(float points, Variant fVertical) {
float result_of_PointsToPixels = Dispatch.call(this, "PointsToPixels", new Variant(points), fVertical).changeType(Variant.VariantFloat).getFloat();
return result_of_PointsToPixels;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param pixels an input-parameter of type float
* @param fVertical an input-parameter of type Variant
* @return the result is of type float
*/
public float pixelsToPoints(float pixels, Variant fVertical) {
return Dispatch.call(this, "PixelsToPoints", new Variant(pixels), fVertical).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param pixels an input-parameter of type float
* @return the result is of type float
*/
public float pixelsToPoints(float pixels) {
return Dispatch.call(this, "PixelsToPoints", new Variant(pixels)).changeType(Variant.VariantFloat).getFloat();
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param pixels an input-parameter of type float
* @param fVertical an input-parameter of type Variant
* @return the result is of type float
*/
public float pixelsToPoints(float pixels, Variant fVertical) {
float result_of_PixelsToPoints = Dispatch.call(this, "PixelsToPoints", new Variant(pixels), fVertical).changeType(Variant.VariantFloat).getFloat();
return result_of_PixelsToPoints;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void keyboardLatin() {
Dispatch.call(this, "KeyboardLatin");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void keyboardBidi() {
Dispatch.call(this, "KeyboardBidi");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void toggleKeyboard() {
Dispatch.call(this, "ToggleKeyboard");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param langId an input-parameter of type int
* @return the result is of type int
*/
public int keyboard(int langId) {
return Dispatch.call(this, "Keyboard", new Variant(langId)).changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int keyboard() {
return Dispatch.call(this, "Keyboard").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String productCode() {
return Dispatch.call(this, "ProductCode").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type DefaultWebOptions
*/
public DefaultWebOptions defaultWebOptions() {
return new DefaultWebOptions(Dispatch.call(this, "DefaultWebOptions").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param range an input-parameter of type Variant
* @param cid an input-parameter of type Variant
* @param piCSE an input-parameter of type Variant
*/
public void discussionSupport(Variant range, Variant cid, Variant piCSE) {
Dispatch.call(this, "DiscussionSupport", range, cid, piCSE);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param name an input-parameter of type String
* @param documentType an input-parameter of type int
*/
public void setDefaultTheme(String name, int documentType) {
Dispatch.call(this, "SetDefaultTheme", name, new Variant(documentType));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param documentType an input-parameter of type int
* @return the result is of type String
*/
public String getDefaultTheme(int documentType) {
return Dispatch.call(this, "GetDefaultTheme", new Variant(documentType)).toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type EmailOptions
*/
public EmailOptions getEmailOptions() {
return new EmailOptions(Dispatch.get(this, "EmailOptions").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MsoLanguageID
*/
public MsoLanguageID getLanguage() {
return new MsoLanguageID(Dispatch.get(this, "Language").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type COMAddIns
*/
public COMAddIns getCOMAddIns() {
return new COMAddIns(Dispatch.get(this, "COMAddIns").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getCheckLanguage() {
return Dispatch.get(this, "CheckLanguage").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param checkLanguage an input-parameter of type boolean
*/
public void setCheckLanguage(boolean checkLanguage) {
Dispatch.put(this, "CheckLanguage", new Variant(checkLanguage));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type LanguageSettings
*/
public LanguageSettings getLanguageSettings() {
return new LanguageSettings(Dispatch.get(this, "LanguageSettings").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDummy1() {
return Dispatch.get(this, "Dummy1").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type AnswerWizard
*/
public AnswerWizard getAnswerWizard() {
return new AnswerWizard(Dispatch.get(this, "AnswerWizard").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MsoFeatureInstall
*/
public MsoFeatureInstall getFeatureInstall() {
return new MsoFeatureInstall(Dispatch.get(this, "FeatureInstall").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param featureInstall an input-parameter of type MsoFeatureInstall
*/
public void setFeatureInstall(MsoFeatureInstall featureInstall) {
Dispatch.put(this, "FeatureInstall", featureInstall);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
* @param printZoomPaperWidth an input-parameter of type Variant
* @param printZoomPaperHeight an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow, Variant printZoomPaperWidth, Variant printZoomPaperHeight) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow, printZoomPaperWidth, printZoomPaperHeight});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
* @param printZoomPaperWidth an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow, Variant printZoomPaperWidth) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow, printZoomPaperWidth});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages) {
Dispatch.callN(this, "PrintOut2000", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies) {
Dispatch.call(this, "PrintOut2000", background, append, range, outputFileName, from, to, item, copies);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item) {
Dispatch.call(this, "PrintOut2000", background, append, range, outputFileName, from, to, item);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to) {
Dispatch.call(this, "PrintOut2000", background, append, range, outputFileName, from, to);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName, Variant from) {
Dispatch.call(this, "PrintOut2000", background, append, range, outputFileName, from);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range, Variant outputFileName) {
Dispatch.call(this, "PrintOut2000", background, append, range, outputFileName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append, Variant range) {
Dispatch.call(this, "PrintOut2000", background, append, range);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
*/
public void printOut2000(Variant background, Variant append) {
Dispatch.call(this, "PrintOut2000", background, append);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
*/
public void printOut2000(Variant background) {
Dispatch.call(this, "PrintOut2000", background);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void printOut2000() {
Dispatch.call(this, "PrintOut2000");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @param varg26 an input-parameter of type Variant
* @param varg27 an input-parameter of type Variant
* @param varg28 an input-parameter of type Variant
* @param varg29 an input-parameter of type Variant
* @param varg30 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25, Variant varg26, Variant varg27, Variant varg28, Variant varg29, Variant varg30) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26, varg27, varg28, varg29, varg30});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @param varg26 an input-parameter of type Variant
* @param varg27 an input-parameter of type Variant
* @param varg28 an input-parameter of type Variant
* @param varg29 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25, Variant varg26, Variant varg27, Variant varg28, Variant varg29) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26, varg27, varg28, varg29});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @param varg26 an input-parameter of type Variant
* @param varg27 an input-parameter of type Variant
* @param varg28 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25, Variant varg26, Variant varg27, Variant varg28) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26, varg27, varg28});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @param varg26 an input-parameter of type Variant
* @param varg27 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25, Variant varg26, Variant varg27) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26, varg27});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @param varg26 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25, Variant varg26) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25, varg26});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @param varg25 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24, Variant varg25) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24, varg25});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @param varg24 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23, Variant varg24) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23, varg24});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @param varg23 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22, Variant varg23) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22, varg23});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @param varg22 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21, Variant varg22) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21, varg22});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @param varg21 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20, Variant varg21) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20, varg21});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @param varg20 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19, Variant varg20) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19, varg20});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @param varg19 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18, Variant varg19) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18, varg19});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @param varg18 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17, Variant varg18) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17, varg18});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @param varg17 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16, Variant varg17) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16, varg17});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @param varg16 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15, Variant varg16) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15, varg16});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @param varg15 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14, Variant varg15) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14, varg15});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @param varg14 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13, Variant varg14) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13, varg14});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @param varg13 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12, Variant varg13) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12, varg13});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @param varg12 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11, Variant varg12) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11, varg12});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @param varg11 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10, Variant varg11) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10, varg11});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @param varg10 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9, Variant varg10) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9, varg10});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @param varg9 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8, Variant varg9) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8, varg9});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @param varg8 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7, Variant varg8) {
return Dispatch.callN(this, "Run", new Object[] { macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7, varg8});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @param varg7 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6, Variant varg7) {
return Dispatch.call(this, "Run", macroName, varg1, varg2, varg3, varg4, varg5, varg6, varg7);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @param varg6 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5, Variant varg6) {
return Dispatch.call(this, "Run", macroName, varg1, varg2, varg3, varg4, varg5, varg6);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @param varg5 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4, Variant varg5) {
return Dispatch.call(this, "Run", macroName, varg1, varg2, varg3, varg4, varg5);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @param varg4 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3, Variant varg4) {
return Dispatch.call(this, "Run", macroName, varg1, varg2, varg3, varg4);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @param varg3 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2, Variant varg3) {
return Dispatch.call(this, "Run", macroName, varg1, varg2, varg3);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @param varg2 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1, Variant varg2) {
return Dispatch.call(this, "Run", macroName, varg1, varg2);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @param varg1 an input-parameter of type Variant
* @return the result is of type Variant
*/
public Variant run(String macroName, Variant varg1) {
return Dispatch.call(this, "Run", macroName, varg1);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param macroName an input-parameter of type String
* @return the result is of type Variant
*/
public Variant run(String macroName) {
return Dispatch.call(this, "Run", macroName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
* @param printZoomPaperWidth an input-parameter of type Variant
* @param printZoomPaperHeight an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow, Variant printZoomPaperWidth, Variant printZoomPaperHeight) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow, printZoomPaperWidth, printZoomPaperHeight});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
* @param printZoomPaperWidth an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow, Variant printZoomPaperWidth) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow, printZoomPaperWidth});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies) {
Dispatch.call(this, "PrintOut", background, append, range, outputFileName, from, to, item, copies);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item) {
Dispatch.call(this, "PrintOut", background, append, range, outputFileName, from, to, item);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to) {
Dispatch.call(this, "PrintOut", background, append, range, outputFileName, from, to);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from) {
Dispatch.call(this, "PrintOut", background, append, range, outputFileName, from);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName) {
Dispatch.call(this, "PrintOut", background, append, range, outputFileName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range) {
Dispatch.call(this, "PrintOut", background, append, range);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append) {
Dispatch.call(this, "PrintOut", background, append);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param background an input-parameter of type Variant
*/
public void printOut(Variant background) {
Dispatch.call(this, "PrintOut", background);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void printOut() {
Dispatch.call(this, "PrintOut");
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param background an input-parameter of type Variant
* @param append an input-parameter of type Variant
* @param range an input-parameter of type Variant
* @param outputFileName an input-parameter of type Variant
* @param from an input-parameter of type Variant
* @param to an input-parameter of type Variant
* @param item an input-parameter of type Variant
* @param copies an input-parameter of type Variant
* @param pages an input-parameter of type Variant
* @param pageType an input-parameter of type Variant
* @param printToFile an input-parameter of type Variant
* @param collate an input-parameter of type Variant
* @param fileName an input-parameter of type Variant
* @param activePrinterMacGX an input-parameter of type Variant
* @param manualDuplexPrint an input-parameter of type Variant
* @param printZoomColumn an input-parameter of type Variant
* @param printZoomRow an input-parameter of type Variant
* @param printZoomPaperWidth an input-parameter of type Variant
* @param printZoomPaperHeight an input-parameter of type Variant
*/
public void printOut(Variant background, Variant append, Variant range, Variant outputFileName, Variant from, Variant to, Variant item, Variant copies, Variant pages, Variant pageType, Variant printToFile, Variant collate, Variant fileName, Variant activePrinterMacGX, Variant manualDuplexPrint, Variant printZoomColumn, Variant printZoomRow, Variant printZoomPaperWidth, Variant printZoomPaperHeight) {
Dispatch.callN(this, "PrintOut", new Object[] { background, append, range, outputFileName, from, to, item, copies, pages, pageType, printToFile, collate, fileName, activePrinterMacGX, manualDuplexPrint, printZoomColumn, printZoomRow, printZoomPaperWidth, printZoomPaperHeight});
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MsoAutomationSecurity
*/
public MsoAutomationSecurity getAutomationSecurity() {
return new MsoAutomationSecurity(Dispatch.get(this, "AutomationSecurity").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param automationSecurity an input-parameter of type MsoAutomationSecurity
*/
public void setAutomationSecurity(MsoAutomationSecurity automationSecurity) {
Dispatch.put(this, "AutomationSecurity", automationSecurity);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param fileDialogType an input-parameter of type MsoFileDialogType
* @return the result is of type FileDialog
*/
public FileDialog getFileDialog(MsoFileDialogType fileDialogType) {
return new FileDialog(Dispatch.call(this, "FileDialog", fileDialogType).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getEmailTemplate() {
return Dispatch.get(this, "EmailTemplate").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param emailTemplate an input-parameter of type String
*/
public void setEmailTemplate(String emailTemplate) {
Dispatch.put(this, "EmailTemplate", emailTemplate);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getShowWindowsInTaskbar() {
return Dispatch.get(this, "ShowWindowsInTaskbar").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param showWindowsInTaskbar an input-parameter of type boolean
*/
public void setShowWindowsInTaskbar(boolean showWindowsInTaskbar) {
Dispatch.put(this, "ShowWindowsInTaskbar", new Variant(showWindowsInTaskbar));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type NewFile
*/
public NewFile getNewDocument() {
return new NewFile(Dispatch.get(this, "NewDocument").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getShowStartupDialog() {
return Dispatch.get(this, "ShowStartupDialog").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param showStartupDialog an input-parameter of type boolean
*/
public void setShowStartupDialog(boolean showStartupDialog) {
Dispatch.put(this, "ShowStartupDialog", new Variant(showStartupDialog));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type AutoCorrect
*/
public AutoCorrect getAutoCorrectEmail() {
return new AutoCorrect(Dispatch.get(this, "AutoCorrectEmail").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type TaskPanes
*/
public TaskPanes getTaskPanes() {
return new TaskPanes(Dispatch.get(this, "TaskPanes").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDefaultLegalBlackline() {
return Dispatch.get(this, "DefaultLegalBlackline").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param defaultLegalBlackline an input-parameter of type boolean
*/
public void setDefaultLegalBlackline(boolean defaultLegalBlackline) {
Dispatch.put(this, "DefaultLegalBlackline", new Variant(defaultLegalBlackline));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean dummy2() {
return Dispatch.call(this, "Dummy2").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type SmartTagRecognizers
*/
public SmartTagRecognizers getSmartTagRecognizers() {
return new SmartTagRecognizers(Dispatch.get(this, "SmartTagRecognizers").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type SmartTagTypes
*/
public SmartTagTypes getSmartTagTypes() {
return new SmartTagTypes(Dispatch.get(this, "SmartTagTypes").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type XMLNamespaces
*/
public XMLNamespaces getXMLNamespaces() {
return new XMLNamespaces(Dispatch.get(this, "XMLNamespaces").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void putFocusInMailHeader() {
Dispatch.call(this, "PutFocusInMailHeader");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getArbitraryXMLSupportAvailable() {
return Dispatch.get(this, "ArbitraryXMLSupportAvailable").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getBuildFull() {
return Dispatch.get(this, "BuildFull").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type String
*/
public String getBuildFeatureCrew() {
return Dispatch.get(this, "BuildFeatureCrew").toString();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param fileName an input-parameter of type String
*/
public void loadMasterList(String fileName) {
Dispatch.call(this, "LoadMasterList", fileName);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param revisedAuthor an input-parameter of type String
* @param ignoreAllComparisonWarnings an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String revisedAuthor, boolean ignoreAllComparisonWarnings) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), revisedAuthor, new Variant(ignoreAllComparisonWarnings)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param revisedAuthor an input-parameter of type String
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String revisedAuthor) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), revisedAuthor}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders) {
return new Document(Dispatch.callN(this, "CompareDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument, int destination) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument, new Variant(destination)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @return the result is of type Document
*/
public Document compareDocuments(Document originalDocument, Document revisedDocument) {
return new Document(Dispatch.call(this, "CompareDocuments", originalDocument, revisedDocument).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param originalAuthor an input-parameter of type String
* @param revisedAuthor an input-parameter of type String
* @param formatFrom an input-parameter of type int
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String originalAuthor, String revisedAuthor, int formatFrom) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), originalAuthor, revisedAuthor, new Variant(formatFrom)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param originalAuthor an input-parameter of type String
* @param revisedAuthor an input-parameter of type String
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String originalAuthor, String revisedAuthor) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), originalAuthor, revisedAuthor}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param originalAuthor an input-parameter of type String
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String originalAuthor) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), originalAuthor}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders) {
return new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders)}).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination), new Variant(granularity)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument, new Variant(destination)).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument) {
return new Document(Dispatch.call(this, "MergeDocuments", originalDocument, revisedDocument).toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).
* @param originalDocument an input-parameter of type Document
* @param revisedDocument an input-parameter of type Document
* @param destination an input-parameter of type int
* @param granularity an input-parameter of type int
* @param compareFormatting an input-parameter of type boolean
* @param compareCaseChanges an input-parameter of type boolean
* @param compareWhitespace an input-parameter of type boolean
* @param compareTables an input-parameter of type boolean
* @param compareHeaders an input-parameter of type boolean
* @param compareFootnotes an input-parameter of type boolean
* @param compareTextboxes an input-parameter of type boolean
* @param compareFields an input-parameter of type boolean
* @param compareComments an input-parameter of type boolean
* @param compareMoves an input-parameter of type boolean
* @param originalAuthor an input-parameter of type String
* @param revisedAuthor an input-parameter of type String
* @param formatFrom an input-parameter of type int
* @return the result is of type Document
*/
public Document mergeDocuments(Document originalDocument, Document revisedDocument, int destination, int granularity, boolean compareFormatting, boolean compareCaseChanges, boolean compareWhitespace, boolean compareTables, boolean compareHeaders, boolean compareFootnotes, boolean compareTextboxes, boolean compareFields, boolean compareComments, boolean compareMoves, String originalAuthor, String revisedAuthor, int formatFrom) {
Document result_of_MergeDocuments = new Document(Dispatch.callN(this, "MergeDocuments", new Object[] { originalDocument, revisedDocument, new Variant(destination), new Variant(granularity), new Variant(compareFormatting), new Variant(compareCaseChanges), new Variant(compareWhitespace), new Variant(compareTables), new Variant(compareHeaders), new Variant(compareFootnotes), new Variant(compareTextboxes), new Variant(compareFields), new Variant(compareComments), new Variant(compareMoves), originalAuthor, revisedAuthor, new Variant(formatFrom)}).toDispatch());
return result_of_MergeDocuments;
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type Bibliography
*/
public Bibliography getBibliography() {
return new Bibliography(Dispatch.get(this, "Bibliography").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getShowStylePreviews() {
return Dispatch.get(this, "ShowStylePreviews").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param showStylePreviews an input-parameter of type boolean
*/
public void setShowStylePreviews(boolean showStylePreviews) {
Dispatch.put(this, "ShowStylePreviews", new Variant(showStylePreviews));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getRestrictLinkedStyles() {
return Dispatch.get(this, "RestrictLinkedStyles").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param restrictLinkedStyles an input-parameter of type boolean
*/
public void setRestrictLinkedStyles(boolean restrictLinkedStyles) {
Dispatch.put(this, "RestrictLinkedStyles", new Variant(restrictLinkedStyles));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type OMathAutoCorrect
*/
public OMathAutoCorrect getOMathAutoCorrect() {
return new OMathAutoCorrect(Dispatch.get(this, "OMathAutoCorrect").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDisplayDocumentInformationPanel() {
return Dispatch.get(this, "DisplayDocumentInformationPanel").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param displayDocumentInformationPanel an input-parameter of type boolean
*/
public void setDisplayDocumentInformationPanel(boolean displayDocumentInformationPanel) {
Dispatch.put(this, "DisplayDocumentInformationPanel", new Variant(displayDocumentInformationPanel));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type IAssistance
*/
public IAssistance getAssistance() {
return new IAssistance(Dispatch.get(this, "Assistance").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getOpenAttachmentsInFullScreen() {
return Dispatch.get(this, "OpenAttachmentsInFullScreen").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param openAttachmentsInFullScreen an input-parameter of type boolean
*/
public void setOpenAttachmentsInFullScreen(boolean openAttachmentsInFullScreen) {
Dispatch.put(this, "OpenAttachmentsInFullScreen", new Variant(openAttachmentsInFullScreen));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type int
*/
public int getActiveEncryptionSession() {
return Dispatch.get(this, "ActiveEncryptionSession").changeType(Variant.VariantInt).getInt();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getDontResetInsertionPointProperties() {
return Dispatch.get(this, "DontResetInsertionPointProperties").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param dontResetInsertionPointProperties an input-parameter of type boolean
*/
public void setDontResetInsertionPointProperties(boolean dontResetInsertionPointProperties) {
Dispatch.put(this, "DontResetInsertionPointProperties", new Variant(dontResetInsertionPointProperties));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type SmartArtLayouts
*/
public SmartArtLayouts getSmartArtLayouts() {
return new SmartArtLayouts(Dispatch.get(this, "SmartArtLayouts").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type SmartArtQuickStyles
*/
public SmartArtQuickStyles getSmartArtQuickStyles() {
return new SmartArtQuickStyles(Dispatch.get(this, "SmartArtQuickStyles").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type SmartArtColors
*/
public SmartArtColors getSmartArtColors() {
return new SmartArtColors(Dispatch.get(this, "SmartArtColors").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param localDocument an input-parameter of type Document
* @param serverDocument an input-parameter of type Document
* @param baseDocument an input-parameter of type Document
* @param favorSource an input-parameter of type boolean
*/
public void threeWayMerge(Document localDocument, Document serverDocument, Document baseDocument, boolean favorSource) {
Dispatch.call(this, "ThreeWayMerge", localDocument, serverDocument, baseDocument, new Variant(favorSource));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*/
public void dummy4() {
Dispatch.call(this, "Dummy4");
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type UndoRecord
*/
public UndoRecord getUndoRecord() {
return new UndoRecord(Dispatch.get(this, "UndoRecord").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type PickerDialog
*/
public PickerDialog getPickerDialog() {
return new PickerDialog(Dispatch.get(this, "PickerDialog").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type ProtectedViewWindows
*/
public ProtectedViewWindows getProtectedViewWindows() {
return new ProtectedViewWindows(Dispatch.get(this, "ProtectedViewWindows").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type ProtectedViewWindow
*/
public ProtectedViewWindow getActiveProtectedViewWindow() {
return new ProtectedViewWindow(Dispatch.get(this, "ActiveProtectedViewWindow").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getIsSandboxed() {
return Dispatch.get(this, "IsSandboxed").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type MsoFileValidationMode
*/
public MsoFileValidationMode getFileValidation() {
return new MsoFileValidationMode(Dispatch.get(this, "FileValidation").toDispatch());
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param fileValidation an input-parameter of type MsoFileValidationMode
*/
public void setFileValidation(MsoFileValidationMode fileValidation) {
Dispatch.put(this, "FileValidation", fileValidation);
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getChartDataPointTrack() {
return Dispatch.get(this, "ChartDataPointTrack").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param chartDataPointTrack an input-parameter of type boolean
*/
public void setChartDataPointTrack(boolean chartDataPointTrack) {
Dispatch.put(this, "ChartDataPointTrack", new Variant(chartDataPointTrack));
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @return the result is of type boolean
*/
public boolean getShowAnimation() {
return Dispatch.get(this, "ShowAnimation").changeType(Variant.VariantBoolean).getBoolean();
}
/**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
* @param showAnimation an input-parameter of type boolean
*/
public void setShowAnimation(boolean showAnimation) {
Dispatch.put(this, "ShowAnimation", new Variant(showAnimation));
}
}
| 48.587487 | 564 | 0.761675 |
8a5de3635029490363ad497043b11edf511be1c1 | 510 | package com.zy.simpleORM;
import java.util.List;
import java.util.Map;
//数据库操作的接口,常用的增删改查,以及按照条件来查询
public interface GenericDAO<T> {
public void save(T t) throws Exception; //增加数据
public void delete(Object id, Class<T> clazz) throws Exception; //删除数据
public void update(T t) throws Exception; //更新数据
public T get(Object id, Class<T> clazz) throws Exception; //查找数据
public List<T> findAllByConditions(Map<String, Object> sqlWhereMap, Class<T> clazz ) throws Exception; //根据搜索条件,批量查询数据
}
| 28.333333 | 121 | 0.733333 |
1f89787141d19069cbe16e93801e976d7c18bf6d | 26,581 | package io.dashbase.parser;
import com.google.common.collect.Lists;
import io.dashbase.exception.ParserException;
import io.dashbase.lexer.QueryLexer;
import io.dashbase.lexer.token.ItemType;
import io.dashbase.lexer.token.TokenItem;
import lombok.NonNull;
import io.dashbase.parser.ast.Expr;
import io.dashbase.parser.ast.ExprType;
import io.dashbase.parser.ast.expr.BinaryExpr;
import io.dashbase.parser.ast.expr.ParenExpr;
import io.dashbase.parser.ast.expr.UnaryExpr;
import io.dashbase.parser.ast.literal.NumberLiteral;
import io.dashbase.parser.ast.literal.StringLiteral;
import io.dashbase.parser.ast.value.*;
import io.dashbase.parser.ast.match.Call;
import io.dashbase.parser.ast.match.Function;
import io.dashbase.parser.ast.match.Matcher;
import io.dashbase.utils.Strings;
import io.dashbase.utils.TypeUtils;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static java.lang.String.format;
import static io.dashbase.lexer.token.ItemType.*;
import static io.dashbase.parser.ast.value.ValueType.*;
import static io.dashbase.parser.ast.value.VectorMatching.VectorMatchCardinality.*;
import static io.dashbase.parser.ast.match.Functions.getFunction;
import static io.dashbase.parser.ast.match.Labels.MetricName;
import static io.dashbase.utils.TypeUtils.isLabel;
public final class QueryParser {
private final QueryLexer lexer;
private final TokenItem[] tokens;
private int peekCount;
private QueryParser(@NonNull String input) {
this.lexer = QueryLexer.lexer(input);
this.tokens = new TokenItem[3];
}
private TokenItem peek() {
if (peekCount > 0) {
return tokens[peekCount - 1];
}
peekCount = 1;
TokenItem item = lexer.nextItem();
// Skip comments
for (; item.type == itemComment; ) {
item = lexer.nextItem();
}
tokens[0] = item;
return tokens[0];
}
private void backup() {
this.peekCount++;
}
private TokenItem next() {
if (peekCount > 0) {
this.peekCount--;
} else {
// skip comments
TokenItem item = lexer.nextItem();
for (; item.type == itemComment; ) {
item = lexer.nextItem();
}
tokens[0] = item;
}
if (tokens[peekCount].type == itemError) {
this.errorf("%s", tokens[peekCount].text);
}
return tokens[peekCount];
}
private void errorf(String format, Object... args) {
// System.err.printf(format + '\n', args);
error(format(format, args));
}
private void error(String errorMessage) {
throw new ParserException(lexer.lineNumber(), lexer.getPosition(), errorMessage);
}
public Expr parserExpr() {
Expr expr = null;
for (; peek().type != itemEOF; ) {
if (peek().type == itemComment) {
continue;
}
if (expr != null) {
this.errorf("could not parse remaining input \"%s\"...", lexer.fromLastPosition());
}
expr = expr();
}
if (expr == null) {
this.errorf("no expression found in input");
}
return expr;
}
// expr parses any expression.
private Expr expr() {
// Parse the starting expression.
Expr expr = unaryExpr();
// Loop through the operations and construct a binary operation tree based
// on the operators' precedence.
for (; ; ) {
ItemType op = peek().type;
if (!op.isOperator()) {
return expr;
}
// consume op
next();
// Parse optional operator matching options. Its validity
// is checked in the type-checking stage.
VectorMatching vecMatching = VectorMatching.of(CardOneToOne);
if (op.isSetOperator()) {
vecMatching.card = CardManyToMany;
}
boolean returnBool = false;
// Parse bool modifier.
if (peek().type == itemBool) {
if (!op.isComparisonOperator()) {
errorf("bool modifier can only be used on comparison operators");
}
// consume
next();
returnBool = true;
}
if (peek().type == itemOn || peek().type == itemIgnoring) {
if (peek().type == itemOn) {
vecMatching.on = true;
}
next();
vecMatching.matchingLabels = labels();
// parse grouping
TokenItem item = peek();
if (item.type == itemGroupLeft || item.type == itemGroupRight) {
next();
if (item.type == itemGroupLeft) {
vecMatching.card = CardManyToOne;
} else {
vecMatching.card = CardOneToMany;
}
if (peek().type == itemLeftParen) {
vecMatching.include = labels();
}
}
}
for (String matchingLabel : vecMatching.matchingLabels) {
for (String include : vecMatching.include) {
if (matchingLabel.equals(include) && vecMatching.on) {
errorf("label \"%s\" must not occur in ON and GROUP clause at once", matchingLabel);
}
}
}
Expr rhs = unaryExpr();
expr = balance(expr, op, rhs, returnBool, vecMatching);
}
}
// labels parses a list of labelnames.
//
// '(' <label_name>, ... ')'
//
private List<String> labels() {
final String context = "grouping opts";
this.expect(itemLeftParen, context);
List<String> labels = Lists.newArrayList();
if (peek().type != itemRightParen) {
for (; ; ) {
TokenItem id = next();
if (!isLabel(id.text)) {
errorf("unexpected %s in %s, expected label", id.desc(), context);
}
labels.add(id.text);
if (peek().type != itemComma) {
break;
}
next();
}
}
expect(itemRightParen, context);
return labels;
}
private BinaryExpr balance(Expr lhs, ItemType op, Expr rhs, boolean returnBool, VectorMatching vectorMatching) {
if (lhs instanceof BinaryExpr) {
BinaryExpr lhsBE = (BinaryExpr) lhs;
int precd = lhsBE.op.precedence() - op.precedence();
// priority higher or right assoc
if (precd < 0 || (precd == 0 && op.isRightAssociative())) {
Expr balanced = balance(lhsBE.rhs, op, rhs, returnBool, vectorMatching);
if (op.isComparisonOperator() && !returnBool
&& rhs.valueType() == ValueTypeScalar
&& lhs.valueType() == ValueTypeScalar) {
errorf("comparisons between scalars must use BOOL modifier");
}
return BinaryExpr.of(
lhsBE.op,
lhsBE.lhs,
balanced,
lhsBE.returnBool,
lhsBE.vectorMatching
);
}
}
if (op.isComparisonOperator() && !returnBool
&& rhs.valueType() == ValueTypeScalar
&& lhs.valueType() == ValueTypeScalar) {
errorf("comparisons between scalars must use BOOL modifier");
}
return BinaryExpr.of(
op,
lhs,
rhs,
returnBool,
vectorMatching
);
}
private Expr unaryExpr() {
TokenItem item = peek();
switch (item.type) {
case itemADD:
case itemSUB: {
next();
// consume this -/+
Expr next = unaryExpr();
if (next instanceof NumberLiteral) {
if (item.type == itemSUB) {
((NumberLiteral) next).number *= -1;
}
return next;
}
return UnaryExpr.of(item.type, next);
}
case itemLeftParen: {
next();
Expr e = expr();
expect(itemRightParen, "paren expression");
return ParenExpr.of(e);
}
}
Expr expr = primaryExpr();
// Expression might be followed by a range selector.
if (peek().type == itemLeftBracket) {
if (Objects.isNull(expr)) {
errorf("expr should not null");
return null;
}
if (expr.exprType != ExprType.VectorSelector) {
errorf("range specification must be preceded by a metric selector, but follows a %s instead", expr.toString());
} else {
expr = rangeSelector((VectorSelector) expr);
}
}
// Parse optional offset.
if (peek().type == itemOffset) {
Duration offset = offset();
switch (expr.exprType) {
case VectorSelector: {
VectorSelector s = (VectorSelector) expr;
s.offset = offset;
break;
}
case MatrixSelector: {
MatrixSelector s = (MatrixSelector) expr;
s.offset = offset;
break;
}
default: {
errorf("offset modifier must be preceded by an instant or range selector, but follows a \"%s\" instead", expr.toString());
}
}
}
return expr;
}
// offset parses an offset modifier.
//
// offset <duration>
//
private Duration offset() {
final String context = "offset";
// consume this token.
this.next();
TokenItem offi = expect(itemDuration, context);
return parseDuration(offi.text);
}
private Expr rangeSelector(VectorSelector expr) {
final String context = "range selector";
this.next();
String erangeStr = expect(itemDuration, context).text;
Duration erange = parseDuration(erangeStr);
this.expect(itemRightBracket, context);
return MatrixSelector.of(
expr.name,
erange,
expr.matchers
);
}
private Duration parseDuration(String erangeStr) {
Duration dur = TypeUtils.parseDuration(erangeStr);
if (dur.equals(Duration.ZERO)) {
errorf("duration must be greater than 0");
}
return dur;
}
// expect consumes the next token and guarantees it has the required type.
private TokenItem expect(ItemType exp, String context) {
TokenItem item = next();
if (item.type != exp) {
errorf("unexpected %s in %s, expected %s", item.desc(), context, exp.desc());
}
return item;
}
private Expr primaryExpr() {
TokenItem item = next();
if (item.type.isAggregator()) {
backup();
return aggrExpr();
}
switch (item.type) {
case itemNumber: {
double number = parseNumber(item.text);
return NumberLiteral.of(number);
}
case itemString: {
return StringLiteral.of(Strings.unquote(item.text));
}
case itemLeftBrace: {
backup();
return VectorSelector("");
}
case itemIdentifier:
if (peek().type == itemLeftParen) {
return call(item.text);
}
case itemMetricIdentifier:
return VectorSelector(item.text);
default: {
errorf("no valid expression found");
break;
}
}
return null;
}
// aggrExpr parses an aggregation expression.
//
// <aggr_op> (<Vector_expr>) [by|without <labels>]
// <aggr_op> [by|without <labels>] (<Vector_expr>)
//
private AggregateExpr aggrExpr() {
final String ctx = "aggregation";
TokenItem agop = next();
if (!agop.type.isAggregator()) {
errorf("expected aggregation operator but got %s", agop);
}
List<String> grouping = Lists.newArrayList();
boolean without = false;
boolean modifiersFirst = false;
ItemType type = peek().type;
if (type == itemBy || type == itemWithout) {
if (type == itemWithout) {
without = true;
}
next();
grouping = labels();
modifiersFirst = true;
}
expect(itemLeftParen, ctx);
Expr param = null;
if (agop.type.isAggregatorWithParam()) {
param = expr();
expect(itemComma, ctx);
}
Expr expr = expr();
expect(itemRightParen, ctx);
if (!modifiersFirst) {
ItemType t = peek().type;
if (t == itemBy || t == itemWithout) {
if (!grouping.isEmpty()) {
errorf("aggregation must only contain one grouping clause");
}
if (t == itemWithout) {
without = true;
}
next();
grouping = labels();
}
}
return AggregateExpr.of(
agop.type,
expr,
param,
grouping,
without
);
}
// call parses a function call.
//
// <func_name> '(' [ <arg_expr>, ...] ')'
//
private Call call(String name) {
final String ctx = "function call";
Function function = getFunction(name);
if (Objects.isNull(function)) {
errorf("unknown function with name \"%s\"", name);
}
expect(itemLeftParen, ctx);
// Might be call without args.
if (peek().type == itemRightParen) {
next(); // consume.
return Call.of(function, Collections.emptyList());
}
List<Expr> args = Lists.newArrayList();
for (; ; ) {
Expr e = expr();
args.add(e);
// Terminate if no more arguments.
if (peek().type != itemComma) {
break;
}
next();
}
// Call must be closed.
expect(itemRightParen, ctx);
return Call.of(function, args);
}
private double parseNumber(String text) {
// inf parser
if (text.toLowerCase().contains("inf")) {
return Double.POSITIVE_INFINITY;
} else if (text.toLowerCase().startsWith("0x")) {
return Integer.valueOf(text.substring(2), 16);
} else if (text.startsWith("0")) {
return Integer.valueOf(text.substring(1), 8);
}
try {
return Double.valueOf(text);
} catch (Exception e) {
this.errorf("error parsing number: %s", e.getMessage());
}
// useless
return -1;
}
// VectorSelector parses a new (instant) vector selector.
//
// <metric_identifier> [<label_matchers>]
// [<metric_identifier>] <label_matchers>
private VectorSelector VectorSelector(String name) {
List<Matcher> matchers = Lists.newArrayList();
if (peek().type == itemLeftBrace) {
matchers = labelMatchers(itemEQL, itemNEQ, itemEQLRegex, itemNEQRegex);
}
if (!name.equals("")) {
for (Matcher matcher : matchers) {
if (matcher.name.equals(MetricName)) {
errorf("metric name must not be set twice: \"%s\" or \"%s\"", name, matcher.value);
}
}
// Set name label matching.
Matcher matcher = Matcher.newMatcher(
Matcher.MatchType.MatchEqual,
MetricName,
name
);
matchers.add(matcher);
}
if (matchers.size() == 0) {
errorf("vector selector must contain label matchers or metric name");
}
// A Vector selector must contain at least one non-empty matcher to prevent
// implicit selection of all metrics (e.g. by a typo).
boolean notEmpty = false;
for (Matcher matcher : matchers) {
if (!matcher.matches("")) {
notEmpty = true;
break;
}
}
if (!notEmpty) {
errorf("vector selector must contain at least one non-empty matcher");
}
return VectorSelector.of(
name,
matchers
);
}
private List<Matcher> labelMatchers(ItemType... operators) {
final String ctx = "label matching";
List<Matcher> matchers = Lists.newArrayList();
expect(itemLeftBrace, ctx);
// Check if no matchers are provided.
if (peek().type == itemRightBrace) {
next();
return matchers;
}
for (; ; ) {
TokenItem label = expect(itemIdentifier, ctx);
ItemType op = next().type;
if (!op.isOperator()) {
errorf("expected label matching operator but got %s", op.desc());
}
boolean validOp = false;
for (ItemType allowedOp : operators) {
if (op == allowedOp) {
validOp = true;
}
}
if (!validOp) {
StringBuilder builder = new StringBuilder();
for (ItemType operator : operators) {
builder.append(operator.desc());
}
errorf(
"operator must be one of %s, is %s",
builder.toString(),
op.desc()
);
}
String val = Strings.unquote(expect(itemString, ctx).text);
// Map the item to the respective match type.
Matcher.MatchType matchType = null;
switch (op) {
case itemEQL:
matchType = Matcher.MatchType.MatchEqual;
break;
case itemNEQ:
matchType = Matcher.MatchType.MatchNotEqual;
break;
case itemEQLRegex:
matchType = Matcher.MatchType.MatchRegexp;
break;
case itemNEQRegex:
matchType = Matcher.MatchType.MatchNotRegexp;
break;
default:
errorf("item %s is not a metric match type", op.desc());
}
Matcher matcher = Matcher.newMatcher(matchType, label.text, val);
matchers.add(matcher);
if (peek().type == itemIdentifier) {
errorf("missing comma before next identifier %s", peek().text);
}
// Terminate list if last matcher.
if (peek().type != itemComma) {
break;
}
next();
// Allow comma after each item in a multi-line listing.
if (peek().type == itemRightBrace) {
break;
}
}
expect(itemRightBrace, ctx);
return matchers;
}
public void typeCheck(Expr expr) {
checkType(expr);
}
// expectType checks the type of the node and raises an error if it
// is not of the expected type.
private void expectType(Expr node, ValueType want, String context) {
ValueType type = checkType(node);
if (type != want) {
errorf("expected type %s in %s, got %s", want.documentedType(), context, type.documentedType());
}
}
private ValueType checkType(Expr expr) {
ValueType valueType;
switch (expr.exprType) {
// TODO case Statements, Expressions, Statement
default: {
valueType = expr.valueType();
}
}
// Recursively check correct typing for child nodes and raise
// errors in case of bad typing.
switch (expr.exprType) {
case BinaryExpr: {
BinaryExpr binaryExpr = (BinaryExpr) expr;
ValueType lhsType = checkType(binaryExpr.lhs);
ValueType rhsType = checkType(binaryExpr.rhs);
if (!binaryExpr.op.isOperator()) {
errorf("binary expression does not support operator %s", binaryExpr.op.desc());
}
if ((lhsType != ValueTypeScalar && lhsType != ValueTypeVector)
|| (rhsType != ValueTypeScalar && rhsType != ValueTypeVector)) {
errorf("binary expression must contain only scalar and instant vector types");
}
if ((lhsType != ValueTypeVector || rhsType != ValueTypeVector) && binaryExpr.vectorMatching != null) {
if (binaryExpr.vectorMatching.matchingLabels.size() > 0) {
errorf("vector matching only allowed between instant vectors");
}
binaryExpr.vectorMatching = null;
} else {
// Both operands are Vectors.
if (binaryExpr.op.isSetOperator() && Objects.nonNull(binaryExpr.vectorMatching)) {
if (binaryExpr.vectorMatching.card == CardOneToMany || binaryExpr.vectorMatching.card == CardManyToOne) {
errorf("no grouping allowed for \"%s\" operation", binaryExpr.op.desc());
}
if (binaryExpr.vectorMatching.card != CardManyToMany) {
errorf("set operations must always be many-to-many");
}
}
}
if ((lhsType == ValueTypeScalar || rhsType == ValueTypeScalar) && binaryExpr.op.isSetOperator()) {
errorf("set operator \"%s\" not allowed in binary scalar expression", binaryExpr.op.desc());
}
break;
}
case UnaryExpr: {
UnaryExpr unaryExpr = (UnaryExpr) expr;
if (unaryExpr.op != itemADD && unaryExpr.op != itemSUB) {
errorf("only + and - operators allowed for unary expressions");
}
ValueType type = checkType(unaryExpr.expr);
if (type != ValueTypeScalar && type != ValueTypeVector) {
errorf(
"unary expression only allowed on expressions of type scalar or instant vector, got \"%s\"",
type.documentedType()
);
}
break;
}
case AggregateExpr: {
AggregateExpr aggregateExpr = (AggregateExpr) expr;
if (!aggregateExpr.op.isAggregator()) {
errorf("aggregation operator expected in aggregation expression but got %s", aggregateExpr.op.desc());
}
expectType(aggregateExpr.expr, ValueTypeVector, "aggregation expression");
ItemType op = aggregateExpr.op;
if (op == itemTopK || op == itemBottomK || op == itemQuantile) {
expectType(aggregateExpr.param, ValueTypeScalar, "aggregation parameter");
}
if (op == itemCountValues) {
expectType(aggregateExpr.param, ValueTypeString, "aggregation parameter");
}
break;
}
case Call: {
Call call = (Call) expr;
int nargs = call.function.argsTypes.size();
if (call.function.variadic == 0 && nargs != call.args.size()) {
errorf("expected %d argument(s) in call to \"%s\", got %d", nargs, call.function.name, call.args.size());
} else {
int na = nargs - 1;
if (na > call.args.size()) {
errorf("expected at least %d argument(s) in call to \"%s\", got %d", na, call.function.name, call.args.size());
}
int nargsMax = na + call.function.variadic;
if (call.function.variadic > 0 && nargsMax < call.args.size()) {
errorf("expected at most %d argument(s) in call to \"%s\", got %d", nargsMax, call.function.name, call.args.size());
}
int argTypesLen = call.function.argsTypes.size();
for (int i = 0; i < call.args.size(); i++) {
Expr arg = call.args.get(i);
if (i >= argTypesLen) {
i = argTypesLen - 1;
}
expectType(arg, call.function.argsTypes.get(i), format("call to function \"%s\"", call.function.name));
}
}
break;
}
case ParenExpr: {
ParenExpr parenExpr = (ParenExpr) expr;
checkType(parenExpr.inner);
break;
}
case NumberLiteral:
case MatrixSelector:
case StringLiteral:
case VectorSelector: {
// Nothing to do for terminals.
break;
}
// default: {
// errorf("unknown node type: %s", expr.toString());
// }
}
return valueType;
}
public static QueryParser parser(String input) {
return new QueryParser(input);
}
public static Expr parseExpr(String input) {
QueryParser parser = parser(input);
Expr expr = parser.parserExpr();
parser.typeCheck(expr);
return expr;
}
}
| 31.871703 | 142 | 0.499944 |
12dcc2c12f0e95a81769fcf313aac67e31b05609 | 407 | package com.ibm.streamsx.sample.weather;
public class Reading {
private Station station;
public Reading(double temp, Station station) {
this.station = station;
this.temp = temp;
}
double temp;
double getTemp(){
return temp;
}
public Station getStation() {
return station;
}
@Override
public String toString() {
return station.getId() + " " + temp + " "+ station.getLocation();
}
} | 16.958333 | 68 | 0.68059 |
f45db217a32fb288ee34dd28c67ccf0bf84df8e0 | 458 | package com.bplow.netconn.query.dao;
import java.sql.SQLException;
import java.util.List;
/**
*
*/
import com.bplow.netconn.query.dao.entity.Ad;
public interface AdDao {
public void insertAd(Ad ad)throws SQLException;
public Ad queryAd(int id)throws SQLException;
public List queryAdList(Ad ad)throws SQLException;
public int delAd(int id) throws SQLException;
public int upateAd(int id) throws SQLException;
}
| 18.32 | 52 | 0.713974 |
85de39c254c8fa13b70012ce48cb2471f595fdb7 | 3,234 | /*
* Copyright (c) 2016—2017 Andrei Tomashpolskiy and individual contributors.
*
* 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 bt.net;
import org.junit.Test;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
public class ReadByBlockChannelTest {
@Test
public void testChannel_NoPartialReads() throws IOException {
int[] limits = new int[] {100, 200, 300};
int[] expectedReads = new int[] {100, 100, 100};
testChannel(limits, expectedReads);
}
@Test
public void testChannel_PartialReads() throws IOException {
int[] limits = new int[] {0, 75, 100, 150, 250, 250, 300};
int[] expectedReads = new int[] {0, 75, 25, 50, 50, 50, 50};
testChannel(limits, expectedReads);
}
private void testChannel(int[] limits, int[] expectedReads) throws IOException {
if (limits.length != expectedReads.length) {
throw new IllegalArgumentException("Lengths do not match");
}
byte[] part0 = new byte[100];
byte[] part1 = new byte[100];
byte[] part2 = new byte[100];
Arrays.fill(part1, (byte) 1);
Arrays.fill(part2, (byte) 2);
List<byte[]> data = new ArrayList<>(Arrays.asList(part0, part1, part2));
ReadByBlockChannel channel = new ReadByBlockChannel(data);
int lenTotal = part0.length + part1.length + part2.length;
ByteBuffer buf = ByteBuffer.allocate(lenTotal);
int readTotal = 0;
int read;
for (int i = 0; i < limits.length; i++) {
int limit = limits[i];
int expectedRead = expectedReads[i];
buf.limit(limit);
read = channel.read(buf);
assertEquals(String.format("Read #%s: expected (%s), actual (%s)", i, expectedRead, read), expectedRead, read);
if (read > 0) {
readTotal += read;
}
}
// all data has been read
assertEquals(-1, channel.read(buf));
assertEquals(lenTotal, readTotal);
assertFalse(buf.hasRemaining());
buf.flip();
byte[] expected = new byte[lenTotal];
System.arraycopy(part0, 0, expected, 0, part0.length);
System.arraycopy(part1, 0, expected, part0.length, part1.length);
System.arraycopy(part2, 0, expected, part0.length + part1.length, part2.length);
byte[] actual = new byte[lenTotal];
buf.get(actual);
assertArrayEquals(expected, actual);
}
}
| 34.404255 | 123 | 0.636673 |
25d5e8884e9bee763a1463447d4dbadd167e8aa2 | 7,087 | package com.github.sendgrid;
import org.json.JSONException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;
public class SendGridTest {
private static final String USERNAME = "username";
private static final String PASSWORD = "password";
private SendGrid sendgrid;
@Before
public void setUp() {
sendgrid = new SendGrid(USERNAME, PASSWORD);
}
@After
public void tearDown() {
sendgrid = null;
}
@Test
public void sanityTestSend() {
String email = "[email protected]";
sendgrid.addTo(email);
sendgrid.addToName("Name Guy");
sendgrid.setFrom(email);
sendgrid.setFromName("Some Name");
sendgrid.setReplyTo("[email protected]");
sendgrid.setSubject("Subject");
sendgrid.setText("Text");
sendgrid.setHtml("Html");
sendgrid.addHeader("key", "value");
String response = sendgrid.send();
assertEquals(response, "{\"message\": \"error\", \"errors\": [\"Bad username / password\"]}");
}
@Test
public void testAddTo() {
String email = "[email protected]";
sendgrid.addTo(email);
assertThat(sendgrid.getTos(), hasItems(email));
}
@Test
public void testAddToName() {
String name = "Example Guy";
sendgrid.addToName(name);
assertThat(sendgrid.getToNames(), hasItems(name));
}
@Test
public void testSetBcc() {
String email = "[email protected]";
sendgrid.setBcc(email);
assertEquals(sendgrid.getBcc(), email);
}
@Test
public void testSetFrom() {
String email = "[email protected]";
sendgrid.setFrom(email);
assertEquals(sendgrid.getFrom(), email);
}
@Test
public void testSetFromName() {
String name = "Example Guy";
sendgrid.setFromName(name);
assertEquals(sendgrid.getFromName(), name);
}
@Test
public void testSetReplyTo() {
String email = "[email protected]";
sendgrid.setReplyTo(email);
assertEquals(sendgrid.getReplyTo(), email);
}
@Test
public void testSetSubject() {
String subject = "This is a subject";
sendgrid.setSubject(subject);
assertEquals(sendgrid.getSubject(), subject);
}
@Test
public void testSetText() {
String text = "This is some email text.";
sendgrid.setText(text);
assertEquals(sendgrid.getText(), text);
}
@Test
public void testSetHtml() {
String html = "This is some email text.";
sendgrid.setHtml(html);
assertEquals(sendgrid.getHtml(), html);
}
@Test
public void testAddFile() throws FileNotFoundException {
File file = new File(getClass().getResource("/test.txt").getFile());
sendgrid.addFile(file);
assertEquals(sendgrid.getAttachments().get(0).name, file.getName());
}
@Test
public void testAddFileFromString() throws FileNotFoundException {
try {
InputStream is = new FileInputStream(getClass().getResource("/test.txt").getFile());
is.close();
SendGrid.Attachment attachment1 = new SendGrid.Attachment("filename.txt", is);
sendgrid.addFile(attachment1);
assertThat(sendgrid.getAttachments(), hasItems(attachment1));
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void testAddMultipleFiles() throws FileNotFoundException {
File file1 = new File(getClass().getResource("/test.txt").getFile());
File file2 = new File(getClass().getResource("/image.png").getFile());
sendgrid.addAttachment(file1);
sendgrid.addFile(file2);
assertEquals(sendgrid.getAttachments().get(0).name, file1.getName());
assertEquals(sendgrid.getAttachments().get(1).name, file2.getName());
}
@Test
public void testAddHeader() throws JSONException {
sendgrid.addHeader("key", "value");
sendgrid.addHeader("other", "other-value");
assertEquals(sendgrid.getHeaders().get("key"), "value");
assertEquals(sendgrid.getHeaders().get("other"), "other-value");
}
@Test
public void testAddFilter_single_filter() throws Exception {
final String expected = "{\"filters\":{\"sendgridApp\":{\"settings\":{\"enabled\":1}}}}";
sendgrid.addFilter("sendgridApp", "enabled", 1);
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
@Test
public void testAddFilter_multiple_filter() throws Exception {
final String expected = "{\"filters\":{\"sendgridApp\":{\"settings\":{\"enabled\":1,\"pizza\":1}},\"ganalytics\":{\"settings\":{\"enabled\":1}}}}";
sendgrid.addFilter("sendgridApp", "enabled", 1);
sendgrid.addFilter("ganalytics", "enabled", 1);
sendgrid.addFilter("sendgridApp", "pizza", 1);
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
@Test
public void testAddFilter_multiple_duplicate_filters() throws Exception {
final String expected = "{\"filters\":{\"sendgridApp\":{\"settings\":{\"enabled\":1,\"pizza\":1}},\"ganalytics\":{\"settings\":{\"enabled\":1}}}}";
sendgrid.addFilter("sendgridApp", "enabled", 1);
sendgrid.addFilter("sendgridApp", "enabled", 1);
sendgrid.addFilter("ganalytics", "enabled", 1);
sendgrid.addFilter("sendgridApp", "pizza", 1);
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
@Test
public void testAddCategory_single_category() throws Exception {
final String expected = "{\"category\":[\"category1\"]}";
sendgrid.addCategory("category1");
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
@Test
public void testAddCategory_multiple_categories() throws Exception {
final String expected = "{\"category\":[\"category1\",\"category2\",\"category3\"]}";
sendgrid.addCategory("category1");
sendgrid.addCategory("category2");
sendgrid.addCategory("category3");
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
@Test
public void testAddCategory_multiple_duplicate_categories() throws Exception {
final String expected = "{\"category\":[\"category1\",\"category2\"]}";
sendgrid.addCategory("category1");
sendgrid.addCategory("category2");
sendgrid.addCategory("category2");
final String actual = (String) sendgrid.getHeaders().get("X-SMTPAPI");
assertEquals(expected, actual);
}
}
| 29.777311 | 155 | 0.626358 |
4ab2ddb443c94754080cd5a7d3f5fd70dbadb8f1 | 3,328 | /*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.eclipse.imagen.media.mlib;
import java.awt.RenderingHints;
import java.awt.image.DataBuffer;
import java.awt.image.RenderedImage;
import java.awt.image.SampleModel;
import java.awt.image.renderable.ParameterBlock;
import java.awt.image.renderable.RenderedImageFactory;
import java.util.Vector;
import org.eclipse.imagen.ImageLayout;
import org.eclipse.imagen.PlanarImage;
import org.eclipse.imagen.ROI;
import org.eclipse.imagen.operator.MosaicType;
import org.eclipse.imagen.media.opimage.RIFUtil;
/**
* A <code>RIF</code> supporting the "Mosaic" operation in the rendered
* image layer.
*
* @since JAI 1.1.2
* @see org.eclipse.imagen.operator.MosaicDescriptor
*/
public class MlibMosaicRIF implements RenderedImageFactory {
/** Constructor. */
public MlibMosaicRIF() {}
/**
* Renders a "Mosaic" operation node.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
// Return if not mediaLib-compatible.
if(!MediaLibAccessor.isMediaLibCompatible(paramBlock, layout) ||
!MediaLibAccessor.hasSameNumBands(paramBlock, layout)) {
return null;
}
// Get sources.
Vector sources = paramBlock.getSources();
// Get target SampleModel.
SampleModel targetSM = null;
if(sources.size() > 0) {
targetSM = ((RenderedImage)sources.get(0)).getSampleModel();
} else if(layout != null &&
layout.isValid(ImageLayout.SAMPLE_MODEL_MASK)) {
targetSM = layout.getSampleModel(null);
}
if(targetSM != null) {
// Return if target data type is floating point. Other more
// extensive type checking is done in MosaicOpImage constructor.
int dataType = targetSM.getDataType();
if(dataType == DataBuffer.TYPE_FLOAT ||
dataType == DataBuffer.TYPE_DOUBLE) {
return null;
}
}
return
new MlibMosaicOpImage(sources,
layout,
renderHints,
(MosaicType)paramBlock.getObjectParameter(0),
(PlanarImage[])paramBlock.getObjectParameter(1),
(ROI[])paramBlock.getObjectParameter(2),
(double[][])paramBlock.getObjectParameter(3),
(double[])paramBlock.getObjectParameter(4));
}
}
| 36.173913 | 82 | 0.633113 |
30db5fe06598c7030b1df41fd2181adba6907738 | 1,121 | import java.util.ArrayList;
import java.util.List;
public class S1380LuckyNumbersMatrix {
public List<Integer> luckyNumbers (int[][] matrix) {
int M = matrix.length, N = matrix[0].length;
int[] min = new int[M];
for (int r = 0; r < M; r++) {
int m = Integer.MAX_VALUE;
for (int c = 0; c < N; c++) {
m = Math.min(m, matrix[r][c]);
}
min[r] = m;
}
List<Integer> res = new ArrayList<>();
for (int c = 0; c < N; c++) {
List<Integer> max = new ArrayList<>();
int m = Integer.MIN_VALUE;
for (int r = 0; r < M; r++) {
int v = matrix[r][c];
if (v > m) {
max.clear();
m = v;
if (v == min[r]) {
max.add(v);
}
} else if (v == m) {
if (v == min[r]) {
max.add(v);
}
}
}
res.addAll(max);
}
return res;
}
}
| 29.5 | 56 | 0.354148 |
90a9717e45003ecb0d72930ab05d04b311884187 | 11,150 | /*
* CPAchecker is a tool for configurable software verification.
* This file is part of CPAchecker.
*
* Copyright (C) 2007-2014 Dirk Beyer
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.
*
*
* CPAchecker web page:
* http://cpachecker.sosy-lab.org
*/
package org.sosy_lab.cpachecker.cfa.types.java;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import javax.annotation.Nullable;
import org.sosy_lab.cpachecker.cfa.ast.java.VisibilityModifier;
/**
* Description of a Java class or interface.
*
* <p>
* Each <code>JClassOrInterfaceType</code> instance includes:
*
* <ul>
* <li>the name of the class or interface (both fully qualified and simple)</li>
* <li> the visibility of the described class or interface and</li>
* <li>the enclosing type of the described class or interface, if one exists</li>
* </ul>
* </p>
*/
public abstract class JClassOrInterfaceType implements JReferenceType {
private static final long serialVersionUID = -9116725120756000396L;
private final VisibilityModifier visibility;
private final String name;
private final String simpleName;
private final @Nullable JClassOrInterfaceType enclosingType;
private final Set<JClassOrInterfaceType> nestedTypes = new HashSet<>();
/**
* Creates a new <code>JClassOrInterfaceType</code> object with the given
* properties.
*
* <p>The fully qualified name includes the full package name and the simple name of the class
* or interface. <br />
* Example: <code>java.lang.Object</code>, with <code>Object</code> as the simple name.
* </p>
*
* @param fullyQualifiedName the fully qualified name of the class or interface
* @param pSimpleName the simple name of the class or interface
* @param pVisibility the visibility of the described class or interface
*/
protected JClassOrInterfaceType(String fullyQualifiedName, String pSimpleName,
final VisibilityModifier pVisibility) {
name = fullyQualifiedName;
visibility = pVisibility;
simpleName = pSimpleName;
enclosingType = null;
checkNotNull(fullyQualifiedName);
checkNotNull(pSimpleName);
//checkArgument(fullyQualifiedName.endsWith(pSimpleName));
checkArgument((getVisibility() != VisibilityModifier.PRIVATE)
|| (getVisibility() != VisibilityModifier.PROTECTED),
" Interfaces can't be private or protected");
}
/**
* Creates a new <code>JClassOrInterfaceType</code> object with the given
* properties.
*
* <p>The fully qualified name includes the full package name and the simple name of the class
* or interface. <br />
* Example: <code>java.lang.Object</code>, with <code>Object</code> as the simple name.
* </p>
*
* @param fullyQualifiedName the fully qualified name of the class or interface
* @param pSimpleName the simple name of the class or interface
* @param pVisibility the visibility of the described class or interface
* @param pEnclosingType the enclosing type of the class or interface
*/
protected JClassOrInterfaceType(String fullyQualifiedName, String pSimpleName,
final VisibilityModifier pVisibility,
JClassOrInterfaceType pEnclosingType) {
name = fullyQualifiedName;
simpleName = pSimpleName;
visibility = pVisibility;
enclosingType = pEnclosingType;
checkNotNull(fullyQualifiedName);
checkNotNull(pSimpleName);
checkArgument(fullyQualifiedName.endsWith(pSimpleName));
checkNotNull(pEnclosingType);
checkArgument((getVisibility() != VisibilityModifier.PRIVATE)
|| (getVisibility() != VisibilityModifier.PROTECTED),
" Interfaces can't be private or protected");
enclosingType.notifyEnclosingTypeOfNestedType(this);
checkEnclosingTypeConsistency();
}
private void checkEnclosingTypeConsistency() {
checkArgument(!isTopLevel());
Set<JClassOrInterfaceType> found = new HashSet<>();
JClassOrInterfaceType nextEnclosingType = enclosingType;
found.add(enclosingType);
while (!nextEnclosingType.isTopLevel()) {
nextEnclosingType = nextEnclosingType.getEnclosingType();
checkArgument(!found.contains(this),
"Class " + getName() + " may not be a nested type of itself.");
found.add(nextEnclosingType);
}
}
@Override
public String toASTString(String pDeclarator) {
return pDeclarator.isEmpty() ? getName() : getName() + " " + pDeclarator;
}
/**
* Returns the fully qualified name of the described Java type.
*
* @return the fully qualified name of the described Java type
*/
public String getName() {
return name;
}
/**
* Returns the visibility of the described Java type.
*
* @return the visibility of the described Java type
*/
public VisibilityModifier getVisibility() {
return visibility;
}
/**
* Returns whether the given object equals this <code>JClassOrInterfaceType</code>.
*
* <p>
* Two <code>JClassOrInterfaceType</code>s equal only if their fully qualified names equal.
* A <code>JClassOrInterfaceType</code> instance does never equal an object that is not of this
* type.
* </p>
*
* @return <code>true</code> if the given object equals this object, <code>false</code> otherwise
*/
@Override
public boolean equals(Object pObj) {
if (this == pObj) {
return true;
}
if (!(pObj instanceof JClassOrInterfaceType)) {
return false;
}
JClassOrInterfaceType other = (JClassOrInterfaceType) pObj;
return Objects.equals(name, other.name);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 7;
result = prime * result + Objects.hashCode(name);
return result;
}
@Override
public String toString() {
return name;
}
/**
* Returns a <code>List</code> containing a <code>JClassOrInterfaceType</code> for each super type
* (interface or class) of the described class in random order.
*
* <p>This includes direct and indirect super types.
*
* @return a <code>Set</code> containing a <code>JClassOrInterfaceType</code> for each super type
* of the described class
*/
public Set<? extends JClassOrInterfaceType> getAllSuperTypesOfType() {
if (this instanceof JClassType) {
return ((JClassType) this).getAllSuperTypesOfClass();
} else if (this instanceof JInterfaceType) {
return ((JInterfaceType) this).getAllSuperInterfaces();
}
return ImmutableSet.of();
}
/**
* Returns a <code>Set</code> containing a <code>JClassOrInterfaceType</code> for each sub type
* that extends the described class or interface.
*
* <p>This includes direct and indirect sub types.
*
* @return a <code>Set</code> containing a <code>JClassOrInterfaceType</code> for each sub type
* that extends the described class
*/
public Set<? extends JClassOrInterfaceType> getAllSubTypesOfType() {
if (this instanceof JClassType) {
return ((JClassType) this).getAllSubTypesOfClass();
} else if (this instanceof JInterfaceType) {
return ((JInterfaceType) this).getAllSuperInterfaces();
}
return ImmutableSet.of();
}
/**
* Returns the directly enclosing type, if one exists.
*
* If the class does not have an enclosing type, a <code>NullPointerException</code> is thrown.
* To check this, {@link #isTopLevel()} can be used.
*
* @return the enclosing type of the described class or interface, if one exists
* @throws NullPointerException if no enclosing type exists
*/
public JClassOrInterfaceType getEnclosingType() {
checkNotNull(enclosingType, "Top-level-classes do not have an enclosing type.");
return enclosingType;
}
/**
* Returns a <code>Set</code> containing one <code>JClassOrInterfaceType</code> for each
* directly nested class or interface of the class or interface this object describes.
*
* <p>
* If no nested types exist, an empty <code>Set</code> is returned.
* </p>
*
* @return a <code>Set</code> containing descriptions for all directly nested types of the class
* or interface this object describes
*/
public Set<JClassOrInterfaceType> getNestedTypes() {
return ImmutableSet.copyOf(nestedTypes);
}
/**
* Returns a <code>Set</code> containing one <code>JClassOrInterfaceType</code> for each
* enclosing type of the class or interface described by this object.
*
* <p>
* This includes directly and indirectly enclosing types.<br />
* Example:
* <pre>
* public class TopClass {
* public class NestedClass {
* public interface NestedInterface { }
* }
* }
* </pre>
* For the class hierarchy above and a <code>JClassOrInterfaceType</code> instance describing
* <code>NestedInterface</code>, a call to this method returns a set containing descriptions for
* <code>NestedClass</code> and <code>TopClass</code>.
* </p>
*
* @return a <code>Set</code> containing one <code>JClassOrInterfaceType</code> for each
* enclosing type of the class or interface described by this object
*/
public final Set<JClassOrInterfaceType> getAllEnclosingTypes() {
Set<JClassOrInterfaceType> result = new HashSet<>();
JClassOrInterfaceType nextEnclosingInstance = enclosingType;
while (!nextEnclosingInstance.isTopLevel()) {
result.add(nextEnclosingInstance);
nextEnclosingInstance = nextEnclosingInstance.getEnclosingType();
}
return result;
}
/**
* Returns whether the class or interface described by this object is at the top level of a
* class hierarchy. A class or interface is at the top level of a class hierarchy, if it is not
* a nested type and does not contain an enclosing type.
*
* @return <code>true</code> if the class or interface described by this
* <code>JClassOrInterfaceType</code> does not have any enclosing types,
* <code>false</code> otherwise
*
*/
public boolean isTopLevel() {
return enclosingType == null;
}
private void notifyEnclosingTypeOfNestedType(JClassOrInterfaceType nestedType) {
checkArgument(!nestedTypes.contains(nestedType));
nestedTypes.add(nestedType);
}
/**
* Returns the simple name of the described class or interface.
*
* @return the simple name of the described class or interface
*/
public String getSimpleName() {
return simpleName;
}
} | 33.383234 | 100 | 0.704753 |
6214103aa9287c22eff6f01c400728f648f94fbd | 6,364 | /**
*/
package org.openecomp.dcae.controller.inventory.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openecomp.dcae.controller.inventory.DCAEServiceGroupByResults;
import org.openecomp.dcae.controller.inventory.DCAEServiceGroupByResultsPropertyValues;
import org.openecomp.dcae.controller.inventory.InventoryPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>DCAE Service Group By Results</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.openecomp.dcae.controller.inventory.impl.DCAEServiceGroupByResultsImpl#getPropertyName <em>Property Name</em>}</li>
* <li>{@link org.openecomp.dcae.controller.inventory.impl.DCAEServiceGroupByResultsImpl#getPropertyValues <em>Property Values</em>}</li>
* </ul>
*
* @generated
*/
public class DCAEServiceGroupByResultsImpl extends MinimalEObjectImpl.Container implements DCAEServiceGroupByResults {
/**
* The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyName()
* @generated
* @ordered
*/
protected static final String PROPERTY_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyName()
* @generated
* @ordered
*/
protected String propertyName = PROPERTY_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getPropertyValues() <em>Property Values</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyValues()
* @generated
* @ordered
*/
protected EList<DCAEServiceGroupByResultsPropertyValues> propertyValues;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DCAEServiceGroupByResultsImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return InventoryPackage.Literals.DCAE_SERVICE_GROUP_BY_RESULTS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPropertyName() {
return propertyName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPropertyName(String newPropertyName) {
String oldPropertyName = propertyName;
propertyName = newPropertyName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_NAME, oldPropertyName, propertyName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DCAEServiceGroupByResultsPropertyValues> getPropertyValues() {
if (propertyValues == null) {
propertyValues = new EObjectContainmentEList<DCAEServiceGroupByResultsPropertyValues>(DCAEServiceGroupByResultsPropertyValues.class, this, InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES);
}
return propertyValues;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES:
return ((InternalEList<?>)getPropertyValues()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_NAME:
return getPropertyName();
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES:
return getPropertyValues();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_NAME:
setPropertyName((String)newValue);
return;
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES:
getPropertyValues().clear();
getPropertyValues().addAll((Collection<? extends DCAEServiceGroupByResultsPropertyValues>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_NAME:
setPropertyName(PROPERTY_NAME_EDEFAULT);
return;
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES:
getPropertyValues().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_NAME:
return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName);
case InventoryPackage.DCAE_SERVICE_GROUP_BY_RESULTS__PROPERTY_VALUES:
return propertyValues != null && !propertyValues.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (propertyName: ");
result.append(propertyName);
result.append(')');
return result.toString();
}
} //DCAEServiceGroupByResultsImpl
| 28.538117 | 207 | 0.713388 |
30e968c4810248de00fe1f1973456fc17ce83742 | 5,177 | /*
* Copyright 2020 Netflix, 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.netflix.spinnaker.gate.controllers;
import com.netflix.spinnaker.gate.config.SpinnakerExtensionsConfigProperties;
import com.netflix.spinnaker.gate.services.TaskService;
import com.netflix.spinnaker.gate.services.internal.Front50Service;
import com.netflix.spinnaker.security.AuthenticatedRequest;
import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
/**
* EndPoints supporting CRUD operations for PluginInfo objects.
*
* <p>TODO: Currently write operations are secured using application as a resource and in future we
* need to move more concrete security model with a specific resource type for plugin management.
*/
@RestController
@RequestMapping(value = "/pluginInfo")
@Slf4j
public class PluginController {
/**
* If not configured, this application will be used to record orca tasks against, plus also used
* to verify permissions against.
*/
private static final String DEFAULT_APPLICATION_NAME = "spinnakerplugins";
private TaskService taskService;
private Front50Service front50Service;
private SpinnakerExtensionsConfigProperties spinnakerExtensionsConfigProperties;
@Autowired
public PluginController(
TaskService taskService,
Front50Service front50Service,
SpinnakerExtensionsConfigProperties spinnakerExtensionsConfigProperties) {
this.taskService = taskService;
this.front50Service = front50Service;
this.spinnakerExtensionsConfigProperties = spinnakerExtensionsConfigProperties;
}
@ApiOperation(value = "Persist plugin metadata information")
@PreAuthorize("hasPermission(#this.this.appName, 'APPLICATION', 'WRITE')")
@RequestMapping(
method = {RequestMethod.POST, RequestMethod.PUT},
consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(value = HttpStatus.ACCEPTED)
Map persistPluginInfo(@RequestBody Map pluginInfo) {
List<Map<String, Object>> jobs = new ArrayList<>();
Map<String, Object> job = new HashMap<>();
job.put("type", "upsertPluginInfo");
job.put("pluginInfo", pluginInfo);
job.put("user", AuthenticatedRequest.getSpinnakerUser().orElse("anonymous"));
jobs.add(job);
return initiateTask("Upsert plugin info with Id: " + pluginInfo.get("id"), jobs);
}
@ApiOperation(value = "Delete plugin info with the provided Id")
@PreAuthorize("hasPermission(#this.this.appName, 'APPLICATION', 'WRITE')")
@RequestMapping(
value = "/{id:.+}",
method = {RequestMethod.DELETE},
consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(value = HttpStatus.ACCEPTED)
Map deletePluginInfo(@PathVariable String id) {
List<Map<String, Object>> jobs = new ArrayList<>();
Map<String, Object> job = new HashMap<>();
job.put("type", "deletePluginInfo");
job.put("pluginInfoId", id);
job.put("user", AuthenticatedRequest.getSpinnakerUser().orElse("anonymous"));
jobs.add(job);
return initiateTask("Delete Plugin info with Id: " + id, jobs);
}
@ApiOperation(value = "Get all plugin info objects")
@RequestMapping(method = RequestMethod.GET)
List<Map> getAllPluginInfo(@RequestParam(value = "service", required = false) String service) {
return front50Service.getPluginInfo(service);
}
private Map initiateTask(String description, List<Map<String, Object>> jobs) {
Map<String, Object> operation = new HashMap<>();
operation.put("description", description);
operation.put("application", getAppName());
operation.put("job", jobs);
return taskService.create(operation);
}
public String getAppName() {
String applicationName = spinnakerExtensionsConfigProperties.getApplicationName();
if (StringUtils.isEmpty(applicationName)) {
applicationName = DEFAULT_APPLICATION_NAME;
}
return applicationName;
}
}
| 39.823077 | 99 | 0.761831 |
0255a28c0065b01971623d4dae2f3fb69e3730bd | 325 | package com.liang;
/**
* Created by GBLiang on 9/22/2017.
*/
public class RNAlarmConstants {
public final static String REACT_NATIVE_ALARM = "REACT_NATIVE_ALARM";
public final static String REACT_NATIVE_ALARM_TITLE = "title";
public final static String REACT_NATIVE_ALARM_MUSIC_URI = "musicUri";
}
| 27.083333 | 74 | 0.729231 |
7b7af91d8eb07884751be3ae8a89b73c8c63aae9 | 11,208 | /*
* Copyright 2021 The University of Manchester
*
* 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.acuity.visualisations.report.entity;
import com.acuity.visualisations.util.Pair;
import lombok.Getter;
import lombok.Setter;
import org.mapdb.DB;
import org.mapdb.DBMaker;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* This class contains report data relating to a particular source data file
*/
public class FileReport {
private DB db = DBMaker
.newTempFileDB()
.transactionDisable()
.deleteFilesAfterClose()
.asyncWriteEnable()
// .mmapFileEnableIfSupported()
.make();
/**
* A map of the source column name as the key and the ACUITY column name as the value
*/
@Getter
private Map<String, Column> columns = new HashMap<>();
/**
* A set containing the raw subjects
*/
@Getter
private Set<String> rawSubjects = new HashSet<>();
/**
* A set containing the ACUITY data entities
*/
@Getter
private Set<String> acuityEntities = new HashSet<>();
/**
* A map of the ACUITY entities that are not mapped to source fields.
*/
@Getter
private Map<String, List<String>> unmappedEntityFields = new HashMap<>();
/**
* The number of rows that were successfully uploaded during the ETL process
*/
@Getter
private int rowsUploaded = 0;
/**
* File size in bytes
*/
@Getter
@Setter
private long fileSize;
/**
* Closes MapDB
*/
public void closeMapDB() {
db.close();
}
public void setColumn(String rawColName) {
getColumn(rawColName).isMapped = false;
}
/**
* Adds a parsed subject to the rawSubjects local instance variable set.
*
* @param subject The subject to add
*/
public void addParsedSubject(String subject) {
rawSubjects.add(subject);
}
/**
* Adds a ACUITY data entity to the acuityEntities local instance variable set.
*
* @param entityName The name of the entity to add
*/
public void addAcuityEntity(String entityName) {
acuityEntities.add(entityName);
}
/**
* Sets the given column to be flagged as being mapped
*
* @param rawColName The data source column name
* @param colName The ACUITY column name
* @param entityName The name of the ACUITY entity that the column belongs to
*/
public void setColumnMapped(String rawColName, String colName, String entityName) {
getColumn(rawColName).isMapped = true;
getColumn(rawColName).colName = colName;
getColumn(rawColName).entityName = entityName;
}
/**
* Associates a data source error to the given source column
*
* @param rawColName The raw data source column
* @param errorDesc The description of the error
*/
public void addDataSourceError(String rawColName, String errorDesc) {
Column column = getColumn(rawColName);
column.colErrors.add(new Pair<ColumnErrorType, String>(ColumnErrorType.DATA_SOURCE_ERROR, errorDesc));
}
/**
* Increments the number of rows that have been uploaded
*/
public void incRowsUploaded() {
rowsUploaded++;
}
/**
* Increments the number of parsed columns
*
* @param rawColName The name of the raw data source column name
*/
public void incColumnParsed(String rawColName) {
Column column = getColumn(rawColName);
column.parsedTotal++;
}
/**
* Associates a column error to the given raw data source column
*
* @param rawColName The name of the raw data source column
* @param errorDesc The description of the error
*/
public void addColumnError(String rawColName, String errorDesc) {
Column column = getColumn(rawColName);
column.colErrors.add(new Pair<ColumnErrorType, String>(ColumnErrorType.MAPPING_ERROR, errorDesc));
}
/**
* Adds a ACUITY entity field that isn't mapped to the report
*
* @param entityName The internal ACUITY entity name
* @param fieldName The name of the field
*/
public void addEntityFieldNotMappedError(String entityName, String fieldName) {
if (!unmappedEntityFields.containsKey(entityName)) {
unmappedEntityFields.put(entityName, new ArrayList<String>());
}
unmappedEntityFields.get(entityName).add(fieldName);
}
/**
* Associates a value error to the source data column and value
*
* @param rawColName The name of the raw data source column
* @param rawValue The value with an error
* @param isCritical Set to true if the value cannot be parsed, otherwise
* set to false if the value needed modification prior
* to parsing. E.g. Changing a number string to a float
* @param errorDesc A description of the error
*/
public void addValueError(String rawColName, String rawValue, boolean isCritical, String errorDesc) {
Column column = getColumn(rawColName);
Map<ValueError, Integer> valueErrorCountMap = column.getValueErrorCountMap();
ValueError valueError = new ValueError(isCritical ? ValueErrorType.PARSE_ERROR : ValueErrorType.PARSE_WARNING, errorDesc, rawValue);
column.parseFailures++;
column.getValErrors().add(valueError);
if (!valueErrorCountMap.containsKey(valueError)) {
valueErrorCountMap.put(valueError, 0);
}
valueErrorCountMap.put(valueError, valueErrorCountMap.get(valueError) + 1);
}
/**
* Gets the column object associated with the raw column name
*
* @param rawColName The source column name
* @return The Column object associated with the raw column name
*/
private Column getColumn(String rawColName) {
return columns.computeIfAbsent(rawColName, s -> new Column(rawColName, false));
}
/**
* Represents a source data column
*/
public final class Column implements Serializable {
private static final long serialVersionUID = -615503619101861202L;
/**
* The total number of times the column has been parsed
*/
private int parsedTotal;
/**
* The total number of times the column has not been parsed
*/
private int parseFailures;
/**
* The ACUITY column name
*/
private String colName;
/**
* The data source column name
*/
private String rawColName;
/**
* Whether the column has been mapped to a ACUITY data field
*/
private boolean isMapped = false;
/**
* The name of the ACUITY entity that this column belongs to
*/
private String entityName;
/**
* A list of errors associated with the column
*/
private List<Pair<ColumnErrorType, String>> colErrors = new ArrayList<>();
/**
* A map of errors counts associated with the column
*/
private Map<ValueError, Integer> valueErrorCountMap = new HashMap<>();
/**
* Creates a new Column object with the given source column name
*
* @param rawColName The source column name
* @param mapped Whether the column has been mapped to a ACUITY field
*/
private Column(String rawColName, boolean mapped) {
this.rawColName = rawColName;
isMapped = mapped;
}
public int getParsedTotal() {
return parsedTotal;
}
public int getParseFailures() {
return parseFailures;
}
public String getRawColName() {
return rawColName;
}
public boolean isMapped() {
return isMapped;
}
public List<Pair<ColumnErrorType, String>> getColErrors() {
return colErrors;
}
public Map<ValueError, Integer> getValueErrorCountMap() {
return valueErrorCountMap;
}
public Set<ValueError> getValErrors() {
db.checkNotClosed();
return db.getHashSet(rawColName);
}
public String getFullName() {
return this.entityName + "." + this.colName;
}
}
/**
* Contains information for errors associated with a source value
*/
public static final class ValueError implements Serializable {
private static final long serialVersionUID = -5127539239024867557L;
/**
* The type of error. A warning or error.
*/
private ValueErrorType errorType;
/**
* A description of the error
*/
private String errorDesc;
/**
* The source value
*/
private String rawValue;
/**
* Creates a new instance of the class with the given values
*
* @param errorType The type of error. A warning or error.
* @param errorDesc A description of the error.
* @param rawValue The source data value
*/
private ValueError(ValueErrorType errorType, String errorDesc, String rawValue) {
this.errorType = errorType;
this.errorDesc = errorDesc;
this.rawValue = rawValue;
}
public ValueErrorType getErrorType() {
return errorType;
}
public String getErrorDesc() {
return errorDesc;
}
public String getRawValue() {
return rawValue;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ValueError)) {
return false;
}
ValueError that = (ValueError) o;
return (errorDesc != null ? errorDesc.equals(that.errorDesc) : that.errorDesc == null)
&& errorType == that.errorType
&& (rawValue != null ? rawValue.equals(that.rawValue) : that.rawValue == null);
}
@Override
public int hashCode() {
int result = errorType != null ? errorType.hashCode() : 0;
result = 31 * result + (errorDesc != null ? errorDesc.hashCode() : 0);
result = 31 * result + (rawValue != null ? rawValue.hashCode() : 0);
return result;
}
}
}
| 30.048257 | 140 | 0.613936 |
617653afcbc1cc7e882292c04c8051d9e75ef007 | 4,387 | /*
* Copyright (C) 2021 The Android Open Source Project
*
* 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.google.android.material.navigationrail;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static com.google.android.material.navigationrail.NavigationRailView.DEFAULT_MENU_GRAVITY;
import static java.lang.Math.min;
import android.content.Context;
import androidx.appcompat.view.menu.MenuBuilder;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import com.google.android.material.navigation.NavigationBarItemView;
import com.google.android.material.navigation.NavigationBarMenuView;
/** @hide For internal use only. */
@RestrictTo(LIBRARY_GROUP)
public class NavigationRailMenuView extends NavigationBarMenuView {
private final FrameLayout.LayoutParams layoutParams =
new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
public NavigationRailMenuView(@NonNull Context context) {
super(context);
layoutParams.gravity = DEFAULT_MENU_GRAVITY;
setLayoutParams(layoutParams);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int childHeightSpec = makeSharedHeightSpec(widthMeasureSpec, heightMeasureSpec);
int childCount = getChildCount();
int maxWidth = 0;
int totalHeight = 0;
for (int i = 0; i < childCount; i++) {
final View child = getChildAt(i);
if (child.getVisibility() != GONE) {
child.measure(widthMeasureSpec, childHeightSpec);
ViewGroup.LayoutParams params = child.getLayoutParams();
params.width = child.getMeasuredWidth();
params.height = child.getMeasuredHeight();
totalHeight += params.height;
if (params.width > maxWidth) {
maxWidth = params.width;
}
}
}
// Set view to use a fixed width, but wrap all item heights
setMeasuredDimension(
View.resolveSizeAndState(
maxWidth,
MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.EXACTLY),
/* childMeasuredState= */ 0),
View.resolveSizeAndState(
totalHeight,
MeasureSpec.makeMeasureSpec(totalHeight, MeasureSpec.EXACTLY),
/* childMeasuredState= */ 0));
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
final int count = getChildCount();
final int width = right - left;
int used = 0;
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if (child.getVisibility() != GONE) {
int childHeight = child.getMeasuredHeight();
child.layout(/* l= */ 0, used, width, childHeight + used);
used += childHeight;
}
}
}
@Override
@NonNull
protected NavigationBarItemView createNavigationBarItemView(@NonNull Context context) {
return new NavigationRailItemView(context);
}
private int makeSharedHeightSpec(int parentWidthSpec, int parentHeightSpec) {
MenuBuilder menu = getMenu();
int visibleCount = menu.getVisibleItems().size();
int maxHeight = MeasureSpec.getSize(parentHeightSpec);
int maxAvailable = maxHeight / (visibleCount == 0 ? 1 : visibleCount);
return MeasureSpec.makeMeasureSpec(
min(MeasureSpec.getSize(parentWidthSpec), maxAvailable), MeasureSpec.EXACTLY);
}
void setMenuGravity(int gravity) {
if (layoutParams.gravity != gravity) {
layoutParams.gravity = gravity;
setLayoutParams(layoutParams);
}
}
int getMenuGravity() {
return layoutParams.gravity;
}
boolean isTopGravity() {
return (layoutParams.gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.TOP;
}
}
| 34.273438 | 97 | 0.715523 |
556ae42113efa78ac3c45f50ade79d29dd4bfed5 | 759 | package eu.nubomedia.af.kurento.net;
import org.vertx.java.core.json.JsonObject;
import eu.nubomedia.af.kurento.SessionHandler;
public interface NetworkService {
void createSession(String action, String sessionId, String from, String to, String content, String contentType, SessionHandler handler);
void acceptSession(String action, String sessionId, String content, String contentType, SessionHandler handler);
void confirmSession(String action, String sessionId, String content, String contentType, SessionHandler handler);
void cancelSession(String action, String sessionId, String content, String contentType, SessionHandler handler);
void endSession(String action, String sessionId, SessionHandler handler);
JsonObject getConfig();
}
| 36.142857 | 137 | 0.810277 |
056ed715808ba369332cbb63de6474fda91cb33f | 9,983 | /*
ScoreBoard
Copyright © 2020 Adam Poole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject
to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.floatingpanda.scoreboard.model;
import android.content.Context;
import androidx.arch.core.executor.testing.InstantTaskExecutorRule;
import androidx.room.Room;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.floatingpanda.scoreboard.LiveDataTestUtil;
import com.floatingpanda.scoreboard.TestData;
import com.floatingpanda.scoreboard.data.AppDatabase;
import com.floatingpanda.scoreboard.data.daos.GroupDao;
import com.floatingpanda.scoreboard.data.daos.GroupMemberDao;
import com.floatingpanda.scoreboard.data.entities.Group;
import com.floatingpanda.scoreboard.data.entities.GroupMember;
import com.floatingpanda.scoreboard.data.entities.Member;
import com.floatingpanda.scoreboard.data.daos.MemberDao;
import com.floatingpanda.scoreboard.repositories.MemberRepository;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@RunWith(AndroidJUnit4.class)
public class MemberRepositoryTest {
@Rule
public InstantTaskExecutorRule instantTaskExecutorRule = new InstantTaskExecutorRule();
private AppDatabase db;
private GroupDao groupDao;
private MemberDao memberDao;
private GroupMemberDao groupMemberDao;
private MemberRepository memberRepository;
@Before
public void createDb() {
Context context = ApplicationProvider.getApplicationContext();
db = Room.inMemoryDatabaseBuilder(context, AppDatabase.class)
.allowMainThreadQueries()
.build();
groupDao = db.groupDao();
memberDao = db.memberDao();
groupMemberDao = db.groupMemberDao();
memberRepository = new MemberRepository(db);
}
@After
public void closeDb() throws IOException {
db.close();
}
@Test
public void getLiveMembersWhenNoMembersInserted() throws InterruptedException {
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertTrue(members.isEmpty());
}
@Test
public void getLiveMembersFromDatabaseWhenMembersInserted() throws InterruptedException {
memberDao.insertAll(TestData.MEMBERS.toArray(new Member[TestData.MEMBERS.size()]));
TimeUnit.MILLISECONDS.sleep(100);
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertFalse(members.isEmpty());
assertThat(members.size(), is(TestData.MEMBERS.size()));
}
@Test
public void getLiveMemberFromDatabaseWhenNoMembersInserted() throws InterruptedException {
List<Member> members = LiveDataTestUtil.getValue((memberRepository.getAll()));
Member member = LiveDataTestUtil.getValue(memberRepository.getLiveMemberById(TestData.MEMBER_1.getId()));
assertTrue(members.isEmpty());
assertNull(member);
}
@Test
public void getLiveMemberFromDatabaseWhenMembersInserted() throws InterruptedException {
memberDao.insertAll(TestData.MEMBERS.toArray(new Member[TestData.MEMBERS.size()]));
TimeUnit.MILLISECONDS.sleep(100);
List<Member> members = LiveDataTestUtil.getValue((memberRepository.getAll()));
assertThat(members.size(), is(TestData.MEMBERS.size()));
Member member = LiveDataTestUtil.getValue(memberRepository.getLiveMemberById(TestData.MEMBER_1.getId()));
assertThat(member, is(TestData.MEMBER_1));
}
@Test
public void getLiveMembersOfAGroupByGroupIdWhenNoneInserted() throws InterruptedException {
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getLiveMembersOfAGroupByGroupId(TestData.GROUP_3.getId()));
assertTrue(members.isEmpty());
}
@Test
public void getLiveMembersOfAGroupByGroupIdWhenAllInserted() throws InterruptedException {
memberDao.insertAll(TestData.MEMBERS.toArray(new Member[TestData.MEMBERS.size()]));
groupDao.insertAll(TestData.GROUPS.toArray(new Group[TestData.GROUPS.size()]));
groupMemberDao.insertAll(TestData.GROUP_MEMBERS.toArray(new GroupMember[TestData.GROUP_MEMBERS.size()]));
//Group 3 has 2 members, member 1 and member 3, associated via groupmember 3 and groupmember 4, respectively.
List<GroupMember> groupMembers = LiveDataTestUtil.getValue(groupMemberDao.getAll());
assertTrue(groupMembers.contains(TestData.GROUP_MEMBER_3));
assertTrue(groupMembers.contains(TestData.GROUP_MEMBER_4));
List<Member> group3Members = LiveDataTestUtil.getValue(memberRepository.getLiveMembersOfAGroupByGroupId(TestData.GROUP_3.getId()));
assertThat(group3Members.size(), is(2));
assertTrue(group3Members.contains(TestData.MEMBER_1));
assertTrue(group3Members.contains(TestData.MEMBER_3));
}
@Test
public void addMemberToDatabase() throws InterruptedException {
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertTrue(members.isEmpty());
memberRepository.insert(TestData.MEMBER_1);
// Waiting for background thread to finish.
TimeUnit.MILLISECONDS.sleep(100);
members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertThat(members.size(), is(1));
assertThat(members.get(0), is(TestData.MEMBER_1));
}
@Test
public void editMemberInDatabase() throws InterruptedException {
memberRepository.insert(TestData.MEMBER_1);
TimeUnit.MILLISECONDS.sleep(100);
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertThat(members.size(), is(1));
assertThat(members.get(0), is(TestData.MEMBER_1));
Member member = new Member(TestData.MEMBER_1);
assertThat(members.get(0), is(members.get(0)));
String newNickname = "Changed nickname";
String newNotes = "Changed notes";
String newImgFilePath = "Changed img file path";
Date newDateCreated = new Date(100);
member.setNickname(newNickname);
member.setNotes(newNotes);
member.setImgFilePath(newImgFilePath);
member.setDateCreated(newDateCreated);
assertThat(member, is(not(members.get(0))));
memberRepository.update(member);
// Waiting for background thread to finish.
TimeUnit.MILLISECONDS.sleep(100);
members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertThat(members.size(), is(1));
Member editedMember = members.get(0);
assertThat(editedMember, is(not(TestData.BG_CATEGORY_1)));
assertThat(editedMember, is(member));
assertThat(editedMember.getNickname(), is(newNickname));
assertThat(editedMember.getNotes(), is(newNotes));
assertThat(editedMember.getImgFilePath(), is(newImgFilePath));
assertThat(editedMember.getDateCreated(), is(newDateCreated));
}
@Test
public void deleteMemberInDatabase() throws InterruptedException {
memberRepository.insert(TestData.MEMBER_1);
TimeUnit.MILLISECONDS.sleep(100);
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertThat(members.size(), is(1));
assertThat(members.get(0), is(TestData.MEMBER_1));
memberRepository.delete(TestData.MEMBER_1);
// Waiting for background thread to finish.
TimeUnit.MILLISECONDS.sleep(100);
members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertTrue(members.isEmpty());
}
@Test
public void testContains() throws InterruptedException {
memberDao.insertAll(TestData.MEMBERS.toArray(new Member[TestData.MEMBERS.size()]));
List<Member> members = LiveDataTestUtil.getValue(memberRepository.getAll());
assertThat(members.size(), is(TestData.MEMBERS.size()));
//Test case 1: Contains - nickname exists in database.
String nickname = TestData.MEMBER_1.getNickname();
boolean contains = memberRepository.containsMemberNickname(nickname);
assertTrue(contains);
//Test case 2: Does not contain - nickname does not exist in database.
nickname = "Non-existent name";
contains = memberRepository.containsMemberNickname(nickname);
assertFalse(contains);
//Test case 3: Does not contain - empty nickname does not exist in database.
nickname = "";
contains = memberRepository.containsMemberNickname(nickname);
assertFalse(contains);
}
}
| 39.14902 | 139 | 0.731544 |
f389f7f1e03260b3515e97700cb6148f73097e5d | 7,196 |
package generated.zcsclient.mail;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import generated.zcsclient.zm.testAttributeName;
/**
* <p>Java class for msgSpec complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="msgSpec">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="header" type="{urn:zimbra}attributeName" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="part" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="raw" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="read" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}int" />
* <attribute name="html" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="neuter" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="ridZ" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="needExp" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "msgSpec", propOrder = {
"header"
})
public class testMsgSpec {
protected List<testAttributeName> header;
@XmlAttribute(name = "id", required = true)
protected String id;
@XmlAttribute(name = "part")
protected String part;
@XmlAttribute(name = "raw")
protected Boolean raw;
@XmlAttribute(name = "read")
protected Boolean read;
@XmlAttribute(name = "max")
protected Integer max;
@XmlAttribute(name = "html")
protected Boolean html;
@XmlAttribute(name = "neuter")
protected Boolean neuter;
@XmlAttribute(name = "ridZ")
protected String ridZ;
@XmlAttribute(name = "needExp")
protected Boolean needExp;
/**
* Gets the value of the header property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the header property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHeader().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link testAttributeName }
*
*
*/
public List<testAttributeName> getHeader() {
if (header == null) {
header = new ArrayList<testAttributeName>();
}
return this.header;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the part property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPart() {
return part;
}
/**
* Sets the value of the part property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPart(String value) {
this.part = value;
}
/**
* Gets the value of the raw property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isRaw() {
return raw;
}
/**
* Sets the value of the raw property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setRaw(Boolean value) {
this.raw = value;
}
/**
* Gets the value of the read property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isRead() {
return read;
}
/**
* Sets the value of the read property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setRead(Boolean value) {
this.read = value;
}
/**
* Gets the value of the max property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getMax() {
return max;
}
/**
* Sets the value of the max property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setMax(Integer value) {
this.max = value;
}
/**
* Gets the value of the html property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isHtml() {
return html;
}
/**
* Sets the value of the html property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setHtml(Boolean value) {
this.html = value;
}
/**
* Gets the value of the neuter property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isNeuter() {
return neuter;
}
/**
* Sets the value of the neuter property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setNeuter(Boolean value) {
this.neuter = value;
}
/**
* Gets the value of the ridZ property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRidZ() {
return ridZ;
}
/**
* Sets the value of the ridZ property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRidZ(String value) {
this.ridZ = value;
}
/**
* Gets the value of the needExp property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isNeedExp() {
return needExp;
}
/**
* Sets the value of the needExp property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setNeedExp(Boolean value) {
this.needExp = value;
}
}
| 22.990415 | 107 | 0.533769 |
c1c499ba98563570abdb0388c8f890441660f670 | 3,353 | /*
Copyright 2014 BarD Software s.r.o
Copyright 2010-2013 GanttProject Team
This file is part of GanttProject, an opensource project management tool.
GanttProject is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GanttProject 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 GanttProject. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sourceforge.ganttproject.test.task.hierarchy;
import net.sourceforge.ganttproject.test.task.TaskTestCase;
import net.sourceforge.ganttproject.task.Task;
import net.sourceforge.ganttproject.task.TaskContainmentHierarchyFacade;
import net.sourceforge.ganttproject.util.collect.Pair;
import java.util.Arrays;
import java.util.List;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
* Tests for {@link TaskContainmentHierarchyFacade}
*
* @author dbarashev (Dmitry Barashev)
*/
public class TestTaskHierarchy extends TaskTestCase {
public void testCreateSimpleHierarchy() {
Task task1 = getTaskManager().createTask();
Task task2 = getTaskManager().createTask();
task2.move(task1);
assertEquals("Unexpected supertask of task=" + task2, task1, task2
.getSupertask());
assertEquals("Unexpected nested tasks of task=" + task1, Arrays
.asList(task2), Arrays.asList(task1
.getNestedTasks()));
}
public void testBreadthFirstSearch() {
Task task1 = getTaskManager().createTask();
Task task2 = getTaskManager().createTask();
Task task3 = getTaskManager().createTask();
Task task4 = getTaskManager().createTask();
Task task5 = getTaskManager().createTask();
final Task task6 = getTaskManager().createTask();
Task task7 = getTaskManager().createTask();
task6.move(task7);
task5.move(task7);
task4.move(task6);
task3.move(task6);
task2.move(task5);
task1.move(task5);
assertEquals(ImmutableList.of(task7, task6, task5, task4, task3, task2, task1),
getTaskManager().getTaskHierarchy().breadthFirstSearch(null, false));
assertEquals(ImmutableList.of(task6, task4, task3),
getTaskManager().getTaskHierarchy().breadthFirstSearch(task6, true));
assertEquals(ImmutableList.of(task2, task1),
getTaskManager().getTaskHierarchy().breadthFirstSearch(task5, false));
final List<Task> filteredBfs = Lists.newArrayList();
getTaskManager().getTaskHierarchy().breadthFirstSearch(getTaskManager().getRootTask(), new Predicate<Pair<Task,Task>>() {
@Override
public boolean apply(Pair<Task, Task> parent_child) {
filteredBfs.add(parent_child.second());
return parent_child.second() != task6;
}
});
assertEquals(ImmutableList.of(getTaskManager().getRootTask(), task7, task6, task5, task2, task1), filteredBfs);
}
}
| 39.447059 | 127 | 0.716672 |
73e2c1c8b22e18e46055ad753134b68311e50163 | 2,921 | package entities;
import javax.persistence.*;
import java.util.Collection;
/**
* Created by Alexandre on 09/05/2016.
*/
@Entity
@Table(name = "parties", schema = "credit_mut", catalog = "")
public class PartiesEntity {
private int id;
private byte isPublic;
private String name;
private TournamentsEntity tournamentsEntity;
private UsersEntity usersEntity;
private Collection<GroupsEntity> groupsEntities;
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "is_public", nullable = false)
public byte getIsPublic() {
return isPublic;
}
public void setIsPublic(byte isPublic) {
this.isPublic = isPublic;
}
@Basic
@Column(name = "name", nullable = false, length = 64)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ManyToOne
@JoinColumn (name = "tournament_id")
public TournamentsEntity getTournamentsEntity() {
return tournamentsEntity;
}
public void setTournamentsEntity(TournamentsEntity tournamentsEntity) {
this.tournamentsEntity = tournamentsEntity;
}
@ManyToOne
@JoinColumn (name = "user_id")
public UsersEntity getUsersEntity () {
return usersEntity;
}
public void setUsersEntity(UsersEntity usersEntity) {
this.usersEntity = usersEntity;
}
@ManyToMany (cascade = CascadeType.ALL, mappedBy = "partiesEntities")
public Collection<GroupsEntity> getGroupsEntities() {
return groupsEntities;
}
public void setGroupsEntities(Collection<GroupsEntity> groupsEntities) {
this.groupsEntities = groupsEntities;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PartiesEntity that = (PartiesEntity) o;
if (id != that.id) return false;
if (isPublic != that.isPublic) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (int) isPublic;
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
}
private Collection<ChoicesPartiesEntity> choicesPartiesEntity;
@OneToMany(fetch = FetchType.EAGER, mappedBy = "partiesEntity")
public Collection<ChoicesPartiesEntity> getChoicesPartiesEntity() {
return choicesPartiesEntity;
}
public void setChoicesPartiesEntity(Collection<ChoicesPartiesEntity> choicesPartiesEntity) {
this.choicesPartiesEntity = choicesPartiesEntity;
}
}
| 26.080357 | 96 | 0.64875 |
c8a40115bcd01eac44312c2917eb8cd16d71fe7d | 314 | package kernbeisser.CustomComponents.ObjectTable.Adjustors;
import javax.swing.table.DefaultTableCellRenderer;
public interface TableCellAdjustor<V> {
void customizeFor(
DefaultTableCellRenderer component,
V v,
boolean isSelected,
boolean hasFocus,
int row,
int column);
}
| 20.933333 | 59 | 0.732484 |
0a1f1ba1f3cb6e55f71c755134c4d78b3896b23d | 1,031 | import java.util.Vector;
import jbotsim.Clock;
import jbotsim.Link;
import jbotsim.Node;
import jbotsim.Topology;
import jbotsim.ui.JViewer;
public class RingMain {
public static void main(String args[]){
int nbNodes=30;
if(args.length < 1) System.out.println("Usage: RingMain <size-of-the-ring>");
else nbNodes = Integer.parseInt(args[0]);
Topology t = new Topology();
Vector<RingNode> vec= new Vector<RingNode>();
for (int i=0; i<nbNodes; i++){
RingNode node= new RingNode();
node.disableWireless();
node.RingSize = nbNodes;
double angle=(2.0*Math.PI/nbNodes)*i;
node.setLocation(300+Math.cos(angle)*200, 300+Math.sin(angle)*200);
t.addNode(node);
vec.add(node);
}
for (int i=0; i<nbNodes-1; i++){
t.addLink(new Link(vec.get(i), vec.get(i+1)));
vec.get(i).right = vec.get(i+1);
vec.get(i+1).left = vec.get(i);
}
t.addLink(new Link(vec.get(nbNodes-1),vec.get(0)));
vec.get(nbNodes-1).right = vec.get(0);
vec.get(0).left = vec.get(nbNodes-1);
new JViewer(t);
}
}
| 26.435897 | 79 | 0.658584 |
fcf4c9a662a98dd02544382fbe0f1acdd455ba22 | 14,450 | /*
* Copyright 2020 Zhenjie Yan.
*
* 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.yanzhenjie.andserver.server;
import androidx.annotation.NonNull;
import com.yanzhenjie.andserver.AndServer;
import com.yanzhenjie.andserver.ProxyHandler;
import com.yanzhenjie.andserver.SSLSocketInitializer;
import com.yanzhenjie.andserver.Server;
import com.yanzhenjie.andserver.util.Executors;
import org.apache.httpcore.ConnectionClosedException;
import org.apache.httpcore.HttpException;
import org.apache.httpcore.HttpHost;
import org.apache.httpcore.HttpServerConnection;
import org.apache.httpcore.impl.DefaultBHttpClientConnection;
import org.apache.httpcore.impl.DefaultBHttpServerConnection;
import org.apache.httpcore.protocol.BasicHttpContext;
import org.apache.httpcore.protocol.HttpCoreContext;
import org.apache.httpcore.protocol.HttpProcessor;
import org.apache.httpcore.protocol.HttpRequestHandler;
import org.apache.httpcore.protocol.HttpService;
import org.apache.httpcore.protocol.ImmutableHttpProcessor;
import org.apache.httpcore.protocol.ResponseConnControl;
import org.apache.httpcore.protocol.ResponseContent;
import org.apache.httpcore.protocol.ResponseDate;
import org.apache.httpcore.protocol.ResponseServer;
import org.apache.httpcore.protocol.UriHttpRequestHandlerMapper;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocket;
/**
* Created by Zhenjie Yan on 3/7/20.
*/
public class ProxyServer extends BasicServer<ProxyServer.Builder> {
public static final String PROXY_CONN_CLIENT = "http.proxy.conn.client";
public static final String PROXY_CONN_ALIVE = "http.proxy.conn.alive";
public static ProxyServer.Builder newBuilder() {
return new ProxyServer.Builder();
}
private final InetAddress mInetAddress;
private final int mPort;
private final int mTimeout;
private final ServerSocketFactory mSocketFactory;
private final SSLContext mSSLContext;
private final SSLSocketInitializer mSSLSocketInitializer;
private final Server.ServerListener mListener;
private Map<String, HttpHost> mHostList;
private HttpServer mHttpServer;
private boolean isRunning;
private ProxyServer(Builder builder) {
super(builder);
this.mInetAddress = builder.inetAddress;
this.mPort = builder.port;
this.mTimeout = builder.timeout;
this.mSocketFactory = builder.mSocketFactory;
this.mSSLContext = builder.sslContext;
this.mSSLSocketInitializer = builder.mSSLSocketInitializer;
this.mListener = builder.listener;
this.mHostList = builder.mHostList;
}
@Override
protected HttpRequestHandler requestHandler() {
return new ProxyHandler(mHostList);
}
@Override
public void startup() {
if (isRunning) {
return;
}
Executors.getInstance().execute(new Runnable() {
@Override
public void run() {
ServerSocketFactory socketFactory = mSocketFactory;
if (socketFactory == null) {
if (mSSLContext != null) {
socketFactory = mSSLContext.getServerSocketFactory();
} else {
socketFactory = ServerSocketFactory.getDefault();
}
}
mHttpServer = new HttpServer(mInetAddress,
mPort,
mTimeout,
socketFactory,
mSSLSocketInitializer,
requestHandler());
try {
mHttpServer.startServer();
isRunning = true;
Executors.getInstance().post(new Runnable() {
@Override
public void run() {
if (mListener != null) {
mListener.onStarted();
}
}
});
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
mHttpServer.stopServer();
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
@Override
public void shutdown() {
if (!isRunning) {
return;
}
Executors.getInstance().execute(new Runnable() {
@Override
public void run() {
if (mHttpServer != null) {
mHttpServer.stopServer();
isRunning = false;
Executors.getInstance().post(new Runnable() {
@Override
public void run() {
if (mListener != null) {
mListener.onStopped();
}
}
});
}
}
});
}
public static class Builder extends BasicServer.Builder<Builder, ProxyServer>
implements Server.ProxyBuilder<Builder, ProxyServer> {
private Map<String, HttpHost> mHostList = new HashMap<>();
public Builder() {
}
@Override
public Builder addProxy(String hostName, String proxyHost) {
mHostList.put(hostName.toLowerCase(Locale.ROOT), HttpHost.create(proxyHost));
return this;
}
@Override
public ProxyServer build() {
return new ProxyServer(this);
}
}
private static class HttpServer implements Runnable {
private final InetAddress mInetAddress;
private final int mPort;
private final int mTimeout;
private final ServerSocketFactory mSocketFactory;
private final SSLSocketInitializer mSSLSocketInitializer;
private final HttpRequestHandler mHandler;
BlockingQueue<Runnable> workQueue = new SynchronousQueue<>();
BlockingQueue<Runnable> serverQueue = new SynchronousQueue<>();
private final ThreadPoolExecutor mServerExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
workQueue, new ThreadFactoryImpl("HTTP-Server-"));
private final ThreadGroup mWorkerThreads = new ThreadGroup("HTTP-workers");
private final ThreadPoolExecutor mWorkerExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 1L,
TimeUnit.SECONDS, serverQueue, new ThreadFactoryImpl("HTTP-Handlers-", mWorkerThreads)) {
@Override
protected void beforeExecute(Thread t, Runnable r) {
if (r instanceof Worker) {
mWorkerSet.put((Worker) r, Boolean.TRUE);
}
}
@Override
protected void afterExecute(Runnable r, Throwable t) {
if (r instanceof Worker) {
mWorkerSet.remove(r);
}
}
};
private final Map<Worker, Boolean> mWorkerSet = new ConcurrentHashMap<>();
private HttpService mHttpService;
private ServerSocket mServerSocket;
public HttpServer(InetAddress inetAddress, int port, int timeout, ServerSocketFactory socketFactory,
SSLSocketInitializer sslSocketInitializer, HttpRequestHandler handler) {
this.mInetAddress = inetAddress;
this.mPort = port;
this.mTimeout = timeout;
this.mSocketFactory = socketFactory;
this.mSSLSocketInitializer = sslSocketInitializer;
this.mHandler = handler;
HttpProcessor inProcessor = new ImmutableHttpProcessor(
new ResponseDate(),
new ResponseServer(AndServer.INFO),
new ResponseContent(),
new ResponseConnControl());
UriHttpRequestHandlerMapper mapper = new UriHttpRequestHandlerMapper();
mapper.register("*", mHandler);
this.mHttpService = new HttpService(inProcessor, mapper);
}
public void startServer() throws IOException {
mServerSocket = mSocketFactory.createServerSocket();
mServerSocket.setReuseAddress(true);
mServerSocket.bind(new InetSocketAddress(mInetAddress, mPort), BUFFER);
mServerSocket.setReceiveBufferSize(BUFFER);
if (mSSLSocketInitializer != null && mServerSocket instanceof SSLServerSocket) {
mSSLSocketInitializer.onCreated((SSLServerSocket) mServerSocket);
}
mServerExecutor.execute(this);
}
public void stopServer() {
mServerExecutor.shutdown();
mWorkerExecutor.shutdown();
try {
mServerSocket.close();
} catch (IOException ignored) {
}
mWorkerThreads.interrupt();
try {
mWorkerExecutor.awaitTermination(3, TimeUnit.SECONDS);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
Set<Worker> workers = mWorkerSet.keySet();
for (Worker worker : workers) {
HttpServerConnection conn = worker.getServerConn();
try {
conn.shutdown();
} catch (IOException ignored) {
}
}
}
@Override
public void run() {
try {
while (!Thread.interrupted()) {
Socket socket = mServerSocket.accept();
socket.setSoTimeout(mTimeout);
socket.setKeepAlive(true);
socket.setTcpNoDelay(true);
socket.setReceiveBufferSize(BUFFER);
socket.setSendBufferSize(BUFFER);
socket.setSoLinger(true, 0);
DefaultBHttpServerConnection serverConn = new DefaultBHttpServerConnection(BUFFER);
serverConn.bind(socket);
DefaultBHttpClientConnection clientConn = new DefaultBHttpClientConnection(BUFFER);
Worker worker = new Worker(mHttpService, serverConn, clientConn);
mWorkerExecutor.execute(worker);
}
} catch (Exception ignored) {
}
}
}
private static class Worker implements Runnable {
private final HttpService mHttpService;
private final DefaultBHttpServerConnection mServerConn;
private final DefaultBHttpClientConnection mClientConn;
public Worker(HttpService httpservice,
DefaultBHttpServerConnection serverConn, DefaultBHttpClientConnection clientConn) {
this.mHttpService = httpservice;
this.mServerConn = serverConn;
this.mClientConn = clientConn;
}
public DefaultBHttpServerConnection getServerConn() {
return mServerConn;
}
@Override
public void run() {
BasicHttpContext localContext = new BasicHttpContext();
HttpCoreContext context = HttpCoreContext.adapt(localContext);
context.setAttribute(PROXY_CONN_CLIENT, mClientConn);
try {
while (!Thread.interrupted()) {
if (!mServerConn.isOpen()) {
mClientConn.close();
break;
}
mHttpService.handleRequest(mServerConn, context);
Boolean keepAlive = (Boolean) context.getAttribute(PROXY_CONN_ALIVE);
if (!Boolean.TRUE.equals(keepAlive)) {
mClientConn.close();
mServerConn.close();
break;
}
}
} catch (ConnectionClosedException ex) {
System.err.println("Client closed connection.");
} catch (IOException ex) {
System.err.println("I/O error: " + ex.getMessage());
} catch (HttpException ex) {
System.err.println("Unrecoverable HTTP protocol violation: " + ex.getMessage());
} finally {
try {
mServerConn.shutdown();
} catch (IOException ignore) {
}
try {
mClientConn.shutdown();
} catch (IOException ignore) {
}
}
}
}
private static class ThreadFactoryImpl implements ThreadFactory {
private final String mPrefix;
private final ThreadGroup mGroup;
private final AtomicLong mCount;
ThreadFactoryImpl(String prefix, ThreadGroup group) {
this.mPrefix = prefix;
this.mGroup = group;
this.mCount = new AtomicLong();
}
ThreadFactoryImpl(String mPrefix) {
this(mPrefix, null);
}
@Override
public Thread newThread(@NonNull Runnable target) {
return new Thread(mGroup, target, mPrefix + "-" + mCount.incrementAndGet());
}
}
} | 36.306533 | 114 | 0.597716 |
2958a635ca1c9f0f85bc349b2ecd32f84b89eefe | 3,671 | package GUI.controllers;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import models.User;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.URL;
import java.util.ResourceBundle;
public class RegisterController implements Initializable {
public TextField tfUsername;
public TextField tfFirstName;
public TextField tfLastName;
public TextField tfCountry;
public PasswordField pfConfirm;
public PasswordField pfPassword;
public Label lError;
private ObservableList<String> genderList = FXCollections.observableArrayList("Male", "Female", "Rather not say");
@FXML
public ChoiceBox<String> choiceGender;
@Override
public void initialize(URL location, ResourceBundle resources) {
choiceGender.setValue("Rather not say");
choiceGender.setItems(genderList);
}
public void login(MouseEvent mouseEvent) throws IOException {
Parent login = FXMLLoader.load(getClass().getResource("../views/login.fxml"));
Scene loginScene = new Scene(login);
Stage window = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
window.setTitle("Welcome");
window.setScene(loginScene);
window.show();
}
public void register(MouseEvent mouseEvent) throws IOException {
if (!isUsernameHasMin8Letters(tfUsername.getText())) {
lError.setText("Username is incorrect!");
} else if (!isTheSameString(pfPassword.getText(), pfConfirm.getText())) {
lError.setText("Passwords are different!");
} else if (tfCountry.getText().length() <=0
|| tfFirstName.getText().length() <=0
|| tfLastName.getText().length() <=0) {
lError.setText("All fields are required!");
} else {
User user = new User();
user.setUsername(tfUsername.getText());
user.setPassword(pfPassword.getText());
user.setCountry(tfCountry.getText());
user.setGender(choiceGender.getValue());
user.setFirstName(tfFirstName.getText());
user.setLastName(tfLastName.getText());
try {
Socket socket = new Socket("localhost", 4444);
ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream());
outputStream.writeObject("POST register");
outputStream.writeObject(user);
socket.close();
} catch (IOException exception) {
exception.printStackTrace();
}
login(mouseEvent);
}
clearForm();
}
private void clearForm() {
tfUsername.clear();
tfFirstName.clear();
tfLastName.clear();
tfCountry.clear();
pfConfirm.clear();
pfPassword.clear();
choiceGender.setValue("Rather not say");
}
public Boolean isTheSameString(String string1, String string2) {
if (string1.equals(string2))
return true;
return false;
}
public Boolean isUsernameHasMin8Letters(String username) {
if (username.length() >= 8)
return true;
return false;
}
}
| 33.372727 | 118 | 0.65459 |
8efebda578e38fdeaa50a52b93b275377bb1d871 | 14,062 | package org.smyld.gui.panels;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.FlowLayout;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import java.util.HashMap;
import java.util.TreeSet;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.smyld.gui.SMYLDLabel;
import org.smyld.gui.SMYLDPanel;
import org.smyld.gui.SMYLDTabbedPane;
import org.smyld.gui.dnd.DragableTransfereHandler;
import org.smyld.gui.event.DockablePanelListener;
import org.smyld.gui.event.DragableComponentListener;
import org.smyld.gui.util.SMYLDGUIUtil;
import org.smyld.resources.Resource;
public class DockablePanel extends SMYLDPanel implements Serializable,
DockableConstants, DragableComponentListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private String pnlRSColor = "wt";
private DockablePanelListener listener;
private BorderLayout borderLayout1 = new BorderLayout();
private SMYLDPanel contentPanel = new SMYLDPanel();
private SMYLDPanel topPanel = new SMYLDPanel(){
// Border colors are (59,108,156)
Color lightSide = new Color(120,179,236);
Color darkSide = new Color(88,154,219);
Color midColor = SMYLDGUIUtil.getMiddleColor(darkSide, lightSide);
Color lightMiddleSide = new Color(105,167,228);
Color darkMiddleSide = new Color(102,164,227);
//7Color darkSide = new Color(28,112,198);
public void setBackground(Color bg) {
// Disable the background change now
}
public void paintComponent(Graphics g){
super.paintComponent(g);
//Color titleColor = (Color)UIManager.getLookAndFeelDefaults().get("List.background");
Graphics2D gd = (Graphics2D)g;
gd.setPaint(new GradientPaint(getWidth()/2,0,lightSide, getWidth()/2, getHeight()/2,midColor));
gd.fillRect(0, 0, getWidth(), getHeight()/2);
gd.setPaint(new GradientPaint(getWidth()/2,getHeight()/2,darkSide, getWidth()/2, getHeight(),midColor));
gd.fillRect(0,getHeight()/2 , getWidth(), getHeight()/2);
gd.drawString("This is my test", 0, 20);
//super.paintComponent(g);
}
};
private SMYLDPanel titleRPanel = new SMYLDPanel();
private SMYLDPanel titleLPanel = new SMYLDPanel();
private SMYLDLabel minimizedLabel;
private String label;
private Resource res;
JLabel title = new JLabel("Title");
JLabel panelIcon;
SMYLDLabel hideLabel;
SMYLDLabel closeLabel;
private SMYLDTabbedPane tabPane;
private DockableComponent firstComponent;
// private String firstTitle;
// private ImageIcon firstIcon;
private HashMap<JComponent,DockableComponent> childComponents;
private DockablePanel instance;
private int status;
private int dockLocation;
public DockablePanel() {
instance = this;
init();
}
public static void main(String[] args){
TreeSet<String> sort = new TreeSet<String>();
for(Object curKey:UIManager.getLookAndFeelDefaults().keySet()){
sort.add(curKey.toString());
}
//sort.addAll(UIManager.getLookAndFeelDefaults().keySet());
for(Object curKey:sort){
System.out.println(curKey.toString());
}
}
private void init() {
res = new Resource();
childComponents = new HashMap<JComponent,DockableComponent>();
this.setLayout(borderLayout1);
panelIcon = new JLabel(res.getImageIcon("parser_sm.gif"));
initTitle();
this.add(topPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
minimizedLabel = createLabel();
}
public void addListener(DockablePanelListener dockabelListener) {
listener = dockabelListener;
}
public void setContent(JComponent newComponent, String title,
ImageIcon icon, boolean showTabTitle, boolean showTabIcon) {
DockableComponent newDockComp = null;
if (!childComponents.containsKey(newComponent)) {
newDockComp = new DockableComponent(newComponent, title, icon,
showTabTitle, showTabIcon);
if (childComponents.size() == 0) {
setSingleComponent(newDockComp);
} else {
// The situation that the same object have been opened again
if ((firstComponent != null)
&& (newComponent.equals(firstComponent.getComponent()))) {
// Code for checking the current status of the object
// whether it is minimized or not
return;
}
if ((tabPane == null) || (childComponents.size() == 1)) {
initTab();
}
setIcon(icon);
setLabel(title);
addTab(newDockComp);
// tabPane.addTab(title,icon,holder);
tabPane.setSelectedComponent(newDockComp.getScroller());
this.add(tabPane, BorderLayout.CENTER);
}
}
revalidate();
childComponents.put(newComponent, newDockComp);
}
private void addTab(DockableComponent newComp) {
if ((newComp.isShowTabIcon()) && (newComp.isShowTabTitle())) {
tabPane.addTab(newComp.getTitle(), newComp.getIcon(), newComp
.getScroller());
} else if (newComp.isShowTabTitle()) {
tabPane.addTab(newComp.getTitle(), newComp.getScroller());
} else if (newComp.isShowTabIcon()) {
tabPane.addTab("", newComp.getIcon(), newComp.getScroller());
} else {
tabPane.addTab("", newComp.getScroller());
}
}
private void setSingleComponent(DockableComponent newComp) {
setIcon(newComp.getIcon());
setLabel(newComp.getTitle());
this.add(newComp.getScroller(), BorderLayout.CENTER);
firstComponent = newComp;
setLabelInfo();
}
private void initTab() {
if (tabPane == null) {
tabPane = new SMYLDTabbedPane();
tabPane.applyComponentOrientation(getComponentOrientation());
tabPane.setBorder(BorderFactory.createEmptyBorder());
tabPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent evt) {
int sel = tabPane.getSelectedIndex();
if (sel >= 0) {
JComponent selectedComp = extractComponent((JScrollPane) tabPane
.getComponentAt(sel));
DockableComponent selDock = (DockableComponent) childComponents
.get(selectedComp);
// setIcon((ImageIcon)tabPane.getIconAt(sel));
// setLabel(tabPane.getTitleAt(sel));
if (selDock != null) {
setIcon(selDock.getIcon());
setLabel(selDock.getTitle());
setLabelInfo();
}
}
}
});
tabPane.setTabPlacement(SwingConstants.BOTTOM);
}
addTab(firstComponent);
// tabPane.addTab(firstComponent.getTitle(),firstComponent.getIcon(),
// firstComponent.getScroller());
}
private void initTitle() {
topPanel.setLayout(new BorderLayout(2, 1));
titleRPanel.setLayout(new FlowLayout());
titleLPanel.setLayout(new FlowLayout());
titleLPanel.setOpaque(false);
titleRPanel.setOpaque(false);
closeLabel = new SMYLDLabel(null, res.getImageIcon("close_" + pnlRSColor + ".gif"));
closeLabel.setBorder(null);
closeLabel.setRolloverIcon(res.getImageIcon("close_" + pnlRSColor + "_o.gif"));
closeLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
handelCloseAction();
}
});
hideLabel = new SMYLDLabel(null, res.getImageIcon("hide_off_" + pnlRSColor + ".gif"));
hideLabel.setBorder(null);
hideLabel.setRolloverIcon(res.getImageIcon("hide_off_" + pnlRSColor + "_o.gif"));
hideLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
if (listener != null) {
status = STATUS_MINIMIZED;
listener.panelHidden(instance);
}
// System.out.println("Hidden");
}
});
setTitleBackground(Color.BLUE);
title.setForeground(Color.WHITE);
titleRPanel.add(hideLabel);
titleRPanel.add(closeLabel);
titleLPanel.add(panelIcon);
titleLPanel.add(title);
setPositions();
// topPanel.setTransferHandler(new DockablePanelTransferHandler(this));
// SMYLDGUIUtil.setDragableComponent(instance,);
instance.setTransferHandler(new DragableTransfereHandler(this));
topPanel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
// System.out.println("Start panel drag");
instance.getTransferHandler().exportAsDrag(instance, evt,
TransferHandler.COPY);
}
});
topPanel.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent evt) {
System.out.println("Gained");
setTitleBackground(Color.BLUE);
}
public void focusLost(FocusEvent evt) {
System.out.println("Lost");
setTitleBackground(Color.GRAY);
}
});
}
public void refresh() {
hideLabel.refresh();
closeLabel.refresh();
}
private void setPositions() {
if (tabPane != null) {
tabPane.applyComponentOrientation(getComponentOrientation());
}
titleRPanel.applyComponentOrientation(getComponentOrientation());
titleLPanel.applyComponentOrientation(getComponentOrientation());
topPanel.applyComponentOrientation(getComponentOrientation());
topPanel.add(titleRPanel, BorderLayout.WEST);
topPanel.add(titleLPanel, BorderLayout.EAST);
if (getComponentOrientation().isLeftToRight()) {
topPanel.add(titleRPanel, BorderLayout.EAST);
topPanel.add(titleLPanel, BorderLayout.WEST);
} else {
topPanel.add(titleRPanel, BorderLayout.WEST);
topPanel.add(titleLPanel, BorderLayout.EAST);
}
}
@Override
public void applyComponentOrientation(ComponentOrientation orient) {
super.applyComponentOrientation(orient);
setPositions();
}
public void resetSize() {
setSize(0, 0);
}
private void handelCloseAction() {
if ((tabPane != null) && (tabPane.getComponentCount() > 1)) {
childComponents.remove(extractComponent((JScrollPane) tabPane
.getSelectedComponent()));
tabPane.remove(tabPane.getSelectedIndex());
if (tabPane.getComponentCount() == 1) {
JScrollPane targetScroll = (JScrollPane) tabPane
.getComponentAt(0);
firstComponent = (DockableComponent) childComponents
.get(extractComponent(targetScroll));
// firstTitle = tabPane.getTitleAt(0);
// firstIcon = (ImageIcon)tabPane.getIconAt(0);
tabPane.remove(targetScroll);
instance.remove(tabPane);
setSingleComponent(firstComponent);
instance.revalidate();
}
} else if (childComponents.size() == 1) {
childComponents.remove(firstComponent.getComponent());
// System.out.println(firstComponent.getParent().toString());
instance.remove(firstComponent.getScroller());
}
if (listener != null) {
listener.panelClosed(instance);
// System.out.println("Closed");
}
}
private JComponent extractComponent(JScrollPane targetScroll) {
return (JComponent) targetScroll.getViewport().getView();
}
@SuppressWarnings("unused")
private JScrollPane extractScroll(JComponent targetComp) {
return (JScrollPane) targetComp.getParent().getParent();
}
public int getComponentNumber() {
return childComponents.size();
}
private void setTitleBackground(Color backColor) {
topPanel.setBackground(backColor);
//titleRPanel.setBackground(backColor);
//titleLPanel.setBackground(backColor);
}
public String getLabel() {
return label;
}
public void setIcon(ImageIcon windowIcon) {
if (windowIcon != null) {
panelIcon.setIcon(windowIcon);
} else {
panelIcon.setIcon(res.getImageIcon("object.gif"));
}
}
public ImageIcon getIcon() {
return (ImageIcon) panelIcon.getIcon();
}
public void setLabel(String label) {
this.label = label;
title.setText(label);
}
public void doClose() {
status = STATUS_CLOSED;
if (listener != null) {
listener.panelClosed(instance);
}
}
public void dragStarted() {
status = STATUS_DRAGGED;
if (listener != null) {
listener.panelDragged(instance);
}
}
public void dragEnded() {
status = STATUS_DROPPED;
/*
* if (tabPane!=null){ if
* ((dockLocation==DockableContainer.DROP_DOWN)||(dockLocation==DockableContainer.DROP_TOP)){
* tabPane.setTabPlacement(tabPane.TOP); }else{
* tabPane.setTabPlacement(tabPane.BOTTOM); } revalidate(); repaint(); }
*/
if (listener != null) {
listener.panelDropped(instance);
}
}
public void setStatus(int newStatus) {
status = newStatus;
}
public int getStatus() {
return status;
}
private SMYLDLabel createLabel() {
SMYLDLabel panLable = new SMYLDLabel(getLabel(), getIcon());
panLable.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
panLable.applyComponentOrientation(getComponentOrientation());
panLable.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
if (listener != null) {
listener.panelShown(instance);
}
}
@Override
public void mouseEntered(MouseEvent evt) {
((SMYLDLabel) evt.getSource()).setBorder(BorderFactory
.createLineBorder(Color.DARK_GRAY));
}
@Override
public void mouseExited(MouseEvent evt) {
((SMYLDLabel) evt.getSource()).setBorder(BorderFactory
.createEmptyBorder(1, 1, 1, 1));
}
});
return panLable;
}
public SMYLDLabel getMinimizedLabel() {
return minimizedLabel;
}
private void setLabelInfo() {
minimizedLabel.setText(getLabel());
minimizedLabel.setIcon(getIcon());
minimizedLabel.applyComponentOrientation(getComponentOrientation());
}
public int getDockLocation() {
return dockLocation;
}
public void setDockLocation(int dockLocation) {
this.dockLocation = dockLocation;
}
public static final int STATUS_SHOWN = 1;
public static final int STATUS_MINIMIZED = 2;
public static final int STATUS_DRAGGED = 3;
public static final int STATUS_DROPPED = 4;
public static final int STATUS_CLOSED = 5;
String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public JComponent getComponent() {
return instance;
}
public boolean isInternal() {
return true;
}
}
| 29.234927 | 107 | 0.723795 |
23e12ef76fcc2e1a1a20adc7fc6baeb62beeb3bb | 8,539 | package edu.emmerson.camel3.cdi.eh;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicy;
import edu.emmerson.camel3.cdi.eh.routes.CallHttpBackendHttpRoute;
import edu.emmerson.camel3.cdi.eh.routes.CallHttpBackendUndertowRoute;
import edu.emmerson.camel3.cdi.eh.routes.ErrorOnExceptionRoute;
import edu.emmerson.camel3.cdi.eh.routes.ErrorOnExceptionToRoute;
import edu.emmerson.camel3.cdi.eh.routes.ErrorOnExceptionToTryCatchRoute;
import edu.emmerson.camel3.cdi.eh.routes.ErrorRoute;
import edu.emmerson.camel3.cdi.eh.routes.InvalidNumberOnExceptionToRoute;
import edu.emmerson.camel3.cdi.eh.routes.InvalidNumberRouteOnExceptionSelfContainedRoute;
import edu.emmerson.camel3.cdi.eh.routes.InvalidNumberTryCatchRoute;
import edu.emmerson.camel3.cdi.eh.routes.NoErrorRoute;
import edu.emmerson.camel3.cdi.eh.routes.NumberRoute;
import edu.emmerson.camel3.cdi.eh.routes.YamlRoute;
import edu.emmerson.camel3.cdi.eh.routes.json.JsonValidationRoute;
import edu.emmerson.camel3.cdi.eh.routes.xml.XmlValidationRoute;
public class RestRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
onException(Throwable.class)
.log("onException:: ${header.X-Correlation-ID} :: ${exception.message} :: ${exception}")
.setBody(constant("Error handling by " + RestRouteBuilder.class))
;
// configure we want to use undertow as the component for the rest DSL
restConfiguration().component("undertow")
.contextPath("/").host("0.0.0.0").port(8080)
.apiContextPath("/api-doc")
.apiContextRouteId("api-doc-endpoint")
.apiProperty("api.title", "Error Handling API").apiProperty("api.version", "1.0.0")
// and enable CORS
.apiProperty("cors", "true");
MetricsRoutePolicy mrpNoErrorRoute = MetricsFactory.createMetricsRoutePolicy(NoErrorRoute.ROUTE_ID);
MetricsRoutePolicy mrpNumberRoute = MetricsFactory.createMetricsRoutePolicy(NumberRoute.ROUTE_ID);
MetricsRoutePolicy mrpInvalidNumberOnExceptionToRoute = MetricsFactory.createMetricsRoutePolicy(InvalidNumberOnExceptionToRoute.ROUTE_ID);
MetricsRoutePolicy mrpInvalidNumberRouteOnExceptionSelfContainedRoute = MetricsFactory.createMetricsRoutePolicy(InvalidNumberRouteOnExceptionSelfContainedRoute.ROUTE_ID);
MetricsRoutePolicy mrpInvalidNumberTryCatchRoute = MetricsFactory.createMetricsRoutePolicy(InvalidNumberTryCatchRoute.ROUTE_ID);
MetricsRoutePolicy mrpErrorRoute = MetricsFactory.createMetricsRoutePolicy(ErrorRoute.ROUTE_ID);
MetricsRoutePolicy mrpErrorOnExceptionRoute = MetricsFactory.createMetricsRoutePolicy(ErrorOnExceptionRoute.ROUTE_ID);
MetricsRoutePolicy mrpErrorOnExceptionToRoute = MetricsFactory.createMetricsRoutePolicy(ErrorOnExceptionToRoute.ROUTE_ID);
MetricsRoutePolicy mrpErrorOnExceptionToTryCatchRoute = MetricsFactory.createMetricsRoutePolicy(ErrorOnExceptionToTryCatchRoute.ROUTE_ID);
MetricsRoutePolicy mrpCallHttpBackendUndertowRoute = MetricsFactory.createMetricsRoutePolicy(CallHttpBackendUndertowRoute.ROUTE_ID);
MetricsRoutePolicy mrpCallHttpBackendHttpRoute = MetricsFactory.createMetricsRoutePolicy(CallHttpBackendHttpRoute.ROUTE_ID);
MetricsRoutePolicy mrpXmlValidationRoute = MetricsFactory.createMetricsRoutePolicy(XmlValidationRoute.ROUTE_ID);
MetricsRoutePolicy mrpJsonValidationRoute = MetricsFactory.createMetricsRoutePolicy(JsonValidationRoute.ROUTE_ID);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/noerror").id("noerror-resource").description("Happy path")
.route().routePolicy(mrpNoErrorRoute)
.to(NoErrorRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/in").id("in-resource").description("Invalid number, without error handling")
.route().routePolicy(mrpNumberRoute)
.to(NumberRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/inoeto").id("inoe-resource").description("Invalid number, with on exception")
.route().routePolicy(mrpInvalidNumberOnExceptionToRoute)
.to(InvalidNumberOnExceptionToRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/inoesc").id("inoesc-resource").description("Invalid number Self Contained, with on exception")
.route().routePolicy(mrpInvalidNumberRouteOnExceptionSelfContainedRoute)
.to(InvalidNumberRouteOnExceptionSelfContainedRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/intc").id("intc-resource").description("Invalid number, with try catch")
.route().routePolicy(mrpInvalidNumberTryCatchRoute)
.to(InvalidNumberTryCatchRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/te").id("intc-resource").description("Throw a Exception without error handling")
.route().routePolicy(mrpErrorRoute)
.to(ErrorRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/teoe").id("intc-resource").description("Implementation Throw a Exception and is handled by onException")
.route().routePolicy(mrpErrorOnExceptionRoute)
.to(ErrorOnExceptionRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/teoet").id("intc-resource").description("Call a route that throw an exception and handle it with caller onException, in thi case onException is ignored.")
.route().routePolicy(mrpErrorOnExceptionToRoute)
.to(ErrorOnExceptionToRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/teoetc").id("intc-resource").description("Call a route that throw an exception and handle it with caller try/catch, in this case try/catch works.")
.route().routePolicy(mrpErrorOnExceptionToTryCatchRoute)
.to(ErrorOnExceptionToTryCatchRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/chbu").id("chbu-resource").description("Call backend HTTP using Undertow component")
.route().routePolicy(mrpCallHttpBackendUndertowRoute)
.to(CallHttpBackendUndertowRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/chbh").id("chbh-resource").description("Call backend HTTP using HTTP component")
.route().routePolicy(mrpCallHttpBackendHttpRoute)
.to(CallHttpBackendHttpRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/schema/xml").id("sxc-resource").description("Call XML schema validation")
.route().routePolicy(mrpXmlValidationRoute)
.to(XmlValidationRoute.DIRECT);
rest("/eh").id("http-endpoint").description("Error Handling rest service")
.consumes("application/json").produces("application/json")
.post("/schema/json").id("sjc-resource").description("Call JSON schema validation")
.route().routePolicy(mrpJsonValidationRoute)
.to(JsonValidationRoute.DIRECT)
;
rest("/yaml").id("http-yaml-endpoint").description("Yaml endpoint")
.get("/simple").id("yaml-simple-resource").description("Simple")
.to(YamlRoute.DIRECT)
;
}
}
| 58.889655 | 178 | 0.728423 |
14579a3d1de051288717ede2c2961c564f558f17 | 15,894 | /* Woodstox XML processor
*
* Copyright (c) 2004 Tatu Saloranta, [email protected]
*
* Licensed under the License specified in file LICENSE, included with
* the source code.
* You may not use this file except in compliance with the License.
*
* 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.ctc.wstx.io;
import java.io.*;
import com.ctc.wstx.api.ReaderConfig;
import com.ctc.wstx.cfg.XmlConsts;
/**
* Optimized Reader that reads UTF-8 encoded content from an input stream.
* In addition to doing (hopefully) optimal conversion, it can also take
* array of "pre-read" (leftover) bytes; this is necessary when preliminary
* stream/reader is trying to figure out XML encoding.
*/
public final class UTF8Reader
extends BaseReader
{
boolean mXml11 = false;
char mSurrogate = NULL_CHAR;
/**
* Total read character count; used for error reporting purposes
*/
int mCharCount = 0;
/**
* Total read byte count; used for error reporting purposes
*/
int mByteCount = 0;
/*
////////////////////////////////////////
// Life-cycle
////////////////////////////////////////
*/
public UTF8Reader(ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len,
boolean recycleBuffer)
{
super(cfg, in, buf, ptr, len, recycleBuffer);
}
@Override
public void setXmlCompliancy(int xmlVersion) {
mXml11 = (xmlVersion == XmlConsts.XML_V_11);
}
/*
////////////////////////////////////////
// Public API
////////////////////////////////////////
*/
@SuppressWarnings("cast")
@Override
public int read(char[] cbuf, int start, int len) throws IOException
{
// Let's first ensure there's enough room...
if (start < 0 || (start+len) > cbuf.length) {
reportBounds(cbuf, start, len);
}
// Already EOF?
if (mByteBuffer == null) {
return -1;
}
if (len < 1) { // dummy call?
return 0;
}
len += start;
int outPtr = start;
// Ok, first; do we have a surrogate from last round?
if (mSurrogate != NULL_CHAR) {
cbuf[outPtr++] = mSurrogate;
mSurrogate = NULL_CHAR;
// No need to load more, already got one char
// 05-Apr-2021, tatu: but if at the end must return:
if (mBytePtr >= mByteBufferEnd) {
mCharCount += 1;
return 1;
}
} else {
// To prevent unnecessary blocking (esp. with network streams),
// we'll only require decoding of a single char
int left = (mByteBufferEnd - mBytePtr);
/* So; only need to load more if we can't provide at least
* one more character. We need not do thorough check here,
* but let's check the common cases here: either completely
* empty buffer (left == 0), or one with less than max. byte
* count for a single char, and starting of a multi-byte
* encoding (this leaves possibility of a 2/3-byte char
* that is still fully accessible... but that can be checked
* by the load method)
*/
if (left < 4) {
// Need to load more?
if (left < 1 || mByteBuffer[mBytePtr] < 0) {
if (!loadMore(left)) { // (legal) EOF?
return -1;
}
}
}
}
/* This may look silly, but using a local var is indeed faster
* (if and when HotSpot properly gets things running) than
* member variable...
*/
byte[] buf = mByteBuffer;
int inPtr = mBytePtr;
int inBufLen = mByteBufferEnd;
main_loop:
while (outPtr < len) {
// At this point we have at least one byte available
int c = (int) buf[inPtr++];
// Let's first do the quickie loop for common case; 7-bit ascii:
if (c >= 0) { // ascii? can probably loop, then
if (c == 0x7F && mXml11) { // DEL illegal in xml1.1
int bytePos = mByteCount + inPtr - 1;
int charPos = mCharCount + (outPtr-start);
reportInvalidXml11(c, bytePos, charPos);
}
cbuf[outPtr++] = (char) c; // ok since MSB is never on
/* Ok, how many such chars could we safely process
* without overruns? (will combine 2 in-loop comparisons
* into just one)
*/
int outMax = (len - outPtr); // max output
int inMax = (inBufLen - inPtr); // max input
int inEnd = inPtr + ((inMax < outMax) ? inMax : outMax);
ascii_loop:
while (true) {
if (inPtr >= inEnd) {
break main_loop;
}
c = ((int) buf[inPtr++]) & 0xFF;
if (c >= 0x7F) { // DEL, or multi-byte
break ascii_loop;
}
cbuf[outPtr++] = (char) c;
}
if (c == 0x7F) {
if (mXml11) { // DEL illegal in xml1.1
int bytePos = mByteCount + inPtr - 1;
int charPos = mCharCount + (outPtr-start);
reportInvalidXml11(c, bytePos, charPos);
} // but not in xml 1.0
cbuf[outPtr++] = (char) c;
if(inPtr >= inEnd){
break main_loop;
}
continue main_loop;
}
}
int needed;
// Ok; if we end here, we got multi-byte combination
if ((c & 0xE0) == 0xC0) { // 2 bytes (0x0080 - 0x07FF)
c = (c & 0x1F);
needed = 1;
} else if ((c & 0xF0) == 0xE0) { // 3 bytes (0x0800 - 0xFFFF)
c = (c & 0x0F);
needed = 2;
} else if ((c & 0xF8) == 0xF0) {
// 4 bytes; double-char BS, with surrogates and all...
c = (c & 0x0F);
needed = 3;
} else {
reportInvalidInitial(c & 0xFF, outPtr-start);
// never gets here...
needed = 1;
}
/* Do we have enough bytes? If not, let's just push back the
* byte and leave, since we have already gotten at least one
* char decoded. This way we will only block (with read from
* input stream) when absolutely necessary.
*/
if ((inBufLen - inPtr) < needed) {
--inPtr;
break main_loop;
}
int d = (int) buf[inPtr++];
if ((d & 0xC0) != 0x080) {
reportInvalidOther(d & 0xFF, outPtr-start);
}
c = (c << 6) | (d & 0x3F);
if (needed > 1) { // needed == 1 means 2 bytes total
d = buf[inPtr++]; // 3rd byte
if ((d & 0xC0) != 0x080) {
reportInvalidOther(d & 0xFF, outPtr-start);
}
c = (c << 6) | (d & 0x3F);
if (needed > 2) { // 4 bytes? (need surrogates)
d = buf[inPtr++];
if ((d & 0xC0) != 0x080) {
reportInvalidOther(d & 0xFF, outPtr-start);
}
c = (c << 6) | (d & 0x3F);
if (c > XmlConsts.MAX_UNICODE_CHAR) {
reportInvalid(c, outPtr-start,
"(above "+Integer.toHexString(XmlConsts.MAX_UNICODE_CHAR)+") ");
}
/* Ugh. Need to mess with surrogates. Ok; let's inline them
* there, then, if there's room: if only room for one,
* need to save the surrogate for the rainy day...
*/
c -= 0x10000; // to normalize it starting with 0x0
cbuf[outPtr++] = (char) (0xD800 + (c >> 10));
// hmmh. can this ever be 0? (not legal, at least?)
c = (0xDC00 | (c & 0x03FF));
// Room for second part?
if (outPtr >= len) { // nope
mSurrogate = (char) c;
break main_loop;
}
// sure, let's fall back to normal processing:
} else {
/* Otherwise, need to check that 3-byte chars are
* legal ones (should not expand to surrogates;
* 0xFFFE and 0xFFFF are illegal)
*/
if (c >= 0xD800) {
// But first, let's check max chars:
if (c < 0xE000) {
reportInvalid(c, outPtr-start, "(a surrogate character) ");
} else if (c >= 0xFFFE) {
reportInvalid(c, outPtr-start, "");
}
} else if (mXml11 && c == 0x2028) { // LSEP?
/* 10-May-2006, TSa: Since LSEP is "non-associative",
* it needs additional handling. One way to do
* this is to convert preceding \r to \n. This
* should be implemented better when integrating
* decoder and tokenizer.
*/
if (outPtr > start && cbuf[outPtr-1] == '\r') {
cbuf[outPtr-1] = '\n';
}
c = CONVERT_LSEP_TO;
}
}
} else { // (needed == 1)
if (mXml11) { // high-order ctrl char detection...
if (c <= 0x9F) {
if (c == 0x85) { // NEL, let's convert?
c = CONVERT_NEL_TO;
} else if (c >= 0x7F) { // DEL, ctrl chars
int bytePos = mByteCount + inPtr - 1;
int charPos = mCharCount + (outPtr-start);
reportInvalidXml11(c, bytePos, charPos);
}
}
}
}
cbuf[outPtr++] = (char) c;
if (inPtr >= inBufLen) {
break main_loop;
}
}
mBytePtr = inPtr;
len = outPtr - start;
mCharCount += len;
return len;
}
/*
////////////////////////////////////////
// Internal methods
////////////////////////////////////////
*/
private void reportInvalidInitial(int mask, int offset)
throws IOException
{
// input (byte) ptr has been advanced by one, by now:
int bytePos = mByteCount + mBytePtr - 1;
int charPos = mCharCount + offset + 1;
throw new CharConversionException("Invalid UTF-8 start byte 0x"
+Integer.toHexString(mask)
+" (at char #"+charPos+", byte #"+bytePos+")");
}
private void reportInvalidOther(int mask, int offset)
throws IOException
{
int bytePos = mByteCount + mBytePtr - 1;
int charPos = mCharCount + offset;
throw new CharConversionException("Invalid UTF-8 middle byte 0x"
+Integer.toHexString(mask)
+" (at char #"+charPos+", byte #"+bytePos+")");
}
private void reportUnexpectedEOF(int gotBytes, int needed)
throws IOException
{
int bytePos = mByteCount + gotBytes;
int charPos = mCharCount;
throw new CharConversionException("Unexpected EOF in the middle of a multi-byte char: got "
+gotBytes+", needed "+needed
+", at char #"+charPos+", byte #"+bytePos+")");
}
private void reportInvalid(int value, int offset, String msg)
throws IOException
{
int bytePos = mByteCount + mBytePtr - 1;
int charPos = mCharCount + offset;
throw new CharConversionException("Invalid UTF-8 character 0x"
+Integer.toHexString(value)+msg
+" at char #"+charPos+", byte #"+bytePos+")");
}
/**
* @param available Number of "unused" bytes in the input buffer
*
* @return True, if enough bytes were read to allow decoding of at least
* one full character; false if EOF was encountered instead.
*/
private boolean loadMore(int available)
throws IOException
{
mByteCount += (mByteBufferEnd - available);
// Bytes that need to be moved to the beginning of buffer?
if (available > 0) {
// 11-Nov-2008, TSa: can only move if we own the buffer; otherwise
// we are stuck with the data.
if (mBytePtr > 0 && canModifyBuffer()) {
for (int i = 0; i < available; ++i) {
mByteBuffer[i] = mByteBuffer[mBytePtr+i];
}
mBytePtr = 0;
mByteBufferEnd = available;
}
} else {
// Ok; here we can actually reasonably expect an EOF,
// so let's do a separate read right away:
int count = readBytes();
if (count < 1) {
if (count < 0) { // -1
freeBuffers(); // to help GC?
return false;
}
// 0 count is no good; let's err out
reportStrangeStream();
}
}
// We now have at least one byte... and that allows us to
// calculate exactly how many bytes we need!
@SuppressWarnings("cast")
int c = (int) mByteBuffer[mBytePtr];
if (c >= 0) { // single byte (ascii) char... cool, can return
return true;
}
// Ok, a multi-byte char, let's check how many bytes we'll need:
int needed;
if ((c & 0xE0) == 0xC0) { // 2 bytes (0x0080 - 0x07FF)
needed = 2;
} else if ((c & 0xF0) == 0xE0) { // 3 bytes (0x0800 - 0xFFFF)
needed = 3;
} else if ((c & 0xF8) == 0xF0) {
// 4 bytes; double-char BS, with surrogates and all...
needed = 4;
} else {
reportInvalidInitial(c & 0xFF, 0);
// never gets here... but compiler whines without this:
needed = 1;
}
/* And then we'll just need to load up to that many bytes;
* if an EOF is hit, that'll be an error. But we need not do
* actual decoding here, just load enough bytes.
*/
while ((mBytePtr + needed) > mByteBufferEnd) {
int count = readBytesAt(mByteBufferEnd);
if (count < 1) {
if (count < 0) { // -1, EOF... no good!
freeBuffers();
reportUnexpectedEOF(mByteBufferEnd, needed);
}
// 0 count is no good; let's err out
reportStrangeStream();
}
}
return true;
}
}
| 37.663507 | 102 | 0.461935 |
905173088336b020743dffe49ce749dbb9c93212 | 801 | package uk.co.idv.context.entities.context.sequence;
import uk.co.idv.method.entities.eligibility.Ineligible;
import java.util.Collection;
public class SequenceIneligible extends Ineligible {
public SequenceIneligible(Collection<String> methodNames) {
super(toReason(methodNames));
}
private static String toReason(Collection<String> methodNames) {
String singularOrPlural = toSingularOrPlural(methodNames);
String formattedNames = String.join(", ", methodNames);
return String.format("Sequence has ineligible %s %s", singularOrPlural, formattedNames);
}
private static String toSingularOrPlural(Collection<String> methodNames) {
if (methodNames.size() == 1) {
return "method";
}
return "methods";
}
}
| 29.666667 | 96 | 0.700375 |
7fc23d6671ca7c55d1d9ea7f86169b5dec2b4628 | 1,835 | package ag.algorithms.leetcode.solutions.strings;
import java.util.HashMap;
import java.util.Stack;
public class ValidParentheses {
public boolean isValid(String parenthesesList) {
if (parenthesesList == null || parenthesesList.isEmpty()) {
return false;
}
Stack<Character> stack = new Stack<>();
for (char parentheses : parenthesesList.toCharArray()) {
if (parentheses == '{' || parentheses == '(' || parentheses == '[') {
stack.push(parentheses);
}
if (!stack.isEmpty()) {
if (parentheses == '}' && stack.peek() == '{') {
stack.pop();
} else if (parentheses == ')' && stack.peek() == '(') {
stack.pop();
} else if (parentheses == ']' && stack.peek() == '[') {
stack.pop();
}
}
}
return stack.isEmpty();
}
public boolean isValid2(String parenthesesList) {
if (parenthesesList == null || parenthesesList.isEmpty()) {
return false;
}
HashMap<Character, Character> closeToOpenPairs = new HashMap<>();
closeToOpenPairs.put('}', '{');
closeToOpenPairs.put(')', '(');
closeToOpenPairs.put(']', '[');
Stack<Character> stack = new Stack<>();
for (char parentheses : parenthesesList.toCharArray()) {
if (closeToOpenPairs.containsKey(parentheses)) {
if (!stack.isEmpty() && closeToOpenPairs.get(parentheses) == stack.peek()) {
stack.pop();
} else {
return false;
}
} else {
stack.push(parentheses);
}
}
return stack.isEmpty();
}
}
| 27.80303 | 92 | 0.487193 |
ccc2a1622ca081bdfc967fb63a0cb4dfa4ae7b68 | 1,071 | package de.codecentric.jenkins.dashboard.api.environments;
import java.util.Date;
import com.amazonaws.services.ec2.model.InstanceState;
public class EnvironmentDetails {
private String version;
private String uri;
private String upTime;
private Date buildTime;
private String env;
private InstanceState state;
public EnvironmentDetails() {
}
public Date getBuildTime() {
return buildTime;
}
public String getEnv() {
return env;
}
public InstanceState getState() {
return state;
}
public String getUpTime() {
return upTime;
}
public String getUri() {
return uri;
}
public String getVersion() {
return version;
}
public void setBuildTime(Date buildTime) {
this.buildTime = buildTime;
}
public void setEnv(String env) {
this.env = env;
}
public void setState(InstanceState state) {
this.state = state;
}
public void setUpTime(String upTime) {
this.upTime = upTime;
}
public void setUri(String uri) {
this.uri = uri;
}
public void setVersion(String version) {
this.version = version;
}
}
| 14.671233 | 58 | 0.706816 |
103077ba244f925c2664774ebd94336fb0250497 | 1,511 | /*
* Copyright 2021 VMware, 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
*
* https://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.micrometer.tracing.test.simple;
import org.junit.jupiter.api.Test;
import static io.micrometer.tracing.test.simple.TracerAssert.assertThat;
import static org.assertj.core.api.BDDAssertions.thenNoException;
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
class TracerAssertTests {
@Test
void should_not_throw_exception_when_name_correct() {
SimpleTracer simpleTracer = new SimpleTracer();
simpleTracer.nextSpan().name("foo").start().end();
thenNoException().isThrownBy(() -> assertThat(simpleTracer).onlySpan().hasNameEqualTo("foo"));
}
@Test
void should_throw_exception_when_name_incorrect() {
SimpleTracer simpleTracer = new SimpleTracer();
simpleTracer.nextSpan().name("foo").start().end();
thenThrownBy(() -> assertThat(simpleTracer).onlySpan().hasNameEqualTo("bar")).isInstanceOf(AssertionError.class);
}
}
| 34.340909 | 121 | 0.735275 |
0d3dfd1f2698ecad4169663a158c50604b382f09 | 7,162 | /*
* 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.tika.parser.iwork;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.Property;
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.sax.XHTMLContentHandler;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import java.util.HashMap;
import java.util.Map;
class NumbersContentHandler extends DefaultHandler {
private final XHTMLContentHandler xhtml;
private final Metadata metadata;
private boolean inSheet = false;
private boolean inText = false;
private boolean parseText = false;
private boolean inMetadata = false;
private Property metadataKey;
private String metadataPropertyQName;
private boolean inTable = false;
private int numberOfSheets = 0;
private int numberOfColumns = -1;
private int currentColumn = 0;
private Map<String, String> menuItems = new HashMap<String, String>();
private String currentMenuItemId;
NumbersContentHandler(XHTMLContentHandler xhtml, Metadata metadata) {
this.xhtml = xhtml;
this.metadata = metadata;
}
@Override
public void endDocument() throws SAXException {
metadata.set(Metadata.PAGE_COUNT, String.valueOf(numberOfSheets));
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if ("ls:workspace".equals(qName)) {
inSheet = true;
numberOfSheets++;
xhtml.startElement("div");
String sheetName = attributes.getValue("ls:workspace-name");
metadata.add("sheetNames", sheetName);
}
if ("sf:text".equals(qName)) {
inText = true;
xhtml.startElement("p");
}
if ("sf:p".equals(qName)) {
parseText = true;
}
if ("sf:metadata".equals(qName)) {
inMetadata = true;
return;
}
if (inMetadata && metadataKey == null) {
metadataKey = resolveMetadataKey(localName);
metadataPropertyQName = qName;
}
if (inMetadata && metadataKey != null && "sf:string".equals(qName)) {
metadata.add(metadataKey, attributes.getValue("sfa:string"));
}
if (!inSheet) {
return;
}
if ("sf:tabular-model".equals(qName)) {
String tableName = attributes.getValue("sf:name");
xhtml.startElement("div");
xhtml.characters(tableName);
xhtml.endElement("div");
inTable = true;
xhtml.startElement("table");
xhtml.startElement("tr");
currentColumn = 0;
}
if ("sf:menu-choices".equals(qName)) {
menuItems = new HashMap<String, String>();
}
if (inTable && "sf:grid".equals(qName)) {
numberOfColumns = Integer.parseInt(attributes.getValue("sf:numcols"));
}
if (menuItems != null && "sf:t".equals(qName)) {
currentMenuItemId = attributes.getValue("sfa:ID");
}
if (currentMenuItemId != null && "sf:ct".equals(qName)) {
menuItems.put(currentMenuItemId, attributes.getValue("sfa:s"));
}
if (inTable && "sf:ct".equals(qName)) {
if (currentColumn >= numberOfColumns) {
currentColumn = 0;
xhtml.endElement("tr");
xhtml.startElement("tr");
}
xhtml.element("td", attributes.getValue("sfa:s"));
currentColumn++;
}
if (inTable && ("sf:n".equals(qName) || "sf:rn".equals(qName))) {
if (currentColumn >= numberOfColumns) {
currentColumn = 0;
xhtml.endElement("tr");
xhtml.startElement("tr");
}
xhtml.element("td", attributes.getValue("sf:v"));
currentColumn++;
}
if (inTable && "sf:proxied-cell-ref".equals(qName)) {
if (currentColumn >= numberOfColumns) {
currentColumn = 0;
xhtml.endElement("tr");
xhtml.startElement("tr");
}
xhtml.element("td", menuItems.get(attributes.getValue("sfa:IDREF")));
currentColumn++;
}
if ("sf:chart-name".equals(qName)) {
// Extract chart name:
xhtml.startElement("div", "class", "chart");
xhtml.startElement("h1");
xhtml.characters(attributes.getValue("sfa:string"));
xhtml.endElement("h1");
xhtml.endElement("div");
}
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
if (parseText && length > 0) {
xhtml.characters(ch, start, length);
}
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if ("ls:workspace".equals(qName)) {
inSheet = false;
xhtml.endElement("div");
}
if ("sf:text".equals(qName)) {
inText = false;
xhtml.endElement("p");
}
if ("sf:p".equals(qName)) {
parseText = false;
}
if ("sf:metadata".equals(qName)) {
inMetadata = false;
}
if (inMetadata && qName.equals(metadataPropertyQName)) {
metadataPropertyQName = null;
metadataKey = null;
}
if (!inSheet) {
return;
}
if ("sf:menu-choices".equals(qName)) {
}
if ("sf:tabular-model".equals(qName)) {
inTable = false;
xhtml.endElement("tr");
xhtml.endElement("table");
}
if (currentMenuItemId != null && "sf:t".equals(qName)) {
currentMenuItemId = null;
}
}
private Property resolveMetadataKey(String localName) {
if ("authors".equals(localName)) {
return TikaCoreProperties.CREATOR;
}
if ("title".equals(localName)) {
return TikaCoreProperties.TITLE;
}
if ("comment".equals(localName)) {
return TikaCoreProperties.COMMENTS;
}
return Property.internalText(localName);
}
}
| 30.87069 | 117 | 0.583217 |
ee621d634cf83afede8637a17b4626159f902fd8 | 1,597 | /*
* Copyright (C) 2014-2021 Philip Helger (www.helger.com)
* philip[at]helger[dot]com
*
* 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.helger.schematron.pure.model;
import java.util.Map;
import javax.annotation.Nonnull;
import com.helger.commons.ValueEnforcer;
import com.helger.commons.annotation.ReturnsMutableCopy;
import com.helger.commons.collection.impl.ICommonsOrderedMap;
/**
* Base interface for Pure Schematron elements that support foreign attributes.
*
* @author Philip Helger
*/
public interface IPSHasForeignAttributes
{
@Nonnull
@ReturnsMutableCopy
ICommonsOrderedMap <String, String> getAllForeignAttributes ();
boolean hasForeignAttributes ();
void addForeignAttribute (@Nonnull String sAttrName, @Nonnull String sAttrValue);
default void addForeignAttributes (@Nonnull final Map <String, String> aForeignAttrs)
{
ValueEnforcer.notNull (aForeignAttrs, "ForeignAttrs");
for (final Map.Entry <String, String> aEntry : aForeignAttrs.entrySet ())
addForeignAttribute (aEntry.getKey (), aEntry.getValue ());
}
}
| 32.591837 | 87 | 0.756418 |
8df58daae2014d9b197881444dc2898fe19b7f0c | 479 | package com.biemo.cloud.bbs.modular.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @date : 2020-09-01 9:31
* @description :
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface RequestLimit {
/**
* 请求次数
*/
int count() default 1;
/**
* 限制时间(秒)
*/
int time() default 5;
}
| 17.107143 | 47 | 0.676409 |
1fdba8b4248dbb92353eef5c77909951fde1c975 | 236 | package test;
public class Sample134 {
public static void main(String[] args) {
Boat boat1 = new Boat();
int seats = 8;
String colorSelect = "green";
boat1.setSeatColor(seats, colorSelect);
boat1.show();
}
}
| 15.733333 | 43 | 0.635593 |
f1575d42fe9495541da0f008132b81529ae74230 | 2,179 | /*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.huawei.kunpeng.intellij.ui.bean;
import com.huawei.kunpeng.intellij.common.bean.DataBean;
import com.huawei.kunpeng.intellij.ui.utils.IDEMessageDialogUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import javax.swing.Icon;
/**
* 消息弹框数据体
*
* @since 1.0.0
*/
@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class MessageDialogBean extends DataBean {
/**
* 消息文本
*/
private String message;
/**
* 弹框标题
*/
private String title;
/**
* 按钮信息数组, 数组成员为按钮信息枚举
*/
private List<IDEMessageDialogUtil.ButtonName> buttonNames;
/**
* 弹框默认选中的按钮下标
*/
private int defaultButton = 0;
/**
* 图标可为空
*/
private Icon icon;
/**
* 自定义toString方法,返回数据体的基本信息
*
* @return 数据体基本信息字符串格式
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Title: " + title + System.getProperty("line.separator"));
sb.append("Message: " + message + System.getProperty("line.separator"));
int count = 0;
for (IDEMessageDialogUtil.ButtonName button : buttonNames) {
sb.append("Button" + count++ + ": key: " + button.getKey() + " name: " + button.getName());
sb.append(System.getProperty("line.separator"));
}
sb.append("Default Button name: " + buttonNames.get(getDefaultButton()).getName());
return sb.toString();
}
}
| 26.253012 | 103 | 0.659018 |
03bf47b64b3da2e891f12741ace55e067a821393 | 692 | class Solution {
public int search(int[] nums, int target) {
int low = 0, high = nums.length-1;
while(low <= high) {
int mid = low + (high-low)/2;
if (nums[mid] == target) return mid;
if (nums[low] <= nums[mid]) {
if (nums[low] <= target && target < nums[mid]) {
high = mid-1;
} else {
low = mid+1;
}
} else {
if (nums[mid] < target && target <= nums[high]) {
low = mid+1;
} else {
high = mid-1;
}
}
}
return -1;
}
} | 30.086957 | 65 | 0.348266 |
312e031d7d53364ae4100fe3a59147102356829d | 2,408 | /*
* 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.sling.jcr.webdav.impl.handler;
import org.apache.jackrabbit.server.io.CopyMoveHandler;
import org.apache.jackrabbit.server.io.CopyMoveManagerImpl;
import org.osgi.framework.ServiceReference;
import org.osgi.service.component.ComponentContext;
/**
* CopyMoveManager service that uses a ServiceTracker to find available
* CopyMoveHandler.
*/
public class SlingCopyMoveManager extends CopyMoveManagerImpl {
private static final CopyMoveHandler[] COPYMOVEHANDLERS_PROTOTYPE = new CopyMoveHandler[0];
private final SlingHandlerManager<CopyMoveHandler> handlerManager;
public SlingCopyMoveManager(final String referenceName) {
handlerManager = new SlingHandlerManager<CopyMoveHandler>(referenceName);
}
@Override
public void addCopyMoveHandler(CopyMoveHandler propertyHandler) {
throw new UnsupportedOperationException(
"This CopyMoveManager only supports registered CopyMoveHandler services");
}
@Override
public CopyMoveHandler[] getCopyMoveHandlers() {
return this.handlerManager.getHandlers(COPYMOVEHANDLERS_PROTOTYPE);
}
public void setComponentContext(ComponentContext componentContext) {
this.handlerManager.setComponentContext(componentContext);
}
public void bindCopyMoveHandler(final ServiceReference copyMoveHandlerReference) {
this.handlerManager.bindHandler(copyMoveHandlerReference);
}
public void unbindCopyMoveHandler(final ServiceReference copyMoveHandlerReference) {
this.handlerManager.unbindHandler(copyMoveHandlerReference);
}
}
| 38.222222 | 95 | 0.773671 |
5ea0b56561c30cf0cb02cac0bfe3d1226e1dfcce | 6,731 | /*
* 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.commons.rng.sampling.distribution;
import org.apache.commons.rng.UniformRandomProvider;
/**
* Sampling from a <a href="https://en.wikipedia.org/wiki/Geometric_distribution">geometric
* distribution</a>.
*
* <p>This distribution samples the number of failures before the first success taking values in the
* set {@code [0, 1, 2, ...]}.</p>
*
* <p>The sample is computed using a related exponential distribution. If \( X \) is an
* exponentially distributed random variable with parameter \( \lambda \), then
* \( Y = \left \lfloor X \right \rfloor \) is a geometrically distributed random variable with
* parameter \( p = 1 − e^\lambda \), with \( p \) the probability of success.</p>
*
* <p>This sampler outperforms using the {@link InverseTransformDiscreteSampler} with an appropriate
* geometric inverse cumulative probability function.</p>
*
* <p>Usage note: As the probability of success (\( p \)) tends towards zero the mean of the
* distribution (\( \frac{1-p}{p} \)) tends towards infinity and due to the use of {@code int}
* for the sample this can result in truncation of the distribution.</p>
*
* <p>Sampling uses {@link UniformRandomProvider#nextDouble()}.</p>
*
* @see <a
* href="https://en.wikipedia.org/wiki/Geometric_distribution#Related_distributions">Geometric
* distribution - related distributions</a>
* @since 1.3
*/
public final class GeometricSampler {
/**
* Sample from the geometric distribution when the probability of success is 1.
*/
private static class GeometricP1Sampler
implements SharedStateDiscreteSampler {
/** The single instance. */
static final GeometricP1Sampler INSTANCE = new GeometricP1Sampler();
@Override
public int sample() {
// When probability of success is 1 the sample is always zero
return 0;
}
@Override
public String toString() {
return "Geometric(p=1) deviate";
}
@Override
public SharedStateDiscreteSampler withUniformRandomProvider(UniformRandomProvider rng) {
// No requirement for a new instance
return this;
}
}
/**
* Sample from the geometric distribution by using a related exponential distribution.
*/
private static class GeometricExponentialSampler
implements SharedStateDiscreteSampler {
/** Underlying source of randomness. Used only for the {@link #toString()} method. */
private final UniformRandomProvider rng;
/** The related exponential sampler for the geometric distribution. */
private final SharedStateContinuousSampler exponentialSampler;
/**
* @param rng Generator of uniformly distributed random numbers
* @param probabilityOfSuccess The probability of success (must be in the range
* {@code [0 < probabilityOfSuccess < 1]})
*/
GeometricExponentialSampler(UniformRandomProvider rng, double probabilityOfSuccess) {
this.rng = rng;
// Use a related exponential distribution:
// λ = −ln(1 − probabilityOfSuccess)
// exponential mean = 1 / λ
// --
// Note on validation:
// If probabilityOfSuccess == Math.nextDown(1.0) the exponential mean is >0 (valid).
// If probabilityOfSuccess == Double.MIN_VALUE the exponential mean is +Infinity
// and the sample will always be Integer.MAX_VALUE (the distribution is truncated). It
// is noted in the class Javadoc that the use of a small p leads to truncation so
// no checks are made for this case.
final double exponentialMean = 1.0 / (-Math.log1p(-probabilityOfSuccess));
exponentialSampler = ZigguratSampler.Exponential.of(rng, exponentialMean);
}
/**
* @param rng Generator of uniformly distributed random numbers
* @param source Source to copy.
*/
GeometricExponentialSampler(UniformRandomProvider rng, GeometricExponentialSampler source) {
this.rng = rng;
exponentialSampler = source.exponentialSampler.withUniformRandomProvider(rng);
}
@Override
public int sample() {
// Return the floor of the exponential sample
return (int) Math.floor(exponentialSampler.sample());
}
@Override
public String toString() {
return "Geometric deviate [" + rng.toString() + "]";
}
@Override
public SharedStateDiscreteSampler withUniformRandomProvider(UniformRandomProvider rng) {
return new GeometricExponentialSampler(rng, this);
}
}
/** Class contains only static methods. */
private GeometricSampler() {}
/**
* Creates a new geometric distribution sampler. The samples will be provided in the set
* {@code k=[0, 1, 2, ...]} where {@code k} indicates the number of failures before the first
* success.
*
* @param rng Generator of uniformly distributed random numbers.
* @param probabilityOfSuccess The probability of success.
* @return the sampler
* @throws IllegalArgumentException if {@code probabilityOfSuccess} is not in the range
* {@code [0 < probabilityOfSuccess <= 1]})
*/
public static SharedStateDiscreteSampler of(UniformRandomProvider rng,
double probabilityOfSuccess) {
if (probabilityOfSuccess <= 0 || probabilityOfSuccess > 1) {
throw new IllegalArgumentException(
"Probability of success (p) must be in the range [0 < p <= 1]: " +
probabilityOfSuccess);
}
return probabilityOfSuccess == 1 ?
GeometricP1Sampler.INSTANCE :
new GeometricExponentialSampler(rng, probabilityOfSuccess);
}
}
| 42.872611 | 100 | 0.661417 |
ba15a4f8ed5f935634013b4876f9703b95b1c47d | 1,562 | package org.mahjong4j.nosituation;
import org.junit.Before;
import org.junit.Test;
import org.mahjong4j.Player;
import org.mahjong4j.hands.Hands;
import org.mahjong4j.tile.Tile;
import org.mahjong4j.yaku.yakuman.Yakuman;
import java.util.List;
import static junit.framework.TestCase.assertEquals;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.junit.Assert.assertThat;
import static org.mahjong4j.Score.SCORE0;
import static org.mahjong4j.yaku.yakuman.Yakuman.SUANKO;
/**
* @author yu1ro
*/
public class SuankoTest {
Hands hands;
Player player;
@Before
public void setUp() throws Exception {
int[] tiles = {
3, 0, 0, 0, 0, 0, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 0, 3,
0, 0, 2, 0, 0, 0, 0, 0, 3,
0, 0, 0, 0,
0, 0, 0
};
Tile last = Tile.M6;
hands = new Hands(tiles, last);
player = new Player(hands);
player.calculate();
}
@Test
public void testGetYakumanListSize() throws Exception {
List<Yakuman> actual = player.getYakumanList();
assertEquals(1, actual.size());
}
@Test
public void testGetYakumanListItem() throws Exception {
List<Yakuman> actual = player.getYakumanList();
assertThat(actual, hasItems(SUANKO));
}
@Test
public void testGetFu() throws Exception {
assertEquals(0, player.getFu());
}
@Test
public void testGetScore() throws Exception {
assertEquals(SCORE0, player.getScore());
}
} | 24.793651 | 64 | 0.633163 |
86678c0e4e8cc075fb01fd2ddc5c1595f034ace9 | 249 | package com.fpinjava.lists.exercise05_12;
import com.fpinjava.lists.exercise05_10.List;
public class Reverse {
public static <A> List<A> reverseViaFoldLeft(List<A> list) {
throw new IllegalStateException("To be implemented");
}
}
| 22.636364 | 64 | 0.730924 |
c42a49be63aee7cdfa6ed21a6285415fcdd08fc9 | 3,481 | /*
This file is licensed 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 net.sf.xmlunit.diff;
import org.w3c.dom.Node;
/**
* Evaluators used for the base cases.
*/
public final class Evaluators {
private Evaluators() {
}
private static final Short CDATA = Node.CDATA_SECTION_NODE;
private static final Short TEXT = Node.TEXT_NODE;
/**
* Difference evaluator that just echos the result passed in.
*/
public static final DifferenceEvaluator Accept =
new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult outcome) {
return outcome;
}
};
/**
* The "standard" difference evaluator which decides which differences make
* two XML documents really different and which still leave them similar.
*/
public static final DifferenceEvaluator Default = new DefaultEvaluator();
/**
* Combines multiple DifferenceEvaluators so that the first one that changes
* the outcome wins.
*/
public static DifferenceEvaluator first(final DifferenceEvaluator... evaluators) {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
for (DifferenceEvaluator ev : evaluators) {
ComparisonResult evaluated = ev.evaluate(comparison, orig);
if (evaluated != orig) {
return evaluated;
}
}
return orig;
}
};
}
public static class DefaultEvaluator implements DifferenceEvaluator {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult outcome) {
if (outcome == ComparisonResult.DIFFERENT) {
switch (comparison.getType()) {
case NODE_TYPE:
Short control = (Short) comparison.getControlDetails().getValue();
Short test = (Short) comparison.getTestDetails().getValue();
if ((control.equals(TEXT) && test.equals(CDATA))
|| (control.equals(CDATA) && test.equals(TEXT))) {
outcome = ComparisonResult.SIMILAR;
}
break;
case HAS_DOCTYPE_DECLARATION:
case DOCTYPE_SYSTEM_ID:
case SCHEMA_LOCATION:
case NO_NAMESPACE_SCHEMA_LOCATION:
case NAMESPACE_PREFIX:
case ATTR_VALUE_EXPLICITLY_SPECIFIED:
case CHILD_NODELIST_SEQUENCE:
case XML_ENCODING:
outcome = ComparisonResult.SIMILAR;
break;
default:
break;
}
}
return outcome;
}
}
}
| 36.642105 | 99 | 0.594944 |
fed17ecc4fe20a791a195a20773454c684439214 | 320 | package com.wayn.mall;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class WaynMallApplication {
public static void main(String[] args) {
SpringApplication.run(WaynMallApplication.class, args);
}
}
| 26.666667 | 68 | 0.79375 |
b68948275f7f46e2616bde4eabd184a989f0f9d6 | 1,691 | package picocli.examples.arggroup;
import picocli.CommandLine;
import picocli.CommandLine.ArgGroup;
import picocli.CommandLine.MutuallyExclusiveArgsException;
import picocli.CommandLine.Option;
/**
* <p>
* The example below defines a command with mutually exclusive options `-a`, `-b` and `-c`.
* </p><p>
* Note that the options are defined as {@code required = true};
* this means required <em>within the group</em>, not required within the command.
* </p><p>
* The group itself has a `multiplicity` attribute that defines how many times
* the group may be specified within the command.
* The default is {@code multiplicity = "0..1"}, meaning that by default a group
* may be omitted or specified once. In this example the group has {@code multiplicity = "1"},
* so one of the options must occur on the command line.
* </p><p>
* The synopsis of this command is rendered as {@code <main class> (-a=<a> | -b=<b> | -c=<c>)}.
* </p>
*/
public class MutuallyExclusiveOptionsDemo {
@ArgGroup(exclusive = true, multiplicity = "1")
Exclusive exclusive;
static class Exclusive {
@Option(names = "-a", required = true) int a;
@Option(names = "-b", required = true) int b;
@Option(names = "-c", required = true) int c;
}
public static void main(String[] args) {
MutuallyExclusiveOptionsDemo example = new MutuallyExclusiveOptionsDemo();
CommandLine cmd = new CommandLine(example);
try {
cmd.parseArgs("-a=1", "-b=2");
} catch (MutuallyExclusiveArgsException ex) {
assert "Error: -a=<a>, -b=<b> are mutually dependent (specify only one)".equals(ex.getMessage());
}
}
}
| 36.76087 | 109 | 0.66233 |
7689008b1e5bedbfac85979614c9fdeaca217b5d | 1,619 | package com.github.sdt.cypher.ui.activities.register;
import android.content.Context;
import androidx.fragment.app.FragmentManager;
import com.github.sdt.cypher.data.rxFirebase.InterfaceFirebase;
import dagger.internal.Factory;
import javax.annotation.processing.Generated;
import javax.inject.Provider;
@Generated(
value = "dagger.internal.codegen.ComponentProcessor",
comments = "https://google.github.io/dagger"
)
public final class InteractorRegister_Factory<V extends InterfaceViewRegister>
implements Factory<InteractorRegister<V>> {
private final Provider<FragmentManager> supportFragmentProvider;
private final Provider<Context> contextProvider;
private final Provider<InterfaceFirebase> firebaseProvider;
public InteractorRegister_Factory(
Provider<FragmentManager> supportFragmentProvider,
Provider<Context> contextProvider,
Provider<InterfaceFirebase> firebaseProvider) {
this.supportFragmentProvider = supportFragmentProvider;
this.contextProvider = contextProvider;
this.firebaseProvider = firebaseProvider;
}
@Override
public InteractorRegister<V> get() {
return new InteractorRegister<V>(
supportFragmentProvider.get(), contextProvider.get(), firebaseProvider.get());
}
public static <V extends InterfaceViewRegister> InteractorRegister_Factory<V> create(
Provider<FragmentManager> supportFragmentProvider,
Provider<Context> contextProvider,
Provider<InterfaceFirebase> firebaseProvider) {
return new InteractorRegister_Factory<V>(
supportFragmentProvider, contextProvider, firebaseProvider);
}
}
| 35.977778 | 87 | 0.791847 |
1be1280b4312e55b8430e1fb58ef46b0d7b56ced | 939 | package com.code10.xml.util;
import com.code10.xml.controller.exception.BadRequestException;
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import java.io.FileInputStream;
import java.io.StringReader;
public class XsdUtil {
public static void validate(String xml, String path) {
final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
try {
final Schema schema = factory.newSchema(new StreamSource(new FileInputStream(path)));
final Validator validator = schema.newValidator();
validator.validate(new StreamSource(new StringReader(xml)));
} catch (Exception e) {
e.printStackTrace();
throw new BadRequestException("XSD validation failed!");
}
}
}
| 33.535714 | 100 | 0.72524 |
13479c13e7ccfd1ea3c8f8338c86a541f8b0ff9d | 1,580 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.delegatednetwork.models;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;
/** Defines values for DelegatedSubnetState. */
public final class DelegatedSubnetState extends ExpandableStringEnum<DelegatedSubnetState> {
/** Static value Deleting for DelegatedSubnetState. */
public static final DelegatedSubnetState DELETING = fromString("Deleting");
/** Static value Succeeded for DelegatedSubnetState. */
public static final DelegatedSubnetState SUCCEEDED = fromString("Succeeded");
/** Static value Failed for DelegatedSubnetState. */
public static final DelegatedSubnetState FAILED = fromString("Failed");
/** Static value Provisioning for DelegatedSubnetState. */
public static final DelegatedSubnetState PROVISIONING = fromString("Provisioning");
/**
* Creates or finds a DelegatedSubnetState from its string representation.
*
* @param name a name to look for.
* @return the corresponding DelegatedSubnetState.
*/
@JsonCreator
public static DelegatedSubnetState fromString(String name) {
return fromString(name, DelegatedSubnetState.class);
}
/** @return known DelegatedSubnetState values. */
public static Collection<DelegatedSubnetState> values() {
return values(DelegatedSubnetState.class);
}
}
| 38.536585 | 92 | 0.751899 |
502c830825cb970dc04e56c0af135d4f1672c106 | 1,768 | /*
* Copyright (C) 2014-2021 D3X Systems - All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.d3x.morpheus.conreg;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NonNull;
import com.d3x.morpheus.series.DoubleSeries;
/**
* Defines a single linear equality constraint on the coefficients estimated
* in a linear regression.
*
* @param <C> the runtime type of the regressor (column) variables.
*
* @author Scott Shaffer
*/
@AllArgsConstructor
public final class RegressionConstraint<C> {
/**
* A unique name for the constraint.
*/
@Getter @NonNull
private final String name;
/**
* The right-hand side value for the linear equality constraint.
*/
@Getter
private final double value;
/**
* The left-hand side terms for the linear equality constraint
* (the coefficients multiplying the regression coefficients).
*/
@Getter @NonNull
private final DoubleSeries<C> terms;
/**
* Returns a list of the regressors affected by this constraint.
* @return a list of the regressors affected by this constraint.
*/
public List<C> listRegressors() {
return terms.listKeys();
}
}
| 28.063492 | 76 | 0.705317 |
0f0adde571302a017020589c987f1108b4355681 | 2,716 | /*
* Copyright (C) 2016 The Android Open Source Project
*
* 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.android.tools.idea.testing;
import com.android.Version;
import com.android.sdklib.SdkVersionInfo;
import com.android.testutils.TestUtils;
import com.android.tools.idea.gradle.plugin.LatestKnownPluginVersionProvider;
import org.jetbrains.annotations.NotNull;
import static com.android.SdkConstants.CURRENT_BUILD_TOOLS_VERSION;
public class BuildEnvironment {
private static BuildEnvironment ourInstance;
@NotNull private final String myGradlePluginVersion;
@NotNull private final String myBuildToolsVersion;
private final int myCompileSdkVersion;
private final int myTargetSdkVersion;
private final int myMinSdkVersion;
private BuildEnvironment(@NotNull String gradlePluginVersion,
@NotNull String buildToolsVersion,
int compileSdkVersion,
int targetSdkVersion,
int minSdkVersion) {
myGradlePluginVersion = gradlePluginVersion;
myBuildToolsVersion = buildToolsVersion;
myCompileSdkVersion = compileSdkVersion;
myTargetSdkVersion = targetSdkVersion;
myMinSdkVersion = minSdkVersion;
}
@NotNull
public synchronized static BuildEnvironment getInstance() {
if (ourInstance == null) {
ourInstance = new BuildEnvironment(
TestUtils.runningFromBazel() ? Version.ANDROID_GRADLE_PLUGIN_VERSION : LatestKnownPluginVersionProvider.INSTANCE.get(),
CURRENT_BUILD_TOOLS_VERSION,
SdkVersionInfo.HIGHEST_KNOWN_STABLE_API,
SdkVersionInfo.HIGHEST_KNOWN_STABLE_API,
SdkVersionInfo.LOWEST_ACTIVE_API
);
}
return ourInstance;
}
@NotNull
public String getGradlePluginVersion() {
return myGradlePluginVersion;
}
@NotNull
public String getBuildToolsVersion() {
return myBuildToolsVersion;
}
public String getCompileSdkVersion() {
return String.valueOf(myCompileSdkVersion);
}
public String getTargetSdkVersion() {
return String.valueOf(myTargetSdkVersion);
}
public String getMinSdkVersion() {
return String.valueOf(myMinSdkVersion);
}
}
| 31.952941 | 127 | 0.739691 |
09d3cb4797d7655cc01f0768f0e3d549e1b23219 | 520 | package com.minda.mindadaily.model;
public class CourseItem {
private String courseName;
private String numOfDay;
private String place;
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getNumOfDay() {
return numOfDay;
}
public void setNumOfDay(String numOfDay) {
this.numOfDay = numOfDay;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
}
| 20 | 47 | 0.736538 |
aba526382088a5a45d2da79f629918134b33b72b | 2,736 | /*
* 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.facebook.presto.sql.planner;
import com.facebook.presto.spi.block.SortOrder;
import com.facebook.presto.sql.tree.Expression;
import com.facebook.presto.sql.tree.OrderBy;
import com.facebook.presto.sql.tree.SortItem;
import com.facebook.presto.sql.tree.SymbolReference;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.toImmutableList;
public class PlannerUtils
{
private PlannerUtils() {}
public static SortOrder toSortOrder(SortItem sortItem)
{
if (sortItem.getOrdering() == SortItem.Ordering.ASCENDING) {
if (sortItem.getNullOrdering() == SortItem.NullOrdering.FIRST) {
return SortOrder.ASC_NULLS_FIRST;
}
return SortOrder.ASC_NULLS_LAST;
}
if (sortItem.getNullOrdering() == SortItem.NullOrdering.FIRST) {
return SortOrder.DESC_NULLS_FIRST;
}
return SortOrder.DESC_NULLS_LAST;
}
public static OrderingScheme toOrderingScheme(List<SortItem> sortItems)
{
return toOrderingScheme(sortItems, item -> {
checkArgument(item instanceof SymbolReference, "must be symbol reference");
return new Symbol(((SymbolReference) item).getName());
});
}
public static OrderingScheme toOrderingScheme(List<SortItem> sortItems, Function<Expression, Symbol> translator)
{
// The logic is similar to QueryPlanner::sort
Map<Symbol, SortOrder> orderings = new LinkedHashMap<>();
for (SortItem item : sortItems) {
Symbol symbol = translator.apply(item.getSortKey());
// don't override existing keys, i.e. when "ORDER BY a ASC, a DESC" is specified
orderings.putIfAbsent(symbol, toSortOrder(item));
}
return new OrderingScheme(orderings.keySet().stream().collect(toImmutableList()), orderings);
}
public static OrderingScheme toOrderingScheme(OrderBy orderBy)
{
return toOrderingScheme(orderBy.getSortItems());
}
}
| 37.479452 | 116 | 0.705044 |
21760bf22acb3e4e7fb64cc880003faa4e90275d | 223 | package com.edvinaskilbauskas.squarie;
/**
* Created by edvinas on 11/29/14.
*/
public enum GameState {
TransitionToMainScreen, MainScreen, TransitionToGame, Game, Dead, TransitionFromDeath, NextPlatformTransition
}
| 24.777778 | 113 | 0.780269 |
7ccf94058831151ef31eefd54a14ea5a05762af8 | 3,856 | package com.regitiny.catiny.service.impl;
import static org.elasticsearch.index.query.QueryBuilders.*;
import com.regitiny.catiny.GeneratedByJHipster;
import com.regitiny.catiny.domain.AccountStatus;
import com.regitiny.catiny.repository.AccountStatusRepository;
import com.regitiny.catiny.repository.search.AccountStatusSearchRepository;
import com.regitiny.catiny.service.AccountStatusService;
import com.regitiny.catiny.service.dto.AccountStatusDTO;
import com.regitiny.catiny.service.mapper.AccountStatusMapper;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing {@link AccountStatus}.
*/
@Service
@Transactional
@GeneratedByJHipster
public class AccountStatusServiceImpl implements AccountStatusService {
private final Logger log = LoggerFactory.getLogger(AccountStatusServiceImpl.class);
private final AccountStatusRepository accountStatusRepository;
private final AccountStatusMapper accountStatusMapper;
private final AccountStatusSearchRepository accountStatusSearchRepository;
public AccountStatusServiceImpl(
AccountStatusRepository accountStatusRepository,
AccountStatusMapper accountStatusMapper,
AccountStatusSearchRepository accountStatusSearchRepository
) {
this.accountStatusRepository = accountStatusRepository;
this.accountStatusMapper = accountStatusMapper;
this.accountStatusSearchRepository = accountStatusSearchRepository;
}
@Override
public AccountStatusDTO save(AccountStatusDTO accountStatusDTO) {
log.debug("Request to save AccountStatus : {}", accountStatusDTO);
AccountStatus accountStatus = accountStatusMapper.toEntity(accountStatusDTO);
accountStatus = accountStatusRepository.save(accountStatus);
AccountStatusDTO result = accountStatusMapper.toDto(accountStatus);
accountStatusSearchRepository.save(accountStatus);
return result;
}
@Override
public Optional<AccountStatusDTO> partialUpdate(AccountStatusDTO accountStatusDTO) {
log.debug("Request to partially update AccountStatus : {}", accountStatusDTO);
return accountStatusRepository
.findById(accountStatusDTO.getId())
.map(
existingAccountStatus -> {
accountStatusMapper.partialUpdate(existingAccountStatus, accountStatusDTO);
return existingAccountStatus;
}
)
.map(accountStatusRepository::save)
.map(
savedAccountStatus -> {
accountStatusSearchRepository.save(savedAccountStatus);
return savedAccountStatus;
}
)
.map(accountStatusMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Page<AccountStatusDTO> findAll(Pageable pageable) {
log.debug("Request to get all AccountStatuses");
return accountStatusRepository.findAll(pageable).map(accountStatusMapper::toDto);
}
@Override
@Transactional(readOnly = true)
public Optional<AccountStatusDTO> findOne(Long id) {
log.debug("Request to get AccountStatus : {}", id);
return accountStatusRepository.findById(id).map(accountStatusMapper::toDto);
}
@Override
public void delete(Long id) {
log.debug("Request to delete AccountStatus : {}", id);
accountStatusRepository.deleteById(id);
accountStatusSearchRepository.deleteById(id);
}
@Override
@Transactional(readOnly = true)
public Page<AccountStatusDTO> search(String query, Pageable pageable) {
log.debug("Request to search for a page of AccountStatuses for query {}", query);
return accountStatusSearchRepository.search(queryStringQuery(query), pageable).map(accountStatusMapper::toDto);
}
}
| 35.703704 | 115 | 0.782417 |
d3d17215f56e35bde4f7037adde2d53038a93f01 | 1,126 | package csp.releaseplan.constraints;
import csp.ConstraintMapping;
import csp.releaseplan.ReleasePlanConsistencyModel;
import org.testng.Assert;
import org.testng.annotations.Test;
import releaseplan.Constraint;
import releaseplan.ConstraintHelper;
import releaseplan.ConstraintType;
import releaseplan.IndexBasedReleasePlan;
import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;
public class DifferentTest {
@Test
public void testDifferent0() throws Exception {
Integer[] noRequirementsPerRelease = new Integer[]{0,2};
Constraint[] constraints = new Constraint[]{
ConstraintHelper.createBinaryDependency(1, ConstraintType.EXCLUDES, 0, 1)
};
IndexBasedReleasePlan test = new IndexBasedReleasePlan(noRequirementsPerRelease);
ReleasePlanConsistencyModel m = new ReleasePlanConsistencyModel(test, Arrays.stream(constraints).collect(Collectors.toList()));
m.build();
Set<ConstraintMapping> diagnosis = m.getDiagnosis();
Assert.assertTrue(m.getDiagnosis() != null && m.getDiagnosis().size() == 1);
}
} | 32.171429 | 135 | 0.745115 |
43ba134314fb4b7189eb3cfc1b3786d3f4b02c56 | 486 | package lk.ultratech.agent.sys.dao.custom.impl;
import lk.ultratech.agent.sys.entity.Worker;
import java.sql.SQLException;
class WorkerDaoImplTest {
public static void main(String[] args) throws SQLException, ClassNotFoundException {
new WorkerDaoImplTest().save();
}
void save() throws SQLException, ClassNotFoundException {
boolean save = new WorkerDAOImpl().save(new Worker("W002","Amal",07111111,"Driver"));
System.out.println(save);
}
} | 28.588235 | 93 | 0.713992 |
df96c46580e9c8d47b6e95e5aac801432253049f | 768 | package com.github.tmarwen.micronaut.microstream.application.model;
import com.github.tmarwen.micronaut.microstream.annotation.Root;
import java.util.ArrayList;
import java.util.List;
/**
* The Chat Graph model root entity.
*
* @since 1.0.0
*/
@Root
public class ChatGraph {
private List<Thread> threads;
private List<User> users;
public ChatGraph() {
this.threads = new ArrayList<>();
this.users = new ArrayList<>();
}
public List<Thread> getThreads() {
return threads;
}
public void setThreads(List<Thread> threads) {
this.threads = threads;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
}
| 18.731707 | 67 | 0.638021 |
9d36bd3e37946b56fb0d6d055646f04c29d899f3 | 2,868 | package com.huang.notetool.util;
import javax.swing.filechooser.FileFilter;
import java.io.File;
/**
* 继承文件拦截器FileFilter
* 实现对文件的限制访问
* 在jFileChooser可以使用他来指定打开文件的类型
*
* @author 黄先生
* @date 2019-05-05
*/
public class NormalFileFilter extends FileFilter {
/**
* 可接收的文件类型
*
* @param file 文件
* @return true or false
*/
@Override
public boolean accept(File file) {
String fileName = file.getName();
//仅显示目录和txt、log、sql、bat、json、tmp、exc、xml、html、dll、cmd、sh
return file.isDirectory()
|| fileName.toLowerCase().endsWith(".txt")
|| fileName.toLowerCase().endsWith(".log")
|| fileName.toLowerCase().endsWith(".sql")
|| fileName.toLowerCase().endsWith(".json")
|| fileName.toLowerCase().endsWith(".tmp")
|| fileName.toLowerCase().endsWith(".exc")
|| fileName.toLowerCase().endsWith(".xml")
|| fileName.toLowerCase().endsWith(".html")
|| fileName.toLowerCase().endsWith(".dll")
|| fileName.toLowerCase().endsWith(".bat")
|| fileName.toLowerCase().endsWith(".cmd")
|| fileName.toLowerCase().endsWith(".sh")
|| fileName.toLowerCase().endsWith(".conf")
|| fileName.toLowerCase().endsWith(".properties")
|| fileName.toLowerCase().endsWith(".yml")
|| fileName.toLowerCase().endsWith(".idea")
|| fileName.toLowerCase().endsWith(".iml")
|| fileName.toLowerCase().endsWith(".md")
|| fileName.toLowerCase().endsWith(".gitignore")
|| fileName.toLowerCase().endsWith(".exe4j");
}
@Override
public String getDescription() {
// 需要的文件类型
return "*.normalFile;";
}
/**
* 根据类型判断文件是否为图片
*
* @param type 文件类型
* @return 是否
*/
public static boolean isaPicture(String type) {
//bmp,jpg,png,tif,gif,pcx,tga,exif,fpx,
// svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp
return type.contains("png")
|| type.contains("svg")
|| type.contains("raw")
|| type.contains("ai")
|| type.contains("eps")
|| type.contains("ufo")
|| type.contains("psd")
|| type.contains("cdr")
|| type.contains("pcd")
|| type.contains("dxf")
|| type.contains("jpg")
|| type.contains("bmp")
|| type.contains("tif")
|| type.contains("pcx")
|| type.contains("tga")
|| type.contains("fpx")
|| type.contains("exif")
|| type.contains("gif")
|| type.contains("icon");
}
}
| 34.142857 | 65 | 0.509066 |
ff15c2774cc54b8170768eab31fdc2240dcda3c1 | 663 | package no.java.moosehead.web;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.time.Instant;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
public class UtilsTest {
@Test
public void shouldConvertFromStringToInstant() throws Exception {
Optional<Instant> instant = Utils.toInstant("28/07-2015 15:45");
assertThat(instant).isPresent();
assertThat(instant.get().toString()).isEqualTo("2015-07-28T13:45:00Z");
}
@Test
public void shouldHandleInvalidDate() throws Exception {
assertThat(Utils.toInstant("sdf").isPresent()).isFalse();
}
} | 24.555556 | 79 | 0.710407 |
edcd43bee33908c873dae33bfd9985f33cee65ad | 1,361 | package com.shieldui.wicket.examples;
import com.shieldui.wicket.calendar.ChangeEventListener;
import java.util.Date;
import java.util.HashMap;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebPage;
public class Calendar extends WebPage
{
private static final long serialVersionUID = 1L;
public Calendar()
{
// add the menu
add(new MenuPanel("menu"));
final com.shieldui.wicket.calendar.Calendar calendar = new com.shieldui.wicket.calendar.Calendar("calendar");
add(calendar);
java.util.Calendar min = java.util.Calendar.getInstance();
min.set(2000, 1, 1);
java.util.Calendar max = java.util.Calendar.getInstance();
max.set(2039, 3, 1);
calendar.getOptions()
.setMin(min)
.setMax(max)
.setValue(new Date())
.getFooter()
.setEnabled(true)
.setFooterTemplate("{0:dd.MM.yy}");
calendar.add(new ChangeEventListener() {
@Override
protected void handleEvent(AjaxRequestTarget target, Object event) {
target.prependJavaScript("alert(\"Value is: " + ((HashMap<String, Boolean>)event).get("value") + "\");");
}
});
}
}
| 32.404762 | 121 | 0.587068 |
043df0bca2e00ae7a2118bfa78d8ec55a5b890e4 | 1,503 | package com.blamejared.crafttweaker.impl_native.entity;
import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker.impl.entity.MCEntityType;
import com.blamejared.crafttweaker_annotations.annotations.Document;
import com.blamejared.crafttweaker_annotations.annotations.NativeTypeRegistration;
import net.minecraft.entity.EntitySpawnPlacementRegistry;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.openzen.zencode.java.ZenCodeType;
@ZenRegister
@Document("vanilla/api/entity/PlacementType")
@NativeTypeRegistration(value = EntitySpawnPlacementRegistry.PlacementType.class, zenCodeName = "crafttweaker.api.entity.PlacementType")
public class ExpandPlacementType {
/**
* Checks if a specific entity type can spawn in the world at the given position with this PlacementType.
*
* @param world A World object.
* @param pos The position to check at.
* @param entityType The EntityType to check for.
*
* @return True if the entity type can spawn. False otherwise.
*
* @docParam world world
* @docParam pos new BlockPos(1,2,3)
* @docParam entityType <entitytype:minecraft:pig>
*/
@ZenCodeType.Method
public static boolean canSpawnAt(EntitySpawnPlacementRegistry.PlacementType internal, World world, BlockPos pos, MCEntityType entityType) {
return internal.canSpawnAt(world, pos, entityType.getInternal());
}
}
| 39.552632 | 143 | 0.756487 |
1e577e8924800c189950f7fb24ad104603f15991 | 2,543 | /*
* Copyright (c) 2016, Salesforce.com, Inc.
* 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 Salesforce.com, Inc. 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 OWNER 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 com.desk.java.apiclient.model;
import java.util.Date;
/**
* Created by Matt Kranzler on 12/29/15.
* Copyright (c) 2016 Desk.com. All rights reserved.
*/
public class OpportunityEvent extends OpportunityActivity {
private static final long serialVersionUID = 4913758388022209018L;
private String title;
private String location;
private Date startAt;
private Date endAt;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Date getStartAt() {
return startAt;
}
public void setStartAt(Date startAt) {
this.startAt = startAt;
}
public Date getEndAt() {
return endAt;
}
public void setEndAt(Date endAt) {
this.endAt = endAt;
}
}
| 33.460526 | 109 | 0.719622 |
467576abf5858b335ff779a775c9d28d8ef525cd | 733 | package invoiceGeneratorEntitites;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;
@Embeddable
public class ShopRegistrationID implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private Long ownerShopId;
private Long customerShopId;
@Column(name="owner_shop_id")
public Long getOwnerShopId() {
return ownerShopId;
}
public void setOwnerShopId(Long ownerShopId) {
this.ownerShopId = ownerShopId;
}
@Column(name="customer_shop_id")
public Long getCustomerShopId() {
return customerShopId;
}
public void setCustomerShopId(Long customerShopId) {
this.customerShopId = customerShopId;
}
}
| 20.361111 | 56 | 0.773533 |
12872e7cb347d30a36143f387c50cab4a56ef149 | 1,829 | package no.mnemonic.act.platform.dao.cassandra.entity;
import com.datastax.oss.driver.api.mapper.annotations.ClusteringColumn;
import com.datastax.oss.driver.api.mapper.annotations.CqlName;
import com.datastax.oss.driver.api.mapper.annotations.Entity;
import com.datastax.oss.driver.api.mapper.annotations.PartitionKey;
import java.util.UUID;
import static no.mnemonic.act.platform.dao.cassandra.entity.CassandraEntity.KEY_SPACE;
import static no.mnemonic.act.platform.dao.cassandra.entity.EvidenceSubmissionAclEntity.TABLE;
@Entity(defaultKeyspace = KEY_SPACE)
@CqlName(TABLE)
public class EvidenceSubmissionAclEntity implements CassandraEntity {
public static final String TABLE = "evidence_submission_acl";
@PartitionKey
@CqlName("submission_id")
private UUID submissionID;
@ClusteringColumn
private UUID id;
@CqlName("subject_id")
private UUID subjectID;
@CqlName("source_id")
private UUID originID;
private long timestamp;
public UUID getSubmissionID() {
return submissionID;
}
public EvidenceSubmissionAclEntity setSubmissionID(UUID submissionID) {
this.submissionID = submissionID;
return this;
}
public UUID getId() {
return id;
}
public EvidenceSubmissionAclEntity setId(UUID id) {
this.id = id;
return this;
}
public UUID getSubjectID() {
return subjectID;
}
public EvidenceSubmissionAclEntity setSubjectID(UUID subjectID) {
this.subjectID = subjectID;
return this;
}
public UUID getOriginID() {
return originID;
}
public EvidenceSubmissionAclEntity setOriginID(UUID originID) {
this.originID = originID;
return this;
}
public long getTimestamp() {
return timestamp;
}
public EvidenceSubmissionAclEntity setTimestamp(long timestamp) {
this.timestamp = timestamp;
return this;
}
}
| 24.065789 | 94 | 0.756698 |
7f4c8187fba2393286d1c142d602b5469b449161 | 2,768 | package com.yerseg.web;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import org.apache.commons.codec.digest.MurmurHash3;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Random;
import java.util.UUID;
@WebServlet("/MainServlet")
public class MainServlet extends HttpServlet {
private Multimap<Integer, String> multiMap;
private SetOfSessionId setId;
public void init() {
multiMap = HashMultimap.create();
setId = SetOfSessionId.getInstance();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Random random = new Random(System.currentTimeMillis());
int number1 = -125 + random.nextInt(347 + 125 + 1);
int number2 = -125 + random.nextInt(347 + 125 + 1);
int seed = (int) (System.currentTimeMillis() % 100000);
String hash = String.valueOf(MurmurHash3.hash32(number1, number2, seed));
multiMap.put(number1 + number2, hash);
request.setAttribute("number1", number1);
request.setAttribute("number2", number2);
request.setAttribute("hashNum", hash);
try {
String msg = (String) request.getParameter("message");
if (msg != null) {
request.setAttribute("message", msg);
}
} catch (NullPointerException ignored) {
}
request.getRequestDispatcher("/count_to_get_in.jsp").forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int userAnswer = -126;
if (!(request.getParameter("answer").equals(""))) {
userAnswer = Integer.parseInt(request.getParameter("answer"));
}
String hash = request.getParameter("hash");
if (checkUserAnswer(userAnswer, hash)) {
UUID uuid = UUID.randomUUID();
setId.putSessionId(uuid.toString());
Cookie cookie = new Cookie("sessionId", uuid.toString());
response.addCookie(cookie);
response.sendRedirect(request.getContextPath() + "/hello_inside.html");
} else {
response.sendRedirect(request.getContextPath() + "/count_to_get_in.html");
}
}
private boolean checkUserAnswer(int answer, String hash) {
if (multiMap.containsKey(answer)) {
return multiMap.get(answer).contains(hash);
}
return false;
}
}
| 36.421053 | 122 | 0.66763 |
066ffbf1701bb463818a88d111b53be5561a7f55 | 914 | public class InventoryManagement {
public static void refreshItem(Item item) {
System.out.print("Processing ");
item.printItem();
if (item.getQuantity() < 5)
System.out.println("Ordering more");
else
System.out.println("There is enough stock");
// if(item.getQuantity() < 5)
// System.out.println("Order more of " + item.getName());
// else
// System.out.println("There is enough stock of " + item.getName());
}
// public static void refreshItem(GroceryItem item) {
// if(item.getQuantity() < 5)
// System.out.println("Order more of " + item.getName());
// else
// System.out.println("There is enough stock of " + item.getName());
// }
// public static void refreshItem(ImportedItem item) {
// if(item.getQuantity() < 5)
// System.out.println("Order more of " + item.getName());
// else
// System.out.println("There is enough stock of " + item.getName());
// }
}
| 22.292683 | 70 | 0.647702 |
c76f5b34661d0add4b430ac692dbd820e3388b3f | 1,352 | package fr.AleksGirardey.Commands.City.Set.Permissions;
import fr.AleksGirardey.Commands.City.CityCommandAssistant;
import fr.AleksGirardey.Objects.Core;
import fr.AleksGirardey.Objects.DBObject.DBPlayer;
import fr.AleksGirardey.Objects.DBObject.Permission;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.entity.living.player.Player;
import java.util.ArrayList;
import java.util.List;
public abstract class CityCommandSetPerm extends CityCommandAssistant{
protected Permission perm;
protected boolean[] values = new boolean[3];
@Override
protected boolean SpecialCheck(DBPlayer player, CommandContext context) {
values[0] = context.<Boolean>getOne("[build]").get();
values[1] = context.<Boolean>getOne("[container]").get();
values[2] = context.<Boolean>getOne("[switch]").get();
return (true);
}
protected abstract void setPerm(DBPlayer player, CommandContext context);
@Override
protected CommandResult ExecCommand(DBPlayer player, CommandContext context) {
setPerm(player, context);
perm.setBuild(values[0]);
perm.setContainer(values[1]);
perm.setSwitch_(values[2]);
return CommandResult.success();
}
}
| 34.666667 | 87 | 0.715237 |
4082db1563c535f41be1c3bb95c888f57f9a2936 | 7,825 | /*
* Copyright (C) 2014 Stefan Niederhauser ([email protected])
*
* 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 guru.nidi.languager;
import guru.nidi.languager.crawl.CrawlPattern;
import guru.nidi.languager.crawl.FindRegexAction;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.*;
import static guru.nidi.languager.Message.Status.FOUND;
import static org.junit.Assert.assertEquals;
/**
*
*/
public class KeyExtractorTest extends BaseTest {
private final File base = fromTestDir("");
@Test
public void testSameKey() throws Exception {
final KeyExtractor extractor = extractFromFile();
final List<KeyExtractor.FindResultPair> sameKeyResults = extractor.getSameKeyResults();
assertEquals(1, sameKeyResults.size());
final KeyExtractor.FindResultPair sameKey = sameKeyResults.get(0);
assertEquals("key1", extractor.keyOf(sameKey.getResult1()));
assertEquals("key1", extractor.keyOf(sameKey.getResult2()));
final SourcePosition pos1 = sameKey.getResult1().getPosition();
final SourcePosition pos2 = sameKey.getResult2().getPosition();
assertEquals(new File(base, "test2.html"), pos1.getSource());
assertEquals(new File(base, "test2.html"), pos2.getSource());
assertEquals(3, pos1.getLine());
assertEquals(4, pos2.getLine());
assertEquals(32, pos1.getColumn());
assertEquals(15, pos2.getColumn());
}
@Test
public void testSameDefaultValue() throws Exception {
final KeyExtractor extractor = extractFromFile();
final List<KeyExtractor.FindResultPair> sameValueResults = extractor.getSameValueResults();
assertEquals(1, sameValueResults.size());
final KeyExtractor.FindResultPair sameValue = sameValueResults.get(0);
assertEquals("key2", extractor.keyOf(sameValue.getResult1()));
assertEquals("key3", extractor.keyOf(sameValue.getResult2()));
final SourcePosition pos1 = sameValue.getResult1().getPosition();
final SourcePosition pos2 = sameValue.getResult2().getPosition();
assertEquals(new File(base, "test2.html"), pos1.getSource());
assertEquals(new File(base, "test2.html"), pos2.getSource());
assertEquals(5, pos1.getLine());
assertEquals(6, pos2.getLine());
assertEquals(15, pos1.getColumn());
assertEquals(9, pos2.getColumn());
}
@Test
public void testUnmessagedTextHtml() throws Exception {
final KeyExtractor extractor = extractFromFile();
extractor.extractNegativesFromFiles(
new CrawlPattern(base, "test2.html", null, "utf-8"),
">(.*?)<", null, EnumSet.of(FindRegexAction.Flag.TRIM));
final Collection<FindResult<List<String>>> negatives = extractor.getNegatives();
assertEquals(2, negatives.size());
Iterator<FindResult<List<String>>> iter = negatives.iterator();
assertEquals("Text9", iter.next().getFinding().get(0));
assertEquals("{{ignore}}", iter.next().getFinding().get(0));
}
@Test
public void testUnmessagedWithIgnore() throws Exception {
final KeyExtractor extractor = extractFromFile();
extractor.extractNegativesFromFiles(
new CrawlPattern(base, "test2.html", null, "utf-8"),
">(.*?)<", "\\{\\{.*?\\}\\}", EnumSet.of(FindRegexAction.Flag.TRIM));
final Collection<FindResult<List<String>>> negatives = extractor.getNegatives();
assertEquals(1, negatives.size());
assertEquals("Text9", negatives.iterator().next().getFinding().get(0));
}
@Test
public void testUnmessagedTextHtmlWithInner() throws Exception {
final KeyExtractor extractor = new KeyExtractor();
extractor.extractFromFiles(
new CrawlPattern(base, "inner.html", null, "utf-8"),
"<msg key='(.*?)'>(.*?)</msg>", EnumSet.of(FindRegexAction.Flag.WITH_EMPTY));
extractor.extractNegativesFromFiles(
new CrawlPattern(base, "inner.html", null, "utf-8"),
">(.*?)<", null, EnumSet.of(FindRegexAction.Flag.TRIM));
final Collection<FindResult<List<String>>> negatives = extractor.getNegatives();
assertEquals(0, negatives.size());
}
@Test
public void testUnmessagedTextJs() throws Exception {
final KeyExtractor extractor = new KeyExtractor();
extractor.extractFromFiles(
new CrawlPattern(base, "*.js", null, "utf-8"),
"/\\*-(.*?)\\*/'(.*?)'", EnumSet.of(FindRegexAction.Flag.WITH_EMPTY));
extractor.extractNegativesFromFiles(
new CrawlPattern(base, "*.js", null, "utf-8"),
"'(.*?)'", null, EnumSet.of(FindRegexAction.Flag.TRIM));
final Collection<FindResult<List<String>>> negatives = extractor.getNegatives();
assertEquals(1, negatives.size());
final Iterator<FindResult<List<String>>> iter = negatives.iterator();
assertEquals("unmessaged", iter.next().getFinding().get(0));
final SortedMap<String, Message> messages = extractor.getMessages();
assertEquals(1, messages.size());
assertEquals(new Message("key", FOUND, "messaged"), messages.get("key"));
final Set<String> ignoredValues = extractor.getIgnoredValues();
assertEquals(1, ignoredValues.size());
assertEquals("ignored", ignoredValues.iterator().next());
}
@Test
public void testMessages() throws Exception {
final KeyExtractor extractor = extractFromFile();
assertEquals(3, extractor.getMessages().size());
final Iterator<Map.Entry<String, Message>> iter = extractor.getMessages().entrySet().iterator();
assertEntryEquals("key1", new Message("key1", FOUND, "default1"), iter.next());
assertEntryEquals("key2", new Message("key2", FOUND, "Text2"), iter.next());
assertEntryEquals("key3", new Message("key3", FOUND, "Text2"), iter.next());
}
private KeyExtractor extractFromFile() throws IOException {
final KeyExtractor extractor = new KeyExtractor();
extractor.extractFromFiles(
new CrawlPattern(base, "test2.html", null, "utf-8"),
"<msg key='(.*?)'>(.*?)</msg>", EnumSet.of(FindRegexAction.Flag.WITH_EMPTY));
return extractor;
}
private void assertEntryEquals(String key, Message value, Map.Entry<String, Message> entry) {
assertEquals(key, entry.getKey());
assertEquals(value, entry.getValue());
}
@Test
public void testExtractFromClasspath() throws Exception {
final KeyExtractor extractor = new KeyExtractor();
extractor.extractFromClasspath(Arrays.asList("classpath*:org/hibernate/validator/ValidationMessages", "classpath*:**/"));
final SortedMap<String, Message> messages = extractor.getMessages();
assertEquals(23, messages.size());
}
@Test
public void testRemoveNewlines() throws Exception {
final KeyExtractor extractor = new KeyExtractor();
extractor.getMessages().put("key", new Message("key", FOUND, " a\n\n\n b "));
extractor.removeNewlines();
assertEquals("a b", extractor.getMessages().get("key").getDefaultValue());
}
}
| 43.472222 | 129 | 0.659553 |
ed80ed5e7cc86f15d5978e5a213e7d688db899c8 | 1,005 | // This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.acm.models;
import com.aliyun.tea.*;
public class GetAntpassportTenantRequest extends TeaModel {
// OAuth模式下的授权token
@NameInMap("auth_token")
public String authToken;
// 蚂蚁通行证uid
@NameInMap("ant_uid")
@Validation(required = true)
public String antUid;
public static GetAntpassportTenantRequest build(java.util.Map<String, ?> map) throws Exception {
GetAntpassportTenantRequest self = new GetAntpassportTenantRequest();
return TeaModel.build(map, self);
}
public GetAntpassportTenantRequest setAuthToken(String authToken) {
this.authToken = authToken;
return this;
}
public String getAuthToken() {
return this.authToken;
}
public GetAntpassportTenantRequest setAntUid(String antUid) {
this.antUid = antUid;
return this;
}
public String getAntUid() {
return this.antUid;
}
}
| 26.447368 | 100 | 0.686567 |
02d9408c3a143243473ce0f5484642e89938c6b8 | 3,972 | package io.advantageous.qbit.service.dispatchers;
import io.advantageous.boon.core.Sys;
import io.advantageous.qbit.reactive.Callback;
import io.advantageous.qbit.reactive.CallbackBuilder;
import io.advantageous.qbit.service.ServiceBundle;
import io.advantageous.qbit.service.ServiceBundleBuilder;
import io.advantageous.qbit.service.ServiceProxyUtils;
import io.advantageous.qbit.system.QBitSystemManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
public class ServiceWorkersTest {
ServiceBundleBuilder serviceBundleBuilder;
ServiceBundle serviceBundle;
QBitSystemManager systemManager;
IMyService myService;
int numServices = 4;
List<MyService> myServiceList;
@Before
public void setup() {
systemManager = new QBitSystemManager();
myServiceList = new ArrayList<>(numServices);
for (int index = 0; index < numServices; index++) {
myServiceList.add(new MyService());
}
final AtomicInteger serviceCount = new AtomicInteger();
serviceBundleBuilder = ServiceBundleBuilder.serviceBundleBuilder().setSystemManager(systemManager);
serviceBundle = serviceBundleBuilder.build();
serviceBundle.addRoundRobinService("/myService", numServices, () -> myServiceList.get(serviceCount.getAndIncrement()));
serviceBundle.start();
myService = serviceBundle.createLocalProxy(IMyService.class, "/myService");
}
@Test
public void test() {
for (int index = 0; index < 100; index++) {
myService.method1();
}
ServiceProxyUtils.flushServiceProxy(myService);
myServiceList.forEach(myService1 -> {
for (int index = 0; index < 10; index++) {
Sys.sleep(10);
if (myService1.count.get() == 25) break;
}
});
myServiceList.forEach(myService1 -> {
for (int index = 0; index < 10; index++) {
assertEquals(25, myService1.count.get());
}
});
}
@Test
public void testWithCallback() {
AtomicBoolean fail = new AtomicBoolean();
AtomicInteger count = new AtomicInteger();
Callback<String> callback = CallbackBuilder.newCallbackBuilder()
.withCallback(String.class, value -> {
if (value.equals("mom")) {
count.incrementAndGet();
}
})
.withErrorHandler(throwable -> {
throwable.printStackTrace();
fail.set(true);
})
.build(String.class);
for (int index = 0; index < 100; index++) {
myService.method2(callback);
}
ServiceProxyUtils.flushServiceProxy(myService);
for (int index = 0; index < 10; index++) {
Sys.sleep(10);
if (count.get() == 100) break;
}
assertFalse(fail.get());
myServiceList.forEach(myService1 -> {
for (int index = 0; index < 10; index++) {
assertEquals(25, myService1.count.get());
}
});
}
@After
public void tearDown() {
systemManager.shutDown();
}
public interface IMyService {
void method1();
void method2(Callback<String> callback);
}
public static class MyService {
final AtomicInteger count = new AtomicInteger();
public void method1() {
count.incrementAndGet();
}
public void method2(final Callback<String> callback) {
count.incrementAndGet();
callback.accept("mom");
}
}
} | 24.981132 | 127 | 0.606747 |
88405a15913d4e7a7c58bb1cffb5041de2bc7703 | 11,775 | /*
* gabien-app-r48 - Editing program for various formats
* Written starting in 2016 by contributors (see CREDITS.txt)
* To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
* You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
package r48.map.events;
import r48.AppMain;
import r48.RubyIO;
import r48.dbs.TXDB;
import r48.dbs.ValueSyntax;
import r48.io.IObjectBackend;
import r48.io.data.IRIO;
import r48.map.mapinfos.R2kRMLikeMapInfoBackend;
import r48.schema.util.SchemaPath;
import java.util.LinkedList;
import static r48.schema.specialized.R2kSystemDefaultsInstallerSchemaElement.getSaveCount;
/**
* Created in the early hours of December 18th, 2017
* Most functionality added (ghhhoooossstttsss!!!) in the late hours of that day.
* BTW: A "ghost" refers to an event in the map not described in the save.
* For maximum compatibility, the save creator deliberately tries not to add events,
* since the converter isn't going to be as accurate as 2k[3].
* In essence: 2k[3]'s save compatibility system is awesome! *Let's stress-test it to simplify this code.*
* An additional benefit of this is that it's bascally behavior-accurate,
* because the ghosts & map events getting merged by the game has similar results to what happens here.
*/
public class R2kSavefileEventAccess implements IEventAccess {
public final IObjectBackend.ILoadedObject saveFileRoot;
public final String saveFileRootId;
public final String saveFileRootSchema;
// This only contains the living.
// The ghosts are added dynamically by getEventKeys & getEvent
public final RubyIO eventsHash = new RubyIO().setHash();
public R2kSavefileEventAccess(String rootId, IObjectBackend.ILoadedObject root, String rootSchema) {
saveFileRoot = root;
saveFileRootId = rootId;
saveFileRootSchema = rootSchema;
int mapId = (int) getMapId();
// Inject 'events'
IRIO sfr = saveFileRoot.getObject();
sfveInjectEvent("Party", mapId, sfr.getIVar("@party_pos"));
sfveInjectEvent("Boat", mapId, sfr.getIVar("@boat_pos"));
sfveInjectEvent("Ship", mapId, sfr.getIVar("@ship_pos"));
sfveInjectEvent("Airship", mapId, sfr.getIVar("@airship_pos"));
// Inject actual events
IRIO se = getSaveEvents();
for (IRIO k : se.getHashKeys())
if (eventsHash.getHashVal(k) == null)
eventsHash.hashVal.put(k, new RubyIO().setDeepClone(se.getHashVal(k)));
}
private long getMapId() {
return saveFileRoot.getObject().getIVar("@party_pos").getIVar("@map").getFX();
}
private IRIO getSaveEvents() {
return saveFileRoot.getObject().getIVar("@map_info").getIVar("@events");
}
private void sfveInjectEvent(String s, int mapId, IRIO instVarBySymbol) {
if (instVarBySymbol.getIVar("@map").getFX() != mapId)
return;
eventsHash.hashVal.put(new RubyIO().setString(s, true), new RubyIO().setDeepClone(instVarBySymbol));
}
@Override
public LinkedList<IRIO> getEventKeys() {
LinkedList<IRIO> keys = new LinkedList<IRIO>(eventsHash.hashVal.keySet());
IRIO map = getMap();
if (map != null)
if (getSaveCount(map).getFX() != saveFileRoot.getObject().getIVar("@party_pos").getIVar("@map_save_count").getFX())
for (IRIO rio : map.getIVar("@events").getHashKeys())
if (eventsHash.getHashVal(rio) == null)
keys.add(rio); // Add ghost
return keys;
}
@Override
public IRIO getEvent(IRIO key) {
IRIO v = eventsHash.getHashVal(key);
if (v != null)
return v;
// Ghost! (?)
IRIO map = getMap();
if (map == null)
return null; // shouldn't happen
return getMapEvent(map, key);
}
private IRIO getMap() {
int mapId = (int) saveFileRoot.getObject().getIVar("@party_pos").getIVar("@map").getFX();
IObjectBackend.ILoadedObject ilo = AppMain.objectDB.getObject(R2kRMLikeMapInfoBackend.sNameFromInt(mapId), null);
if (ilo == null)
return null;
return ilo.getObject();
}
private IRIO getMapEvent(IRIO map, IRIO key) {
return map.getIVar("@events").getHashVal(key);
}
@Override
public void delEvent(IRIO key) {
if (key.getType() == '"') {
if (key.decString().equals("Player")) {
AppMain.launchDialog(TXDB.get("You can't do THAT! ...Who would clean up the mess?"));
} else {
IRIO rio = getEvent(key);
if (rio == null) {
AppMain.launchDialog(TXDB.get("That's already gone."));
} else {
rio.getIVar("@map").setFX(0);
AppMain.launchDialog(TXDB.get("Can't be deleted, but was moved to @map 0 (as close as you can get to deleted)"));
pokeHive();
}
}
} else {
IRIO se = getSaveEvents();
if (se.getHashVal(key) == null) {
AppMain.launchDialog(TXDB.get("You're trying to delete a ghost. Yes, I know the Event Picker is slightly unreliable. Poor ghost."));
} else {
se.removeHashVal(key);
IRIO map = getMap();
boolean ghost = false;
if (map != null)
if (getSaveCount(map).getFX() != saveFileRoot.getObject().getIVar("@party_pos").getIVar("@map_save_count").getFX())
ghost = true;
if (ghost) {
AppMain.launchDialog(TXDB.get("Transformed to ghost. Re-Syncing it and setting @active to false might get rid of it."));
} else {
AppMain.launchDialog(TXDB.get("As the version numbers are in sync, this worked."));
}
pokeHive();
}
}
}
@Override
public String[] eventTypes() {
return new String[] {
};
}
@Override
public RubyIO addEvent(RubyIO eve, int type) {
AppMain.launchDialog(TXDB.get("Couldn't add the event."));
return null;
}
public static void eventAsSaveEvent(IRIO rMap, long mapId, IRIO key, IRIO event) {
IRIO rio = rMap.addHashVal(key);
SchemaPath.setDefaultValue(rio, AppMain.schemas.getSDBEntry("RPG::SaveMapEvent"), key);
rio.getIVar("@map").setFX(mapId);
rio.getIVar("@x").setDeepClone(event.getIVar("@x"));
rio.getIVar("@y").setDeepClone(event.getIVar("@y"));
IRIO pages = event.getIVar("@pages");
IRIO eventPage = null;
if (pages.getALen() >= 2)
eventPage = pages.getAElem(1);
if (eventPage != null) {
rio.getIVar("@character_name").setDeepClone(eventPage.getIVar("@character_name"));
rio.getIVar("@character_index").setDeepClone(eventPage.getIVar("@character_index"));
rio.getIVar("@character_direction").setDeepClone(eventPage.getIVar("@character_direction"));
rio.getIVar("@dir").setDeepClone(eventPage.getIVar("@character_direction"));
rio.getIVar("@transparency").setFX((eventPage.getIVar("@character_blend_mode").getType() == 'T') ? 3 : 0);
rio.getIVar("@move_freq").setDeepClone(eventPage.getIVar("@move_freq"));
rio.getIVar("@move_speed").setDeepClone(eventPage.getIVar("@move_speed"));
rio.getIVar("@layer").setDeepClone(eventPage.getIVar("@layer"));
rio.getIVar("@block_other_events").setDeepClone(eventPage.getIVar("@block_other_events"));
// with any luck the moveroute issue will solve itself. with luck.
}
}
@Override
public String[] getEventSchema(IRIO key) {
if (key.getType() == '"') {
if (key.decString().equals("Party"))
return new String[] {"RPG::SavePartyLocation", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
if (key.decString().equals("Boat"))
return new String[] {"RPG::SaveVehicleLocation", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
if (key.decString().equals("Ship"))
return new String[] {"RPG::SaveVehicleLocation", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
if (key.decString().equals("Airship"))
return new String[] {"RPG::SaveVehicleLocation", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
}
// Used for ghosts
if (eventsHash.getHashVal(key) == null)
return new String[] {"OPAQUE", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
return new String[] {"RPG::SaveMapEvent", saveFileRootId, saveFileRootSchema, ValueSyntax.encode(key)};
}
@Override
public int getEventType(IRIO evK) {
// for cloning
return 1;
}
@Override
public Runnable hasSync(final IRIO evK) {
// Ghost...!
if (eventsHash.getHashVal(evK) == null)
return new Runnable() {
@Override
public void run() {
// "Naw! Ghostie want biscuits!"
if (eventsHash.getHashVal(evK) != null) {
// "Dere's already a ghostie here, and 'e's nomming on biscuits!"
AppMain.launchDialog(TXDB.get("The event was already added somehow (but perhaps not synced). The button should now have disappeared."));
} else {
IRIO map = getMap();
if (map == null) {
AppMain.launchDialog(TXDB.get("There's no map to get the event from!"));
return;
}
IRIO ev = map.getIVar("@events").getHashVal(evK);
if (ev == null) {
AppMain.launchDialog(TXDB.get("So, you saw the ghost, got the Map's properties window via System Tools (or you left it up) to delete the event, then came back and pressed Sync? Or has the software just completely broken?!?!?"));
return;
}
eventAsSaveEvent(getSaveEvents(), getMapId(), evK, ev);
pokeHive();
}
}
};
return null;
}
@Override
public String customEventsName() {
return TXDB.get("Player/Vehicles/Events");
}
@Override
public long getEventX(IRIO a) {
return getEvent(a).getIVar("@x").getFX();
}
@Override
public long getEventY(IRIO a) {
return getEvent(a).getIVar("@y").getFX();
}
@Override
public String getEventName(IRIO a) {
IRIO rio = getEvent(a).getIVar("@name");
if (rio == null)
return null;
return rio.decString();
}
@Override
public void setEventXY(IRIO a, long x, long y) {
IRIO se = getSaveEvents();
a = se.getHashVal(a);
if (a == null) {
AppMain.launchDialog(TXDB.get("The ghost refuses to budge."));
return;
}
a.getIVar("@x").setFX(x);
a.getIVar("@y").setFX(y);
pokeHive();
}
public void pokeHive() {
AppMain.objectDB.objectRootModified(saveFileRoot, new SchemaPath(AppMain.schemas.getSDBEntry(saveFileRootSchema), saveFileRoot));
}
}
| 42.053571 | 256 | 0.597452 |
191a73aaedef897d0ef8c9b06907d3b3525b89c0 | 8,572 | /**
* Copyright (c) 2014-2017 Netflix, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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 mslcli.common.util;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import com.netflix.msl.MslConstants.CompressionAlgorithm;
import com.netflix.msl.MslCryptoException;
import com.netflix.msl.crypto.ICryptoContext;
import com.netflix.msl.entityauth.EntityAuthenticationData;
import com.netflix.msl.entityauth.EntityAuthenticationFactory;
import com.netflix.msl.entityauth.EntityAuthenticationScheme;
import com.netflix.msl.io.DefaultMslEncoderFactory;
import com.netflix.msl.io.MslEncoderFactory;
import com.netflix.msl.io.MslEncoderFormat;
import com.netflix.msl.keyx.KeyExchangeFactory;
import com.netflix.msl.keyx.KeyExchangeScheme;
import com.netflix.msl.msg.MessageCapabilities;
import com.netflix.msl.tokens.TokenFactory;
import com.netflix.msl.userauth.UserAuthenticationFactory;
import com.netflix.msl.userauth.UserAuthenticationScheme;
import com.netflix.msl.util.MslContext;
import com.netflix.msl.util.MslStore;
import mslcli.common.IllegalCmdArgumentException;
import mslcli.common.MslConfig;
/**
* <p>ABstract class for MSL context specific to the given entity.</p>
*
* @author Vadim Spector <[email protected]>
*/
public abstract class CommonMslContext extends MslContext {
/**
* <p>Create a new MSL context.</p>
*
* @param appCtx application context
* @param mslCfg MSL configuration.
* @throws ConfigurationException
* @throws IllegalCmdArgumentException
*/
protected CommonMslContext(final AppContext appCtx, final MslConfig mslCfg) throws ConfigurationException, IllegalCmdArgumentException {
if (appCtx == null) {
throw new IllegalArgumentException("NULL app context");
}
if (mslCfg == null) {
throw new IllegalArgumentException("NULL MSL config");
}
// Initialize MSL config.
this.mslCfg = mslCfg;
// Entity authentication data.
this.entityAuthData = mslCfg.getEntityAuthenticationData();
// Message capabilities.
final Set<CompressionAlgorithm> compressionAlgos = new HashSet<CompressionAlgorithm>(Arrays.asList(CompressionAlgorithm.GZIP, CompressionAlgorithm.LZW));
final List<String> languages = Arrays.asList("en-US");
final Set<MslEncoderFormat> encoderFormats = new HashSet<MslEncoderFormat>(Arrays.asList(MslEncoderFormat.JSON));
this.messageCaps = new MessageCapabilities(compressionAlgos, languages, encoderFormats);
// Entity authentication factories.
this.entityAuthFactories = mslCfg.getEntityAuthenticationFactories();
// User authentication factories.
this.userAuthFactories = mslCfg.getUserAuthenticationFactories();
// Key exchange factories.
this.keyxFactories = mslCfg.getKeyExchangeFactories();
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getTime()
*/
@Override
public final long getTime() {
return System.currentTimeMillis();
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getRandom()
*/
@Override
public final Random getRandom() {
return new SecureRandom();
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#isPeerToPeer()
*/
@Override
public final boolean isPeerToPeer() {
return false;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getMessageCapabilities()
*/
@Override
public final MessageCapabilities getMessageCapabilities() {
return messageCaps;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getEntityAuthenticationData(com.netflix.msl.util.MslContext.ReauthCode)
*/
@Override
public final EntityAuthenticationData getEntityAuthenticationData(final ReauthCode reauthCode) {
return entityAuthData;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getMslCryptoContext()
*/
@Override
public abstract ICryptoContext getMslCryptoContext() throws MslCryptoException;
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getEntityAuthenticationFactory(com.netflix.msl.entityauth.EntityAuthenticationScheme)
*/
@Override
public final EntityAuthenticationFactory getEntityAuthenticationFactory(final EntityAuthenticationScheme scheme) {
for (final EntityAuthenticationFactory factory : entityAuthFactories) {
if (factory.getScheme().equals(scheme))
return factory;
}
return null;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getUserAuthenticationFactory(com.netflix.msl.userauth.UserAuthenticationScheme)
*/
@Override
public final UserAuthenticationFactory getUserAuthenticationFactory(final UserAuthenticationScheme scheme) {
for (final UserAuthenticationFactory factory : userAuthFactories) {
if (factory.getScheme().equals(scheme))
return factory;
}
return null;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getTokenFactory()
*/
@Override
public abstract TokenFactory getTokenFactory();
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getKeyExchangeFactory(com.netflix.msl.keyx.KeyExchangeScheme)
*/
@Override
public final KeyExchangeFactory getKeyExchangeFactory(final KeyExchangeScheme scheme) {
for (final KeyExchangeFactory factory : keyxFactories) {
if (factory.getScheme().equals(scheme))
return factory;
}
return null;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getKeyExchangeFactories()
*/
@Override
public final SortedSet<KeyExchangeFactory> getKeyExchangeFactories() {
return keyxFactories;
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getEntityAuthenticationScheme()
*/
@Override
public final EntityAuthenticationScheme getEntityAuthenticationScheme(final String name) {
return EntityAuthenticationScheme.getScheme(name);
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getKeyExchangeScheme()
*/
@Override
public final KeyExchangeScheme getKeyExchangeScheme(final String name) {
return KeyExchangeScheme.getScheme(name);
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getUserAuthenticationScheme()
*/
@Override
public final UserAuthenticationScheme getUserAuthenticationScheme(final String name) {
return UserAuthenticationScheme.getScheme(name);
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getMslStore()
*/
@Override
public final MslStore getMslStore() {
return mslCfg.getMslStore();
}
/* (non-Javadoc)
* @see com.netflix.msl.util.MslContext#getMslEncoderFactory()
*/
@Override
public MslEncoderFactory getMslEncoderFactory() {
return encoderFactory;
}
@Override
public final String toString() {
return SharedUtil.toString(this);
}
/** MSL config */
private final MslConfig mslCfg;
/** Entity authentication data. */
private final EntityAuthenticationData entityAuthData;
/** message capabilities */
private final MessageCapabilities messageCaps;
/** entity authentication factories */
private final Set<EntityAuthenticationFactory> entityAuthFactories;
/** user authentication factories */
private final Set<UserAuthenticationFactory> userAuthFactories;
/** key exchange factories */
private final SortedSet<KeyExchangeFactory> keyxFactories;
/** MSL encoder factory. */
private final MslEncoderFactory encoderFactory = new DefaultMslEncoderFactory();
}
| 34.425703 | 161 | 0.707186 |
ee70565288594862a983e2a37c19fc7bef06ce53 | 12,163 | package seedu.address.model.event;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.testutil.event.TypicalEvents.EVENT1;
import static seedu.address.testutil.event.TypicalEvents.EVENT2;
import static seedu.address.testutil.event.TypicalEvents.getTypicalEvents;
import static seedu.address.testutil.event.TypicalEvents.getTypicalEventsRecord;
import static seedu.address.testutil.event.TypicalVEvents.VEVENT1;
import static seedu.address.testutil.event.TypicalVEvents.VEVENT2;
import static seedu.address.testutil.event.TypicalVEvents.VEVENT3;
import static seedu.address.testutil.event.TypicalVEvents.VEVENT4;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.commons.math3.util.Pair;
import org.junit.jupiter.api.Test;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import jfxtras.icalendarfx.components.VEvent;
import seedu.address.commons.core.index.Index;
import seedu.address.model.event.exceptions.DuplicateVEventException;
import seedu.address.model.event.exceptions.VEventNotFoundException;
import seedu.address.testutil.event.EventBuilder;
public class EventRecordTest {
private final EventRecord eventRecord = new EventRecord();
@Test
public void constructor() {
assertEquals(Collections.emptyList(), eventRecord.getVEventList());
}
@Test
public void resetData_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.resetData(null));
}
@Test
public void resetData_withValidEventRecord_replacesData() {
EventRecord newData = getTypicalEventsRecord();
eventRecord.resetData(newData);
assertEquals(newData, eventRecord);
}
@Test
public void resetData_withDuplicateEvents_throwsDuplicateVEventException() {
// Two events with the same name, start date time and end date time
Event editedEvent1 = new EventBuilder(EVENT1).withEventName(EVENT2.getEventName())
.withStartDateTime(EVENT2.getStartDateTime())
.withEndDateTime(EVENT2.getEndDateTime())
.build();
List<Event> newEvents = Arrays.asList(editedEvent1, EVENT2);
EventRecordStub newData = new EventRecordStub(newEvents);
assertThrows(DuplicateVEventException.class, () -> eventRecord.resetData(newData));
}
@Test
public void resetDataWithEventList_withValidEventRecord_replacesData() {
List<Event> newData = getTypicalEvents();
eventRecord.resetDataWithEventList(newData);
EventRecord expectedEventRecord = new EventRecord(getTypicalEventsRecord());
assertEquals(eventRecord, expectedEventRecord);
}
@Test
public void resetDataWithEventList_withDuplicateEvents_throwsDuplicateVEventException() {
// Two events with the same name, start date time and end date time
Event editedEvent1 = new EventBuilder(EVENT1).withEventName(EVENT2.getEventName())
.withStartDateTime(EVENT2.getStartDateTime())
.withEndDateTime(EVENT2.getEndDateTime())
.build();
List<Event> newEvents = Arrays.asList(editedEvent1, EVENT2);
assertThrows(DuplicateVEventException.class, () -> eventRecord.resetDataWithEventList(newEvents));
}
@Test
public void contains_nullVEvent_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.contains(null));
}
@Test
public void contains_vEventNotInEventRecord_returnsFalse() {
assertFalse(eventRecord.contains(VEVENT1));
}
@Test
public void contains_vEventInEventRecord_returnsFalse() {
eventRecord.addVEvent(VEVENT1);
assertTrue(eventRecord.contains(VEVENT1));
}
@Test
public void hasVEvent_vEventWithSameIdentityFieldsInEventRecord_returnsTrue() {
eventRecord.addVEvent(VEVENT1);
VEvent editedVEvent1 = new VEvent(VEVENT1).withCategories("group23")
.withRecurrenceRule("FREQ=DAILY;COUNT=2");
assertTrue(eventRecord.contains(editedVEvent1));
}
@Test
public void getVEventList_modifyList_throwsUnsupportedOperationException() {
assertThrows(UnsupportedOperationException.class, () -> eventRecord.getVEventList().remove(0));
}
@Test
public void add_nullVEvent_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.addVEvent(null));
}
@Test
public void add_duplicateVEvent_throwsDuplicateVEventException() {
eventRecord.addVEvent(VEVENT1);
assertThrows(DuplicateVEventException.class, () -> eventRecord.addVEvent(VEVENT1));
}
@Test
public void setVEvent_nullTargetVEvent_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.setVEvent(null, VEVENT1));
}
@Test
public void setVEvent_editedVEventIsSameVEvent_success() {
eventRecord.addVEvent(VEVENT1);
eventRecord.setVEvent(Index.fromZeroBased(0), VEVENT1);
EventRecord expectedUniqueEventRecord = new EventRecord();
expectedUniqueEventRecord.addVEvent(VEVENT1);
assertEquals(eventRecord, expectedUniqueEventRecord);
}
@Test
public void setVEvent_editedVEventHasSameIdentity_success() {
eventRecord.addVEvent(VEVENT1);
VEvent editedVEvent1 = new VEvent(VEVENT1).withCategories("group23")
.withRecurrenceRule("FREQ=DAILY;COUNT=2");
eventRecord.setVEvent(Index.fromZeroBased(0), editedVEvent1);
EventRecord expectedUniqueEventRecord = new EventRecord();
expectedUniqueEventRecord.addVEvent(editedVEvent1);
assertEquals(expectedUniqueEventRecord, eventRecord);
}
@Test
public void setVEvent_editedVEventHasDifferentIdentity_success() {
eventRecord.addVEvent(VEVENT1);
eventRecord.setVEvent(Index.fromZeroBased(0), VEVENT2);
EventRecord expectedUniqueEventRecord = new EventRecord();
expectedUniqueEventRecord.addVEvent(VEVENT2);
assertEquals(expectedUniqueEventRecord, eventRecord);
}
@Test
public void setVEvent_editedVEventHasNonUniqueIdentity_throwsDuplicateVEventException() {
eventRecord.addVEvent(VEVENT1);
eventRecord.addVEvent(VEVENT2);
// attempt to set VEVENT1 to become VEVENT2 when eventRecord contains VEVENT2
assertThrows(DuplicateVEventException.class, () -> eventRecord.setVEvent(Index.fromZeroBased(0), VEVENT2));
}
@Test
public void deleteVEvent_nullVEvent_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.deleteVEvent(null));
}
@Test
public void deleteVEvent_indexDoesNotExist_throwsVEventNotFoundException() {
assertThrows(IndexOutOfBoundsException.class, () -> eventRecord.deleteVEvent(Index.fromZeroBased(0)));
}
@Test
public void deleteVEvent_existingVEvent_removesVEvent() {
eventRecord.addVEvent(VEVENT1);
eventRecord.deleteVEvent(Index.fromZeroBased(0));
EventRecord expectedUniqueEventRecord = new EventRecord();
assertEquals(expectedUniqueEventRecord, eventRecord);
}
@Test
public void setVEvents_nullList_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.setVEvents((List<VEvent>) null));
}
@Test
public void setVEvents_list_replacesOwnListWithProvidedList() {
eventRecord.addVEvent(VEVENT1);
List<VEvent> vEventList = Collections.singletonList(VEVENT2);
eventRecord.setVEvents(vEventList);
EventRecord expectedUniqueVEventList = new EventRecord();
expectedUniqueVEventList.addVEvent(VEVENT2);
assertEquals(expectedUniqueVEventList, eventRecord);
}
@Test
public void setVEvents_listWithDuplicateVEvents_throwsDuplicateVEventException() {
List<VEvent> listWithDuplicateVEvents = Arrays.asList(VEVENT1, VEVENT1);
assertThrows(DuplicateVEventException.class, () -> eventRecord.setVEvents(listWithDuplicateVEvents));
}
@Test
public void getVEvent_nullIndex_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.getVEvent(null));
}
@Test
public void getVEvent_withValidIndex_returnsTrue() {
eventRecord.addVEvent(VEVENT1);
VEvent vEvent = eventRecord.getVEvent(Index.fromZeroBased(0));
assertEquals(VEVENT1, vEvent);
}
@Test
public void getVEvent_withInvalidIndex_throwsIndexOutOfBoundException() {
assertThrows(IndexOutOfBoundsException.class, () -> eventRecord.getVEvent(Index.fromZeroBased(0)));
}
@Test
public void findVEvents_nullDesiredEventName_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> eventRecord.findVEvents(null));
}
@Test
public void findVEvents_withValidDesiredEventName_returnsTrue() {
eventRecord.addVEvent(VEVENT1);
eventRecord.addVEvent(VEVENT2);
List<Pair<Index, VEvent>> expectedResultList = new ArrayList<>();
expectedResultList.add(new Pair(Index.fromZeroBased(0), VEVENT1));
List<Pair<Index, VEvent>> actualResultList = eventRecord.findVEvents(VEVENT1.getSummary().getValue());
assertEquals(expectedResultList, actualResultList);
}
@Test
public void findVEvents_withDesiredEventNameNotFound_returnsEmptyList() {
eventRecord.addVEvent(VEVENT1);
eventRecord.addVEvent(VEVENT2);
List<Pair<Index, VEvent>> actualResultList = eventRecord.findVEvents(VEVENT3.getSummary().getValue());
assertEquals(Collections.emptyList(), actualResultList);
}
@Test
public void findMostSimilarVEvent_emptyEventRecord_throwsVEventNotFoundException() {
assertThrows(VEventNotFoundException.class, () -> eventRecord.findMostSimilarVEvent("event name"));
}
@Test
public void findMostSimilarVEvent_nullDesiredEventName_throwsVEventNotFoundException() {
assertThrows(NullPointerException.class, () -> eventRecord.findMostSimilarVEvent(null));
}
@Test
public void findMostSimilarVEvent_exactEventName_returnsExactVEvent() {
eventRecord.addVEvent(VEVENT1);
Pair<Index, VEvent> vEventPairFound = eventRecord.findMostSimilarVEvent(VEVENT1.getSummary().getValue());
assertEquals(vEventPairFound.getValue(), VEVENT1);
}
@Test
public void findMostSimilarVEvent_similarEventName_returnsCorrectVEventAndIndex() {
eventRecord.addVEvent(VEVENT2);
eventRecord.addVEvent(VEVENT3);
eventRecord.addVEvent(VEVENT4);
Index desiredIndex = Index.fromZeroBased(0);
eventRecord.setVEvent(desiredIndex, VEVENT1);
Pair<Index, VEvent> vEventPairFound =
eventRecord.findMostSimilarVEvent(VEVENT1.getSummary().getValue().substring(0, 5));
assertEquals(desiredIndex, vEventPairFound.getKey());
assertEquals(VEVENT1, vEventPairFound.getValue());
}
@Test
public void findMostSimilarVEvent_irrelevantEventName_returnsMostSimilarVEvent() {
eventRecord.addVEvent(VEVENT2);
Pair<Index, VEvent> vEventPairFound =
eventRecord.findMostSimilarVEvent("irrelevant event name");
assertEquals(VEVENT2, vEventPairFound.getValue());
}
/**
* A stub ReadOnlyEvents whose events list can violate interface constraints.
*/
private static class EventRecordStub implements ReadOnlyEvents {
private final ObservableList<Event> events = FXCollections.observableArrayList();
EventRecordStub(Collection<Event> events) {
this.events.setAll(events);
}
@Override
public ObservableList<Event> getAllEvents() {
return events;
}
}
}
| 40.408638 | 115 | 0.732961 |
6dc155c3c03212f5303b44e8deae841caf0f1828 | 2,773 | package com.orbitz.consul.model.acl;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.collect.ImmutableList;
import org.immutables.value.Value;
import java.util.List;
import java.util.Optional;
@Value.Immutable
@JsonSerialize(as = ImmutableRole.class)
@JsonDeserialize(as = ImmutableRole.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class Role {
@JsonProperty("Name")
public abstract String name();
@JsonProperty("ID")
public abstract Optional<String> id();
@JsonProperty("Description")
public abstract Optional<String> description();
@JsonProperty("Policies")
@JsonDeserialize(as = ImmutableList.class, contentAs = RolePolicyLink.class)
public abstract List<RolePolicyLink> policies();
@JsonProperty("ServiceIdentities")
@JsonDeserialize(as = ImmutableList.class, contentAs = RoleServiceIdentity.class)
public abstract List<RoleServiceIdentity> serviceIdentities();
@JsonProperty("NodeIdentities")
@JsonDeserialize(as = ImmutableList.class, contentAs = RoleNodeIdentity.class)
public abstract List<RoleNodeIdentity> nodeIdentities();
@JsonProperty("Namespace")
public abstract Optional<String> namespace();
@Value.Immutable
@JsonSerialize(as = ImmutableRolePolicyLink.class)
@JsonDeserialize(as = ImmutableRolePolicyLink.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract static class RolePolicyLink {
@JsonProperty("ID")
public abstract Optional<String> id();
@JsonProperty("Name")
public abstract Optional<String> name();
}
@Value.Immutable
@JsonSerialize(as = ImmutableRoleServiceIdentity.class)
@JsonDeserialize(as = ImmutableRoleServiceIdentity.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract static class RoleServiceIdentity {
@JsonProperty("ServiceName")
public abstract String name();
@JsonProperty("Datacenters")
@JsonDeserialize(as = ImmutableList.class, contentAs = String.class)
public abstract List<String> datacenters();
}
@Value.Immutable
@JsonSerialize(as = ImmutableRoleNodeIdentity.class)
@JsonDeserialize(as = ImmutableRoleNodeIdentity.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract static class RoleNodeIdentity {
@JsonProperty("NodeName")
public abstract String name();
@JsonProperty("Datacenter")
public abstract String datacenter();
}
}
| 33.011905 | 85 | 0.74432 |
c4f3e7d875056d93174db53fe1ae88058a70ffc8 | 142 | package com.archer.designpattern.demo.command;
/**
* Created by Archer on 2017/11/23.
*/
public interface Command {
void execute();
}
| 14.2 | 46 | 0.690141 |
728f9f553840d55e3735563ff5906b7f9a0d617f | 9,365 | /*------------------------------------------------------------------------------
Copyright (c) CovertJaguar, 2011-2019
http://railcraft.info
This code is the property of CovertJaguar
and may only be used with explicit written
permission unless otherwise specified on the
license page at http://railcraft.info/wiki/info:license.
-----------------------------------------------------------------------------*/
package mods.railcraft.common.blocks.single;
import buildcraft.api.statements.IActionExternal;
import mods.railcraft.common.blocks.TileSmartItemTicking;
import mods.railcraft.common.blocks.interfaces.ITileRotate;
import mods.railcraft.common.emblems.EmblemToolsServer;
import mods.railcraft.common.gui.EnumGui;
import mods.railcraft.common.gui.GuiHandler;
import mods.railcraft.common.plugins.buildcraft.actions.Actions;
import mods.railcraft.common.plugins.buildcraft.triggers.IHasWork;
import mods.railcraft.common.plugins.forge.OreDictPlugin;
import mods.railcraft.common.util.inventory.InvTools;
import mods.railcraft.common.util.inventory.wrappers.InventoryMapper;
import mods.railcraft.common.util.misc.Game;
import mods.railcraft.common.util.network.IGuiReturnHandler;
import mods.railcraft.common.util.network.RailcraftInputStream;
import mods.railcraft.common.util.network.RailcraftOutputStream;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
@SuppressWarnings("unused")
@net.minecraftforge.fml.common.Optional.Interface(iface = "mods.railcraft.common.plugins.buildcraft.triggers.IHasWork", modid = "BuildCraftAPI|statements")
public class TileEngravingBench extends TileSmartItemTicking implements ISidedInventory, IHasWork, IGuiReturnHandler, ITileRotate {
//TODO: Finish conversion to RCUs
public enum GuiPacketType {
START_CRAFTING, NORMAL_RETURN, OPEN_UNLOCK, OPEN_NORMAL, UNLOCK_EMBLEM
}
private static final int PROCESS_TIME = 100;
private static final int ACTIVATION_POWER = 50;
private static final int MAX_RECEIVE = 1000;
private static final int MAX_ENERGY = ACTIVATION_POWER * (PROCESS_TIME + (PROCESS_TIME / 2));
private static final int SLOT_INPUT = 0;
private static final int SLOT_RESULT = 1;
private static final int[] SLOTS = InvTools.buildSlotArray(0, 2);
private final InventoryMapper invResult = new InventoryMapper(this, SLOT_RESULT, 1).ignoreItemChecks();
// public final FEEnergyIndicator rfIndicator;
private int progress;
public boolean paused, startCrafting, isCrafting, flippedAxis;
public String currentEmblem = "";
private final Set<Object> actions = new HashSet<>();
public TileEngravingBench() {
super(2);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
data.setBoolean("flippedAxis", flippedAxis);
data.setBoolean("isCrafting", isCrafting);
data.setInteger("progress", progress);
data.setString("currentEmblem", currentEmblem);
return data;
}
@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
flippedAxis = data.getBoolean("flippedAxis");
isCrafting = data.getBoolean("isCrafting");
progress = data.getInteger("progress");
currentEmblem = data.getString("currentEmblem");
}
@Override
public void writePacketData(RailcraftOutputStream data) throws IOException {
super.writePacketData(data);
data.writeBoolean(flippedAxis);
}
@Override
public void readPacketData(RailcraftInputStream data) throws IOException {
super.readPacketData(data);
flippedAxis = data.readBoolean();
markBlockForUpdate();
}
@Override
public void readGuiData(RailcraftInputStream data, EntityPlayer sender) throws IOException {
GuiPacketType type = GuiPacketType.values()[data.readByte()];
switch (type) {
case START_CRAFTING:
startCrafting = true;
case NORMAL_RETURN:
currentEmblem = data.readUTF();
break;
case OPEN_UNLOCK:
GuiHandler.openGui(EnumGui.ENGRAVING_BENCH_UNLOCK, sender, world, getPos());
break;
case OPEN_NORMAL:
GuiHandler.openGui(EnumGui.ENGRAVING_BENCH, sender, world, getPos());
break;
case UNLOCK_EMBLEM:
if (EmblemToolsServer.manager != null) {
int windowId = data.readByte();
String code = data.readUTF();
EmblemToolsServer.manager.unlockEmblem((EntityPlayerMP) sender, code, windowId);
}
break;
}
}
@Override
public boolean openGui(EntityPlayer player) {
BlockPos offsetPos = getPos().add(0.5, 0.5, 0.5);
if (player.getDistanceSq(offsetPos) > 64D)
return false;
GuiHandler.openGui(EnumGui.ENGRAVING_BENCH, player, world, getPos());
return true;
}
public void setProgress(int progress) {
this.progress = progress;
}
public int getProgress() {
return progress;
}
public int getProgressScaled(int i) {
return (progress * i) / PROCESS_TIME;
}
@Override
public void update() {
super.update();
if (Game.isClient(world))
return;
if (clock % 16 == 0)
processActions();
if (paused)
return;
if (startCrafting) {
startCrafting = false;
isCrafting = true;
}
if (!getStackInSlot(SLOT_RESULT).isEmpty())
isCrafting = false;
if (!isCrafting) {
progress = 0;
return;
}
ItemStack emblem = makeEmblem();
if (InvTools.isEmpty(emblem))
return;
if (!isItemValidForSlot(SLOT_INPUT, getStackInSlot(SLOT_INPUT))) {
progress = 0;
return;
}
// TODO charge usage
if (progress >= PROCESS_TIME) {
isCrafting = false;
if (invResult.canFit(emblem)) {
decrStackSize(SLOT_INPUT, 1);
invResult.addStack(emblem);
progress = 0;
}
} else
progress++;
}
private @Nullable ItemStack makeEmblem() {
if (currentEmblem == null || currentEmblem.isEmpty() || EmblemToolsServer.manager == null)
return null;
return EmblemToolsServer.manager.getEmblemItemStack(currentEmblem);
}
@Override
public boolean hasWork() {
return isCrafting;
}
public void setPaused(boolean p) {
paused = p;
}
private void processActions() {
paused = actions.stream().anyMatch(a -> a == Actions.PAUSE);
actions.clear();
}
@Override
public void actionActivated(IActionExternal action) {
actions.add(action);
}
@Override
public int[] getSlotsForFace(EnumFacing side) {
return SLOTS;
}
@Override
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
return isItemValidForSlot(index, itemStackIn);
}
@Override
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
return index == SLOT_RESULT;
}
@SuppressWarnings("SimplifiableIfStatement")
@Override
public boolean isItemValidForSlot(int slot, @Nullable ItemStack stack) {
if (slot == SLOT_RESULT)
return false;
if (InvTools.isEmpty(stack))
return false;
if (OreDictPlugin.isOreType("ingotSteel", stack))
return true;
if (OreDictPlugin.isOreType("ingotBronze", stack))
return true;
if (OreDictPlugin.isOreType("ingotBrass", stack))
return true;
return Items.GOLD_INGOT == stack.getItem();
}
@Override
public void onBlockPlacedBy(IBlockState state, @Nullable EntityLivingBase entityLiving, ItemStack stack) {
super.onBlockPlacedBy(state, entityLiving, stack);
if (entityLiving != null) {
EnumFacing facing = entityLiving.getHorizontalFacing();
if (facing == EnumFacing.EAST || facing == EnumFacing.WEST)
flippedAxis = true;
}
}
@Override
public boolean rotateBlock(EnumFacing axis) {
flippedAxis = !flippedAxis;
sendUpdateToClient();
return true;
}
@Override
public EnumGui getGui() {
return EnumGui.ENGRAVING_BENCH;
}
@Override
public EnumFacing getFacing() {
return flippedAxis ? EnumFacing.WEST : EnumFacing.NORTH;
}
@Override
public void setFacing(EnumFacing facing) {
flippedAxis = facing.getAxis() == EnumFacing.Axis.X;
}
}
| 32.517361 | 155 | 0.648478 |
a8fe3d8767116a5072c424e19bf3ce385736934c | 898 | package com.sample.tools.operation.ops;
import java.io.File;
import java.util.List;
import com.sample.tools.config.Settings;
import com.sample.tools.operation.AbsOps;
import com.sample.tools.operation.OpsException;
import com.sample.tools.operation.OpsFile;
import com.sample.tools.operation.OpsFile.OpsEntry;
/**
* 配置文件的操作
*
* @author lifeng
*/
public class ConfigOps extends AbsOps {
@Override
protected void doInnerOps(OpsFile file) throws Exception {
try {
if (file.continuAbled()) {
File base = Settings.me().getConfigPath();
List<OpsEntry> sattics = file.configs();
for (OpsEntry entry : sattics) {
// h2,sqlite下为数据库文件不能直接替换
if (entry.getName().indexOf("h2") != -1 || entry.getName().indexOf("sqlite") != -1) {
continue;
}
this.updateFile(base, entry);
}
}
} catch (Exception e) {
throw new OpsException("更新配置文件失败");
}
}
}
| 23.631579 | 90 | 0.685969 |
d59f0c65221e76e3492a027c8237600fee30afa2 | 290 | package com.demo.beanorder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author ZhangShaowei on 2021/10/15 14:50
*/
@Configuration
public class B {
@Bean
public C c() {
return new C();
}
}
| 16.111111 | 60 | 0.693103 |
508a354ce8a93fa7a74e54b28cb5ce5ab04521bf | 4,715 | /*
* Copyright 2019-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
*
* https://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.vividus.bdd.util;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import org.jbehave.core.configuration.Keywords;
import org.jbehave.core.model.ExamplesTable.TableProperties;
import org.jbehave.core.steps.ParameterConverters;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
class ExamplesTableProcessorTests
{
private static final String ZERO = "0";
private static final List<String> VALUES1 = List.of("4", "3");
private static final List<String> VALUES2 = List.of("1", ZERO);
private static final List<String> KEYS = List.of("key1", "key2");
private static final String TABLE = "|key1|key2|\n|4|3|\n|1|0|";
private final Keywords keywords = new Keywords();
private final ParameterConverters parameterConverters = new ParameterConverters();
@ParameterizedTest
@MethodSource("tableToBuildSource")
void testBuildTable(String expectedTable, List<List<String>> rows)
{
assertEquals(expectedTable, ExamplesTableProcessor.buildExamplesTable(KEYS, rows, createProperties(), true));
}
static Stream<Arguments> tableToBuildSource()
{
List<String> row = new ArrayList<>();
row.add(null);
row.add(ZERO);
return Stream.of(
Arguments.of(TABLE, List.of(VALUES1, VALUES2)),
Arguments.of("|key1|key2|\n!4!3!\n!1|!0!", List.of(VALUES1, List.of("1|", ZERO))),
Arguments.of("|key1|key2|\n#11|#12!#\n#13?#14$#", List.of(List.of("11|", "12!"), List.of("13?", "14$"))),
Arguments.of("|key1|key2|\n|null|0|", List.of(row))
);
}
@Test
void testBuildExamplesTableException()
{
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> ExamplesTableProcessor
.buildExamplesTable(KEYS, List.of(List.of("0|", "1!"), List.of("2?", "3$"), List.of("4#", "5%"),
List.of("6*", "7*")), createProperties(), true));
assertEquals("There are not alternative value separators applicable for examples table",
exception.getMessage());
}
@Test
void testBuildExamplesTableFromColumns()
{
String expectedTable = "|key1|key2|\n|4|1|\n|3|0|";
assertEquals(expectedTable, ExamplesTableProcessor.buildExamplesTableFromColumns(KEYS,
List.of(VALUES1, VALUES2), createProperties()));
}
@Test
void testBuildExamplesTableCheckForValueSeparatorIsFalse()
{
List<String> values = List.of("v\\|a1", "val\\|2");
String expectedTable = "|key1|key2|\n|v\\|a1|val\\|2|";
assertEquals(expectedTable,
ExamplesTableProcessor.buildExamplesTable(KEYS, List.of(values), createProperties(), false));
}
@Test
void testBuildExamplesTableFromColumnsException()
{
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> ExamplesTableProcessor
.buildExamplesTableFromColumns(KEYS, List.of(VALUES1, List.of(ZERO)), createProperties()));
assertEquals("Columns are not aligned: column 'key1' has 2 value(s), column 'key2' has 1 value(s)",
exception.getMessage());
}
@Test
void testBuildExamplesTableAppendTablePropertiesTrue()
{
List<String> values = List.of("a1", "a2");
String expectedTable = "{valueSeparator=!}\n|key1|key2|\n!a1!a2!";
TableProperties tableProperties = new TableProperties("valueSeparator=!", keywords, parameterConverters);
assertEquals(expectedTable,
ExamplesTableProcessor.buildExamplesTable(KEYS, List.of(values), tableProperties, false, true));
}
private TableProperties createProperties()
{
return new TableProperties("", keywords, parameterConverters);
}
}
| 40.646552 | 118 | 0.682291 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.