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
0e94aed80fdd61188b7ab46d8a513c87e24b50f7
5,542
/* * GridGain Community Edition Licensing * Copyright 2019 GridGain Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause * Restriction; 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. * * Commons Clause Restriction * * The Software is provided to you by the Licensor under the License, as defined below, subject to * the following condition. * * Without limiting other conditions in the License, the grant of rights under the License will not * include, and the License does not grant to you, the right to Sell the Software. * For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you * under the License to provide to third parties, for a fee or other consideration (including without * limitation fees for hosting or consulting/ support services related to the Software), a product or * service whose value derives, entirely or substantially, from the functionality of the Software. * Any license notice or attribution required by the License must also include this Commons Clause * License Condition notice. * * For purposes of the clause above, the “Licensor” is Copyright 2019 GridGain Systems, Inc., * the “License” is the Apache License, Version 2.0, and the Software is the GridGain Community * Edition software provided with this notice. */ package org.apache.ignite.internal.processors.cache; import java.util.Collection; import java.util.HashMap; import java.util.Map; import javax.cache.Cache; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.internal.util.typedef.internal.S; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CachePeekMode.ALL; /** * Tests for cache query index. */ @RunWith(JUnit4.class) public class IgniteCacheQueryIndexSelfTest extends GridCacheAbstractSelfTest { /** Grid count. */ private static final int GRID_CNT = 2; /** Entry count. */ private static final int ENTRY_CNT = 10; /** {@inheritDoc} */ @Override protected int gridCount() { return GRID_CNT; } /** {@inheritDoc} */ @Override protected CacheMode cacheMode() { return PARTITIONED; } /** * @throws Exception If failed. */ @Test public void testWithoutStoreLoad() throws Exception { IgniteCache<Integer, CacheValue> cache = grid(0).cache(DEFAULT_CACHE_NAME); for (int i = 0; i < ENTRY_CNT; i++) cache.put(i, new CacheValue(i)); checkCache(cache); checkQuery(cache); } /** {@inheritDoc} */ @Override protected Class<?>[] indexedTypes() { return new Class<?>[]{Integer.class, CacheValue.class}; } /** * @throws Exception If failed. */ @Test public void testWithStoreLoad() throws Exception { for (int i = 0; i < ENTRY_CNT; i++) storeStgy.putToStore(i, new CacheValue(i)); IgniteCache<Integer, CacheValue> cache0 = grid(0).cache(DEFAULT_CACHE_NAME); cache0.loadCache(null); checkCache(cache0); checkQuery(cache0); } /** * @param cache Cache. * @throws Exception If failed. */ private void checkCache(IgniteCache<Integer, CacheValue> cache) throws Exception { Map<Integer, CacheValue> map = new HashMap<>(); for (Cache.Entry<Integer, CacheValue> entry : cache) map.put(entry.getKey(), entry.getValue()); assert map.entrySet().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: " + cache.size(); assert map.keySet().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: " + cache.size(); assert map.values().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: " + cache.size(); assert cache.localSize(ALL) == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: " + cache.localSize(); } /** * @param cache Cache. * @throws Exception If failed. */ private void checkQuery(IgniteCache<Integer, CacheValue> cache) throws Exception { QueryCursor<Cache.Entry<Integer, CacheValue>> qry = cache.query(new SqlQuery(CacheValue.class, "val >= 5")); Collection<Cache.Entry<Integer, CacheValue>> queried = qry.getAll(); assertEquals("Unexpected query result: " + queried, 5, queried.size()); } /** * Test cache value. */ private static class CacheValue { @QuerySqlField private final int val; CacheValue(int val) { this.val = val; } int value() { return val; } /** {@inheritDoc} */ @Override public String toString() { return S.toString(CacheValue.class, this); } } }
34.6375
112
0.669253
e23f32a5c74e8edf4536b08e1eb46526a69a04db
5,005
package com.fourthwoods.starter; import com.fourthwoods.starter.authentication.AuthenticationFilter; import com.fourthwoods.starter.authentication.CustomAuthenticationFailureHandler; import com.fourthwoods.starter.authentication.UserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.access.hierarchicalroles.RoleHierarchy; import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl; import org.springframework.security.access.vote.RoleHierarchyVoter; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; @SpringBootApplication public class StarterApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(StarterApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(StarterApplication.class); } @Configuration @EnableWebSecurity public static class WebSecurityConfig extends WebSecurityConfigurerAdapter { final static Logger logger = LoggerFactory.getLogger(WebSecurityConfig.class); @Autowired private CustomAuthenticationFailureHandler customAuthenticationFailureHandler; public static String[] antPatterns = { "/", "/favicon.ico", "/webjars/**", "/js/**", "/css/**", "/login**" }; @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers(antPatterns).permitAll() .anyRequest() .authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .failureHandler(customAuthenticationFailureHandler) .and() .logout() .logoutSuccessUrl("/?logout_successful") .permitAll(); http.addFilterAfter(new AuthenticationFilter(), BasicAuthenticationFilter.class); } @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) protected static class MethodSecurityConfig extends GlobalMethodSecurityConfiguration { private static String roleHierarchyDefinition = "ROLE_ADMIN > ROLE_MODERATOR\n" + "ROLE_MODERATOR > ROLE_USER\n" + "ROLE_OWNER > ROLE_EDITOR\n" + "ROLE_EDITOR > ROLE_USER\n" + "ROLE_USER > ROLE_GUEST "; @Autowired private AuthenticationProvider authenticationProvider; @Bean public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } @Bean public RoleHierarchy roleHierarchy() { RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl(); roleHierarchy.setHierarchy(roleHierarchyDefinition); return roleHierarchy; } @Bean @Autowired public RoleHierarchyVoter roleVoter(RoleHierarchy roleHierarchy) { return new RoleHierarchyVoter(roleHierarchy); } @Bean @Autowired public AuthenticationProvider authenticationProvider(UserService userDetailsService, PasswordEncoder passwordEncoder) { DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider(); authenticationProvider.setUserDetailsService(userDetailsService); authenticationProvider.setPasswordEncoder(passwordEncoder); return authenticationProvider; } @Autowired public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(authenticationProvider); } } } }
38.206107
125
0.768432
2bccdbef6746069001b569a783a2649ee459f11b
8,312
/* * Copyright 2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.geemvc.handler; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import com.geemvc.RequestContext; import com.geemvc.logging.Log; import com.geemvc.logging.annotation.Logger; import com.geemvc.reflect.ReflectionProvider; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Singleton; @Singleton public class DefaultCompositeHandlerResolver implements CompositeHandlerResolver { protected final Set<HandlerResolver> handlerResolvers; protected final ReflectionProvider reflectionProvider; @Logger protected Log log; @Inject protected Injector injector; @Inject public DefaultCompositeHandlerResolver(ReflectionProvider reflectionProvider) { this.reflectionProvider = reflectionProvider; this.handlerResolvers = reflectionProvider.locateHandlerResolvers(); } @Override public RequestHandler resolve(Class<?> controllerClass, String handlerMethod) { List<RequestHandler> requestHandlers = new ArrayList<>(); for (HandlerResolver handlerResolver : handlerResolvers) { log.trace("Looking for handler method {} in controller class {} using handler resolver '{}'.", () -> handlerMethod, () -> controllerClass.getName(), () -> handlerResolver.getClass().getName()); RequestHandler requestHandler = handlerResolver.resolve(controllerClass, handlerMethod); if (requestHandler != null) { log.trace("Found request handler '{}' using handler resolver '{}'.", () -> requestHandler, () -> handlerResolver.getClass().getName()); requestHandlers.add(requestHandler); } else { log.trace("No request handler found using handler resolver '{}'.", () -> handlerResolver.getClass().getName()); } } if (requestHandlers.size() == 1) { log.info("Found 1 request handler ({}) for the handler method {} and controller class {}.", () -> requestHandlers.get(0), () -> handlerMethod, () -> controllerClass.getName()); } else if (requestHandlers.isEmpty()) { log.warn("No request handler found for the handler method {} and controller class {}.", () -> handlerMethod, () -> controllerClass.getName()); } else if (requestHandlers.size() > 0) { log.info("More than 1 request handlers found for the handler method {} and controller class {}. Using the first one of {}.", () -> requestHandlers.get(0), () -> handlerMethod, () -> requestHandlers); } return requestHandlers.isEmpty() ? null : requestHandlers.get(0); } @Override public RequestHandler resolveByName(String uniqueName) { List<RequestHandler> requestHandlers = new ArrayList<>(); for (HandlerResolver handlerResolver : handlerResolvers) { log.trace("Looking for request handler by the unique name '{}' using handler resolver '{}'.", () -> uniqueName, () -> handlerResolver.getClass().getName()); RequestHandler requestHandler = handlerResolver.resolveByName(uniqueName); if (requestHandler != null) { log.trace("Found request handler '{}' using handler resolver '{}'.", () -> requestHandler, () -> handlerResolver.getClass().getName()); requestHandlers.add(requestHandler); } else { log.trace("No request handler found using handler resolver '{}'.", () -> handlerResolver.getClass().getName()); } } if (requestHandlers.size() == 1) { log.info("Found 1 request handler ({}) for the unique name '{}' '{}'.", () -> requestHandlers.get(0), () -> uniqueName); } else if (requestHandlers.isEmpty()) { log.warn("No request handler found for the unique name '{}'.", () -> uniqueName); } else if (requestHandlers.size() > 0) { log.info("More than 1 request handlers found for the the unique name '{}'. Using the first one of {}.", () -> uniqueName, () -> requestHandlers); } return requestHandlers.isEmpty() ? null : requestHandlers.get(0); } @Override public List<RequestHandler> resolve(String requestURI) { List<RequestHandler> requestHandlers = new ArrayList<>(); for (HandlerResolver handlerResolver : handlerResolvers) { log.trace("Looking for request handlers using path '{}' and handler resolver '{}'.", () -> requestURI, () -> handlerResolver.getClass().getName()); final List<RequestHandler> reqHandlers = handlerResolver.resolve(requestURI); if (reqHandlers != null && !reqHandlers.isEmpty()) requestHandlers.addAll(reqHandlers); log.trace("Found {} request handlers using path '{}' and handler resolver '{}'.", () -> reqHandlers == null ? 0 : reqHandlers.size(), () -> requestURI, () -> handlerResolver.getClass().getName()); } log.trace("Found request handlers {} for path '{}'.", () -> requestHandlers, () -> requestURI); return requestHandlers; } @Override public List<RequestHandler> resolve(String requestURI, String httpMethod) { List<RequestHandler> requestHandlers = new ArrayList<>(); for (HandlerResolver handlerResolver : handlerResolvers) { log.trace("Looking for request handlers using path '{} {}' and handler resolver '{}'.", () -> httpMethod, () -> requestURI, () -> handlerResolver.getClass().getName()); List<RequestHandler> reqHandlers = handlerResolver.resolve(requestURI, httpMethod); if (reqHandlers != null && !reqHandlers.isEmpty()) requestHandlers.addAll(reqHandlers); log.trace("Found {} request handlers using path '{} {}' and handler resolver '{}'.", () -> reqHandlers == null ? 0 : reqHandlers.size(), () -> httpMethod, () -> requestURI, () -> handlerResolver.getClass().getName()); } log.trace("Found request handlers {} for path '{}'.", () -> requestHandlers, () -> requestURI); return requestHandlers; } @Override public RequestHandler resolve(RequestContext requestCtx, Collection<Class<?>> controllerClasses) { List<RequestHandler> requestHandlers = new ArrayList<>(); for (HandlerResolver handlerResolver : handlerResolvers) { log.trace("Looking for request handlers in controller classes {} using handler resolver '{}'.", () -> controllerClasses, () -> handlerResolver.getClass().getName()); RequestHandler requestHandler = handlerResolver.resolve(requestCtx, controllerClasses); if (requestHandler != null) { log.trace("Found request handler '{}' using handler resolver '{}'.", () -> requestHandler, () -> handlerResolver.getClass().getName()); requestHandlers.add(requestHandler); } else { log.trace("No request handler found using handler resolver '{}'.", () -> handlerResolver.getClass().getName()); } } if (requestHandlers.size() == 1) { log.info("Found 1 request handler ({}) for the path '{}'.", () -> requestHandlers.get(0), () -> requestCtx.getPath()); } else if (requestHandlers.isEmpty()) { log.warn("No request handler found for path '{}'.", () -> requestCtx.getPath()); } else if (requestHandlers.size() > 0) { log.info("More than 1 request handlers found for the path '{}'. Using the first one of {}.", () -> requestCtx.getPath(), () -> requestHandlers); } return requestHandlers.isEmpty() ? null : requestHandlers.get(0); } }
47.770115
229
0.644249
4d0b963aba92abeb23c28d48d725f3a05f4e3678
6,588
/* * Copyright (c) 2016-2018. Uniquid Inc. or its affiliates. All Rights Reserved. * * License is in the "LICENSE" file accompanying this file. * See the License for the specific language governing permissions and limitations under the License. */ package com.uniquid.contract; import com.uniquid.blockchain.impl.InsightApiDAOImpl; import com.uniquid.params.UniquidLitecoinRegTest; import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.core.Transaction; import org.junit.Assert; import org.junit.Test; import org.spongycastle.util.encoders.Hex; import java.util.BitSet; public class ContractUtilsTest { @Test public void test() throws Exception { NetworkParameters parameters = UniquidLitecoinRegTest.get(); InsightApiDAOImpl blockChainDAOImpl = new InsightApiDAOImpl("http://40.115.103.9:3001/insight-lite-api"); String tx = blockChainDAOImpl.retrieveRawTx("238658afbe6e61db2dd3f923f289a40f007d00cfc8672fadaac7fd4a9c01ade6 "); Transaction originalTransaction = parameters.getDefaultSerializer().makeTransaction(Hex.decode(tx)); BitSet bitSet = new BitSet(); bitSet.set(34); bitSet.set(35); bitSet.set(36); Transaction contract; contract = ContractUtils.buildAccessContract( null, "n4KKztGVmQ6sQ462AxPPfVU9Gk4HLY6bdo", "musfm34J4hH2KH2SaEoiycnoDyR36d5wXT", originalTransaction.getOutput(3), bitSet, parameters); String contractTx = new String(Hex.encode(contract.bitcoinSerialize())); Assert.assertEquals( "0100000001e6ad019c4afdc7aaad2f67c8cf007d000fa489f223f9d32ddb616ebeaf588623030000004847304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a001ffffffff030000000000000000536a4c5000000000001c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0930400000000001976a914fa1804e0b3d2049116ec25cfc3d30d47f6ccb8ca88ac2cdf8a00000000001976a9149d7cb191574e06f1ee5d225e90c0fb24383819c688ac00000000", contractTx); contract = ContractUtils.buildAccessContract( "mxt3rL7PSZ22oaRGzVJV3voGwJhU1PFhdB", null, "musfm34J4hH2KH2SaEoiycnoDyR36d5wXT", originalTransaction.getOutput(3), bitSet, parameters); contractTx = new String(Hex.encode(contract.bitcoinSerialize())); Assert.assertEquals( "0100000001e6ad019c4afdc7aaad2f67c8cf007d000fa489f223f9d32ddb616ebeaf588623030000004847304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a001ffffffff03a0860100000000001976a914be778308363d598e21a2643e9b86fbf5c781865488ac0000000000000000536a4c5000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006cec8d00000000001976a9149d7cb191574e06f1ee5d225e90c0fb24383819c688ac00000000", contractTx); contract = ContractUtils.buildAccessContract( "mxt3rL7PSZ22oaRGzVJV3voGwJhU1PFhdB", "n4KKztGVmQ6sQ462AxPPfVU9Gk4HLY6bdo", "musfm34J4hH2KH2SaEoiycnoDyR36d5wXT", originalTransaction.getOutput(3), null, parameters ); contractTx = new String(Hex.encode(contract.bitcoinSerialize())); Assert.assertEquals( "0100000001e6ad019c4afdc7aaad2f67c8cf007d000fa489f223f9d32ddb616ebeaf588623030000004847304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a001ffffffff03a0860100000000001976a914be778308363d598e21a2643e9b86fbf5c781865488ace0930400000000001976a914fa1804e0b3d2049116ec25cfc3d30d47f6ccb8ca88ac8c588900000000001976a9149d7cb191574e06f1ee5d225e90c0fb24383819c688ac00000000", contractTx); contract = ContractUtils.buildAccessContract( "mxt3rL7PSZ22oaRGzVJV3voGwJhU1PFhdB", "n4KKztGVmQ6sQ462AxPPfVU9Gk4HLY6bdo", "musfm34J4hH2KH2SaEoiycnoDyR36d5wXT", originalTransaction.getOutput(3), bitSet, parameters ); contractTx = new String(Hex.encode(contract.bitcoinSerialize())); Assert.assertEquals( "0100000001e6ad019c4afdc7aaad2f67c8cf007d000fa489f223f9d32ddb616ebeaf588623030000004847304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a001ffffffff04a0860100000000001976a914be778308363d598e21a2643e9b86fbf5c781865488ac0000000000000000536a4c5000000000001c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0930400000000001976a914fa1804e0b3d2049116ec25cfc3d30d47f6ccb8ca88ac8c588900000000001976a9149d7cb191574e06f1ee5d225e90c0fb24383819c688ac00000000", contractTx); Transaction revoke; try { revoke = ContractUtils.buildRevokeContract( null, "mxt3rL7PSZ22oaRGzVJV3voGwJhU1PFhdB", originalTransaction.getOutput(2), parameters); Assert.fail(); } catch (Exception e) { // } try { revoke = ContractUtils.buildRevokeContract( "n4KKztGVmQ6sQ462AxPPfVU9Gk4HLY6bdo", null, originalTransaction.getOutput(2), parameters); Assert.fail(); } catch (Exception e) { // } revoke = ContractUtils.buildRevokeContract( "n4KKztGVmQ6sQ462AxPPfVU9Gk4HLY6bdo", "mxt3rL7PSZ22oaRGzVJV3voGwJhU1PFhdB", originalTransaction.getOutput(2), parameters); String revokeTx = new String(Hex.encode(revoke.bitcoinSerialize())); Assert.assertEquals( "0100000001e6ad019c4afdc7aaad2f67c8cf007d000fa489f223f9d32ddb616ebeaf588623020000004847304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a001ffffffff0284c50100000000001976a914fa1804e0b3d2049116ec25cfc3d30d47f6ccb8ca88ac84c50100000000001976a914be778308363d598e21a2643e9b86fbf5c781865488ac00000000", revokeTx); } }
53.129032
653
0.768974
8f2e4ee6ab1e9afccf0e3e04a6cdd474b640b92f
2,033
package controller; import java.awt.Dimension; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.swing.JFileChooser; import observer.DownloadObserver; import Model.MainViewModel; import tasks.DownloadTask; import view.MainView; /** * Class thats acts as a controller for the MainView class and handles its events. * * @author c.timpert * */ public class MainViewController { private MainView view; private MainViewModel model; public MainViewController(MainView view, MainViewModel model) { this.model = model; this.view = view; model.addObserver(view); } /** * Opens a JFileChooser and saves the chosen directory to the model if one was chosen */ public void showFileChooser() { JFileChooser fileChooser = new JFileChooser(); fileChooser.setCurrentDirectory(new java.io.File(".")); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setDialogTitle("Choose Location: "); fileChooser.setPreferredSize(new Dimension(450, 300)); fileChooser.setVisible(true); int option = fileChooser.showOpenDialog(view); if (option == JFileChooser.APPROVE_OPTION) { File directory = fileChooser.getSelectedFile(); model.setSaveLocation(directory.getAbsolutePath().replaceAll("\\\\", "/")); } } /** * Saves the downloadlink into the model * * @param link the link to save */ public void setDonwloadLink(String link) { model.setDownloadLink(link); } /** * Start the download process */ public void startDownload() { String downloadLink = model.getDownloadLink(); String saveLocation = model.getSaveLocation(); try { DownloadTask task = new DownloadTask(new URL(downloadLink), saveLocation); DownloadObserver observer = new DownloadObserver(view); task.addObserver(observer); task.start(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }
26.402597
86
0.735366
b8c3feeb15f0b7b97dcbdec347f51370c5cdb4c8
14,037
package connect.ui.service; import android.app.Service; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import com.google.gson.Gson; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import connect.im.IMessage; import connect.im.model.FailMsgsManager; import connect.im.netty.BufferBean; import connect.im.netty.MessageDecoder; import connect.im.netty.MessageEncoder; import connect.im.netty.NettySession; import connect.ui.service.bean.ServiceAck; import connect.ui.service.bean.ServiceInfoBean; import connect.utils.TimeUtil; import connect.utils.log.LogManager; import connect.utils.okhttp.HttpRequest; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.timeout.IdleState; import io.netty.handler.timeout.IdleStateEvent; import io.netty.handler.timeout.IdleStateHandler; public class PushService extends Service { private String Tag = "tag_PushService"; private PushService service; private IMessage localBinder; private PushBinder pushBinder; private PushConnect pushConnect; @Override public IBinder onBind(Intent intent) { return pushBinder; } @Override public void onCreate() { super.onCreate(); service = this; if (pushBinder == null) { pushBinder = new PushBinder(); } if (pushConnect == null) { pushConnect = new PushConnect(); } } public static void startService(Context context) { Intent intent = new Intent(context, PushService.class); context.startService(intent); } class PushConnect implements ServiceConnection { @Override public void onServiceConnected(ComponentName name, IBinder service) { try { LogManager.getLogger().d(Tag, "onServiceConnected"+TimeUtil.getCurrentTimeInString(TimeUtil.DATE_FORMAT_SECOND)); localBinder = IMessage.Stub.asInterface(service); localBinder.connectMessage(ServiceAck.SERVER_ADDRESS.getAck(), new byte[0], new byte[0]); } catch (RemoteException e) { e.printStackTrace(); } } @Override public void onServiceDisconnected(ComponentName name) { if (service == null) { service = PushService.this; } if (pushConnect == null) { Intent intent = new Intent(service, SocketService.class); service.startService(intent); service.bindService(intent, pushConnect, Service.BIND_IMPORTANT); } } } class PushBinder extends IMessage.Stub { @Override public void connectMessage(int type, byte[] ack, byte[] message) throws RemoteException { ByteBuffer byteBuffer; BufferBean bufferBean; ServiceAck serviceAck = ServiceAck.valueOf(type); switch (serviceAck) { case BIND_SUCCESS: LogManager.getLogger().d(Tag, "connectMessage :BIND_SUCCESS;"+TimeUtil.getCurrentTimeInString(TimeUtil.DATE_FORMAT_SECOND)); Intent intent = new Intent(service, SocketService.class); bindService(intent, pushConnect, Service.BIND_IMPORTANT); break; case MESSAGE: bufferBean = new BufferBean(ack, message); if (!NettySession.getInstance().isWriteAble()) { reconDelay(); } else { NettySession.getInstance().getChannel().writeAndFlush(bufferBean).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { reconDelay(); } } }); } break; case CONNECT_START: connectService(); break; case CONNECT_SUCCESS: connectSuccess(); break; case EXIT_ACCOUNT: stopConnect(); localBinder.connectMessage(ServiceAck.EXIT_ACCOUNT.getAck(), new byte[0], new byte[0]); unbindService(pushConnect); pushConnect = null; stopSelf(); break; case SERVER_ADDRESS: try { byteBuffer = ByteBuffer.wrap(message); String serviceInfo = new String(byteBuffer.array(), "utf-8"); ServiceInfoBean serviceInfoBean = new Gson().fromJson(serviceInfo, ServiceInfoBean.class); socketAddress = serviceInfoBean.getServiceAddress(); socketPort = serviceInfoBean.getPort(); canReConnect = true; connectService(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } break; } } } @Override public void onDestroy() { super.onDestroy(); } /** tag */ private final int TAG_CONNECT = 100; /** The message exchange Even the Fibonacci sequence */ private long[] reconFibonacci = new long[]{1000, 1000}; private Handler reconHandler = new Handler(Looper.myLooper()) { @Override public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case TAG_CONNECT: if (HttpRequest.isConnectNet()) { connectService(); } break; } } }; public void resetFibonacci() { reconFibonacci[0] = 1000; reconFibonacci[1] = 1000; } /** * connect success */ public void connectSuccess() { canReConnect = true; resetFibonacci(); reconHandler.removeMessages(TAG_CONNECT); } public void reconDelay() { LogManager.getLogger().d(Tag, "connectServer reconDelay()..."); if (canReConnect && !reconHandler.hasMessages(TAG_CONNECT)) { if (reconFibonacci[0] + reconFibonacci[1] > 34000) {//10 time repeat resetFibonacci(); FailMsgsManager.getInstance().removeAllFailMsg(); } long count = reconFibonacci[0] + reconFibonacci[1]; reconFibonacci[0] = reconFibonacci[1]; reconFibonacci[1] = count; LogManager.getLogger().d(Tag, "connectServer reconDelay()..." + count / 1000 + "s reconnect"); Message msg = Message.obtain(reconHandler, TAG_CONNECT); reconHandler.sendMessageDelayed(msg, count); } } private ConnectRunable connectRunable; private static ExecutorService threadPoolExecutor = Executors.newSingleThreadExecutor(); private static boolean canReConnect = true; private String socketAddress; private int socketPort; public void connectService() { LogManager.getLogger().d(Tag, "connectService:" + TimeUtil.getCurrentTimeInString(TimeUtil.DATE_FORMAT_SECOND)); NettySession.getInstance().shutDown(); connectRunable = new ConnectRunable(); threadPoolExecutor.submit(connectRunable); } class ConnectRunable implements Runnable { @Override public void run() { EventLoopGroup loopGroup = new NioEventLoopGroup(); Bootstrap bootstrap = new Bootstrap(); bootstrap.group(loopGroup);//java.lang.OutOfMemoryError: Could not allocate JNI Env bootstrap.channel(NioSocketChannel.class); bootstrap.option(ChannelOption.SO_KEEPALIVE, true); bootstrap.option(ChannelOption.TCP_NODELAY, true);//TCP协议 bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 30000); bootstrap.handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new IdleStateHandler(10, 10, 0, TimeUnit.SECONDS)); ch.pipeline().addLast(new MessageEncoder()); ch.pipeline().addLast(new MessageDecoder()); ch.pipeline().addLast(new ConnectHandlerAdapter()); } }); ChannelFuture future = bootstrap.connect(socketAddress, socketPort); try { future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { localBinder.connectMessage(ServiceAck.HAND_SHAKE.getAck(), new byte[0], new byte[0]); } else if (!future.isSuccess()) { reconDelay(); } } }).sync(); Channel channel = future.channel(); NettySession.getInstance().setLoopGroup(loopGroup); NettySession.getInstance().setChannel(channel); channel.closeFuture().sync(); } catch (Exception e) { e.printStackTrace(); LogManager.getLogger().d(Tag, "connectService() Exception ==> " + e.getMessage()); reconDelay(); }finally { NettySession.getInstance().shutDown(); reconDelay(); } } } public void stopConnect() { LogManager.getLogger().d(Tag, "stopConnect() ==> "); canReConnect = false; NettySession.getInstance().shutDown(); } /** Recently received a message of time */ private static long lastReceiverTime; /** Heart rate */ private final static long HEART_FREQUENCY = 20 * 1000; @ChannelHandler.Sharable class ConnectHandlerAdapter extends ChannelHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { super.channelRead(ctx, msg); lastReceiverTime = TimeUtil.getCurrentTimeInLong(); BufferBean bufferBean = (BufferBean) msg; localBinder.connectMessage(ServiceAck.MESSAGE.getAck(), bufferBean.getAck(), bufferBean.getMessage()); } @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { super.userEventTriggered(ctx, evt); if (IdleStateEvent.class.isAssignableFrom(evt.getClass())) { IdleStateEvent event = (IdleStateEvent) evt; if (event.state() == IdleState.READER_IDLE || event.state() == IdleState.WRITER_IDLE || event.state() == IdleState.ALL_IDLE) { long curtime = TimeUtil.getCurrentTimeInLong(); if (curtime < lastReceiverTime + HEART_FREQUENCY) { LogManager.getLogger().d(Tag, "userEventTriggered() ==> " + (curtime - lastReceiverTime)); try { localBinder.connectMessage(ServiceAck.HEART_BEAT.getAck(), new byte[0], new byte[0]); } catch (RemoteException e) { e.printStackTrace(); reconDelay(); } } else {//connect timeout ctx.close(); LogManager.getLogger().d(Tag, "userEventTriggered() ==> connect timeout" + (curtime - lastReceiverTime)); reconDelay(); } } } } @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); LogManager.getLogger().d(Tag, "channelActive() == "); //localBinder.connectMessage(ServiceAck.HAND_SHAKE.getAck(), new byte[0], new byte[0]); } /** * When the TCP connection is broken, it will be called back * * @param ctx * @throws Exception */ @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); ctx.close(); LogManager.getLogger().d(Tag, "channelInactive() ==> connection is broken"); reconDelay(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { super.exceptionCaught(ctx, cause); ctx.close(); LogManager.getLogger().d(Tag, "exceptionCaught() =="); reconDelay(); } } }
37.937838
144
0.585025
a70d8e8f0ed3b0be889e852fb9f251cfa2304a02
1,799
package net.yasfu.acoworth.ShopListeners; import de.epiceric.shopchest.shop.Shop; import net.yasfu.acoworth.AcoWorthPlugin; import net.yasfu.acoworth.Storage; import org.bukkit.Material; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.inventory.ItemStack; import de.epiceric.shopchest.event.ShopBuySellEvent; /* ShopChest https://github.com/EpicEricEE/ShopChest https://www.spigotmc.org/resources/shopchest.11431/ */ public class ShopChestListener implements Listener { AcoWorthPlugin plugin; public ShopChestListener(AcoWorthPlugin pl) { plugin = pl; } @EventHandler(priority = EventPriority.MONITOR) public void onShopChestSale(ShopBuySellEvent shopBuySellEvent) { Shop shop = shopBuySellEvent.getShop(); Shop.ShopType shopType = shop.getShopType(); if (shopBuySellEvent.isCancelled() || shopType == Shop.ShopType.ADMIN) { return; } FileConfiguration cfg = plugin.getConfig(); String type = cfg.getString("trackSaleTypes"); if (type == null) { type = "BUY"; } ShopBuySellEvent.Type eventType = shopBuySellEvent.getType(); plugin.getLogger().info(eventType.toString()); if ((type.equals("BUY") && eventType == ShopBuySellEvent.Type.SELL) || (type.equals("SELL") && eventType == ShopBuySellEvent.Type.BUY)) { return; } ItemStack item = shop.getItem().getItemStack(); Material mat = item.getType(); int amt = shopBuySellEvent.getNewAmount(); double cost = shopBuySellEvent.getNewPrice(); cost /= amt; Storage.addSale(mat, cost); } }
28.109375
145
0.684269
f884c54ce2b436fe20f7835d934620ea059d97d8
2,895
// polymorphism/rodent/Rodent12.java // TIJ4 Chapter Polymorphism, Exercise 12, page 298 /* Modify exercise 9 so that it demonstrates the order of initialization of the * base classes and derived classes. Now add member objects to both the base and * derived classes, and show the order in which their initialization occurs during * construction. */ /* Solution includes, in same package: * import java.util.*; * public class RandomRodentGenerator { * private Random rand = new Random(); * public Rodent next() { * switch(rand.nextInt(3)) { * default: * case 0: return new Mouse(); * case 1: return new Rat(); * case 2: return new Squirrel(); * } * } * } */ package polymorphism.rodent; import static org.greggordon.tools.Print.*; class Characteristic { private String s; Characteristic(String s) { this.s = s; println("Creating Characteristic " + s); } } class Description { private String s; Description(String s) { this.s = s; println("Creating Description " + s); } } class Rodent { private String name = "Rodent"; private Characteristic c = new Characteristic("has tail"); private Description d = new Description("small mammal"); Rodent() { println("Rodent()"); } protected void eat() { println("Rodent.eat()"); } protected void run() { println("Rodent.run()"); } protected void sleep() { println("Rodent.sleep()"); } public String toString() { return name; } } class Mouse extends Rodent { private String name = "Mouse"; private Characteristic c = new Characteristic("likes cheese"); private Description d = new Description("nocturnal"); Mouse() { println("Mouse()"); } protected void eat() { println("Mouse.eat()"); } protected void run() { println("Mouse.run()"); } protected void sleep() { println("Mouse.sleep()"); } public String toString() { return name; } } class Rat extends Rodent { private String name = "Rat"; private Characteristic c = new Characteristic("larger"); private Description d = new Description("black"); Rat() { println("Rat()"); } protected void eat() { println("Rat.eat()"); } protected void run() { println("Rat.run()"); } protected void sleep() { println("Rat.sleep()"); } public String toString() { return name; } } class Squirrel extends Rodent { private String name = "Squirrel"; private Characteristic c = new Characteristic("climbs trees"); private Description d = new Description("likes nuts"); Squirrel() { println("Squirrel()"); } protected void eat() { println("Squirrel.eat()"); } protected void run() { println("Squirrel.run()"); } protected void sleep() { println("Squirrel.sleep()"); } public String toString() { return name; } } public class Rodent12 { private static RandomRodentGenerator gen = new RandomRodentGenerator(); public static void main(String[] args) { Rodent[] rodents = new Rodent[10]; for(Rodent r : rodents) { r = gen.next(); println(r); } } }
30.473684
81
0.686701
10114e3c9508fe03e1736ac2a5d3179ffb833ef2
534
import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; public class ask { public static final String ENDPOINT = "http://dydra.com/jhacker/foaf/sparql"; public static final String QUERY = "ASK WHERE {?s ?p ?o}"; public static void main(String[] args) { QueryExecution exec = QueryExecutionFactory.sparqlService(ENDPOINT, QUERY); System.out.println("# " + exec + "\n"); try { System.out.println(exec.execAsk()); } finally { exec.close(); } } }
26.7
79
0.666667
e8418e77b056783c5c15932bbce18b13082d6d3f
354
/** * Created by Administrator on 2016/9/8. */ import java.util.LinkedHashMap; import java.util.Map; public class JasonAI { public static void main(String args[]){ String str1 = new String("\t"); Map<Integer,Integer> jm = new LinkedHashMap<Integer,Integer>(); jm.put(1,1); System.out.print(jm.size()); } }
17.7
71
0.615819
338819bd7cdaa2952745b40d6f75b631b12ff0bd
3,329
package ndm.miniwms.pojo; import java.util.Date; public class StockEntries { private Integer id;// 记录id private Integer inventoryId;// 库存id private Integer itemId;// 商品id private Date date;// 日期 private String type;// 类型 private Integer inId;// 入库单id private Integer outId;// 出库单id private Integer checkId;// 盘点id private Integer openingStock;// 变更前数量 private Integer closingStock;// 变更后数量 private Integer companyId;// 公司id private Integer operatorId;// 操作人id private StockInventory stockInventory;//库存 private StockItem stockItem;//商品 private StockIn stockIn;//入库单 private StockOut stockOut;//出库单 private StockCheck stockCheck;//盘点 private CompanyDetails companyDetails;//公司 private CompanyUser companyUser;//用户 public StockInventory getStockInventory() { return stockInventory; } public void setStockInventory(StockInventory stockInventory) { this.stockInventory = stockInventory; } public StockItem getStockItem() { return stockItem; } public void setStockItem(StockItem stockItem) { this.stockItem = stockItem; } public StockIn getStockIn() { return stockIn; } public void setStockIn(StockIn stockIn) { this.stockIn = stockIn; } public StockOut getStockOut() { return stockOut; } public void setStockOut(StockOut stockOut) { this.stockOut = stockOut; } public StockCheck getStockCheck() { return stockCheck; } public void setStockCheck(StockCheck stockCheck) { this.stockCheck = stockCheck; } public CompanyDetails getCompanyDetails() { return companyDetails; } public void setCompanyDetails(CompanyDetails companyDetails) { this.companyDetails = companyDetails; } public CompanyUser getCompanyUser() { return companyUser; } public void setCompanyUser(CompanyUser companyUser) { this.companyUser = companyUser; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getInventoryId() { return inventoryId; } public void setInventoryId(Integer inventoryId) { this.inventoryId = inventoryId; } public Integer getItemId() { return itemId; } public void setItemId(Integer itemId) { this.itemId = itemId; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public String getType() { return type; } public void setType(String type) { this.type = type; } public Integer getInId() { return inId; } public void setInId(Integer inId) { this.inId = inId; } public Integer getOutId() { return outId; } public void setOutId(Integer outId) { this.outId = outId; } public Integer getCheckId() { return checkId; } public void setCheckId(Integer checkId) { this.checkId = checkId; } public Integer getOpeningStock() { return openingStock; } public void setOpeningStock(Integer openingStock) { this.openingStock = openingStock; } public Integer getClosingStock() { return closingStock; } public void setClosingStock(Integer closingStock) { this.closingStock = closingStock; } public Integer getCompanyId() { return companyId; } public void setCompanyId(Integer companyId) { this.companyId = companyId; } public Integer getOperatorId() { return operatorId; } public void setOperatorId(Integer operatorId) { this.operatorId = operatorId; } }
18.494444
63
0.732953
35dbd38cf0ad839032af6e4250d47d7ce770ba18
311
package com.nested_map_viewer.app; public class NestedMapViewer extends CustomApp { public NestedMapViewer() { super("viewer.fxml", "NMapViewer"); } public static void main(String[] args) { launch(); } @Override protected void show() { stage.show(); } }
16.368421
48
0.604502
e4beed758394844db6454aa1146be4d73e939f0a
471
package dev.sheldan.abstracto.core.models; import lombok.Builder; import lombok.Getter; import lombok.Setter; @Getter @Setter @Builder public class AServerChannelUserId { private Long guildId; private Long channelId; private Long userId; public ServerIdChannelId toServerChannelId() { return ServerIdChannelId. builder() .serverId(guildId) .channelId(channelId) .build(); } }
20.478261
50
0.645435
85146d6a8bfe8e56f40374acd74ee1ba8bf7edc1
896
package com.pbm; import android.database.Cursor; import java.io.Serializable; class LocationType implements Serializable { private static final long serialVersionUID = 1L; private int id; private String name; LocationType(int id, String name) { this.id = id; this.name = name; } static LocationType blankLocationType() { return new LocationType(0, ""); } public String toString() { return name; } static LocationType newFromDBCursor(Cursor cursor) { return new LocationType( cursor.getInt(cursor.getColumnIndexOrThrow(PBMContract.LocationTypeContract.COLUMN_ID)), cursor.getString(cursor.getColumnIndexOrThrow(PBMContract.LocationTypeContract.COLUMN_NAME)) ); } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
18.666667
95
0.728795
0ded01c810b3f3c233bac87cc891c05c8c407ea0
2,040
package UnitTest.AlgorithmTest.combineTest.sumofSubSequenceTest.LMGTest; import Algorithm.comprehensive.sumofSubSequence.LMG.Choir; /** * @author liujun * @version 1.0 * @date 2020-02-12 09:38 * @author—Email liujunfirst@outlook.com * @description * @blogURL */ public class ChoirTestDemo { public void TestgetMaxValue(Choir choir) { int value = choir.getMaxValue(PowerDemo01, ChoseNum, intervald); assert value == BestValueDemo01; value = choir.getMaxValue(PowerDemo02, ChoseNum, intervald); assert value == BestValueDemo02; value = choir.getMaxValue(PowerDemo03, ChoseNum, intervald); assert value == BestValueDemo03; value = choir.getMaxValue(PowerDemo04, ChoseNum, intervald); assert value == BestValueDemo04; value = choir.getMaxValue(PowerDemo05, ChoseNum, intervald); assert value == BestValueDemo05; value = choir.getMaxValue(PowerDemo06, ChoseNum, intervald); assert value == BestValueDemo06; value = choir.getMaxValue(PowerDemo07, ChoseNum, intervald); assert value == BestValueDemo07; value = choir.getMaxValue(PowerDemo08, ChoseNum, intervald); assert value == BestValueDemo08; } //设置学生数量:K 和间距:D int ChoseNum = 5; int intervald = 5; //能力值 int[] PowerDemo01 = {}; int[] PowerDemo02 = null; int[] PowerDemo03 = {1, 5, 9, 7, 5, 3, 2, 8, 4, 6}; int[] PowerDemo04 = {1, 5, -9, 7, 5, -3, 2, 8, 4, 6}; int[] PowerDemo05 = {1, 5, -9, 7, 5, -3, 2, -8, 4, 6}; int[] PowerDemo06 = {1, 5, -9, 7, 0, -3, 2, -8, 0, 4, 6, 5}; int[] PowerDemo07 = {9, 1, 1, 1, 1, 1, 9, 1, 1, 9, 1, 1, 9, 9}; int[] PowerDemo08 = {24, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 4, 3, -9, -6, -9, 3, 3, 9, -3, -12, 4, 4}; int BestValueDemo01 = -1; int BestValueDemo02 = -1; int BestValueDemo03 = 15120; int BestValueDemo04 = 9072; int BestValueDemo05 = 15120; int BestValueDemo06 = 15120; int BestValueDemo07 = 6561; int BestValueDemo08 = 52488; }
36.428571
101
0.62598
21f1e48e58a38b6880de74bd67f94f09f3470417
2,571
/* * @copyright defined in LICENSE.txt */ package hera.example.stream.internal; import hera.api.model.Block; import hera.api.model.StreamObserver; import hera.api.model.Subscription; import hera.api.model.Transaction; import hera.api.model.TxHash; import hera.client.AergoClient; import hera.example.stream.BlockStream; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component class BlockStreamImpl implements BlockStream { // WARN: be careful of memory leak by never removed one protected final Map<TxHash, CompletableFuture<TxHash>> hash2Submited = new ConcurrentHashMap<>(); protected final Object lock = new Object(); protected volatile Subscription<Block> subscription; @Autowired protected AergoClient client; @Override public CompletableFuture<TxHash> submit(TxHash txHash) { // make a subscription if it's in unsubscribed state if (null == subscription || subscription.isUnsubscribed()) { synchronized (lock) { if (null == subscription || subscription.isUnsubscribed()) { subscription = makeNewSubscription(); } } } // make a non-completed future and keep it CompletableFuture<TxHash> future = new CompletableFuture<>(); hash2Submited.put(txHash, future); return future; } @Override public boolean unsubmit(TxHash txHash) { return null != hash2Submited.remove(txHash); } private Subscription<Block> makeNewSubscription() { StreamObserver<Block> streamObserver = new StreamObserver<Block>() { @Override public void onNext(Block block) { System.out.println("New block: " + block.getHash()); block.getTransactions().stream().map(Transaction::getHash) .forEach(hash -> { // it hash is submitted one, complete it CompletableFuture<TxHash> submitted = hash2Submited.get(hash); if (null != submitted) { System.out.println("Complete submitted hash: " + hash); submitted.complete(hash); hash2Submited.remove(hash); } }); } @Override public void onError(Throwable t) { System.err.println("Error: " + t); } @Override public void onCompleted() { System.err.println("Complete"); } }; return client.getBlockOperation().subscribeBlock(streamObserver); } }
29.895349
99
0.678335
1aa1c50c40de5f4c50e09be832dd6ed00b953dec
7,773
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mskalnik.gui; import com.mskalnik.bl.AppointmentsHandler; import com.mskalnik.bl.DoctorsHandler; import com.mskalnik.bl.PatientsHandler; import com.mskalnik.model.Appointment; import com.mskalnik.model.Doctor; import com.mskalnik.model.Patient; import java.time.LocalDate; import java.util.List; import javax.swing.DefaultListModel; import javax.swing.JOptionPane; /** * * @author mskalnik */ public class Appointments extends javax.swing.JPanel { private static final PatientsHandler PATIENTS_HANDLER = new PatientsHandler(); private static final DoctorsHandler DOCTORS_HANDLER = new DoctorsHandler(); private static final AppointmentsHandler APPOINTMENTS_HANDLER = new AppointmentsHandler(); /** * Creates new form Appointments */ public Appointments() { initComponents(); fillData(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); liAppointments = new javax.swing.JList<>(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); cbYear = new javax.swing.JComboBox<>(); cbDoctor = new javax.swing.JComboBox<>(); cbPatient = new javax.swing.JComboBox<>(); cbDay = new javax.swing.JComboBox<>(); cbMonth = new javax.swing.JComboBox<>(); btnMake = new javax.swing.JButton(); btnUpdate = new javax.swing.JButton(); jLabel2.setText("jLabel2"); setLayout(null); jLabel1.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jLabel1.setText("All Appointments"); add(jLabel1); jLabel1.setBounds(6, 6, 130, 19); jScrollPane1.setViewportView(liAppointments); add(jScrollPane1); jScrollPane1.setBounds(6, 31, 350, 131); jLabel3.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jLabel3.setText("Make an Appointment"); add(jLabel3); jLabel3.setBounds(10, 190, 170, 19); jLabel4.setText("Doctor:"); add(jLabel4); jLabel4.setBounds(10, 220, 41, 16); jLabel5.setText("Patient:"); add(jLabel5); jLabel5.setBounds(10, 250, 50, 16); jLabel6.setText("Date:"); add(jLabel6); jLabel6.setBounds(10, 280, 29, 16); add(cbYear); cbYear.setBounds(270, 280, 90, 26); add(cbDoctor); cbDoctor.setBounds(110, 220, 250, 26); add(cbPatient); cbPatient.setBounds(110, 250, 250, 26); add(cbDay); cbDay.setBounds(110, 280, 70, 26); add(cbMonth); cbMonth.setBounds(190, 280, 70, 26); btnMake.setText("Make an appointment"); btnMake.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnMakeActionPerformed(evt); } }); add(btnMake); btnMake.setBounds(110, 310, 170, 32); btnUpdate.setText("Update"); btnUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnUpdateActionPerformed(evt); } }); add(btnUpdate); btnUpdate.setBounds(290, 310, 70, 32); }// </editor-fold>//GEN-END:initComponents private void btnMakeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMakeActionPerformed // TODO add your handling code here: String[] doctorList = cbDoctor.getSelectedItem().toString().split(":"); String[] patientList = cbPatient.getSelectedItem().toString().split(":"); int doctorId = Integer.parseInt(doctorList[0]); int patientId = Integer.parseInt(patientList[0]); Doctor d = DOCTORS_HANDLER.getDoctor(doctorId); Patient p = PATIENTS_HANDLER.getExistingPatient(patientId); int day = Integer.parseInt(cbDay.getSelectedItem().toString()); int month = Integer.parseInt(cbMonth.getSelectedItem().toString()); int year = Integer.parseInt(cbYear.getSelectedItem().toString()); LocalDate date = LocalDate.of(year, month, day); APPOINTMENTS_HANDLER.insertAppointments(new Appointment(d, p, date)); JOptionPane.showMessageDialog(null, "Appointment for " + cbPatient.getSelectedItem().toString() + " made!\n"); fillData(); }//GEN-LAST:event_btnMakeActionPerformed private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed // TODO add your handling code here: fillData(); }//GEN-LAST:event_btnUpdateActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnMake; private javax.swing.JButton btnUpdate; private javax.swing.JComboBox<String> cbDay; private javax.swing.JComboBox<String> cbDoctor; private javax.swing.JComboBox<String> cbMonth; private javax.swing.JComboBox<String> cbPatient; private javax.swing.JComboBox<String> cbYear; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JList<String> liAppointments; // End of variables declaration//GEN-END:variables private void fillData() { cbDoctor.removeAllItems(); cbPatient.removeAllItems(); cbDay.removeAllItems(); cbMonth.removeAllItems(); cbYear.removeAllItems(); List<Doctor> doctors = DOCTORS_HANDLER.getDoctors(); doctors.forEach((doctor) -> { cbDoctor.addItem(doctor.getIdDoctor()+ ": " + doctor.getFirstName() + " " + doctor.getSurname()); }); List<Patient> patients = PATIENTS_HANDLER.getExistingPatients(); patients.forEach((patient) -> { cbPatient.addItem(patient.getOpid() + ": " + patient.getFirstName() + " " + patient.getSurname()); }); for (int i = 1; i <= 31; i++) { cbDay.addItem(String.valueOf(i)); } for (int i = 1; i <= 12; i++) { cbMonth.addItem(String.valueOf(i)); } for (int i = 2019; i <= 2024; i++) { cbYear.addItem(String.valueOf(i)); } List<Appointment> appointments = APPOINTMENTS_HANDLER.getAppointments(); DefaultListModel model = new DefaultListModel(); for (Appointment appointment : appointments) { model.addElement(appointment.getId() + ": Doctor " + appointment.getDoctor().getFirstName() + " " + appointment.getDoctor().getSurname() + ", Patient " + appointment.getPatient().getFirstName() + " " + appointment.getPatient().getSurname()); } liAppointments.setModel(model); } }
37.014286
253
0.640551
5f768ba6383ea6eaca91f7fd724a7bca3df3d52c
404
package br.com.command.comandos; import br.com.command.interfaces.Command; import br.com.command.modelos.SomCozinha; /** * Created by danielmarcoto on 17/11/15. */ public class SomCozinhaDesligarCommand implements Command { private SomCozinha som; public SomCozinhaDesligarCommand(SomCozinha som) { this.som = som; } @Override public void execute() {som.desligar();} }
20.2
59
0.717822
521b62f54aebfa0390d039837155e71d7768810e
415,412
/* * 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. */ /** * @author Pavel Dolgov * @version $Revision$ * * This file is based on Win32 headers and has been generated by the nativebridge tool. */ package org.apache.harmony.awt.nativebridge.windows; import org.apache.harmony.awt.nativebridge.*; public class Win32 extends BasicLibWrapper { static Win32 instance; public static synchronized Win32 getInstance() { if (instance == null) { instance = new Win32(); } return instance; } private Win32() { System.loadLibrary("Win32Wrapper"); //$NON-NLS-1$ init(); } private static native void init(); public final int FillRect(long hDC, RECT lprc, long hbr) { long tmp_0 = lprc == null ? 0 : lprc.longLockPointer(); int tmp_ret = FillRect(hDC, tmp_0, hbr); if (lprc != null) { lprc.unlock(); } return tmp_ret; } public final native int FillRect(long hDC, long lprc, long hbr); public static class RECT extends CommonStructWrapper { public static final int sizeof = 16; RECT(boolean direct) { super(sizeof, direct); } RECT(VoidPointer base) { super(base); } RECT(long addr) { super(addr); } public final void set_left(int val) { byteBase.setInt32(0, val); } public final int get_left() { return byteBase.getInt32(0); } public final void set_top(int val) { byteBase.setInt32(4, val); } public final int get_top() { return byteBase.getInt32(4); } public final void set_right(int val) { byteBase.setInt32(8, val); } public final int get_right() { return byteBase.getInt32(8); } public final void set_bottom(int val) { byteBase.setInt32(12, val); } public final int get_bottom() { return byteBase.getInt32(12); } @Override public int size() { return sizeof; } } public final RECT createRECT(boolean direct) { return new RECT(direct); } public final RECT createRECT(VoidPointer base) { return new RECT(base); } public final RECT createRECT(long addr) { return new RECT(addr); } public final native int LineTo(long param_0, int param_1, int param_2); public final native int GetWindowLongW(long hWnd, int nIndex); public final int PeekMessageW(MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) { long tmp_0 = lpMsg == null ? 0 : lpMsg.longLockPointer(); int tmp_ret = PeekMessageW(tmp_0, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); if (lpMsg != null) { lpMsg.unlock(); } return tmp_ret; } public final native int PeekMessageW(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg); public static class MSG extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 48 : 28; MSG(boolean direct) { super(sizeof, direct); } MSG(VoidPointer base) { super(base); } MSG(long addr) { super(addr); } public final void set_hwnd(long val) { byteBase.setAddress(0, val); } public final long get_hwnd() { return byteBase.getAddress(0); } public final void set_message(int val) { byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val); } public final int get_message() { return byteBase.getInt32(NativeBridge.is64 ? 8 : 4); } public final void set_wParam(long val) { byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val); } public final long get_wParam() { return byteBase.getCLong(NativeBridge.is64 ? 16 : 8); } public final void set_lParam(long val) { byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val); } public final long get_lParam() { return byteBase.getCLong(NativeBridge.is64 ? 24 : 12); } public final void set_time(int val) { byteBase.setInt32(NativeBridge.is64 ? 32 : 16, val); } public final int get_time() { return byteBase.getInt32(NativeBridge.is64 ? 32 : 16); } public final POINT get_pt() { return instance.createPOINT(getElementPointer(NativeBridge.is64 ? 36 : 20)); } @Override public int size() { return sizeof; } } public final MSG createMSG(boolean direct) { return new MSG(direct); } public final MSG createMSG(VoidPointer base) { return new MSG(base); } public final MSG createMSG(long addr) { return new MSG(addr); } public static class POINT extends CommonStructWrapper { public static final int sizeof = 8; POINT(boolean direct) { super(sizeof, direct); } POINT(VoidPointer base) { super(base); } POINT(long addr) { super(addr); } public final void set_x(int val) { byteBase.setInt32(0, val); } public final int get_x() { return byteBase.getInt32(0); } public final void set_y(int val) { byteBase.setInt32(4, val); } public final int get_y() { return byteBase.getInt32(4); } @Override public int size() { return sizeof; } } public final POINT createPOINT(boolean direct) { return new POINT(direct); } public final POINT createPOINT(VoidPointer base) { return new POINT(base); } public final POINT createPOINT(long addr) { return new POINT(addr); } public final native int BitBlt(long param_0, int param_1, int param_2, int param_3, int param_4, long param_5, int param_6, int param_7, int param_8); public final int GetSaveFileNameW(OPENFILENAMEW param_0) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); int tmp_ret = GetSaveFileNameW(tmp_0); if (param_0 != null) { param_0.unlock(); } return tmp_ret; } public final native int GetSaveFileNameW(long param_0); public static class OPENFILENAMEW extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 152 : 88; OPENFILENAMEW(boolean direct) { super(sizeof, direct); } OPENFILENAMEW(VoidPointer base) { super(base); } OPENFILENAMEW(long addr) { super(addr); } public final void set_lStructSize(int val) { byteBase.setInt32(0, val); } public final int get_lStructSize() { return byteBase.getInt32(0); } public final void set_hwndOwner(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_hwndOwner() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final void set_hInstance(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_hInstance() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final void set_lpstrFilter(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 24 : 12, val); } public final Int16Pointer get_lpstrFilter() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 24 : 12)); } public final void set_lpstrCustomFilter(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 32 : 16, val); } public final Int16Pointer get_lpstrCustomFilter() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 32 : 16)); } public final void set_nMaxCustFilter(int val) { byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val); } public final int get_nMaxCustFilter() { return byteBase.getInt32(NativeBridge.is64 ? 40 : 20); } public final void set_nFilterIndex(int val) { byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val); } public final int get_nFilterIndex() { return byteBase.getInt32(NativeBridge.is64 ? 44 : 24); } public final void set_lpstrFile(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 48 : 28, val); } public final Int16Pointer get_lpstrFile() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 48 : 28)); } public final void set_nMaxFile(int val) { byteBase.setInt32(NativeBridge.is64 ? 56 : 32, val); } public final int get_nMaxFile() { return byteBase.getInt32(NativeBridge.is64 ? 56 : 32); } public final void set_lpstrFileTitle(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 64 : 36, val); } public final Int16Pointer get_lpstrFileTitle() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 64 : 36)); } public final void set_nMaxFileTitle(int val) { byteBase.setInt32(NativeBridge.is64 ? 72 : 40, val); } public final int get_nMaxFileTitle() { return byteBase.getInt32(NativeBridge.is64 ? 72 : 40); } public final void set_lpstrInitialDir(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 80 : 44, val); } public final Int16Pointer get_lpstrInitialDir() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 80 : 44)); } public final void set_lpstrTitle(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 88 : 48, val); } public final Int16Pointer get_lpstrTitle() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 88 : 48)); } public final void set_Flags(int val) { byteBase.setInt32(NativeBridge.is64 ? 96 : 52, val); } public final int get_Flags() { return byteBase.getInt32(NativeBridge.is64 ? 96 : 52); } public final void set_nFileOffset(short val) { byteBase.setInt16(NativeBridge.is64 ? 100 : 56, val); } public final short get_nFileOffset() { return byteBase.getInt16(NativeBridge.is64 ? 100 : 56); } public final void set_nFileExtension(short val) { byteBase.setInt16(NativeBridge.is64 ? 102 : 58, val); } public final short get_nFileExtension() { return byteBase.getInt16(NativeBridge.is64 ? 102 : 58); } public final void set_lpstrDefExt(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 104 : 60, val); } public final Int16Pointer get_lpstrDefExt() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 104 : 60)); } public final void set_lCustData(long val) { byteBase.setCLong(NativeBridge.is64 ? 112 : 64, val); } public final long get_lCustData() { return byteBase.getCLong(NativeBridge.is64 ? 112 : 64); } public final void set_lpfnHook(long val) { byteBase.setAddress(NativeBridge.is64 ? 120 : 68, val); } public final long get_lpfnHook() { return byteBase.getAddress(NativeBridge.is64 ? 120 : 68); } public final long LPOFNHOOKPROC(long param_0, int param_1, long param_2, long param_3) { long tmp_ret = instance.proxycall0(get_lpfnHook(), param_0, param_1, param_2, param_3); return tmp_ret; } public final void set_lpTemplateName(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 128 : 72, val); } public final Int16Pointer get_lpTemplateName() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 128 : 72)); } public final void set_pvReserved(VoidPointer val) { byteBase.setPointer(NativeBridge.is64 ? 136 : 76, val); } public final VoidPointer get_pvReserved() { return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 136 : 76)); } public final void set_dwReserved(int val) { byteBase.setInt32(NativeBridge.is64 ? 144 : 80, val); } public final int get_dwReserved() { return byteBase.getInt32(NativeBridge.is64 ? 144 : 80); } public final void set_FlagsEx(int val) { byteBase.setInt32(NativeBridge.is64 ? 148 : 84, val); } public final int get_FlagsEx() { return byteBase.getInt32(NativeBridge.is64 ? 148 : 84); } @Override public int size() { return sizeof; } } public final OPENFILENAMEW createOPENFILENAMEW(boolean direct) { return new OPENFILENAMEW(direct); } public final OPENFILENAMEW createOPENFILENAMEW(VoidPointer base) { return new OPENFILENAMEW(base); } public final OPENFILENAMEW createOPENFILENAMEW(long addr) { return new OPENFILENAMEW(addr); } final native long proxycall0(long fnptr, long param_0, int param_1, long param_2, long param_3); public final native int CreateCaret(long hWnd, long hBitmap, int nWidth, int nHeight); public final native int ImmDestroyContext(long param_0); public final int ImmGetCompositionStringW(long param_0, int param_1, VoidPointer param_2, int param_3) { long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = ImmGetCompositionStringW(param_0, param_1, tmp_0, param_3); if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int ImmGetCompositionStringW(long param_0, int param_1, long param_2, int param_3); public final native int GetSystemMetrics(int nIndex); public final native int SetForegroundWindow(long hWnd); public final native long SendMessageW(long hWnd, int Msg, long wParam, long lParam); public final int GetThemeSysFont(VoidPointer hTheme, int iFontId, LOGFONTA plf) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); long tmp_1 = plf == null ? 0 : plf.longLockPointer(); int tmp_ret = GetThemeSysFont(tmp_0, iFontId, tmp_1); if (hTheme != null) { hTheme.unlock(); } if (plf != null) { plf.unlock(); } return tmp_ret; } public final native int GetThemeSysFont(long hTheme, int iFontId, long plf); public static class LOGFONTA extends CommonStructWrapper { public static final int sizeof = 60; LOGFONTA(boolean direct) { super(sizeof, direct); } LOGFONTA(VoidPointer base) { super(base); } LOGFONTA(long addr) { super(addr); } public final void set_lfHeight(int val) { byteBase.setInt32(0, val); } public final int get_lfHeight() { return byteBase.getInt32(0); } public final void set_lfWidth(int val) { byteBase.setInt32(4, val); } public final int get_lfWidth() { return byteBase.getInt32(4); } public final void set_lfEscapement(int val) { byteBase.setInt32(8, val); } public final int get_lfEscapement() { return byteBase.getInt32(8); } public final void set_lfOrientation(int val) { byteBase.setInt32(12, val); } public final int get_lfOrientation() { return byteBase.getInt32(12); } public final void set_lfWeight(int val) { byteBase.setInt32(16, val); } public final int get_lfWeight() { return byteBase.getInt32(16); } public final void set_lfItalic(byte val) { byteBase.set(20, val); } public final byte get_lfItalic() { return byteBase.get(20); } public final void set_lfUnderline(byte val) { byteBase.set(21, val); } public final byte get_lfUnderline() { return byteBase.get(21); } public final void set_lfStrikeOut(byte val) { byteBase.set(22, val); } public final byte get_lfStrikeOut() { return byteBase.get(22); } public final void set_lfCharSet(byte val) { byteBase.set(23, val); } public final byte get_lfCharSet() { return byteBase.get(23); } public final void set_lfOutPrecision(byte val) { byteBase.set(24, val); } public final byte get_lfOutPrecision() { return byteBase.get(24); } public final void set_lfClipPrecision(byte val) { byteBase.set(25, val); } public final byte get_lfClipPrecision() { return byteBase.get(25); } public final void set_lfQuality(byte val) { byteBase.set(26, val); } public final byte get_lfQuality() { return byteBase.get(26); } public final void set_lfPitchAndFamily(byte val) { byteBase.set(27, val); } public final byte get_lfPitchAndFamily() { return byteBase.get(27); } public final Int8Pointer get_lfFaceName() { return nb.createInt8Pointer(getElementPointer(28)); } @Override public int size() { return sizeof; } } public final LOGFONTA createLOGFONTA(boolean direct) { return new LOGFONTA(direct); } public final LOGFONTA createLOGFONTA(VoidPointer base) { return new LOGFONTA(base); } public final LOGFONTA createLOGFONTA(long addr) { return new LOGFONTA(addr); } public final int SystemParametersInfoW(int uiAction, int uiParam, VoidPointer pvParam, int fWinIni) { long tmp_0 = pvParam == null ? 0 : pvParam.longLockPointer(); int tmp_ret = SystemParametersInfoW(uiAction, uiParam, tmp_0, fWinIni); if (pvParam != null) { pvParam.unlock(); } return tmp_ret; } public final native int SystemParametersInfoW(int uiAction, int uiParam, long pvParam, int fWinIni); public final native int GetCaretBlinkTime(); public final long CreateDCW(String param_0, String param_1, String param_2, DEVMODEW param_3) { Int16Pointer _param_0 = null == param_0? null : nb.createInt16Pointer(param_0, false); long tmp_0 = _param_0 == null ? 0 : _param_0.longLockPointer(); Int16Pointer _param_1 = null == param_1? null : nb.createInt16Pointer(param_1, false); long tmp_1 = _param_1 == null ? 0 : _param_1.longLockPointer(); Int16Pointer _param_2 = null == param_2? null : nb.createInt16Pointer(param_2, false); long tmp_2 = _param_2 == null ? 0 : _param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_ret = CreateDCW(tmp_0, tmp_1, tmp_2, tmp_3); if (_param_0 != null) { _param_0.unlock(); _param_0.free(); } if (_param_1 != null) { _param_1.unlock(); _param_1.free(); } if (_param_2 != null) { _param_2.unlock(); _param_2.free(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final long CreateDCW(Int16Pointer param_0, Int16Pointer param_1, Int16Pointer param_2, DEVMODEW param_3) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_ret = CreateDCW(tmp_0, tmp_1, tmp_2, tmp_3); if (param_0 != null) { param_0.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final native long CreateDCW(long param_0, long param_1, long param_2, long param_3); public static class DEVMODEW extends CommonStructWrapper { public static final int sizeof = 220; DEVMODEW(boolean direct) { super(sizeof, direct); } DEVMODEW(VoidPointer base) { super(base); } DEVMODEW(long addr) { super(addr); } public final Int16Pointer get_dmDeviceName() { return nb.createInt16Pointer(getElementPointer(0)); } public final void set_dmSpecVersion(short val) { byteBase.setInt16(64, val); } public final short get_dmSpecVersion() { return byteBase.getInt16(64); } public final void set_dmDriverVersion(short val) { byteBase.setInt16(66, val); } public final short get_dmDriverVersion() { return byteBase.getInt16(66); } public final void set_dmSize(short val) { byteBase.setInt16(68, val); } public final short get_dmSize() { return byteBase.getInt16(68); } public final void set_dmDriverExtra(short val) { byteBase.setInt16(70, val); } public final short get_dmDriverExtra() { return byteBase.getInt16(70); } public final void set_dmFields(int val) { byteBase.setInt32(72, val); } public final int get_dmFields() { return byteBase.getInt32(72); } public final void set_dmOrientation(short val) { byteBase.setInt16(76, val); } public final short get_dmOrientation() { return byteBase.getInt16(76); } public final void set_dmPaperSize(short val) { byteBase.setInt16(78, val); } public final short get_dmPaperSize() { return byteBase.getInt16(78); } public final void set_dmPaperLength(short val) { byteBase.setInt16(80, val); } public final short get_dmPaperLength() { return byteBase.getInt16(80); } public final void set_dmPaperWidth(short val) { byteBase.setInt16(82, val); } public final short get_dmPaperWidth() { return byteBase.getInt16(82); } public final void set_dmScale(short val) { byteBase.setInt16(84, val); } public final short get_dmScale() { return byteBase.getInt16(84); } public final void set_dmCopies(short val) { byteBase.setInt16(86, val); } public final short get_dmCopies() { return byteBase.getInt16(86); } public final void set_dmDefaultSource(short val) { byteBase.setInt16(88, val); } public final short get_dmDefaultSource() { return byteBase.getInt16(88); } public final void set_dmPrintQuality(short val) { byteBase.setInt16(90, val); } public final short get_dmPrintQuality() { return byteBase.getInt16(90); } public final POINTL get_dmPosition() { return instance.createPOINTL(getElementPointer(76)); } public final void set_dmDisplayOrientation(int val) { byteBase.setInt32(84, val); } public final int get_dmDisplayOrientation() { return byteBase.getInt32(84); } public final void set_dmDisplayFixedOutput(int val) { byteBase.setInt32(88, val); } public final int get_dmDisplayFixedOutput() { return byteBase.getInt32(88); } public final void set_dmColor(short val) { byteBase.setInt16(92, val); } public final short get_dmColor() { return byteBase.getInt16(92); } public final void set_dmDuplex(short val) { byteBase.setInt16(94, val); } public final short get_dmDuplex() { return byteBase.getInt16(94); } public final void set_dmYResolution(short val) { byteBase.setInt16(96, val); } public final short get_dmYResolution() { return byteBase.getInt16(96); } public final void set_dmTTOption(short val) { byteBase.setInt16(98, val); } public final short get_dmTTOption() { return byteBase.getInt16(98); } public final void set_dmCollate(short val) { byteBase.setInt16(100, val); } public final short get_dmCollate() { return byteBase.getInt16(100); } public final Int16Pointer get_dmFormName() { return nb.createInt16Pointer(getElementPointer(102)); } public final void set_dmLogPixels(short val) { byteBase.setInt16(166, val); } public final short get_dmLogPixels() { return byteBase.getInt16(166); } public final void set_dmBitsPerPel(int val) { byteBase.setInt32(168, val); } public final int get_dmBitsPerPel() { return byteBase.getInt32(168); } public final void set_dmPelsWidth(int val) { byteBase.setInt32(172, val); } public final int get_dmPelsWidth() { return byteBase.getInt32(172); } public final void set_dmPelsHeight(int val) { byteBase.setInt32(176, val); } public final int get_dmPelsHeight() { return byteBase.getInt32(176); } public final void set_dmDisplayFlags(int val) { byteBase.setInt32(180, val); } public final int get_dmDisplayFlags() { return byteBase.getInt32(180); } public final void set_dmNup(int val) { byteBase.setInt32(180, val); } public final int get_dmNup() { return byteBase.getInt32(180); } public final void set_dmDisplayFrequency(int val) { byteBase.setInt32(184, val); } public final int get_dmDisplayFrequency() { return byteBase.getInt32(184); } public final void set_dmICMMethod(int val) { byteBase.setInt32(188, val); } public final int get_dmICMMethod() { return byteBase.getInt32(188); } public final void set_dmICMIntent(int val) { byteBase.setInt32(192, val); } public final int get_dmICMIntent() { return byteBase.getInt32(192); } public final void set_dmMediaType(int val) { byteBase.setInt32(196, val); } public final int get_dmMediaType() { return byteBase.getInt32(196); } public final void set_dmDitherType(int val) { byteBase.setInt32(200, val); } public final int get_dmDitherType() { return byteBase.getInt32(200); } public final void set_dmReserved1(int val) { byteBase.setInt32(204, val); } public final int get_dmReserved1() { return byteBase.getInt32(204); } public final void set_dmReserved2(int val) { byteBase.setInt32(208, val); } public final int get_dmReserved2() { return byteBase.getInt32(208); } public final void set_dmPanningWidth(int val) { byteBase.setInt32(212, val); } public final int get_dmPanningWidth() { return byteBase.getInt32(212); } public final void set_dmPanningHeight(int val) { byteBase.setInt32(216, val); } public final int get_dmPanningHeight() { return byteBase.getInt32(216); } @Override public int size() { return sizeof; } } public final DEVMODEW createDEVMODEW(boolean direct) { return new DEVMODEW(direct); } public final DEVMODEW createDEVMODEW(VoidPointer base) { return new DEVMODEW(base); } public final DEVMODEW createDEVMODEW(long addr) { return new DEVMODEW(addr); } public static class POINTL extends CommonStructWrapper { public static final int sizeof = 8; POINTL(boolean direct) { super(sizeof, direct); } POINTL(VoidPointer base) { super(base); } POINTL(long addr) { super(addr); } public final void set_x(int val) { byteBase.setInt32(0, val); } public final int get_x() { return byteBase.getInt32(0); } public final void set_y(int val) { byteBase.setInt32(4, val); } public final int get_y() { return byteBase.getInt32(4); } @Override public int size() { return sizeof; } } public final POINTL createPOINTL(boolean direct) { return new POINTL(direct); } public final POINTL createPOINTL(VoidPointer base) { return new POINTL(base); } public final POINTL createPOINTL(long addr) { return new POINTL(addr); } public final native int Arc(long param_0, int param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8); public final native int ImmReleaseContext(long param_0, long param_1); public final int PolyPolygon(long param_0, Win32.POINT param_1, Int32Pointer param_2, int param_3) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = PolyPolygon(param_0, tmp_0, tmp_1, param_3); if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int PolyPolygon(long param_0, long param_1, long param_2, int param_3); public final native long CreatePen(int param_0, int param_1, int param_2); public final native short GetKeyState(int nVirtKey); public final long CreateIconIndirect(ICONINFO piconinfo) { long tmp_0 = piconinfo == null ? 0 : piconinfo.longLockPointer(); long tmp_ret = CreateIconIndirect(tmp_0); if (piconinfo != null) { piconinfo.unlock(); } return tmp_ret; } public final native long CreateIconIndirect(long piconinfo); public static class ICONINFO extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 32 : 20; ICONINFO(boolean direct) { super(sizeof, direct); } ICONINFO(VoidPointer base) { super(base); } ICONINFO(long addr) { super(addr); } public final void set_fIcon(int val) { byteBase.setInt32(0, val); } public final int get_fIcon() { return byteBase.getInt32(0); } public final void set_xHotspot(int val) { byteBase.setInt32(4, val); } public final int get_xHotspot() { return byteBase.getInt32(4); } public final void set_yHotspot(int val) { byteBase.setInt32(8, val); } public final int get_yHotspot() { return byteBase.getInt32(8); } public final void set_hbmMask(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 12, val); } public final long get_hbmMask() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 12); } public final void set_hbmColor(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 16, val); } public final long get_hbmColor() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 16); } @Override public int size() { return sizeof; } } public final ICONINFO createICONINFO(boolean direct) { return new ICONINFO(direct); } public final ICONINFO createICONINFO(VoidPointer base) { return new ICONINFO(base); } public final ICONINFO createICONINFO(long addr) { return new ICONINFO(addr); } public final native int RoundRect(long param_0, int param_1, int param_2, int param_3, int param_4, int param_5, int param_6); public final long ExtCreateRegion(XFORM param_0, int param_1, RGNDATA param_2) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_ret = ExtCreateRegion(tmp_0, param_1, tmp_1); if (param_0 != null) { param_0.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native long ExtCreateRegion(long param_0, int param_1, long param_2); public static class RGNDATA extends CommonStructWrapper { public static final int sizeof = 36; RGNDATA(boolean direct) { super(sizeof, direct); } RGNDATA(VoidPointer base) { super(base); } RGNDATA(long addr) { super(addr); } public final RGNDATAHEADER get_rdh() { return instance.createRGNDATAHEADER(getElementPointer(0)); } public final Int8Pointer get_Buffer() { return nb.createInt8Pointer(getElementPointer(32)); } @Override public int size() { return sizeof; } } public final RGNDATA createRGNDATA(boolean direct) { return new RGNDATA(direct); } public final RGNDATA createRGNDATA(VoidPointer base) { return new RGNDATA(base); } public final RGNDATA createRGNDATA(long addr) { return new RGNDATA(addr); } public static class XFORM extends CommonStructWrapper { public static final int sizeof = 24; XFORM(boolean direct) { super(sizeof, direct); } XFORM(VoidPointer base) { super(base); } XFORM(long addr) { super(addr); } public final void set_eM11(float val) { byteBase.setFloat(0, val); } public final float get_eM11() { return byteBase.getFloat(0); } public final void set_eM12(float val) { byteBase.setFloat(4, val); } public final float get_eM12() { return byteBase.getFloat(4); } public final void set_eM21(float val) { byteBase.setFloat(8, val); } public final float get_eM21() { return byteBase.getFloat(8); } public final void set_eM22(float val) { byteBase.setFloat(12, val); } public final float get_eM22() { return byteBase.getFloat(12); } public final void set_eDx(float val) { byteBase.setFloat(16, val); } public final float get_eDx() { return byteBase.getFloat(16); } public final void set_eDy(float val) { byteBase.setFloat(20, val); } public final float get_eDy() { return byteBase.getFloat(20); } @Override public int size() { return sizeof; } } public final XFORM createXFORM(boolean direct) { return new XFORM(direct); } public final XFORM createXFORM(VoidPointer base) { return new XFORM(base); } public final XFORM createXFORM(long addr) { return new XFORM(addr); } public static class RGNDATAHEADER extends CommonStructWrapper { public static final int sizeof = 32; RGNDATAHEADER(boolean direct) { super(sizeof, direct); } RGNDATAHEADER(VoidPointer base) { super(base); } RGNDATAHEADER(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_iType(int val) { byteBase.setInt32(4, val); } public final int get_iType() { return byteBase.getInt32(4); } public final void set_nCount(int val) { byteBase.setInt32(8, val); } public final int get_nCount() { return byteBase.getInt32(8); } public final void set_nRgnSize(int val) { byteBase.setInt32(12, val); } public final int get_nRgnSize() { return byteBase.getInt32(12); } public final Win32.RECT get_rcBound() { return Win32.instance.createRECT(getElementPointer(16)); } @Override public int size() { return sizeof; } } public final RGNDATAHEADER createRGNDATAHEADER(boolean direct) { return new RGNDATAHEADER(direct); } public final RGNDATAHEADER createRGNDATAHEADER(VoidPointer base) { return new RGNDATAHEADER(base); } public final RGNDATAHEADER createRGNDATAHEADER(long addr) { return new RGNDATAHEADER(addr); } public final int GetThemeSysInt(VoidPointer hTheme, int iIntId, Int32Pointer piValue) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); long tmp_1 = piValue == null ? 0 : piValue.longLockPointer(); int tmp_ret = GetThemeSysInt(tmp_0, iIntId, tmp_1); if (hTheme != null) { hTheme.unlock(); } if (piValue != null) { piValue.unlock(); } return tmp_ret; } public final native int GetThemeSysInt(long hTheme, int iIntId, long piValue); public final int TrackMouseEvent(TRACKMOUSEEVENT lpEventTrack) { long tmp_0 = lpEventTrack == null ? 0 : lpEventTrack.longLockPointer(); int tmp_ret = TrackMouseEvent(tmp_0); if (lpEventTrack != null) { lpEventTrack.unlock(); } return tmp_ret; } public final native int TrackMouseEvent(long lpEventTrack); public static class TRACKMOUSEEVENT extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 24 : 16; TRACKMOUSEEVENT(boolean direct) { super(sizeof, direct); } TRACKMOUSEEVENT(VoidPointer base) { super(base); } TRACKMOUSEEVENT(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_hwndTrack(long val) { byteBase.setAddress(8, val); } public final long get_hwndTrack() { return byteBase.getAddress(8); } public final void set_dwHoverTime(int val) { byteBase.setInt32(NativeBridge.is64 ? 16 : 12, val); } public final int get_dwHoverTime() { return byteBase.getInt32(NativeBridge.is64 ? 16 : 12); } @Override public int size() { return sizeof; } } public final TRACKMOUSEEVENT createTRACKMOUSEEVENT(boolean direct) { return new TRACKMOUSEEVENT(direct); } public final TRACKMOUSEEVENT createTRACKMOUSEEVENT(VoidPointer base) { return new TRACKMOUSEEVENT(base); } public final TRACKMOUSEEVENT createTRACKMOUSEEVENT(long addr) { return new TRACKMOUSEEVENT(addr); } public final long CreateWindowExW(int dwExStyle, String lpClassName, String lpWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, VoidPointer lpParam) { Int16Pointer _lpClassName = null == lpClassName? null : nb.createInt16Pointer(lpClassName, false); long tmp_0 = _lpClassName == null ? 0 : _lpClassName.longLockPointer(); Int16Pointer _lpWindowName = null == lpWindowName? null : nb.createInt16Pointer(lpWindowName, false); long tmp_1 = _lpWindowName == null ? 0 : _lpWindowName.longLockPointer(); long tmp_2 = lpParam == null ? 0 : lpParam.longLockPointer(); long tmp_ret = CreateWindowExW(dwExStyle, tmp_0, tmp_1, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, tmp_2); if (_lpClassName != null) { _lpClassName.unlock(); _lpClassName.free(); } if (_lpWindowName != null) { _lpWindowName.unlock(); _lpWindowName.free(); } if (lpParam != null) { lpParam.unlock(); } return tmp_ret; } public final long CreateWindowExW(int dwExStyle, Int16Pointer lpClassName, Int16Pointer lpWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, VoidPointer lpParam) { long tmp_0 = lpClassName == null ? 0 : lpClassName.longLockPointer(); long tmp_1 = lpWindowName == null ? 0 : lpWindowName.longLockPointer(); long tmp_2 = lpParam == null ? 0 : lpParam.longLockPointer(); long tmp_ret = CreateWindowExW(dwExStyle, tmp_0, tmp_1, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, tmp_2); if (lpClassName != null) { lpClassName.unlock(); } if (lpWindowName != null) { lpWindowName.unlock(); } if (lpParam != null) { lpParam.unlock(); } return tmp_ret; } public final native long CreateWindowExW(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam); public final native long SetClipboardViewer(long hWndNewViewer); public final native int Ellipse(long param_0, int param_1, int param_2, int param_3, int param_4); public final native int GetLastError(); public final void SHGetSettings(SHELLFLAGSTATE lpsfs, int dwMask) { long tmp_0 = lpsfs == null ? 0 : lpsfs.longLockPointer(); SHGetSettings(tmp_0, dwMask); if (lpsfs != null) { lpsfs.unlock(); } } public final native void SHGetSettings(long lpsfs, int dwMask); public static class SHELLFLAGSTATE extends CommonStructWrapper { public static final int sizeof = 56; SHELLFLAGSTATE(boolean direct) { super(sizeof, direct); } SHELLFLAGSTATE(VoidPointer base) { super(base); } SHELLFLAGSTATE(long addr) { super(addr); } public final void set_fShowAllObjects(int val) { byteBase.setInt32(0, val); } public final int get_fShowAllObjects() { return byteBase.getInt32(0); } public final void set_fShowExtensions(int val) { byteBase.setInt32(4, val); } public final int get_fShowExtensions() { return byteBase.getInt32(4); } public final void set_fNoConfirmRecycle(int val) { byteBase.setInt32(8, val); } public final int get_fNoConfirmRecycle() { return byteBase.getInt32(8); } public final void set_fShowSysFiles(int val) { byteBase.setInt32(12, val); } public final int get_fShowSysFiles() { return byteBase.getInt32(12); } public final void set_fShowCompColor(int val) { byteBase.setInt32(16, val); } public final int get_fShowCompColor() { return byteBase.getInt32(16); } public final void set_fDoubleClickInWebView(int val) { byteBase.setInt32(20, val); } public final int get_fDoubleClickInWebView() { return byteBase.getInt32(20); } public final void set_fDesktopHTML(int val) { byteBase.setInt32(24, val); } public final int get_fDesktopHTML() { return byteBase.getInt32(24); } public final void set_fWin95Classic(int val) { byteBase.setInt32(28, val); } public final int get_fWin95Classic() { return byteBase.getInt32(28); } public final void set_fDontPrettyPath(int val) { byteBase.setInt32(32, val); } public final int get_fDontPrettyPath() { return byteBase.getInt32(32); } public final void set_fShowAttribCol(int val) { byteBase.setInt32(36, val); } public final int get_fShowAttribCol() { return byteBase.getInt32(36); } public final void set_fMapNetDrvBtn(int val) { byteBase.setInt32(40, val); } public final int get_fMapNetDrvBtn() { return byteBase.getInt32(40); } public final void set_fShowInfoTip(int val) { byteBase.setInt32(44, val); } public final int get_fShowInfoTip() { return byteBase.getInt32(44); } public final void set_fHideIcons(int val) { byteBase.setInt32(48, val); } public final int get_fHideIcons() { return byteBase.getInt32(48); } public final void set_fRestFlags(int val) { byteBase.setInt32(52, val); } public final int get_fRestFlags() { return byteBase.getInt32(52); } @Override public int size() { return sizeof; } } public final SHELLFLAGSTATE createSHELLFLAGSTATE(boolean direct) { return new SHELLFLAGSTATE(direct); } public final SHELLFLAGSTATE createSHELLFLAGSTATE(VoidPointer base) { return new SHELLFLAGSTATE(base); } public final SHELLFLAGSTATE createSHELLFLAGSTATE(long addr) { return new SHELLFLAGSTATE(addr); } public final native long ImmAssociateContext(long param_0, long param_1); public final native long ImmGetContext(long param_0); public final native int GetPixel(long param_0, int param_1, int param_2); public final native long GetDC(long hWnd); public final native int GetBkMode(long param_0); public final native long GetStockObject(int param_0); public final native int ValidateRgn(long hWnd, long hRgn); public final native void keybd_event(byte bVk, byte bScan, int dwFlags, long dwExtraInfo); public final int DrawThemeBackground(VoidPointer hTheme, long hdc, int iPartId, int iStateId, Win32.RECT pRect, Win32.RECT pClipRect) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); long tmp_1 = pRect == null ? 0 : pRect.longLockPointer(); long tmp_2 = pClipRect == null ? 0 : pClipRect.longLockPointer(); int tmp_ret = DrawThemeBackground(tmp_0, hdc, iPartId, iStateId, tmp_1, tmp_2); if (hTheme != null) { hTheme.unlock(); } if (pRect != null) { pRect.unlock(); } if (pClipRect != null) { pClipRect.unlock(); } return tmp_ret; } public final native int DrawThemeBackground(long hTheme, long hdc, int iPartId, int iStateId, long pRect, long pClipRect); public final int GetMonitorInfoW(long hMonitor, MONITORINFO lpmi) { long tmp_0 = lpmi == null ? 0 : lpmi.longLockPointer(); int tmp_ret = GetMonitorInfoW(hMonitor, tmp_0); if (lpmi != null) { lpmi.unlock(); } return tmp_ret; } public final native int GetMonitorInfoW(long hMonitor, long lpmi); public static class MONITORINFO extends CommonStructWrapper { public static final int sizeof = 40; MONITORINFO(boolean direct) { super(sizeof, direct); } MONITORINFO(VoidPointer base) { super(base); } MONITORINFO(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final Win32.RECT get_rcMonitor() { return Win32.instance.createRECT(getElementPointer(4)); } public final Win32.RECT get_rcWork() { return Win32.instance.createRECT(getElementPointer(20)); } public final void set_dwFlags(int val) { byteBase.setInt32(36, val); } public final int get_dwFlags() { return byteBase.getInt32(36); } @Override public int size() { return sizeof; } } public final MONITORINFO createMONITORINFO(boolean direct) { return new MONITORINFO(direct); } public final MONITORINFO createMONITORINFO(VoidPointer base) { return new MONITORINFO(base); } public final MONITORINFO createMONITORINFO(long addr) { return new MONITORINFO(addr); } public final native int GetCurrentThreadId(); public final native int DeleteDC(long param_0); public final long SHGetFileInfoW(String pszPath, int dwFileAttributes, SHFILEINFOW psfi, int cbFileInfo, int uFlags) { Int16Pointer _pszPath = null == pszPath? null : nb.createInt16Pointer(pszPath, false); long tmp_0 = _pszPath == null ? 0 : _pszPath.longLockPointer(); long tmp_1 = psfi == null ? 0 : psfi.longLockPointer(); long tmp_ret = SHGetFileInfoW(tmp_0, dwFileAttributes, tmp_1, cbFileInfo, uFlags); if (_pszPath != null) { _pszPath.unlock(); _pszPath.free(); } if (psfi != null) { psfi.unlock(); } return tmp_ret; } public final long SHGetFileInfoW(Int16Pointer pszPath, int dwFileAttributes, SHFILEINFOW psfi, int cbFileInfo, int uFlags) { long tmp_0 = pszPath == null ? 0 : pszPath.longLockPointer(); long tmp_1 = psfi == null ? 0 : psfi.longLockPointer(); long tmp_ret = SHGetFileInfoW(tmp_0, dwFileAttributes, tmp_1, cbFileInfo, uFlags); if (pszPath != null) { pszPath.unlock(); } if (psfi != null) { psfi.unlock(); } return tmp_ret; } public final native long SHGetFileInfoW(long pszPath, int dwFileAttributes, long psfi, int cbFileInfo, int uFlags); public static class SHFILEINFOW extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 696 : 692; SHFILEINFOW(boolean direct) { super(sizeof, direct); } SHFILEINFOW(VoidPointer base) { super(base); } SHFILEINFOW(long addr) { super(addr); } public final void set_hIcon(long val) { byteBase.setAddress(0, val); } public final long get_hIcon() { return byteBase.getAddress(0); } public final void set_iIcon(int val) { byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val); } public final int get_iIcon() { return byteBase.getInt32(NativeBridge.is64 ? 8 : 4); } public final void set_dwAttributes(int val) { byteBase.setInt32(NativeBridge.is64 ? 12 : 8, val); } public final int get_dwAttributes() { return byteBase.getInt32(NativeBridge.is64 ? 12 : 8); } public final Int16Pointer get_szDisplayName() { return nb.createInt16Pointer(getElementPointer(NativeBridge.is64 ? 16 : 12)); } public final Int16Pointer get_szTypeName() { return nb.createInt16Pointer(getElementPointer(NativeBridge.is64 ? 536 : 532)); } @Override public int size() { return sizeof; } } public final SHFILEINFOW createSHFILEINFOW(boolean direct) { return new SHFILEINFOW(direct); } public final SHFILEINFOW createSHFILEINFOW(VoidPointer base) { return new SHFILEINFOW(base); } public final SHFILEINFOW createSHFILEINFOW(long addr) { return new SHFILEINFOW(addr); } public final long DispatchMessageW(Win32.MSG lpMsg) { long tmp_0 = lpMsg == null ? 0 : lpMsg.longLockPointer(); long tmp_ret = DispatchMessageW(tmp_0); if (lpMsg != null) { lpMsg.unlock(); } return tmp_ret; } public final native long DispatchMessageW(long lpMsg); public final native int PostThreadMessageW(int idThread, int Msg, long wParam, long lParam); public final native int GetSysColor(int nIndex); public final native long GetSystemMenu(long hWnd, int bRevert); public final int SetPixelFormat(long param_0, int param_1, PIXELFORMATDESCRIPTOR param_2) { long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = SetPixelFormat(param_0, param_1, tmp_0); if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int SetPixelFormat(long param_0, int param_1, long param_2); public static class PIXELFORMATDESCRIPTOR extends CommonStructWrapper { public static final int sizeof = 40; PIXELFORMATDESCRIPTOR(boolean direct) { super(sizeof, direct); } PIXELFORMATDESCRIPTOR(VoidPointer base) { super(base); } PIXELFORMATDESCRIPTOR(long addr) { super(addr); } public final void set_nSize(short val) { byteBase.setInt16(0, val); } public final short get_nSize() { return byteBase.getInt16(0); } public final void set_nVersion(short val) { byteBase.setInt16(2, val); } public final short get_nVersion() { return byteBase.getInt16(2); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_iPixelType(byte val) { byteBase.set(8, val); } public final byte get_iPixelType() { return byteBase.get(8); } public final void set_cColorBits(byte val) { byteBase.set(9, val); } public final byte get_cColorBits() { return byteBase.get(9); } public final void set_cRedBits(byte val) { byteBase.set(10, val); } public final byte get_cRedBits() { return byteBase.get(10); } public final void set_cRedShift(byte val) { byteBase.set(11, val); } public final byte get_cRedShift() { return byteBase.get(11); } public final void set_cGreenBits(byte val) { byteBase.set(12, val); } public final byte get_cGreenBits() { return byteBase.get(12); } public final void set_cGreenShift(byte val) { byteBase.set(13, val); } public final byte get_cGreenShift() { return byteBase.get(13); } public final void set_cBlueBits(byte val) { byteBase.set(14, val); } public final byte get_cBlueBits() { return byteBase.get(14); } public final void set_cBlueShift(byte val) { byteBase.set(15, val); } public final byte get_cBlueShift() { return byteBase.get(15); } public final void set_cAlphaBits(byte val) { byteBase.set(16, val); } public final byte get_cAlphaBits() { return byteBase.get(16); } public final void set_cAlphaShift(byte val) { byteBase.set(17, val); } public final byte get_cAlphaShift() { return byteBase.get(17); } public final void set_cAccumBits(byte val) { byteBase.set(18, val); } public final byte get_cAccumBits() { return byteBase.get(18); } public final void set_cAccumRedBits(byte val) { byteBase.set(19, val); } public final byte get_cAccumRedBits() { return byteBase.get(19); } public final void set_cAccumGreenBits(byte val) { byteBase.set(20, val); } public final byte get_cAccumGreenBits() { return byteBase.get(20); } public final void set_cAccumBlueBits(byte val) { byteBase.set(21, val); } public final byte get_cAccumBlueBits() { return byteBase.get(21); } public final void set_cAccumAlphaBits(byte val) { byteBase.set(22, val); } public final byte get_cAccumAlphaBits() { return byteBase.get(22); } public final void set_cDepthBits(byte val) { byteBase.set(23, val); } public final byte get_cDepthBits() { return byteBase.get(23); } public final void set_cStencilBits(byte val) { byteBase.set(24, val); } public final byte get_cStencilBits() { return byteBase.get(24); } public final void set_cAuxBuffers(byte val) { byteBase.set(25, val); } public final byte get_cAuxBuffers() { return byteBase.get(25); } public final void set_iLayerType(byte val) { byteBase.set(26, val); } public final byte get_iLayerType() { return byteBase.get(26); } public final void set_bReserved(byte val) { byteBase.set(27, val); } public final byte get_bReserved() { return byteBase.get(27); } public final void set_dwLayerMask(int val) { byteBase.setInt32(28, val); } public final int get_dwLayerMask() { return byteBase.getInt32(28); } public final void set_dwVisibleMask(int val) { byteBase.setInt32(32, val); } public final int get_dwVisibleMask() { return byteBase.getInt32(32); } public final void set_dwDamageMask(int val) { byteBase.setInt32(36, val); } public final int get_dwDamageMask() { return byteBase.getInt32(36); } @Override public int size() { return sizeof; } } public final PIXELFORMATDESCRIPTOR createPIXELFORMATDESCRIPTOR(boolean direct) { return new PIXELFORMATDESCRIPTOR(direct); } public final PIXELFORMATDESCRIPTOR createPIXELFORMATDESCRIPTOR(VoidPointer base) { return new PIXELFORMATDESCRIPTOR(base); } public final PIXELFORMATDESCRIPTOR createPIXELFORMATDESCRIPTOR(long addr) { return new PIXELFORMATDESCRIPTOR(addr); } public final int GetCursorPos(Win32.POINT lpPoint) { long tmp_0 = lpPoint == null ? 0 : lpPoint.longLockPointer(); int tmp_ret = GetCursorPos(tmp_0); if (lpPoint != null) { lpPoint.unlock(); } return tmp_ret; } public final native int GetCursorPos(long lpPoint); public final native int PatBlt(long param_0, int param_1, int param_2, int param_3, int param_4, int param_5); public final native long SetCursor(long hCursor); public final int AppendMenuW(long hMenu, int uFlags, long uIDNewItem, String lpNewItem) { Int16Pointer _lpNewItem = null == lpNewItem? null : nb.createInt16Pointer(lpNewItem, false); long tmp_0 = _lpNewItem == null ? 0 : _lpNewItem.longLockPointer(); int tmp_ret = AppendMenuW(hMenu, uFlags, uIDNewItem, tmp_0); if (_lpNewItem != null) { _lpNewItem.unlock(); _lpNewItem.free(); } return tmp_ret; } public final int AppendMenuW(long hMenu, int uFlags, long uIDNewItem, Int16Pointer lpNewItem) { long tmp_0 = lpNewItem == null ? 0 : lpNewItem.longLockPointer(); int tmp_ret = AppendMenuW(hMenu, uFlags, uIDNewItem, tmp_0); if (lpNewItem != null) { lpNewItem.unlock(); } return tmp_ret; } public final native int AppendMenuW(long hMenu, int uFlags, long uIDNewItem, long lpNewItem); public final int SetWindowPlacement(long hWnd, WINDOWPLACEMENT lpwndpl) { long tmp_0 = lpwndpl == null ? 0 : lpwndpl.longLockPointer(); int tmp_ret = SetWindowPlacement(hWnd, tmp_0); if (lpwndpl != null) { lpwndpl.unlock(); } return tmp_ret; } public final native int SetWindowPlacement(long hWnd, long lpwndpl); public static class WINDOWPLACEMENT extends CommonStructWrapper { public static final int sizeof = 44; WINDOWPLACEMENT(boolean direct) { super(sizeof, direct); } WINDOWPLACEMENT(VoidPointer base) { super(base); } WINDOWPLACEMENT(long addr) { super(addr); } public final void set_length(int val) { byteBase.setInt32(0, val); } public final int get_length() { return byteBase.getInt32(0); } public final void set_flags(int val) { byteBase.setInt32(4, val); } public final int get_flags() { return byteBase.getInt32(4); } public final void set_showCmd(int val) { byteBase.setInt32(8, val); } public final int get_showCmd() { return byteBase.getInt32(8); } public final Win32.POINT get_ptMinPosition() { return Win32.instance.createPOINT(getElementPointer(12)); } public final Win32.POINT get_ptMaxPosition() { return Win32.instance.createPOINT(getElementPointer(20)); } public final Win32.RECT get_rcNormalPosition() { return Win32.instance.createRECT(getElementPointer(28)); } @Override public int size() { return sizeof; } } public final WINDOWPLACEMENT createWINDOWPLACEMENT(boolean direct) { return new WINDOWPLACEMENT(direct); } public final WINDOWPLACEMENT createWINDOWPLACEMENT(VoidPointer base) { return new WINDOWPLACEMENT(base); } public final WINDOWPLACEMENT createWINDOWPLACEMENT(long addr) { return new WINDOWPLACEMENT(addr); } public final native long ActivateKeyboardLayout(long hkl, int Flags); public final native int CommDlgExtendedError(); public final int GlobalUnlock(VoidPointer hMem) { long tmp_0 = hMem == null ? 0 : hMem.longLockPointer(); int tmp_ret = GlobalUnlock(tmp_0); if (hMem != null) { hMem.unlock(); } return tmp_ret; } public final native int GlobalUnlock(long hMem); public final native int SetROP2(long param_0, int param_1); public final int SHBindToParent(ITEMIDLIST pidl, GUID riid, PointerPointer ppv, PointerPointer ppidlLast) { long tmp_0 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppv == null ? 0 : ppv.longLockPointer(); long tmp_3 = ppidlLast == null ? 0 : ppidlLast.longLockPointer(); int tmp_ret = SHBindToParent(tmp_0, tmp_1, tmp_2, tmp_3); if (pidl != null) { pidl.unlock(); } if (riid != null) { riid.unlock(); } if (ppv != null) { ppv.unlock(); } if (ppidlLast != null) { ppidlLast.unlock(); } return tmp_ret; } public final native int SHBindToParent(long pidl, long riid, long ppv, long ppidlLast); public static class GUID extends CommonStructWrapper { public static final int sizeof = 16; GUID(boolean direct) { super(sizeof, direct); } GUID(VoidPointer base) { super(base); } GUID(long addr) { super(addr); } public final void set_Data1(int val) { byteBase.setInt32(0, val); } public final int get_Data1() { return byteBase.getInt32(0); } public final void set_Data2(short val) { byteBase.setInt16(4, val); } public final short get_Data2() { return byteBase.getInt16(4); } public final void set_Data3(short val) { byteBase.setInt16(6, val); } public final short get_Data3() { return byteBase.getInt16(6); } public final Int8Pointer get_Data4() { return nb.createInt8Pointer(getElementPointer(8)); } @Override public int size() { return sizeof; } } public final GUID createGUID(boolean direct) { return new GUID(direct); } public final GUID createGUID(VoidPointer base) { return new GUID(base); } public final GUID createGUID(long addr) { return new GUID(addr); } public static class ITEMIDLIST extends CommonStructWrapper { public static final int sizeof = 4; ITEMIDLIST(boolean direct) { super(sizeof, direct); } ITEMIDLIST(VoidPointer base) { super(base); } ITEMIDLIST(long addr) { super(addr); } public final SHITEMID get_mkid() { return instance.createSHITEMID(getElementPointer(0)); } @Override public int size() { return sizeof; } } public final ITEMIDLIST createITEMIDLIST(boolean direct) { return new ITEMIDLIST(direct); } public final ITEMIDLIST createITEMIDLIST(VoidPointer base) { return new ITEMIDLIST(base); } public final ITEMIDLIST createITEMIDLIST(long addr) { return new ITEMIDLIST(addr); } public static class SHITEMID extends CommonStructWrapper { public static final int sizeof = 4; SHITEMID(boolean direct) { super(sizeof, direct); } SHITEMID(VoidPointer base) { super(base); } SHITEMID(long addr) { super(addr); } public final void set_cb(short val) { byteBase.setInt16(0, val); } public final short get_cb() { return byteBase.getInt16(0); } public final Int8Pointer get_abID() { return nb.createInt8Pointer(getElementPointer(2)); } @Override public int size() { return sizeof; } } public final SHITEMID createSHITEMID(boolean direct) { return new SHITEMID(direct); } public final SHITEMID createSHITEMID(VoidPointer base) { return new SHITEMID(base); } public final SHITEMID createSHITEMID(long addr) { return new SHITEMID(addr); } public final int InSendMessageEx(VoidPointer lpReserved) { long tmp_0 = lpReserved == null ? 0 : lpReserved.longLockPointer(); int tmp_ret = InSendMessageEx(tmp_0); if (lpReserved != null) { lpReserved.unlock(); } return tmp_ret; } public final native int InSendMessageEx(long lpReserved); public final int GetLocaleInfoW(int Locale, int LCType, Int16Pointer lpLCData, int cchData) { long tmp_0 = lpLCData == null ? 0 : lpLCData.longLockPointer(); int tmp_ret = GetLocaleInfoW(Locale, LCType, tmp_0, cchData); if (lpLCData != null) { lpLCData.unlock(); } return tmp_ret; } public final native int GetLocaleInfoW(int Locale, int LCType, long lpLCData, int cchData); public final int SHGetDataFromIDListW(IShellFolder psf, Win32.ITEMIDLIST pidl, int nFormat, VoidPointer pv, int cb) { long tmp_0 = psf == null ? 0 : psf.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pv == null ? 0 : pv.longLockPointer(); int tmp_ret = SHGetDataFromIDListW(tmp_0, tmp_1, nFormat, tmp_2, cb); if (psf != null) { psf.unlock(); } if (pidl != null) { pidl.unlock(); } if (pv != null) { pv.unlock(); } return tmp_ret; } public final native int SHGetDataFromIDListW(long psf, long pidl, int nFormat, long pv, int cb); public static class IShellFolder extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IShellFolderVtbl vtbl; IShellFolder(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IShellFolderVtbl get_lpVtbl() { return instance.createIShellFolderVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObject) { return vtbl.QueryInterface(this, riid, ppvObject); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int ParseDisplayName(long hwnd, IBindCtx pbc, Int16Pointer pszDisplayName, Int32Pointer pchEaten, PointerPointer ppidl, Int32Pointer pdwAttributes) { return vtbl.ParseDisplayName(this, hwnd, pbc, pszDisplayName, pchEaten, ppidl, pdwAttributes); } public final int EnumObjects(long hwnd, int grfFlags, PointerPointer ppenumIDList) { return vtbl.EnumObjects(this, hwnd, grfFlags, ppenumIDList); } public final int BindToObject(Win32.ITEMIDLIST pidl, IBindCtx pbc, Win32.GUID riid, PointerPointer ppv) { return vtbl.BindToObject(this, pidl, pbc, riid, ppv); } public final int BindToStorage(Win32.ITEMIDLIST pidl, IBindCtx pbc, Win32.GUID riid, PointerPointer ppv) { return vtbl.BindToStorage(this, pidl, pbc, riid, ppv); } public final int CompareIDs(long lParam, Win32.ITEMIDLIST pidl1, Win32.ITEMIDLIST pidl2) { return vtbl.CompareIDs(this, lParam, pidl1, pidl2); } public final int CreateViewObject(long hwndOwner, Win32.GUID riid, PointerPointer ppv) { return vtbl.CreateViewObject(this, hwndOwner, riid, ppv); } public final int GetAttributesOf(int cidl, PointerPointer apidl, Int32Pointer rgfInOut) { return vtbl.GetAttributesOf(this, cidl, apidl, rgfInOut); } public final int GetUIObjectOf(long hwndOwner, int cidl, PointerPointer apidl, Win32.GUID riid, Int32Pointer rgfReserved, PointerPointer ppv) { return vtbl.GetUIObjectOf(this, hwndOwner, cidl, apidl, riid, rgfReserved, ppv); } public final int GetDisplayNameOf(Win32.ITEMIDLIST pidl, int uFlags, STRRET pName) { return vtbl.GetDisplayNameOf(this, pidl, uFlags, pName); } public final int SetNameOf(long hwnd, Win32.ITEMIDLIST pidl, String pszName, int uFlags, PointerPointer ppidlOut) { return vtbl.SetNameOf(this, hwnd, pidl, pszName, uFlags, ppidlOut); } public final int SetNameOf(long hwnd, Win32.ITEMIDLIST pidl, Int16Pointer pszName, int uFlags, PointerPointer ppidlOut) { return vtbl.SetNameOf(this, hwnd, pidl, pszName, uFlags, ppidlOut); } @Override public int size() { return sizeof; } } public final IShellFolder createIShellFolder(long addr) { return new IShellFolder(addr); } public static class STRRET extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 272 : 264; STRRET(boolean direct) { super(sizeof, direct); } STRRET(VoidPointer base) { super(base); } STRRET(long addr) { super(addr); } public final void set_uType(int val) { byteBase.setInt32(0, val); } public final int get_uType() { return byteBase.getInt32(0); } public final void set_pOleStr(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 8 : 4, val); } public final Int16Pointer get_pOleStr() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 8 : 4)); } public final void set_uOffset(int val) { byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val); } public final int get_uOffset() { return byteBase.getInt32(NativeBridge.is64 ? 8 : 4); } public final Int8Pointer get_cStr() { return nb.createInt8Pointer(getElementPointer(NativeBridge.is64 ? 8 : 4)); } @Override public int size() { return sizeof; } } public final STRRET createSTRRET(boolean direct) { return new STRRET(direct); } public final STRRET createSTRRET(VoidPointer base) { return new STRRET(base); } public final STRRET createSTRRET(long addr) { return new STRRET(addr); } public static class IBindCtx extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IBindCtxVtbl vtbl; IBindCtx(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IBindCtxVtbl get_lpVtbl() { return instance.createIBindCtxVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObject) { return vtbl.QueryInterface(this, riid, ppvObject); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int RegisterObjectBound(IUnknown punk) { return vtbl.RegisterObjectBound(this, punk); } public final int RevokeObjectBound(IUnknown punk) { return vtbl.RevokeObjectBound(this, punk); } public final int ReleaseBoundObjects() { return vtbl.ReleaseBoundObjects(this); } public final int SetBindOptions(BIND_OPTS pbindopts) { return vtbl.SetBindOptions(this, pbindopts); } public final int GetBindOptions(BIND_OPTS pbindopts) { return vtbl.GetBindOptions(this, pbindopts); } public final int GetRunningObjectTable(PointerPointer pprot) { return vtbl.GetRunningObjectTable(this, pprot); } public final int RegisterObjectParam(Int16Pointer pszKey, IUnknown punk) { return vtbl.RegisterObjectParam(this, pszKey, punk); } public final int GetObjectParam(Int16Pointer pszKey, PointerPointer ppunk) { return vtbl.GetObjectParam(this, pszKey, ppunk); } public final int EnumObjectParam(PointerPointer ppenum) { return vtbl.EnumObjectParam(this, ppenum); } public final int RevokeObjectParam(Int16Pointer pszKey) { return vtbl.RevokeObjectParam(this, pszKey); } @Override public int size() { return sizeof; } } public final IBindCtx createIBindCtx(long addr) { return new IBindCtx(addr); } public static class IShellFolderVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 104 : 52; IShellFolderVtbl(boolean direct) { super(sizeof, direct); } IShellFolderVtbl(VoidPointer base) { super(base); } IShellFolderVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IShellFolder This, Win32.GUID riid, PointerPointer ppvObject) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObject == null ? 0 : ppvObject.longLockPointer(); int tmp_ret = instance.proxycall1(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObject != null) { ppvObject.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IShellFolder This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall2(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IShellFolder This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall3(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_ParseDisplayName(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_ParseDisplayName() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int ParseDisplayName(Win32.IShellFolder This, long hwnd, Win32.IBindCtx pbc, Int16Pointer pszDisplayName, Int32Pointer pchEaten, PointerPointer ppidl, Int32Pointer pdwAttributes) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pbc == null ? 0 : pbc.longLockPointer(); long tmp_2 = pszDisplayName == null ? 0 : pszDisplayName.longLockPointer(); long tmp_3 = pchEaten == null ? 0 : pchEaten.longLockPointer(); long tmp_4 = ppidl == null ? 0 : ppidl.longLockPointer(); long tmp_5 = pdwAttributes == null ? 0 : pdwAttributes.longLockPointer(); int tmp_ret = instance.proxycall4(get_ParseDisplayName(), tmp_0, hwnd, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5); if (This != null) { This.unlock(); } if (pbc != null) { pbc.unlock(); } if (pszDisplayName != null) { pszDisplayName.unlock(); } if (pchEaten != null) { pchEaten.unlock(); } if (ppidl != null) { ppidl.unlock(); } if (pdwAttributes != null) { pdwAttributes.unlock(); } return tmp_ret; } public final void set_EnumObjects(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_EnumObjects() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int EnumObjects(Win32.IShellFolder This, long hwnd, int grfFlags, PointerPointer ppenumIDList) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = ppenumIDList == null ? 0 : ppenumIDList.longLockPointer(); int tmp_ret = instance.proxycall5(get_EnumObjects(), tmp_0, hwnd, grfFlags, tmp_1); if (This != null) { This.unlock(); } if (ppenumIDList != null) { ppenumIDList.unlock(); } return tmp_ret; } public final void set_BindToObject(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_BindToObject() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int BindToObject(Win32.IShellFolder This, Win32.ITEMIDLIST pidl, Win32.IBindCtx pbc, Win32.GUID riid, PointerPointer ppv) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pbc == null ? 0 : pbc.longLockPointer(); long tmp_3 = riid == null ? 0 : riid.longLockPointer(); long tmp_4 = ppv == null ? 0 : ppv.longLockPointer(); int tmp_ret = instance.proxycall6(get_BindToObject(), tmp_0, tmp_1, tmp_2, tmp_3, tmp_4); if (This != null) { This.unlock(); } if (pidl != null) { pidl.unlock(); } if (pbc != null) { pbc.unlock(); } if (riid != null) { riid.unlock(); } if (ppv != null) { ppv.unlock(); } return tmp_ret; } public final void set_BindToStorage(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_BindToStorage() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int BindToStorage(Win32.IShellFolder This, Win32.ITEMIDLIST pidl, Win32.IBindCtx pbc, Win32.GUID riid, PointerPointer ppv) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pbc == null ? 0 : pbc.longLockPointer(); long tmp_3 = riid == null ? 0 : riid.longLockPointer(); long tmp_4 = ppv == null ? 0 : ppv.longLockPointer(); int tmp_ret = instance.proxycall7(get_BindToStorage(), tmp_0, tmp_1, tmp_2, tmp_3, tmp_4); if (This != null) { This.unlock(); } if (pidl != null) { pidl.unlock(); } if (pbc != null) { pbc.unlock(); } if (riid != null) { riid.unlock(); } if (ppv != null) { ppv.unlock(); } return tmp_ret; } public final void set_CompareIDs(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_CompareIDs() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int CompareIDs(Win32.IShellFolder This, long lParam, Win32.ITEMIDLIST pidl1, Win32.ITEMIDLIST pidl2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl1 == null ? 0 : pidl1.longLockPointer(); long tmp_2 = pidl2 == null ? 0 : pidl2.longLockPointer(); int tmp_ret = instance.proxycall8(get_CompareIDs(), tmp_0, lParam, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (pidl1 != null) { pidl1.unlock(); } if (pidl2 != null) { pidl2.unlock(); } return tmp_ret; } public final void set_CreateViewObject(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_CreateViewObject() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int CreateViewObject(Win32.IShellFolder This, long hwndOwner, Win32.GUID riid, PointerPointer ppv) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppv == null ? 0 : ppv.longLockPointer(); int tmp_ret = instance.proxycall9(get_CreateViewObject(), tmp_0, hwndOwner, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppv != null) { ppv.unlock(); } return tmp_ret; } public final void set_GetAttributesOf(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_GetAttributesOf() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int GetAttributesOf(Win32.IShellFolder This, int cidl, PointerPointer apidl, Int32Pointer rgfInOut) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = apidl == null ? 0 : apidl.longLockPointer(); long tmp_2 = rgfInOut == null ? 0 : rgfInOut.longLockPointer(); int tmp_ret = instance.proxycall10(get_GetAttributesOf(), tmp_0, cidl, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (apidl != null) { apidl.unlock(); } if (rgfInOut != null) { rgfInOut.unlock(); } return tmp_ret; } public final void set_GetUIObjectOf(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_GetUIObjectOf() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int GetUIObjectOf(Win32.IShellFolder This, long hwndOwner, int cidl, PointerPointer apidl, Win32.GUID riid, Int32Pointer rgfReserved, PointerPointer ppv) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = apidl == null ? 0 : apidl.longLockPointer(); long tmp_2 = riid == null ? 0 : riid.longLockPointer(); long tmp_3 = rgfReserved == null ? 0 : rgfReserved.longLockPointer(); long tmp_4 = ppv == null ? 0 : ppv.longLockPointer(); int tmp_ret = instance.proxycall11(get_GetUIObjectOf(), tmp_0, hwndOwner, cidl, tmp_1, tmp_2, tmp_3, tmp_4); if (This != null) { This.unlock(); } if (apidl != null) { apidl.unlock(); } if (riid != null) { riid.unlock(); } if (rgfReserved != null) { rgfReserved.unlock(); } if (ppv != null) { ppv.unlock(); } return tmp_ret; } public final void set_GetDisplayNameOf(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_GetDisplayNameOf() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int GetDisplayNameOf(Win32.IShellFolder This, Win32.ITEMIDLIST pidl, int uFlags, Win32.STRRET pName) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pName == null ? 0 : pName.longLockPointer(); int tmp_ret = instance.proxycall12(get_GetDisplayNameOf(), tmp_0, tmp_1, uFlags, tmp_2); if (This != null) { This.unlock(); } if (pidl != null) { pidl.unlock(); } if (pName != null) { pName.unlock(); } return tmp_ret; } public final void set_SetNameOf(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_SetNameOf() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int SetNameOf(Win32.IShellFolder This, long hwnd, Win32.ITEMIDLIST pidl, String pszName, int uFlags, PointerPointer ppidlOut) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); Int16Pointer _pszName = null == pszName? null : nb.createInt16Pointer(pszName, false); long tmp_2 = _pszName == null ? 0 : _pszName.longLockPointer(); long tmp_3 = ppidlOut == null ? 0 : ppidlOut.longLockPointer(); int tmp_ret = instance.proxycall13(get_SetNameOf(), tmp_0, hwnd, tmp_1, tmp_2, uFlags, tmp_3); if (This != null) { This.unlock(); } if (pidl != null) { pidl.unlock(); } if (_pszName != null) { _pszName.unlock(); _pszName.free(); } if (ppidlOut != null) { ppidlOut.unlock(); } return tmp_ret; } public final int SetNameOf(Win32.IShellFolder This, long hwnd, Win32.ITEMIDLIST pidl, Int16Pointer pszName, int uFlags, PointerPointer ppidlOut) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pszName == null ? 0 : pszName.longLockPointer(); long tmp_3 = ppidlOut == null ? 0 : ppidlOut.longLockPointer(); int tmp_ret = instance.proxycall13(get_SetNameOf(), tmp_0, hwnd, tmp_1, tmp_2, uFlags, tmp_3); if (This != null) { This.unlock(); } if (pidl != null) { pidl.unlock(); } if (pszName != null) { pszName.unlock(); } if (ppidlOut != null) { ppidlOut.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IShellFolderVtbl createIShellFolderVtbl(boolean direct) { return new IShellFolderVtbl(direct); } public final IShellFolderVtbl createIShellFolderVtbl(VoidPointer base) { return new IShellFolderVtbl(base); } public final IShellFolderVtbl createIShellFolderVtbl(long addr) { return new IShellFolderVtbl(addr); } public static class IUnknown extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IUnknownVtbl vtbl; IUnknown(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IUnknownVtbl get_lpVtbl() { return instance.createIUnknownVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObject) { return vtbl.QueryInterface(this, riid, ppvObject); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } @Override public int size() { return sizeof; } } public final IUnknown createIUnknown(long addr) { return new IUnknown(addr); } public static class BIND_OPTS extends CommonStructWrapper { public static final int sizeof = 16; BIND_OPTS(boolean direct) { super(sizeof, direct); } BIND_OPTS(VoidPointer base) { super(base); } BIND_OPTS(long addr) { super(addr); } public final void set_cbStruct(int val) { byteBase.setInt32(0, val); } public final int get_cbStruct() { return byteBase.getInt32(0); } public final void set_grfFlags(int val) { byteBase.setInt32(4, val); } public final int get_grfFlags() { return byteBase.getInt32(4); } public final void set_grfMode(int val) { byteBase.setInt32(8, val); } public final int get_grfMode() { return byteBase.getInt32(8); } public final void set_dwTickCountDeadline(int val) { byteBase.setInt32(12, val); } public final int get_dwTickCountDeadline() { return byteBase.getInt32(12); } @Override public int size() { return sizeof; } } public final BIND_OPTS createBIND_OPTS(boolean direct) { return new BIND_OPTS(direct); } public final BIND_OPTS createBIND_OPTS(VoidPointer base) { return new BIND_OPTS(base); } public final BIND_OPTS createBIND_OPTS(long addr) { return new BIND_OPTS(addr); } public static class IBindCtxVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 104 : 52; IBindCtxVtbl(boolean direct) { super(sizeof, direct); } IBindCtxVtbl(VoidPointer base) { super(base); } IBindCtxVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IBindCtx This, Win32.GUID riid, PointerPointer ppvObject) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObject == null ? 0 : ppvObject.longLockPointer(); int tmp_ret = instance.proxycall14(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObject != null) { ppvObject.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IBindCtx This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall15(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IBindCtx This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall16(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_RegisterObjectBound(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_RegisterObjectBound() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int RegisterObjectBound(Win32.IBindCtx This, Win32.IUnknown punk) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = punk == null ? 0 : punk.longLockPointer(); int tmp_ret = instance.proxycall17(get_RegisterObjectBound(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (punk != null) { punk.unlock(); } return tmp_ret; } public final void set_RevokeObjectBound(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_RevokeObjectBound() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int RevokeObjectBound(Win32.IBindCtx This, Win32.IUnknown punk) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = punk == null ? 0 : punk.longLockPointer(); int tmp_ret = instance.proxycall18(get_RevokeObjectBound(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (punk != null) { punk.unlock(); } return tmp_ret; } public final void set_ReleaseBoundObjects(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_ReleaseBoundObjects() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int ReleaseBoundObjects(Win32.IBindCtx This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall19(get_ReleaseBoundObjects(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetBindOptions(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_SetBindOptions() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int SetBindOptions(Win32.IBindCtx This, Win32.BIND_OPTS pbindopts) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pbindopts == null ? 0 : pbindopts.longLockPointer(); int tmp_ret = instance.proxycall20(get_SetBindOptions(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (pbindopts != null) { pbindopts.unlock(); } return tmp_ret; } public final void set_GetBindOptions(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_GetBindOptions() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int GetBindOptions(Win32.IBindCtx This, Win32.BIND_OPTS pbindopts) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pbindopts == null ? 0 : pbindopts.longLockPointer(); int tmp_ret = instance.proxycall21(get_GetBindOptions(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (pbindopts != null) { pbindopts.unlock(); } return tmp_ret; } public final void set_GetRunningObjectTable(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_GetRunningObjectTable() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int GetRunningObjectTable(Win32.IBindCtx This, PointerPointer pprot) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pprot == null ? 0 : pprot.longLockPointer(); int tmp_ret = instance.proxycall22(get_GetRunningObjectTable(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (pprot != null) { pprot.unlock(); } return tmp_ret; } public final void set_RegisterObjectParam(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_RegisterObjectParam() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int RegisterObjectParam(Win32.IBindCtx This, Int16Pointer pszKey, Win32.IUnknown punk) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pszKey == null ? 0 : pszKey.longLockPointer(); long tmp_2 = punk == null ? 0 : punk.longLockPointer(); int tmp_ret = instance.proxycall23(get_RegisterObjectParam(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (pszKey != null) { pszKey.unlock(); } if (punk != null) { punk.unlock(); } return tmp_ret; } public final void set_GetObjectParam(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_GetObjectParam() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int GetObjectParam(Win32.IBindCtx This, Int16Pointer pszKey, PointerPointer ppunk) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pszKey == null ? 0 : pszKey.longLockPointer(); long tmp_2 = ppunk == null ? 0 : ppunk.longLockPointer(); int tmp_ret = instance.proxycall24(get_GetObjectParam(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (pszKey != null) { pszKey.unlock(); } if (ppunk != null) { ppunk.unlock(); } return tmp_ret; } public final void set_EnumObjectParam(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_EnumObjectParam() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int EnumObjectParam(Win32.IBindCtx This, PointerPointer ppenum) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = ppenum == null ? 0 : ppenum.longLockPointer(); int tmp_ret = instance.proxycall25(get_EnumObjectParam(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (ppenum != null) { ppenum.unlock(); } return tmp_ret; } public final void set_RevokeObjectParam(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_RevokeObjectParam() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int RevokeObjectParam(Win32.IBindCtx This, Int16Pointer pszKey) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = pszKey == null ? 0 : pszKey.longLockPointer(); int tmp_ret = instance.proxycall26(get_RevokeObjectParam(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (pszKey != null) { pszKey.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IBindCtxVtbl createIBindCtxVtbl(boolean direct) { return new IBindCtxVtbl(direct); } public final IBindCtxVtbl createIBindCtxVtbl(VoidPointer base) { return new IBindCtxVtbl(base); } public final IBindCtxVtbl createIBindCtxVtbl(long addr) { return new IBindCtxVtbl(addr); } public static class IUnknownVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 24 : 12; IUnknownVtbl(boolean direct) { super(sizeof, direct); } IUnknownVtbl(VoidPointer base) { super(base); } IUnknownVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IUnknown This, Win32.GUID riid, PointerPointer ppvObject) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObject == null ? 0 : ppvObject.longLockPointer(); int tmp_ret = instance.proxycall27(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObject != null) { ppvObject.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IUnknown This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall28(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IUnknown This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall29(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IUnknownVtbl createIUnknownVtbl(boolean direct) { return new IUnknownVtbl(direct); } public final IUnknownVtbl createIUnknownVtbl(VoidPointer base) { return new IUnknownVtbl(base); } public final IUnknownVtbl createIUnknownVtbl(long addr) { return new IUnknownVtbl(addr); } final native int proxycall1(long fnptr, long This, long riid, long ppvObject); final native int proxycall2(long fnptr, long This); final native int proxycall3(long fnptr, long This); final native int proxycall4(long fnptr, long This, long hwnd, long pbc, long pszDisplayName, long pchEaten, long ppidl, long pdwAttributes); final native int proxycall5(long fnptr, long This, long hwnd, int grfFlags, long ppenumIDList); final native int proxycall6(long fnptr, long This, long pidl, long pbc, long riid, long ppv); final native int proxycall7(long fnptr, long This, long pidl, long pbc, long riid, long ppv); final native int proxycall8(long fnptr, long This, long lParam, long pidl1, long pidl2); final native int proxycall9(long fnptr, long This, long hwndOwner, long riid, long ppv); final native int proxycall10(long fnptr, long This, int cidl, long apidl, long rgfInOut); final native int proxycall11(long fnptr, long This, long hwndOwner, int cidl, long apidl, long riid, long rgfReserved, long ppv); final native int proxycall12(long fnptr, long This, long pidl, int uFlags, long pName); final native int proxycall13(long fnptr, long This, long hwnd, long pidl, long pszName, int uFlags, long ppidlOut); final native int proxycall14(long fnptr, long This, long riid, long ppvObject); final native int proxycall15(long fnptr, long This); final native int proxycall16(long fnptr, long This); final native int proxycall17(long fnptr, long This, long punk); final native int proxycall18(long fnptr, long This, long punk); final native int proxycall19(long fnptr, long This); final native int proxycall20(long fnptr, long This, long pbindopts); final native int proxycall21(long fnptr, long This, long pbindopts); final native int proxycall22(long fnptr, long This, long pprot); final native int proxycall23(long fnptr, long This, long pszKey, long punk); final native int proxycall24(long fnptr, long This, long pszKey, long ppunk); final native int proxycall25(long fnptr, long This, long ppenum); final native int proxycall26(long fnptr, long This, long pszKey); final native int proxycall27(long fnptr, long This, long riid, long ppvObject); final native int proxycall28(long fnptr, long This); final native int proxycall29(long fnptr, long This); public final int ScreenToClient(long hWnd, Win32.POINT lpPoint) { long tmp_0 = lpPoint == null ? 0 : lpPoint.longLockPointer(); int tmp_ret = ScreenToClient(hWnd, tmp_0); if (lpPoint != null) { lpPoint.unlock(); } return tmp_ret; } public final native int ScreenToClient(long hWnd, long lpPoint); public final native long GetParent(long hWnd); public final native long SetFocus(long hWnd); public final int DescribePixelFormat(long param_0, int param_1, int param_2, Win32.PIXELFORMATDESCRIPTOR param_3) { long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = DescribePixelFormat(param_0, param_1, param_2, tmp_0); if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final native int DescribePixelFormat(long param_0, int param_1, int param_2, long param_3); public final native int SetTextColor(long param_0, int param_1); public final native long MonitorFromWindow(long hwnd, int dwFlags); public final int GetDIBits(long param_0, long param_1, int param_2, int param_3, VoidPointer param_4, BITMAPINFO param_5, int param_6) { long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer(); long tmp_1 = param_5 == null ? 0 : param_5.longLockPointer(); int tmp_ret = GetDIBits(param_0, param_1, param_2, param_3, tmp_0, tmp_1, param_6); if (param_4 != null) { param_4.unlock(); } if (param_5 != null) { param_5.unlock(); } return tmp_ret; } public final native int GetDIBits(long param_0, long param_1, int param_2, int param_3, long param_4, long param_5, int param_6); public static class BITMAPINFO extends CommonStructWrapper { public static final int sizeof = 44; BITMAPINFO(boolean direct) { super(sizeof, direct); } BITMAPINFO(VoidPointer base) { super(base); } BITMAPINFO(long addr) { super(addr); } public final BITMAPINFOHEADER get_bmiHeader() { return instance.createBITMAPINFOHEADER(getElementPointer(0)); } public final Int8Pointer get_bmiColors() { return nb.createInt8Pointer(getElementPointer(40)); } @Override public int size() { return sizeof; } } public final BITMAPINFO createBITMAPINFO(boolean direct) { return new BITMAPINFO(direct); } public final BITMAPINFO createBITMAPINFO(VoidPointer base) { return new BITMAPINFO(base); } public final BITMAPINFO createBITMAPINFO(long addr) { return new BITMAPINFO(addr); } public static class BITMAPINFOHEADER extends CommonStructWrapper { public static final int sizeof = 40; BITMAPINFOHEADER(boolean direct) { super(sizeof, direct); } BITMAPINFOHEADER(VoidPointer base) { super(base); } BITMAPINFOHEADER(long addr) { super(addr); } public final void set_biSize(int val) { byteBase.setInt32(0, val); } public final int get_biSize() { return byteBase.getInt32(0); } public final void set_biWidth(int val) { byteBase.setInt32(4, val); } public final int get_biWidth() { return byteBase.getInt32(4); } public final void set_biHeight(int val) { byteBase.setInt32(8, val); } public final int get_biHeight() { return byteBase.getInt32(8); } public final void set_biPlanes(short val) { byteBase.setInt16(12, val); } public final short get_biPlanes() { return byteBase.getInt16(12); } public final void set_biBitCount(short val) { byteBase.setInt16(14, val); } public final short get_biBitCount() { return byteBase.getInt16(14); } public final void set_biCompression(int val) { byteBase.setInt32(16, val); } public final int get_biCompression() { return byteBase.getInt32(16); } public final void set_biSizeImage(int val) { byteBase.setInt32(20, val); } public final int get_biSizeImage() { return byteBase.getInt32(20); } public final void set_biXPelsPerMeter(int val) { byteBase.setInt32(24, val); } public final int get_biXPelsPerMeter() { return byteBase.getInt32(24); } public final void set_biYPelsPerMeter(int val) { byteBase.setInt32(28, val); } public final int get_biYPelsPerMeter() { return byteBase.getInt32(28); } public final void set_biClrUsed(int val) { byteBase.setInt32(32, val); } public final int get_biClrUsed() { return byteBase.getInt32(32); } public final void set_biClrImportant(int val) { byteBase.setInt32(36, val); } public final int get_biClrImportant() { return byteBase.getInt32(36); } @Override public int size() { return sizeof; } } public final BITMAPINFOHEADER createBITMAPINFOHEADER(boolean direct) { return new BITMAPINFOHEADER(direct); } public final BITMAPINFOHEADER createBITMAPINFOHEADER(VoidPointer base) { return new BITMAPINFOHEADER(base); } public final BITMAPINFOHEADER createBITMAPINFOHEADER(long addr) { return new BITMAPINFOHEADER(addr); } public final int FormatMessageW(int dwFlags, VoidPointer lpSource, int dwMessageId, int dwLanguageId, Int16Pointer lpBuffer, int nSize, PointerPointer Arguments) { long tmp_0 = lpSource == null ? 0 : lpSource.longLockPointer(); long tmp_1 = lpBuffer == null ? 0 : lpBuffer.longLockPointer(); long tmp_2 = Arguments == null ? 0 : Arguments.longLockPointer(); int tmp_ret = FormatMessageW(dwFlags, tmp_0, dwMessageId, dwLanguageId, tmp_1, nSize, tmp_2); if (lpSource != null) { lpSource.unlock(); } if (lpBuffer != null) { lpBuffer.unlock(); } if (Arguments != null) { Arguments.unlock(); } return tmp_ret; } public final native int FormatMessageW(int dwFlags, long lpSource, int dwMessageId, int dwLanguageId, long lpBuffer, int nSize, long Arguments); public final int SHGetDesktopFolder(PointerPointer ppshf) { long tmp_0 = ppshf == null ? 0 : ppshf.longLockPointer(); int tmp_ret = SHGetDesktopFolder(tmp_0); if (ppshf != null) { ppshf.unlock(); } return tmp_ret; } public final native int SHGetDesktopFolder(long ppshf); public final int ImmSetCompositionWindow(long param_0, COMPOSITIONFORM param_1) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = ImmSetCompositionWindow(param_0, tmp_0); if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final native int ImmSetCompositionWindow(long param_0, long param_1); public static class COMPOSITIONFORM extends CommonStructWrapper { public static final int sizeof = 28; COMPOSITIONFORM(boolean direct) { super(sizeof, direct); } COMPOSITIONFORM(VoidPointer base) { super(base); } COMPOSITIONFORM(long addr) { super(addr); } public final void set_dwStyle(int val) { byteBase.setInt32(0, val); } public final int get_dwStyle() { return byteBase.getInt32(0); } public final Win32.POINT get_ptCurrentPos() { return Win32.instance.createPOINT(getElementPointer(4)); } public final Win32.RECT get_rcArea() { return Win32.instance.createRECT(getElementPointer(12)); } @Override public int size() { return sizeof; } } public final COMPOSITIONFORM createCOMPOSITIONFORM(boolean direct) { return new COMPOSITIONFORM(direct); } public final COMPOSITIONFORM createCOMPOSITIONFORM(VoidPointer base) { return new COMPOSITIONFORM(base); } public final COMPOSITIONFORM createCOMPOSITIONFORM(long addr) { return new COMPOSITIONFORM(addr); } public final int SendInput(int cInputs, INPUT pInputs, int cbSize) { long tmp_0 = pInputs == null ? 0 : pInputs.longLockPointer(); int tmp_ret = SendInput(cInputs, tmp_0, cbSize); if (pInputs != null) { pInputs.unlock(); } return tmp_ret; } public final native int SendInput(int cInputs, long pInputs, int cbSize); public static class INPUT extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 40 : 28; INPUT(boolean direct) { super(sizeof, direct); } INPUT(VoidPointer base) { super(base); } INPUT(long addr) { super(addr); } public final void set_type(int val) { byteBase.setInt32(0, val); } public final int get_type() { return byteBase.getInt32(0); } public final MOUSEINPUT get_mi() { return instance.createMOUSEINPUT(getElementPointer(NativeBridge.is64 ? 8 : 4)); } public final KEYBDINPUT get_ki() { return instance.createKEYBDINPUT(getElementPointer(NativeBridge.is64 ? 8 : 4)); } public final HARDWAREINPUT get_hi() { return instance.createHARDWAREINPUT(getElementPointer(NativeBridge.is64 ? 8 : 4)); } @Override public int size() { return sizeof; } } public final INPUT createINPUT(boolean direct) { return new INPUT(direct); } public final INPUT createINPUT(VoidPointer base) { return new INPUT(base); } public final INPUT createINPUT(long addr) { return new INPUT(addr); } public static class MOUSEINPUT extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 32 : 24; MOUSEINPUT(boolean direct) { super(sizeof, direct); } MOUSEINPUT(VoidPointer base) { super(base); } MOUSEINPUT(long addr) { super(addr); } public final void set_dx(int val) { byteBase.setInt32(0, val); } public final int get_dx() { return byteBase.getInt32(0); } public final void set_dy(int val) { byteBase.setInt32(4, val); } public final int get_dy() { return byteBase.getInt32(4); } public final void set_mouseData(int val) { byteBase.setInt32(8, val); } public final int get_mouseData() { return byteBase.getInt32(8); } public final void set_dwFlags(int val) { byteBase.setInt32(12, val); } public final int get_dwFlags() { return byteBase.getInt32(12); } public final void set_time(int val) { byteBase.setInt32(16, val); } public final int get_time() { return byteBase.getInt32(16); } public final void set_dwExtraInfo(long val) { byteBase.setCLong(NativeBridge.is64 ? 24 : 20, val); } public final long get_dwExtraInfo() { return byteBase.getCLong(NativeBridge.is64 ? 24 : 20); } @Override public int size() { return sizeof; } } public final MOUSEINPUT createMOUSEINPUT(boolean direct) { return new MOUSEINPUT(direct); } public final MOUSEINPUT createMOUSEINPUT(VoidPointer base) { return new MOUSEINPUT(base); } public final MOUSEINPUT createMOUSEINPUT(long addr) { return new MOUSEINPUT(addr); } public static class HARDWAREINPUT extends CommonStructWrapper { public static final int sizeof = 8; HARDWAREINPUT(boolean direct) { super(sizeof, direct); } HARDWAREINPUT(VoidPointer base) { super(base); } HARDWAREINPUT(long addr) { super(addr); } public final void set_uMsg(int val) { byteBase.setInt32(0, val); } public final int get_uMsg() { return byteBase.getInt32(0); } public final void set_wParamL(short val) { byteBase.setInt16(4, val); } public final short get_wParamL() { return byteBase.getInt16(4); } public final void set_wParamH(short val) { byteBase.setInt16(6, val); } public final short get_wParamH() { return byteBase.getInt16(6); } @Override public int size() { return sizeof; } } public final HARDWAREINPUT createHARDWAREINPUT(boolean direct) { return new HARDWAREINPUT(direct); } public final HARDWAREINPUT createHARDWAREINPUT(VoidPointer base) { return new HARDWAREINPUT(base); } public final HARDWAREINPUT createHARDWAREINPUT(long addr) { return new HARDWAREINPUT(addr); } public static class KEYBDINPUT extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 24 : 16; KEYBDINPUT(boolean direct) { super(sizeof, direct); } KEYBDINPUT(VoidPointer base) { super(base); } KEYBDINPUT(long addr) { super(addr); } public final void set_wVk(short val) { byteBase.setInt16(0, val); } public final short get_wVk() { return byteBase.getInt16(0); } public final void set_wScan(short val) { byteBase.setInt16(2, val); } public final short get_wScan() { return byteBase.getInt16(2); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_time(int val) { byteBase.setInt32(8, val); } public final int get_time() { return byteBase.getInt32(8); } public final void set_dwExtraInfo(long val) { byteBase.setCLong(NativeBridge.is64 ? 16 : 12, val); } public final long get_dwExtraInfo() { return byteBase.getCLong(NativeBridge.is64 ? 16 : 12); } @Override public int size() { return sizeof; } } public final KEYBDINPUT createKEYBDINPUT(boolean direct) { return new KEYBDINPUT(direct); } public final KEYBDINPUT createKEYBDINPUT(VoidPointer base) { return new KEYBDINPUT(base); } public final KEYBDINPUT createKEYBDINPUT(long addr) { return new KEYBDINPUT(addr); } public final int DeleteObject(VoidPointer param_0) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); int tmp_ret = DeleteObject(tmp_0); if (param_0 != null) { param_0.unlock(); } return tmp_ret; } public final native int DeleteObject(long param_0); public final native int ImmIsIME(long param_0); public final short RegisterClassExW(WNDCLASSEXW param_0) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); short tmp_ret = RegisterClassExW(tmp_0); if (param_0 != null) { param_0.unlock(); } return tmp_ret; } public final native short RegisterClassExW(long param_0); public static class WNDCLASSEXW extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 80 : 48; WNDCLASSEXW(boolean direct) { super(sizeof, direct); } WNDCLASSEXW(VoidPointer base) { super(base); } WNDCLASSEXW(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final void set_style(int val) { byteBase.setInt32(4, val); } public final int get_style() { return byteBase.getInt32(4); } public final void set_lpfnWndProc(long val) { byteBase.setAddress(8, val); } public final long get_lpfnWndProc() { return byteBase.getAddress(8); } public final long WNDPROC(long param_0, int param_1, long param_2, long param_3) { long tmp_ret = instance.proxycall30(get_lpfnWndProc(), param_0, param_1, param_2, param_3); return tmp_ret; } public final void set_cbClsExtra(int val) { byteBase.setInt32(NativeBridge.is64 ? 16 : 12, val); } public final int get_cbClsExtra() { return byteBase.getInt32(NativeBridge.is64 ? 16 : 12); } public final void set_cbWndExtra(int val) { byteBase.setInt32(NativeBridge.is64 ? 20 : 16, val); } public final int get_cbWndExtra() { return byteBase.getInt32(NativeBridge.is64 ? 20 : 16); } public final void set_hInstance(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 20, val); } public final long get_hInstance() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 20); } public final void set_hIcon(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 24, val); } public final long get_hIcon() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 24); } public final void set_hCursor(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 28, val); } public final long get_hCursor() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 28); } public final void set_hbrBackground(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 32, val); } public final long get_hbrBackground() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 32); } public final void set_lpszMenuName(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 56 : 36, val); } public final Int16Pointer get_lpszMenuName() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 56 : 36)); } public final void set_lpszClassName(Int16Pointer val) { byteBase.setPointer(NativeBridge.is64 ? 64 : 40, val); } public final Int16Pointer get_lpszClassName() { return nb.createInt16Pointer(byteBase.getAddress(NativeBridge.is64 ? 64 : 40)); } public final void set_hIconSm(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 44, val); } public final long get_hIconSm() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 44); } @Override public int size() { return sizeof; } } public final WNDCLASSEXW createWNDCLASSEXW(boolean direct) { return new WNDCLASSEXW(direct); } public final WNDCLASSEXW createWNDCLASSEXW(VoidPointer base) { return new WNDCLASSEXW(base); } public final WNDCLASSEXW createWNDCLASSEXW(long addr) { return new WNDCLASSEXW(addr); } final native long proxycall30(long fnptr, long param_0, int param_1, long param_2, long param_3); public final native long GetWindowDC(long hWnd); public final int RegisterClipboardFormatW(String lpszFormat) { Int16Pointer _lpszFormat = null == lpszFormat? null : nb.createInt16Pointer(lpszFormat, false); long tmp_0 = _lpszFormat == null ? 0 : _lpszFormat.longLockPointer(); int tmp_ret = RegisterClipboardFormatW(tmp_0); if (_lpszFormat != null) { _lpszFormat.unlock(); _lpszFormat.free(); } return tmp_ret; } public final int RegisterClipboardFormatW(Int16Pointer lpszFormat) { long tmp_0 = lpszFormat == null ? 0 : lpszFormat.longLockPointer(); int tmp_ret = RegisterClipboardFormatW(tmp_0); if (lpszFormat != null) { lpszFormat.unlock(); } return tmp_ret; } public final native int RegisterClipboardFormatW(long lpszFormat); public final native int EnumClipboardFormats(int format); public final native long GetFocus(); public final native long CreateRectRgn(int param_0, int param_1, int param_2, int param_3); public final native int DestroyCursor(long hCursor); public final int GetCurrentThemeName(Int16Pointer pszThemeFileName, int cchMaxNameChars, Int16Pointer pszColorBuff, int cchMaxColorChars, Int16Pointer pszSizeBuff, int cchMaxSizeChars) { long tmp_0 = pszThemeFileName == null ? 0 : pszThemeFileName.longLockPointer(); long tmp_1 = pszColorBuff == null ? 0 : pszColorBuff.longLockPointer(); long tmp_2 = pszSizeBuff == null ? 0 : pszSizeBuff.longLockPointer(); int tmp_ret = GetCurrentThemeName(tmp_0, cchMaxNameChars, tmp_1, cchMaxColorChars, tmp_2, cchMaxSizeChars); if (pszThemeFileName != null) { pszThemeFileName.unlock(); } if (pszColorBuff != null) { pszColorBuff.unlock(); } if (pszSizeBuff != null) { pszSizeBuff.unlock(); } return tmp_ret; } public final native int GetCurrentThemeName(long pszThemeFileName, int cchMaxNameChars, long pszColorBuff, int cchMaxColorChars, long pszSizeBuff, int cchMaxSizeChars); public final native long GetClipboardData(int uFormat); public final int MoveToEx(long param_0, int param_1, int param_2, Win32.POINT param_3) { long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = MoveToEx(param_0, param_1, param_2, tmp_0); if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final native int MoveToEx(long param_0, int param_1, int param_2, long param_3); public final native int ImmNotifyIME(long param_0, int dwAction, int dwIndex, int dwValue); public final long WindowFromPoint(Win32.POINT Point) { long tmp_0 = Point == null ? 0 : Point.longLockPointer(); long tmp_ret = WindowFromPoint(tmp_0); if (Point != null) { Point.unlock(); } return tmp_ret; } public final native long WindowFromPoint(long Point); public final native long SetCapture(long hWnd); public final native int DestroyCaret(); public final int SetWindowTextW(long hWnd, String lpString) { Int16Pointer _lpString = null == lpString? null : nb.createInt16Pointer(lpString, false); long tmp_0 = _lpString == null ? 0 : _lpString.longLockPointer(); int tmp_ret = SetWindowTextW(hWnd, tmp_0); if (_lpString != null) { _lpString.unlock(); _lpString.free(); } return tmp_ret; } public final int SetWindowTextW(long hWnd, Int16Pointer lpString) { long tmp_0 = lpString == null ? 0 : lpString.longLockPointer(); int tmp_ret = SetWindowTextW(hWnd, tmp_0); if (lpString != null) { lpString.unlock(); } return tmp_ret; } public final native int SetWindowTextW(long hWnd, long lpString); public final int DrawFocusRect(long hDC, Win32.RECT lprc) { long tmp_0 = lprc == null ? 0 : lprc.longLockPointer(); int tmp_ret = DrawFocusRect(hDC, tmp_0); if (lprc != null) { lprc.unlock(); } return tmp_ret; } public final native int DrawFocusRect(long hDC, long lprc); public final long CreateBrushIndirect(LOGBRUSH param_0) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); long tmp_ret = CreateBrushIndirect(tmp_0); if (param_0 != null) { param_0.unlock(); } return tmp_ret; } public final native long CreateBrushIndirect(long param_0); public static class LOGBRUSH extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 16 : 12; LOGBRUSH(boolean direct) { super(sizeof, direct); } LOGBRUSH(VoidPointer base) { super(base); } LOGBRUSH(long addr) { super(addr); } public final void set_lbStyle(int val) { byteBase.setInt32(0, val); } public final int get_lbStyle() { return byteBase.getInt32(0); } public final void set_lbColor(int val) { byteBase.setInt32(4, val); } public final int get_lbColor() { return byteBase.getInt32(4); } public final void set_lbHatch(long val) { byteBase.setCLong(8, val); } public final long get_lbHatch() { return byteBase.getCLong(8); } @Override public int size() { return sizeof; } } public final LOGBRUSH createLOGBRUSH(boolean direct) { return new LOGBRUSH(direct); } public final LOGBRUSH createLOGBRUSH(VoidPointer base) { return new LOGBRUSH(base); } public final LOGBRUSH createLOGBRUSH(long addr) { return new LOGBRUSH(addr); } public final native int MapVirtualKeyW(int uCode, int uMapType); public final int GetRgnBox(long param_0, Win32.RECT param_1) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = GetRgnBox(param_0, tmp_0); if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final native int GetRgnBox(long param_0, long param_1); public final native long GetActiveWindow(); public final int WideCharToMultiByte(int CodePage, int dwFlags, String lpWideCharStr, int cchWideChar, Int8Pointer lpMultiByteStr, int cbMultiByte, String lpDefaultChar, Int32Pointer lpUsedDefaultChar) { Int16Pointer _lpWideCharStr = null == lpWideCharStr? null : nb.createInt16Pointer(lpWideCharStr, false); long tmp_0 = _lpWideCharStr == null ? 0 : _lpWideCharStr.longLockPointer(); long tmp_1 = lpMultiByteStr == null ? 0 : lpMultiByteStr.longLockPointer(); Int8Pointer _lpDefaultChar = null == lpDefaultChar? null : nb.createInt8Pointer(lpDefaultChar, false); long tmp_2 = _lpDefaultChar == null ? 0 : _lpDefaultChar.longLockPointer(); long tmp_3 = lpUsedDefaultChar == null ? 0 : lpUsedDefaultChar.longLockPointer(); int tmp_ret = WideCharToMultiByte(CodePage, dwFlags, tmp_0, cchWideChar, tmp_1, cbMultiByte, tmp_2, tmp_3); if (_lpWideCharStr != null) { _lpWideCharStr.unlock(); _lpWideCharStr.free(); } if (lpMultiByteStr != null) { lpMultiByteStr.unlock(); } if (_lpDefaultChar != null) { _lpDefaultChar.unlock(); _lpDefaultChar.free(); } if (lpUsedDefaultChar != null) { lpUsedDefaultChar.unlock(); } return tmp_ret; } public final int WideCharToMultiByte(int CodePage, int dwFlags, Int16Pointer lpWideCharStr, int cchWideChar, Int8Pointer lpMultiByteStr, int cbMultiByte, Int8Pointer lpDefaultChar, Int32Pointer lpUsedDefaultChar) { long tmp_0 = lpWideCharStr == null ? 0 : lpWideCharStr.longLockPointer(); long tmp_1 = lpMultiByteStr == null ? 0 : lpMultiByteStr.longLockPointer(); long tmp_2 = lpDefaultChar == null ? 0 : lpDefaultChar.longLockPointer(); long tmp_3 = lpUsedDefaultChar == null ? 0 : lpUsedDefaultChar.longLockPointer(); int tmp_ret = WideCharToMultiByte(CodePage, dwFlags, tmp_0, cchWideChar, tmp_1, cbMultiByte, tmp_2, tmp_3); if (lpWideCharStr != null) { lpWideCharStr.unlock(); } if (lpMultiByteStr != null) { lpMultiByteStr.unlock(); } if (lpDefaultChar != null) { lpDefaultChar.unlock(); } if (lpUsedDefaultChar != null) { lpUsedDefaultChar.unlock(); } return tmp_ret; } public final native int WideCharToMultiByte(int CodePage, int dwFlags, long lpWideCharStr, int cchWideChar, long lpMultiByteStr, int cbMultiByte, long lpDefaultChar, long lpUsedDefaultChar); public final native int IsThemeActive(); public final int GetThemeSysColor(VoidPointer hTheme, int iColorId) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); int tmp_ret = GetThemeSysColor(tmp_0, iColorId); if (hTheme != null) { hTheme.unlock(); } return tmp_ret; } public final native int GetThemeSysColor(long hTheme, int iColorId); public final long GlobalSize(VoidPointer hMem) { long tmp_0 = hMem == null ? 0 : hMem.longLockPointer(); long tmp_ret = GlobalSize(tmp_0); if (hMem != null) { hMem.unlock(); } return tmp_ret; } public final native long GlobalSize(long hMem); public final native int FillRgn(long param_0, long param_1, long param_2); public final int DrawFrameControl(long param_0, Win32.RECT param_1, int param_2, int param_3) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = DrawFrameControl(param_0, tmp_0, param_2, param_3); if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final native int DrawFrameControl(long param_0, long param_1, int param_2, int param_3); public final native int EmptyClipboard(); public final native int DestroyWindow(long hWnd); public final int CloseThemeData(VoidPointer hTheme) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); int tmp_ret = CloseThemeData(tmp_0); if (hTheme != null) { hTheme.unlock(); } return tmp_ret; } public final native int CloseThemeData(long hTheme); public final int TextOutW(long param_0, int param_1, int param_2, String param_3, int param_4) { Int16Pointer _param_3 = null == param_3? null : nb.createInt16Pointer(param_3, false); long tmp_0 = _param_3 == null ? 0 : _param_3.longLockPointer(); int tmp_ret = TextOutW(param_0, param_1, param_2, tmp_0, param_4); if (_param_3 != null) { _param_3.unlock(); _param_3.free(); } return tmp_ret; } public final int TextOutW(long param_0, int param_1, int param_2, Int16Pointer param_3, int param_4) { long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = TextOutW(param_0, param_1, param_2, tmp_0, param_4); if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final native int TextOutW(long param_0, int param_1, int param_2, long param_3, int param_4); public final int GetCaretPos(Win32.POINT lpPoint) { long tmp_0 = lpPoint == null ? 0 : lpPoint.longLockPointer(); int tmp_ret = GetCaretPos(tmp_0); if (lpPoint != null) { lpPoint.unlock(); } return tmp_ret; } public final native int GetCaretPos(long lpPoint); public final int GetThemeSysSize(VoidPointer hTheme, int iSizeId) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); int tmp_ret = GetThemeSysSize(tmp_0, iSizeId); if (hTheme != null) { hTheme.unlock(); } return tmp_ret; } public final native int GetThemeSysSize(long hTheme, int iSizeId); public final native int SelectClipRgn(long param_0, long param_1); public final int SHGetFolderLocation(long hwnd, int csidl, VoidPointer hToken, int dwFlags, PointerPointer ppidl) { long tmp_0 = hToken == null ? 0 : hToken.longLockPointer(); long tmp_1 = ppidl == null ? 0 : ppidl.longLockPointer(); int tmp_ret = SHGetFolderLocation(hwnd, csidl, tmp_0, dwFlags, tmp_1); if (hToken != null) { hToken.unlock(); } if (ppidl != null) { ppidl.unlock(); } return tmp_ret; } public final native int SHGetFolderLocation(long hwnd, int csidl, long hToken, int dwFlags, long ppidl); public final native long ImmCreateContext(); public final int CLSIDFromString(Int16Pointer lpsz, Win32.GUID pclsid) { long tmp_0 = lpsz == null ? 0 : lpsz.longLockPointer(); long tmp_1 = pclsid == null ? 0 : pclsid.longLockPointer(); int tmp_ret = CLSIDFromString(tmp_0, tmp_1); if (lpsz != null) { lpsz.unlock(); } if (pclsid != null) { pclsid.unlock(); } return tmp_ret; } public final native int CLSIDFromString(long lpsz, long pclsid); public final int StrRetToBufW(Win32.STRRET pstr, Win32.ITEMIDLIST pidl, Int16Pointer pszBuf, int cchBuf) { long tmp_0 = pstr == null ? 0 : pstr.longLockPointer(); long tmp_1 = pidl == null ? 0 : pidl.longLockPointer(); long tmp_2 = pszBuf == null ? 0 : pszBuf.longLockPointer(); int tmp_ret = StrRetToBufW(tmp_0, tmp_1, tmp_2, cchBuf); if (pstr != null) { pstr.unlock(); } if (pidl != null) { pidl.unlock(); } if (pszBuf != null) { pszBuf.unlock(); } return tmp_ret; } public final native int StrRetToBufW(long pstr, long pidl, long pszBuf, int cchBuf); public final native int SetPolyFillMode(long param_0, int param_1); public final Int8Pointer LocalFree(VoidPointer hMem) { long tmp_0 = hMem == null ? 0 : hMem.longLockPointer(); long tmp_ret = LocalFree(tmp_0); if (hMem != null) { hMem.unlock(); } return nb.createInt8Pointer(tmp_ret); } public final native long LocalFree(long hMem); public final native long CreateCompatibleDC(long param_0); public final native long CreateCompatibleBitmap(long param_0, int param_1, int param_2); public final native long DefWindowProcW(long hWnd, int Msg, long wParam, long lParam); public final native int CloseClipboard(); public final native long SetActiveWindow(long hWnd); public final native int GetDeviceCaps(long param_0, int param_1); public final native long CreatePatternBrush(long param_0); public final native void mouse_event(int dwFlags, int dx, int dy, int dwData, long dwExtraInfo); public final int EnumDisplayDevicesW(String lpDevice, int iDevNum, DISPLAY_DEVICEW lpDisplayDevice, int dwFlags) { Int16Pointer _lpDevice = null == lpDevice? null : nb.createInt16Pointer(lpDevice, false); long tmp_0 = _lpDevice == null ? 0 : _lpDevice.longLockPointer(); long tmp_1 = lpDisplayDevice == null ? 0 : lpDisplayDevice.longLockPointer(); int tmp_ret = EnumDisplayDevicesW(tmp_0, iDevNum, tmp_1, dwFlags); if (_lpDevice != null) { _lpDevice.unlock(); _lpDevice.free(); } if (lpDisplayDevice != null) { lpDisplayDevice.unlock(); } return tmp_ret; } public final int EnumDisplayDevicesW(Int16Pointer lpDevice, int iDevNum, DISPLAY_DEVICEW lpDisplayDevice, int dwFlags) { long tmp_0 = lpDevice == null ? 0 : lpDevice.longLockPointer(); long tmp_1 = lpDisplayDevice == null ? 0 : lpDisplayDevice.longLockPointer(); int tmp_ret = EnumDisplayDevicesW(tmp_0, iDevNum, tmp_1, dwFlags); if (lpDevice != null) { lpDevice.unlock(); } if (lpDisplayDevice != null) { lpDisplayDevice.unlock(); } return tmp_ret; } public final native int EnumDisplayDevicesW(long lpDevice, int iDevNum, long lpDisplayDevice, int dwFlags); public static class DISPLAY_DEVICEW extends CommonStructWrapper { public static final int sizeof = 840; DISPLAY_DEVICEW(boolean direct) { super(sizeof, direct); } DISPLAY_DEVICEW(VoidPointer base) { super(base); } DISPLAY_DEVICEW(long addr) { super(addr); } public final void set_cb(int val) { byteBase.setInt32(0, val); } public final int get_cb() { return byteBase.getInt32(0); } public final Int16Pointer get_DeviceName() { return nb.createInt16Pointer(getElementPointer(4)); } public final Int16Pointer get_DeviceString() { return nb.createInt16Pointer(getElementPointer(68)); } public final void set_StateFlags(int val) { byteBase.setInt32(324, val); } public final int get_StateFlags() { return byteBase.getInt32(324); } public final Int16Pointer get_DeviceID() { return nb.createInt16Pointer(getElementPointer(328)); } public final Int16Pointer get_DeviceKey() { return nb.createInt16Pointer(getElementPointer(584)); } @Override public int size() { return sizeof; } } public final DISPLAY_DEVICEW createDISPLAY_DEVICEW(boolean direct) { return new DISPLAY_DEVICEW(direct); } public final DISPLAY_DEVICEW createDISPLAY_DEVICEW(VoidPointer base) { return new DISPLAY_DEVICEW(base); } public final DISPLAY_DEVICEW createDISPLAY_DEVICEW(long addr) { return new DISPLAY_DEVICEW(addr); } public final native int SetWindowLongW(long hWnd, int nIndex, int dwNewLong); public final int Polygon(long param_0, Win32.POINT param_1, int param_2) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = Polygon(param_0, tmp_0, param_2); if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final native int Polygon(long param_0, long param_1, int param_2); public final native int GetUpdateRgn(long hWnd, long hRgn, int bErase); public final native int Pie(long param_0, int param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8); public final native long GetClipboardOwner(); public final native int ShowWindow(long hWnd, int nCmdShow); public final int MapWindowPoints(long hWndFrom, long hWndTo, Win32.POINT lpPoints, int cPoints) { long tmp_0 = lpPoints == null ? 0 : lpPoints.longLockPointer(); int tmp_ret = MapWindowPoints(hWndFrom, hWndTo, tmp_0, cPoints); if (lpPoints != null) { lpPoints.unlock(); } return tmp_ret; } public final native int MapWindowPoints(long hWndFrom, long hWndTo, long lpPoints, int cPoints); public final int ChoosePixelFormat(long param_0, Win32.PIXELFORMATDESCRIPTOR param_1) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = ChoosePixelFormat(param_0, tmp_0); if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final native int ChoosePixelFormat(long param_0, long param_1); public final int PolyPolyline(long param_0, Win32.POINT param_1, Int32Pointer param_2, int param_3) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = PolyPolyline(param_0, tmp_0, tmp_1, param_3); if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int PolyPolyline(long param_0, long param_1, long param_2, int param_3); public final native int GetRandomRgn(long param_0, long param_1, int param_2); public final long ExtCreatePen(int param_0, int param_1, Win32.LOGBRUSH param_2, int param_3, Int32Pointer param_4) { long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_1 = param_4 == null ? 0 : param_4.longLockPointer(); long tmp_ret = ExtCreatePen(param_0, param_1, tmp_0, param_3, tmp_1); if (param_2 != null) { param_2.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final native long ExtCreatePen(int param_0, int param_1, long param_2, int param_3, long param_4); public final int ChangeDisplaySettingsExW(String lpszDeviceName, Win32.DEVMODEW lpDevMode, long hwnd, int dwflags, VoidPointer lParam) { Int16Pointer _lpszDeviceName = null == lpszDeviceName? null : nb.createInt16Pointer(lpszDeviceName, false); long tmp_0 = _lpszDeviceName == null ? 0 : _lpszDeviceName.longLockPointer(); long tmp_1 = lpDevMode == null ? 0 : lpDevMode.longLockPointer(); long tmp_2 = lParam == null ? 0 : lParam.longLockPointer(); int tmp_ret = ChangeDisplaySettingsExW(tmp_0, tmp_1, hwnd, dwflags, tmp_2); if (_lpszDeviceName != null) { _lpszDeviceName.unlock(); _lpszDeviceName.free(); } if (lpDevMode != null) { lpDevMode.unlock(); } if (lParam != null) { lParam.unlock(); } return tmp_ret; } public final int ChangeDisplaySettingsExW(Int16Pointer lpszDeviceName, Win32.DEVMODEW lpDevMode, long hwnd, int dwflags, VoidPointer lParam) { long tmp_0 = lpszDeviceName == null ? 0 : lpszDeviceName.longLockPointer(); long tmp_1 = lpDevMode == null ? 0 : lpDevMode.longLockPointer(); long tmp_2 = lParam == null ? 0 : lParam.longLockPointer(); int tmp_ret = ChangeDisplaySettingsExW(tmp_0, tmp_1, hwnd, dwflags, tmp_2); if (lpszDeviceName != null) { lpszDeviceName.unlock(); } if (lpDevMode != null) { lpDevMode.unlock(); } if (lParam != null) { lParam.unlock(); } return tmp_ret; } public final native int ChangeDisplaySettingsExW(long lpszDeviceName, long lpDevMode, long hwnd, int dwflags, long lParam); public final int GetRegionData(long param_0, int param_1, Win32.RGNDATA param_2) { long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = GetRegionData(param_0, param_1, tmp_0); if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int GetRegionData(long param_0, int param_1, long param_2); public final int InflateRect(Win32.RECT lprc, int dx, int dy) { long tmp_0 = lprc == null ? 0 : lprc.longLockPointer(); int tmp_ret = InflateRect(tmp_0, dx, dy); if (lprc != null) { lprc.unlock(); } return tmp_ret; } public final native int InflateRect(long lprc, int dx, int dy); public final native int SetBkColor(long param_0, int param_1); public final native long GetAncestor(long hwnd, int gaFlags); public final int GetThemeSysBool(VoidPointer hTheme, int iBoolId) { long tmp_0 = hTheme == null ? 0 : hTheme.longLockPointer(); int tmp_ret = GetThemeSysBool(tmp_0, iBoolId); if (hTheme != null) { hTheme.unlock(); } return tmp_ret; } public final native int GetThemeSysBool(long hTheme, int iBoolId); public final int TranslateMessage(Win32.MSG lpMsg) { long tmp_0 = lpMsg == null ? 0 : lpMsg.longLockPointer(); int tmp_ret = TranslateMessage(tmp_0); if (lpMsg != null) { lpMsg.unlock(); } return tmp_ret; } public final native int TranslateMessage(long lpMsg); public final native long CreateSolidBrush(int param_0); public final Int8Pointer OpenThemeData(long hwnd, String pszClassList) { Int16Pointer _pszClassList = null == pszClassList? null : nb.createInt16Pointer(pszClassList, false); long tmp_0 = _pszClassList == null ? 0 : _pszClassList.longLockPointer(); long tmp_ret = OpenThemeData(hwnd, tmp_0); if (_pszClassList != null) { _pszClassList.unlock(); _pszClassList.free(); } return nb.createInt8Pointer(tmp_ret); } public final Int8Pointer OpenThemeData(long hwnd, Int16Pointer pszClassList) { long tmp_0 = pszClassList == null ? 0 : pszClassList.longLockPointer(); long tmp_ret = OpenThemeData(hwnd, tmp_0); if (pszClassList != null) { pszClassList.unlock(); } return nb.createInt8Pointer(tmp_ret); } public final native long OpenThemeData(long hwnd, long pszClassList); public final int GetWindowPlacement(long hWnd, Win32.WINDOWPLACEMENT lpwndpl) { long tmp_0 = lpwndpl == null ? 0 : lpwndpl.longLockPointer(); int tmp_ret = GetWindowPlacement(hWnd, tmp_0); if (lpwndpl != null) { lpwndpl.unlock(); } return tmp_ret; } public final native int GetWindowPlacement(long hWnd, long lpwndpl); public final native int ReleaseCapture(); public final int MultiByteToWideChar(int CodePage, int dwFlags, String lpMultiByteStr, int cbMultiByte, Int16Pointer lpWideCharStr, int cchWideChar) { Int8Pointer _lpMultiByteStr = null == lpMultiByteStr? null : nb.createInt8Pointer(lpMultiByteStr, false); long tmp_0 = _lpMultiByteStr == null ? 0 : _lpMultiByteStr.longLockPointer(); long tmp_1 = lpWideCharStr == null ? 0 : lpWideCharStr.longLockPointer(); int tmp_ret = MultiByteToWideChar(CodePage, dwFlags, tmp_0, cbMultiByte, tmp_1, cchWideChar); if (_lpMultiByteStr != null) { _lpMultiByteStr.unlock(); _lpMultiByteStr.free(); } if (lpWideCharStr != null) { lpWideCharStr.unlock(); } return tmp_ret; } public final int MultiByteToWideChar(int CodePage, int dwFlags, Int8Pointer lpMultiByteStr, int cbMultiByte, Int16Pointer lpWideCharStr, int cchWideChar) { long tmp_0 = lpMultiByteStr == null ? 0 : lpMultiByteStr.longLockPointer(); long tmp_1 = lpWideCharStr == null ? 0 : lpWideCharStr.longLockPointer(); int tmp_ret = MultiByteToWideChar(CodePage, dwFlags, tmp_0, cbMultiByte, tmp_1, cchWideChar); if (lpMultiByteStr != null) { lpMultiByteStr.unlock(); } if (lpWideCharStr != null) { lpWideCharStr.unlock(); } return tmp_ret; } public final native int MultiByteToWideChar(int CodePage, int dwFlags, long lpMultiByteStr, int cbMultiByte, long lpWideCharStr, int cchWideChar); public final int PlaySoundW(String pszSound, long hmod, int fdwSound) { Int16Pointer _pszSound = null == pszSound? null : nb.createInt16Pointer(pszSound, false); long tmp_0 = _pszSound == null ? 0 : _pszSound.longLockPointer(); int tmp_ret = PlaySoundW(tmp_0, hmod, fdwSound); if (_pszSound != null) { _pszSound.unlock(); _pszSound.free(); } return tmp_ret; } public final int PlaySoundW(Int16Pointer pszSound, long hmod, int fdwSound) { long tmp_0 = pszSound == null ? 0 : pszSound.longLockPointer(); int tmp_ret = PlaySoundW(tmp_0, hmod, fdwSound); if (pszSound != null) { pszSound.unlock(); } return tmp_ret; } public final native int PlaySoundW(long pszSound, long hmod, int fdwSound); public final int GetObjectW(VoidPointer param_0, int param_1, VoidPointer param_2) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = GetObjectW(tmp_0, param_1, tmp_1); if (param_0 != null) { param_0.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final native int GetObjectW(long param_0, int param_1, long param_2); public final long LoadCursorW(long hInstance, String lpCursorName) { Int16Pointer _lpCursorName = null == lpCursorName? null : nb.createInt16Pointer(lpCursorName, false); long tmp_0 = _lpCursorName == null ? 0 : _lpCursorName.longLockPointer(); long tmp_ret = LoadCursorW(hInstance, tmp_0); if (_lpCursorName != null) { _lpCursorName.unlock(); _lpCursorName.free(); } return tmp_ret; } public final long LoadCursorW(long hInstance, Int16Pointer lpCursorName) { long tmp_0 = lpCursorName == null ? 0 : lpCursorName.longLockPointer(); long tmp_ret = LoadCursorW(hInstance, tmp_0); if (lpCursorName != null) { lpCursorName.unlock(); } return tmp_ret; } public final native long LoadCursorW(long hInstance, long lpCursorName); public final native int EnableTheming(int fEnable); public final native int IsIconic(long hWnd); public final native int EnableWindow(long hWnd, int bEnable); public final native int PostMessageW(long hWnd, int Msg, long wParam, long lParam); public final Int8Pointer GlobalLock(VoidPointer hMem) { long tmp_0 = hMem == null ? 0 : hMem.longLockPointer(); long tmp_ret = GlobalLock(tmp_0); if (hMem != null) { hMem.unlock(); } return nb.createInt8Pointer(tmp_ret); } public final native long GlobalLock(long hMem); public final native int ReleaseDC(long hWnd, long hDC); public final int GetKeyboardLayoutList(int nBuff, PointerPointer lpList) { long tmp_0 = lpList == null ? 0 : lpList.longLockPointer(); int tmp_ret = GetKeyboardLayoutList(nBuff, tmp_0); if (lpList != null) { lpList.unlock(); } return tmp_ret; } public final native int GetKeyboardLayoutList(int nBuff, long lpList); public final Int8Pointer SelectObject(long param_0, VoidPointer param_1) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_ret = SelectObject(param_0, tmp_0); if (param_1 != null) { param_1.unlock(); } return nb.createInt8Pointer(tmp_ret); } public final native long SelectObject(long param_0, long param_1); public final native long GetKeyboardLayout(int idThread); public final int GetWindowRect(long hWnd, Win32.RECT lpRect) { long tmp_0 = lpRect == null ? 0 : lpRect.longLockPointer(); int tmp_ret = GetWindowRect(hWnd, tmp_0); if (lpRect != null) { lpRect.unlock(); } return tmp_ret; } public final native int GetWindowRect(long hWnd, long lpRect); public final int DrawEdge(long hdc, Win32.RECT qrc, int edge, int grfFlags) { long tmp_0 = qrc == null ? 0 : qrc.longLockPointer(); int tmp_ret = DrawEdge(hdc, tmp_0, edge, grfFlags); if (qrc != null) { qrc.unlock(); } return tmp_ret; } public final native int DrawEdge(long hdc, long qrc, int edge, int grfFlags); public final int GetMessageW(Win32.MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax) { long tmp_0 = lpMsg == null ? 0 : lpMsg.longLockPointer(); int tmp_ret = GetMessageW(tmp_0, hWnd, wMsgFilterMin, wMsgFilterMax); if (lpMsg != null) { lpMsg.unlock(); } return tmp_ret; } public final native int GetMessageW(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax); public final native int GetPixelFormat(long param_0); public final Int8Pointer SetClipboardData(int uFormat, VoidPointer hMem) { long tmp_0 = hMem == null ? 0 : hMem.longLockPointer(); long tmp_ret = SetClipboardData(uFormat, tmp_0); if (hMem != null) { hMem.unlock(); } return nb.createInt8Pointer(tmp_ret); } public final native long SetClipboardData(int uFormat, long hMem); public final native int MulDiv(int nNumber, int nNumerator, int nDenominator); public final long CreateBitmap(int param_0, int param_1, int param_2, int param_3, VoidPointer param_4) { long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer(); long tmp_ret = CreateBitmap(param_0, param_1, param_2, param_3, tmp_0); if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final native long CreateBitmap(int param_0, int param_1, int param_2, int param_3, long param_4); public final int GetClipboardFormatNameW(int format, Int16Pointer lpszFormatName, int cchMaxCount) { long tmp_0 = lpszFormatName == null ? 0 : lpszFormatName.longLockPointer(); int tmp_ret = GetClipboardFormatNameW(format, tmp_0, cchMaxCount); if (lpszFormatName != null) { lpszFormatName.unlock(); } return tmp_ret; } public final native int GetClipboardFormatNameW(int format, long lpszFormatName, int cchMaxCount); public final native int SetWindowPos(long hWnd, long hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags); public final native int ImmSetOpenStatus(long param_0, int param_1); public final native int SetCaretPos(int X, int Y); public final int GetOpenFileNameW(Win32.OPENFILENAMEW param_0) { long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer(); int tmp_ret = GetOpenFileNameW(tmp_0); if (param_0 != null) { param_0.unlock(); } return tmp_ret; } public final native int GetOpenFileNameW(long param_0); public final long CreateDIBSection(long param_0, Win32.BITMAPINFO param_1, int param_2, PointerPointer param_3, VoidPointer param_4, int param_5) { long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer(); long tmp_ret = CreateDIBSection(param_0, tmp_0, param_2, tmp_1, tmp_2, param_5); if (param_1 != null) { param_1.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final native long CreateDIBSection(long param_0, long param_1, int param_2, long param_3, long param_4, int param_5); public final native int SetBkMode(long param_0, int param_1); public final native int Rectangle(long param_0, int param_1, int param_2, int param_3, int param_4); public final native int GetDoubleClickTime(); public final int GetClientRect(long hWnd, Win32.RECT lpRect) { long tmp_0 = lpRect == null ? 0 : lpRect.longLockPointer(); int tmp_ret = GetClientRect(hWnd, tmp_0); if (lpRect != null) { lpRect.unlock(); } return tmp_ret; } public final native int GetClientRect(long hWnd, long lpRect); public final native int UpdateWindow(long hWnd); public final native long GlobalAlloc(int uFlags, long dwBytes); public final native int ChangeClipboardChain(long hWndRemove, long hWndNewNext); public final native int OpenClipboard(long hWndNewOwner); public static class IDirectDraw7 extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDraw7Vtbl vtbl; IDirectDraw7(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IDirectDraw7Vtbl get_lpVtbl() { return instance.createIDirectDraw7Vtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObj) { return vtbl.QueryInterface(this, riid, ppvObj); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int Compact() { return vtbl.Compact(this); } public final int CreateClipper(int param_1, PointerPointer param_2, Win32.IUnknown param_3) { return vtbl.CreateClipper(this, param_1, param_2, param_3); } public final int CreatePalette(int param_1, PALETTEENTRY param_2, PointerPointer param_3, Win32.IUnknown param_4) { return vtbl.CreatePalette(this, param_1, param_2, param_3, param_4); } public final int CreateSurface(DDSURFACEDESC2 param_1, PointerPointer param_2, Win32.IUnknown param_3) { return vtbl.CreateSurface(this, param_1, param_2, param_3); } public final int DuplicateSurface(IDirectDrawSurface7 param_1, PointerPointer param_2) { return vtbl.DuplicateSurface(this, param_1, param_2); } public final int EnumDisplayModes(int param_1, DDSURFACEDESC2 param_2, VoidPointer param_3, long param_4) { return vtbl.EnumDisplayModes(this, param_1, param_2, param_3, param_4); } public final int EnumSurfaces(int param_1, DDSURFACEDESC2 param_2, VoidPointer param_3, long param_4) { return vtbl.EnumSurfaces(this, param_1, param_2, param_3, param_4); } public final int FlipToGDISurface() { return vtbl.FlipToGDISurface(this); } public final int GetCaps(DDCAPS_DX7 param_1, DDCAPS_DX7 param_2) { return vtbl.GetCaps(this, param_1, param_2); } public final int GetDisplayMode(DDSURFACEDESC2 param_1) { return vtbl.GetDisplayMode(this, param_1); } public final int GetFourCCCodes(Int32Pointer param_1, Int32Pointer param_2) { return vtbl.GetFourCCCodes(this, param_1, param_2); } public final int GetGDISurface(PointerPointer param_1) { return vtbl.GetGDISurface(this, param_1); } public final int GetMonitorFrequency(Int32Pointer param_1) { return vtbl.GetMonitorFrequency(this, param_1); } public final int GetScanLine(Int32Pointer param_1) { return vtbl.GetScanLine(this, param_1); } public final int GetVerticalBlankStatus(Int32Pointer param_1) { return vtbl.GetVerticalBlankStatus(this, param_1); } public final int Initialize(Win32.GUID param_1) { return vtbl.Initialize(this, param_1); } public final int RestoreDisplayMode() { return vtbl.RestoreDisplayMode(this); } public final int SetCooperativeLevel(long param_1, int param_2) { return vtbl.SetCooperativeLevel(this, param_1, param_2); } public final int SetDisplayMode(int param_1, int param_2, int param_3, int param_4, int param_5) { return vtbl.SetDisplayMode(this, param_1, param_2, param_3, param_4, param_5); } public final int WaitForVerticalBlank(int param_1, VoidPointer param_2) { return vtbl.WaitForVerticalBlank(this, param_1, param_2); } public final int GetAvailableVidMem(DDSCAPS2 param_1, Int32Pointer param_2, Int32Pointer param_3) { return vtbl.GetAvailableVidMem(this, param_1, param_2, param_3); } public final int GetSurfaceFromDC(long param_1, PointerPointer param_2) { return vtbl.GetSurfaceFromDC(this, param_1, param_2); } public final int RestoreAllSurfaces() { return vtbl.RestoreAllSurfaces(this); } public final int TestCooperativeLevel() { return vtbl.TestCooperativeLevel(this); } public final int GetDeviceIdentifier(DDDEVICEIDENTIFIER2 param_1, int param_2) { return vtbl.GetDeviceIdentifier(this, param_1, param_2); } public final int StartModeTest(SIZE param_1, int param_2, int param_3) { return vtbl.StartModeTest(this, param_1, param_2, param_3); } public final int EvaluateMode(int param_1, Int32Pointer param_2) { return vtbl.EvaluateMode(this, param_1, param_2); } @Override public int size() { return sizeof; } } public final IDirectDraw7 createIDirectDraw7(long addr) { return new IDirectDraw7(addr); } public static class IDirectDraw extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDrawVtbl vtbl; IDirectDraw(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IDirectDrawVtbl get_lpVtbl() { return instance.createIDirectDrawVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObj) { return vtbl.QueryInterface(this, riid, ppvObj); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int Compact() { return vtbl.Compact(this); } public final int CreateClipper(int param_1, PointerPointer param_2, Win32.IUnknown param_3) { return vtbl.CreateClipper(this, param_1, param_2, param_3); } public final int CreatePalette(int param_1, PALETTEENTRY param_2, PointerPointer param_3, Win32.IUnknown param_4) { return vtbl.CreatePalette(this, param_1, param_2, param_3, param_4); } public final int CreateSurface(DDSURFACEDESC param_1, PointerPointer param_2, Win32.IUnknown param_3) { return vtbl.CreateSurface(this, param_1, param_2, param_3); } public final int DuplicateSurface(IDirectDrawSurface param_1, PointerPointer param_2) { return vtbl.DuplicateSurface(this, param_1, param_2); } public final int EnumDisplayModes(int param_1, DDSURFACEDESC param_2, VoidPointer param_3, long param_4) { return vtbl.EnumDisplayModes(this, param_1, param_2, param_3, param_4); } public final int EnumSurfaces(int param_1, DDSURFACEDESC param_2, VoidPointer param_3, long param_4) { return vtbl.EnumSurfaces(this, param_1, param_2, param_3, param_4); } public final int FlipToGDISurface() { return vtbl.FlipToGDISurface(this); } public final int GetCaps(DDCAPS_DX7 param_1, DDCAPS_DX7 param_2) { return vtbl.GetCaps(this, param_1, param_2); } public final int GetDisplayMode(DDSURFACEDESC param_1) { return vtbl.GetDisplayMode(this, param_1); } public final int GetFourCCCodes(Int32Pointer param_1, Int32Pointer param_2) { return vtbl.GetFourCCCodes(this, param_1, param_2); } public final int GetGDISurface(PointerPointer param_1) { return vtbl.GetGDISurface(this, param_1); } public final int GetMonitorFrequency(Int32Pointer param_1) { return vtbl.GetMonitorFrequency(this, param_1); } public final int GetScanLine(Int32Pointer param_1) { return vtbl.GetScanLine(this, param_1); } public final int GetVerticalBlankStatus(Int32Pointer param_1) { return vtbl.GetVerticalBlankStatus(this, param_1); } public final int Initialize(Win32.GUID param_1) { return vtbl.Initialize(this, param_1); } public final int RestoreDisplayMode() { return vtbl.RestoreDisplayMode(this); } public final int SetCooperativeLevel(long param_1, int param_2) { return vtbl.SetCooperativeLevel(this, param_1, param_2); } public final int SetDisplayMode(int param_1, int param_2, int param_3) { return vtbl.SetDisplayMode(this, param_1, param_2, param_3); } public final int WaitForVerticalBlank(int param_1, VoidPointer param_2) { return vtbl.WaitForVerticalBlank(this, param_1, param_2); } @Override public int size() { return sizeof; } } public final IDirectDraw createIDirectDraw(long addr) { return new IDirectDraw(addr); } public static class IEnumIDList extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IEnumIDListVtbl vtbl; IEnumIDList(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IEnumIDListVtbl get_lpVtbl() { return instance.createIEnumIDListVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObject) { return vtbl.QueryInterface(this, riid, ppvObject); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int Next(int celt, PointerPointer rgelt, Int32Pointer pceltFetched) { return vtbl.Next(this, celt, rgelt, pceltFetched); } public final int Skip(int celt) { return vtbl.Skip(this, celt); } public final int Reset() { return vtbl.Reset(this); } public final int Clone(PointerPointer ppenum) { return vtbl.Clone(this, ppenum); } @Override public int size() { return sizeof; } } public final IEnumIDList createIEnumIDList(long addr) { return new IEnumIDList(addr); } public static class IDirectDrawClipper extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDrawClipperVtbl vtbl; IDirectDrawClipper(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IDirectDrawClipperVtbl get_lpVtbl() { return instance.createIDirectDrawClipperVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObj) { return vtbl.QueryInterface(this, riid, ppvObj); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int GetClipList(Win32.RECT param_1, Win32.RGNDATA param_2, Int32Pointer param_3) { return vtbl.GetClipList(this, param_1, param_2, param_3); } public final int GetHWnd(PointerPointer param_1) { return vtbl.GetHWnd(this, param_1); } public final int Initialize(Win32.IDirectDraw param_1, int param_2) { return vtbl.Initialize(this, param_1, param_2); } public final int IsClipListChanged(Int32Pointer param_1) { return vtbl.IsClipListChanged(this, param_1); } public final int SetClipList(Win32.RGNDATA param_1, int param_2) { return vtbl.SetClipList(this, param_1, param_2); } public final int SetHWnd(int param_1, long param_2) { return vtbl.SetHWnd(this, param_1, param_2); } @Override public int size() { return sizeof; } } public final IDirectDrawClipper createIDirectDrawClipper(long addr) { return new IDirectDrawClipper(addr); } public static class IDirectDrawPalette extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDrawPaletteVtbl vtbl; IDirectDrawPalette(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IDirectDrawPaletteVtbl get_lpVtbl() { return instance.createIDirectDrawPaletteVtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObj) { return vtbl.QueryInterface(this, riid, ppvObj); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int GetCaps(Int32Pointer param_1) { return vtbl.GetCaps(this, param_1); } public final int GetEntries(int param_1, int param_2, int param_3, PALETTEENTRY param_4) { return vtbl.GetEntries(this, param_1, param_2, param_3, param_4); } public final int Initialize(Win32.IDirectDraw param_1, int param_2, PALETTEENTRY param_3) { return vtbl.Initialize(this, param_1, param_2, param_3); } public final int SetEntries(int param_1, int param_2, int param_3, PALETTEENTRY param_4) { return vtbl.SetEntries(this, param_1, param_2, param_3, param_4); } @Override public int size() { return sizeof; } } public final IDirectDrawPalette createIDirectDrawPalette(long addr) { return new IDirectDrawPalette(addr); } public static class IDirectDrawPaletteVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 56 : 28; IDirectDrawPaletteVtbl(boolean direct) { super(sizeof, direct); } IDirectDrawPaletteVtbl(VoidPointer base) { super(base); } IDirectDrawPaletteVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDrawPalette This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall31(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDrawPalette This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall32(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDrawPalette This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall33(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetCaps(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_GetCaps() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int GetCaps(Win32.IDirectDrawPalette This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall34(get_GetCaps(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetEntries(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_GetEntries() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int GetEntries(Win32.IDirectDrawPalette This, int param_1, int param_2, int param_3, PALETTEENTRY param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall35(get_GetEntries(), tmp_0, param_1, param_2, param_3, tmp_1); if (This != null) { This.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int Initialize(Win32.IDirectDrawPalette This, Win32.IDirectDraw param_1, int param_2, PALETTEENTRY param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall36(get_Initialize(), tmp_0, tmp_1, param_2, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_SetEntries(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_SetEntries() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int SetEntries(Win32.IDirectDrawPalette This, int param_1, int param_2, int param_3, PALETTEENTRY param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall37(get_SetEntries(), tmp_0, param_1, param_2, param_3, tmp_1); if (This != null) { This.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDrawPaletteVtbl createIDirectDrawPaletteVtbl(boolean direct) { return new IDirectDrawPaletteVtbl(direct); } public final IDirectDrawPaletteVtbl createIDirectDrawPaletteVtbl(VoidPointer base) { return new IDirectDrawPaletteVtbl(base); } public final IDirectDrawPaletteVtbl createIDirectDrawPaletteVtbl(long addr) { return new IDirectDrawPaletteVtbl(addr); } public static class IDirectDraw7Vtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 240 : 120; IDirectDraw7Vtbl(boolean direct) { super(sizeof, direct); } IDirectDraw7Vtbl(VoidPointer base) { super(base); } IDirectDraw7Vtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDraw7 This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall38(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall39(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall40(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Compact(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_Compact() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int Compact(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall41(get_Compact(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_CreateClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_CreateClipper() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int CreateClipper(Win32.IDirectDraw7 This, int param_1, PointerPointer param_2, Win32.IUnknown param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall42(get_CreateClipper(), tmp_0, param_1, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_CreatePalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_CreatePalette() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int CreatePalette(Win32.IDirectDraw7 This, int param_1, PALETTEENTRY param_2, PointerPointer param_3, Win32.IUnknown param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall43(get_CreatePalette(), tmp_0, param_1, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_CreateSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_CreateSurface() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int CreateSurface(Win32.IDirectDraw7 This, DDSURFACEDESC2 param_1, PointerPointer param_2, Win32.IUnknown param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall44(get_CreateSurface(), tmp_0, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_DuplicateSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_DuplicateSurface() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int DuplicateSurface(Win32.IDirectDraw7 This, IDirectDrawSurface7 param_1, PointerPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall45(get_DuplicateSurface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_EnumDisplayModes(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_EnumDisplayModes() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int EnumDisplayModes(Win32.IDirectDraw7 This, int param_1, DDSURFACEDESC2 param_2, VoidPointer param_3, long param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall46(get_EnumDisplayModes(), tmp_0, param_1, tmp_1, tmp_2, param_4); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_EnumSurfaces(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_EnumSurfaces() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int EnumSurfaces(Win32.IDirectDraw7 This, int param_1, DDSURFACEDESC2 param_2, VoidPointer param_3, long param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall47(get_EnumSurfaces(), tmp_0, param_1, tmp_1, tmp_2, param_4); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_FlipToGDISurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_FlipToGDISurface() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int FlipToGDISurface(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall48(get_FlipToGDISurface(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetCaps(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_GetCaps() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int GetCaps(Win32.IDirectDraw7 This, DDCAPS_DX7 param_1, DDCAPS_DX7 param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall49(get_GetCaps(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_GetDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int GetDisplayMode(Win32.IDirectDraw7 This, DDSURFACEDESC2 param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall50(get_GetDisplayMode(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetFourCCCodes(long val) { byteBase.setAddress(NativeBridge.is64 ? 104 : 52, val); } public final long get_GetFourCCCodes() { return byteBase.getAddress(NativeBridge.is64 ? 104 : 52); } public final int GetFourCCCodes(Win32.IDirectDraw7 This, Int32Pointer param_1, Int32Pointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall51(get_GetFourCCCodes(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetGDISurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 112 : 56, val); } public final long get_GetGDISurface() { return byteBase.getAddress(NativeBridge.is64 ? 112 : 56); } public final int GetGDISurface(Win32.IDirectDraw7 This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall52(get_GetGDISurface(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetMonitorFrequency(long val) { byteBase.setAddress(NativeBridge.is64 ? 120 : 60, val); } public final long get_GetMonitorFrequency() { return byteBase.getAddress(NativeBridge.is64 ? 120 : 60); } public final int GetMonitorFrequency(Win32.IDirectDraw7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall53(get_GetMonitorFrequency(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetScanLine(long val) { byteBase.setAddress(NativeBridge.is64 ? 128 : 64, val); } public final long get_GetScanLine() { return byteBase.getAddress(NativeBridge.is64 ? 128 : 64); } public final int GetScanLine(Win32.IDirectDraw7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall54(get_GetScanLine(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetVerticalBlankStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 136 : 68, val); } public final long get_GetVerticalBlankStatus() { return byteBase.getAddress(NativeBridge.is64 ? 136 : 68); } public final int GetVerticalBlankStatus(Win32.IDirectDraw7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall55(get_GetVerticalBlankStatus(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 144 : 72, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 144 : 72); } public final int Initialize(Win32.IDirectDraw7 This, Win32.GUID param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall56(get_Initialize(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_RestoreDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 152 : 76, val); } public final long get_RestoreDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 152 : 76); } public final int RestoreDisplayMode(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall57(get_RestoreDisplayMode(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetCooperativeLevel(long val) { byteBase.setAddress(NativeBridge.is64 ? 160 : 80, val); } public final long get_SetCooperativeLevel() { return byteBase.getAddress(NativeBridge.is64 ? 160 : 80); } public final int SetCooperativeLevel(Win32.IDirectDraw7 This, long param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall58(get_SetCooperativeLevel(), tmp_0, param_1, param_2); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 168 : 84, val); } public final long get_SetDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 168 : 84); } public final int SetDisplayMode(Win32.IDirectDraw7 This, int param_1, int param_2, int param_3, int param_4, int param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall59(get_SetDisplayMode(), tmp_0, param_1, param_2, param_3, param_4, param_5); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_WaitForVerticalBlank(long val) { byteBase.setAddress(NativeBridge.is64 ? 176 : 88, val); } public final long get_WaitForVerticalBlank() { return byteBase.getAddress(NativeBridge.is64 ? 176 : 88); } public final int WaitForVerticalBlank(Win32.IDirectDraw7 This, int param_1, VoidPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall60(get_WaitForVerticalBlank(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetAvailableVidMem(long val) { byteBase.setAddress(NativeBridge.is64 ? 184 : 92, val); } public final long get_GetAvailableVidMem() { return byteBase.getAddress(NativeBridge.is64 ? 184 : 92); } public final int GetAvailableVidMem(Win32.IDirectDraw7 This, DDSCAPS2 param_1, Int32Pointer param_2, Int32Pointer param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall61(get_GetAvailableVidMem(), tmp_0, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_GetSurfaceFromDC(long val) { byteBase.setAddress(NativeBridge.is64 ? 192 : 96, val); } public final long get_GetSurfaceFromDC() { return byteBase.getAddress(NativeBridge.is64 ? 192 : 96); } public final int GetSurfaceFromDC(Win32.IDirectDraw7 This, long param_1, PointerPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall62(get_GetSurfaceFromDC(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_RestoreAllSurfaces(long val) { byteBase.setAddress(NativeBridge.is64 ? 200 : 100, val); } public final long get_RestoreAllSurfaces() { return byteBase.getAddress(NativeBridge.is64 ? 200 : 100); } public final int RestoreAllSurfaces(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall63(get_RestoreAllSurfaces(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_TestCooperativeLevel(long val) { byteBase.setAddress(NativeBridge.is64 ? 208 : 104, val); } public final long get_TestCooperativeLevel() { return byteBase.getAddress(NativeBridge.is64 ? 208 : 104); } public final int TestCooperativeLevel(Win32.IDirectDraw7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall64(get_TestCooperativeLevel(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetDeviceIdentifier(long val) { byteBase.setAddress(NativeBridge.is64 ? 216 : 108, val); } public final long get_GetDeviceIdentifier() { return byteBase.getAddress(NativeBridge.is64 ? 216 : 108); } public final int GetDeviceIdentifier(Win32.IDirectDraw7 This, DDDEVICEIDENTIFIER2 param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall65(get_GetDeviceIdentifier(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_StartModeTest(long val) { byteBase.setAddress(NativeBridge.is64 ? 224 : 112, val); } public final long get_StartModeTest() { return byteBase.getAddress(NativeBridge.is64 ? 224 : 112); } public final int StartModeTest(Win32.IDirectDraw7 This, SIZE param_1, int param_2, int param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall66(get_StartModeTest(), tmp_0, tmp_1, param_2, param_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_EvaluateMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 232 : 116, val); } public final long get_EvaluateMode() { return byteBase.getAddress(NativeBridge.is64 ? 232 : 116); } public final int EvaluateMode(Win32.IDirectDraw7 This, int param_1, Int32Pointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall67(get_EvaluateMode(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDraw7Vtbl createIDirectDraw7Vtbl(boolean direct) { return new IDirectDraw7Vtbl(direct); } public final IDirectDraw7Vtbl createIDirectDraw7Vtbl(VoidPointer base) { return new IDirectDraw7Vtbl(base); } public final IDirectDraw7Vtbl createIDirectDraw7Vtbl(long addr) { return new IDirectDraw7Vtbl(addr); } public static class IDirectDrawClipperVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 72 : 36; IDirectDrawClipperVtbl(boolean direct) { super(sizeof, direct); } IDirectDrawClipperVtbl(VoidPointer base) { super(base); } IDirectDrawClipperVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDrawClipper This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall68(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDrawClipper This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall69(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDrawClipper This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall70(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetClipList(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_GetClipList() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int GetClipList(Win32.IDirectDrawClipper This, Win32.RECT param_1, Win32.RGNDATA param_2, Int32Pointer param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall71(get_GetClipList(), tmp_0, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_GetHWnd(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_GetHWnd() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int GetHWnd(Win32.IDirectDrawClipper This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall72(get_GetHWnd(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int Initialize(Win32.IDirectDrawClipper This, Win32.IDirectDraw param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall73(get_Initialize(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_IsClipListChanged(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_IsClipListChanged() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int IsClipListChanged(Win32.IDirectDrawClipper This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall74(get_IsClipListChanged(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetClipList(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_SetClipList() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int SetClipList(Win32.IDirectDrawClipper This, Win32.RGNDATA param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall75(get_SetClipList(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetHWnd(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_SetHWnd() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int SetHWnd(Win32.IDirectDrawClipper This, int param_1, long param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall76(get_SetHWnd(), tmp_0, param_1, param_2); if (This != null) { This.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDrawClipperVtbl createIDirectDrawClipperVtbl(boolean direct) { return new IDirectDrawClipperVtbl(direct); } public final IDirectDrawClipperVtbl createIDirectDrawClipperVtbl(VoidPointer base) { return new IDirectDrawClipperVtbl(base); } public final IDirectDrawClipperVtbl createIDirectDrawClipperVtbl(long addr) { return new IDirectDrawClipperVtbl(addr); } public static class DDSCAPS2 extends CommonStructWrapper { public static final int sizeof = 16; DDSCAPS2(boolean direct) { super(sizeof, direct); } DDSCAPS2(VoidPointer base) { super(base); } DDSCAPS2(long addr) { super(addr); } public final void set_dwCaps(int val) { byteBase.setInt32(0, val); } public final int get_dwCaps() { return byteBase.getInt32(0); } public final void set_dwCaps2(int val) { byteBase.setInt32(4, val); } public final int get_dwCaps2() { return byteBase.getInt32(4); } public final void set_dwCaps3(int val) { byteBase.setInt32(8, val); } public final int get_dwCaps3() { return byteBase.getInt32(8); } public final void set_dwCaps4(int val) { byteBase.setInt32(12, val); } public final int get_dwCaps4() { return byteBase.getInt32(12); } public final void set_dwVolumeDepth(int val) { byteBase.setInt32(12, val); } public final int get_dwVolumeDepth() { return byteBase.getInt32(12); } @Override public int size() { return sizeof; } } public final DDSCAPS2 createDDSCAPS2(boolean direct) { return new DDSCAPS2(direct); } public final DDSCAPS2 createDDSCAPS2(VoidPointer base) { return new DDSCAPS2(base); } public final DDSCAPS2 createDDSCAPS2(long addr) { return new DDSCAPS2(addr); } public static class DDSURFACEDESC extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 120 : 108; DDSURFACEDESC(boolean direct) { super(sizeof, direct); } DDSURFACEDESC(VoidPointer base) { super(base); } DDSURFACEDESC(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_dwHeight(int val) { byteBase.setInt32(8, val); } public final int get_dwHeight() { return byteBase.getInt32(8); } public final void set_dwWidth(int val) { byteBase.setInt32(12, val); } public final int get_dwWidth() { return byteBase.getInt32(12); } public final void set_lPitch(int val) { byteBase.setInt32(16, val); } public final int get_lPitch() { return byteBase.getInt32(16); } public final void set_dwLinearSize(int val) { byteBase.setInt32(16, val); } public final int get_dwLinearSize() { return byteBase.getInt32(16); } public final void set_dwBackBufferCount(int val) { byteBase.setInt32(20, val); } public final int get_dwBackBufferCount() { return byteBase.getInt32(20); } public final void set_dwMipMapCount(int val) { byteBase.setInt32(24, val); } public final int get_dwMipMapCount() { return byteBase.getInt32(24); } public final void set_dwZBufferBitDepth(int val) { byteBase.setInt32(24, val); } public final int get_dwZBufferBitDepth() { return byteBase.getInt32(24); } public final void set_dwRefreshRate(int val) { byteBase.setInt32(24, val); } public final int get_dwRefreshRate() { return byteBase.getInt32(24); } public final void set_dwAlphaBitDepth(int val) { byteBase.setInt32(28, val); } public final int get_dwAlphaBitDepth() { return byteBase.getInt32(28); } public final void set_dwReserved(int val) { byteBase.setInt32(32, val); } public final int get_dwReserved() { return byteBase.getInt32(32); } public final void set_lpSurface(VoidPointer val) { byteBase.setPointer(NativeBridge.is64 ? 40 : 36, val); } public final VoidPointer get_lpSurface() { return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 40 : 36)); } public final DDCOLORKEY get_ddckCKDestOverlay() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 48 : 40)); } public final DDCOLORKEY get_ddckCKDestBlt() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 56 : 48)); } public final DDCOLORKEY get_ddckCKSrcOverlay() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 64 : 56)); } public final DDCOLORKEY get_ddckCKSrcBlt() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 72 : 64)); } public final DDPIXELFORMAT get_ddpfPixelFormat() { return instance.createDDPIXELFORMAT(getElementPointer(NativeBridge.is64 ? 80 : 72)); } public final DDSCAPS get_ddsCaps() { return instance.createDDSCAPS(getElementPointer(NativeBridge.is64 ? 112 : 104)); } @Override public int size() { return sizeof; } } public final DDSURFACEDESC createDDSURFACEDESC(boolean direct) { return new DDSURFACEDESC(direct); } public final DDSURFACEDESC createDDSURFACEDESC(VoidPointer base) { return new DDSURFACEDESC(base); } public final DDSURFACEDESC createDDSURFACEDESC(long addr) { return new DDSURFACEDESC(addr); } public static class IDirectDrawSurface extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDrawSurface(boolean direct) { super(sizeof, direct); } IDirectDrawSurface(VoidPointer base) { super(base); } IDirectDrawSurface(long addr) { super(addr); } public final IDirectDrawSurfaceVtbl get_lpVtbl() { return instance.createIDirectDrawSurfaceVtbl(byteBase.getAddress(0)); } @Override public int size() { return sizeof; } } public final IDirectDrawSurface createIDirectDrawSurface(boolean direct) { return new IDirectDrawSurface(direct); } public final IDirectDrawSurface createIDirectDrawSurface(VoidPointer base) { return new IDirectDrawSurface(base); } public final IDirectDrawSurface createIDirectDrawSurface(long addr) { return new IDirectDrawSurface(addr); } public static class IDirectDrawVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 184 : 92; IDirectDrawVtbl(boolean direct) { super(sizeof, direct); } IDirectDrawVtbl(VoidPointer base) { super(base); } IDirectDrawVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDraw This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall77(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDraw This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall78(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDraw This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall79(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Compact(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_Compact() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int Compact(Win32.IDirectDraw This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall80(get_Compact(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_CreateClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_CreateClipper() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int CreateClipper(Win32.IDirectDraw This, int param_1, PointerPointer param_2, Win32.IUnknown param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall81(get_CreateClipper(), tmp_0, param_1, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_CreatePalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_CreatePalette() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int CreatePalette(Win32.IDirectDraw This, int param_1, PALETTEENTRY param_2, PointerPointer param_3, Win32.IUnknown param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall82(get_CreatePalette(), tmp_0, param_1, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_CreateSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_CreateSurface() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int CreateSurface(Win32.IDirectDraw This, Win32.DDSURFACEDESC param_1, PointerPointer param_2, Win32.IUnknown param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall83(get_CreateSurface(), tmp_0, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_DuplicateSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_DuplicateSurface() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int DuplicateSurface(Win32.IDirectDraw This, Win32.IDirectDrawSurface param_1, PointerPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall84(get_DuplicateSurface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_EnumDisplayModes(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_EnumDisplayModes() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int EnumDisplayModes(Win32.IDirectDraw This, int param_1, Win32.DDSURFACEDESC param_2, VoidPointer param_3, long param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall85(get_EnumDisplayModes(), tmp_0, param_1, tmp_1, tmp_2, param_4); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_EnumSurfaces(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_EnumSurfaces() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int EnumSurfaces(Win32.IDirectDraw This, int param_1, Win32.DDSURFACEDESC param_2, VoidPointer param_3, long param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall86(get_EnumSurfaces(), tmp_0, param_1, tmp_1, tmp_2, param_4); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_FlipToGDISurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_FlipToGDISurface() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int FlipToGDISurface(Win32.IDirectDraw This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall87(get_FlipToGDISurface(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetCaps(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_GetCaps() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int GetCaps(Win32.IDirectDraw This, DDCAPS_DX7 param_1, DDCAPS_DX7 param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall88(get_GetCaps(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_GetDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int GetDisplayMode(Win32.IDirectDraw This, Win32.DDSURFACEDESC param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall89(get_GetDisplayMode(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetFourCCCodes(long val) { byteBase.setAddress(NativeBridge.is64 ? 104 : 52, val); } public final long get_GetFourCCCodes() { return byteBase.getAddress(NativeBridge.is64 ? 104 : 52); } public final int GetFourCCCodes(Win32.IDirectDraw This, Int32Pointer param_1, Int32Pointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall90(get_GetFourCCCodes(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetGDISurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 112 : 56, val); } public final long get_GetGDISurface() { return byteBase.getAddress(NativeBridge.is64 ? 112 : 56); } public final int GetGDISurface(Win32.IDirectDraw This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall91(get_GetGDISurface(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetMonitorFrequency(long val) { byteBase.setAddress(NativeBridge.is64 ? 120 : 60, val); } public final long get_GetMonitorFrequency() { return byteBase.getAddress(NativeBridge.is64 ? 120 : 60); } public final int GetMonitorFrequency(Win32.IDirectDraw This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall92(get_GetMonitorFrequency(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetScanLine(long val) { byteBase.setAddress(NativeBridge.is64 ? 128 : 64, val); } public final long get_GetScanLine() { return byteBase.getAddress(NativeBridge.is64 ? 128 : 64); } public final int GetScanLine(Win32.IDirectDraw This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall93(get_GetScanLine(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetVerticalBlankStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 136 : 68, val); } public final long get_GetVerticalBlankStatus() { return byteBase.getAddress(NativeBridge.is64 ? 136 : 68); } public final int GetVerticalBlankStatus(Win32.IDirectDraw This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall94(get_GetVerticalBlankStatus(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 144 : 72, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 144 : 72); } public final int Initialize(Win32.IDirectDraw This, Win32.GUID param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall95(get_Initialize(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_RestoreDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 152 : 76, val); } public final long get_RestoreDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 152 : 76); } public final int RestoreDisplayMode(Win32.IDirectDraw This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall96(get_RestoreDisplayMode(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetCooperativeLevel(long val) { byteBase.setAddress(NativeBridge.is64 ? 160 : 80, val); } public final long get_SetCooperativeLevel() { return byteBase.getAddress(NativeBridge.is64 ? 160 : 80); } public final int SetCooperativeLevel(Win32.IDirectDraw This, long param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall97(get_SetCooperativeLevel(), tmp_0, param_1, param_2); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetDisplayMode(long val) { byteBase.setAddress(NativeBridge.is64 ? 168 : 84, val); } public final long get_SetDisplayMode() { return byteBase.getAddress(NativeBridge.is64 ? 168 : 84); } public final int SetDisplayMode(Win32.IDirectDraw This, int param_1, int param_2, int param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall98(get_SetDisplayMode(), tmp_0, param_1, param_2, param_3); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_WaitForVerticalBlank(long val) { byteBase.setAddress(NativeBridge.is64 ? 176 : 88, val); } public final long get_WaitForVerticalBlank() { return byteBase.getAddress(NativeBridge.is64 ? 176 : 88); } public final int WaitForVerticalBlank(Win32.IDirectDraw This, int param_1, VoidPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall99(get_WaitForVerticalBlank(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDrawVtbl createIDirectDrawVtbl(boolean direct) { return new IDirectDrawVtbl(direct); } public final IDirectDrawVtbl createIDirectDrawVtbl(VoidPointer base) { return new IDirectDrawVtbl(base); } public final IDirectDrawVtbl createIDirectDrawVtbl(long addr) { return new IDirectDrawVtbl(addr); } public static class IEnumIDListVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 56 : 28; IEnumIDListVtbl(boolean direct) { super(sizeof, direct); } IEnumIDListVtbl(VoidPointer base) { super(base); } IEnumIDListVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IEnumIDList This, Win32.GUID riid, PointerPointer ppvObject) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObject == null ? 0 : ppvObject.longLockPointer(); int tmp_ret = instance.proxycall100(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObject != null) { ppvObject.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IEnumIDList This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall101(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IEnumIDList This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall102(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Next(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_Next() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int Next(Win32.IEnumIDList This, int celt, PointerPointer rgelt, Int32Pointer pceltFetched) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = rgelt == null ? 0 : rgelt.longLockPointer(); long tmp_2 = pceltFetched == null ? 0 : pceltFetched.longLockPointer(); int tmp_ret = instance.proxycall103(get_Next(), tmp_0, celt, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (rgelt != null) { rgelt.unlock(); } if (pceltFetched != null) { pceltFetched.unlock(); } return tmp_ret; } public final void set_Skip(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_Skip() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int Skip(Win32.IEnumIDList This, int celt) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall104(get_Skip(), tmp_0, celt); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Reset(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_Reset() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int Reset(Win32.IEnumIDList This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall105(get_Reset(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Clone(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_Clone() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int Clone(Win32.IEnumIDList This, PointerPointer ppenum) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = ppenum == null ? 0 : ppenum.longLockPointer(); int tmp_ret = instance.proxycall106(get_Clone(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (ppenum != null) { ppenum.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IEnumIDListVtbl createIEnumIDListVtbl(boolean direct) { return new IEnumIDListVtbl(direct); } public final IEnumIDListVtbl createIEnumIDListVtbl(VoidPointer base) { return new IEnumIDListVtbl(base); } public final IEnumIDListVtbl createIEnumIDListVtbl(long addr) { return new IEnumIDListVtbl(addr); } public static class SIZE extends CommonStructWrapper { public static final int sizeof = 8; SIZE(boolean direct) { super(sizeof, direct); } SIZE(VoidPointer base) { super(base); } SIZE(long addr) { super(addr); } public final void set_cx(int val) { byteBase.setInt32(0, val); } public final int get_cx() { return byteBase.getInt32(0); } public final void set_cy(int val) { byteBase.setInt32(4, val); } public final int get_cy() { return byteBase.getInt32(4); } @Override public int size() { return sizeof; } } public final SIZE createSIZE(boolean direct) { return new SIZE(direct); } public final SIZE createSIZE(VoidPointer base) { return new SIZE(base); } public final SIZE createSIZE(long addr) { return new SIZE(addr); } public static class PALETTEENTRY extends CommonStructWrapper { public static final int sizeof = 4; PALETTEENTRY(boolean direct) { super(sizeof, direct); } PALETTEENTRY(VoidPointer base) { super(base); } PALETTEENTRY(long addr) { super(addr); } public final void set_peRed(byte val) { byteBase.set(0, val); } public final byte get_peRed() { return byteBase.get(0); } public final void set_peGreen(byte val) { byteBase.set(1, val); } public final byte get_peGreen() { return byteBase.get(1); } public final void set_peBlue(byte val) { byteBase.set(2, val); } public final byte get_peBlue() { return byteBase.get(2); } public final void set_peFlags(byte val) { byteBase.set(3, val); } public final byte get_peFlags() { return byteBase.get(3); } @Override public int size() { return sizeof; } } public final PALETTEENTRY createPALETTEENTRY(boolean direct) { return new PALETTEENTRY(direct); } public final PALETTEENTRY createPALETTEENTRY(VoidPointer base) { return new PALETTEENTRY(base); } public final PALETTEENTRY createPALETTEENTRY(long addr) { return new PALETTEENTRY(addr); } public static class DDCAPS_DX7 extends CommonStructWrapper { public static final int sizeof = 240; DDCAPS_DX7(boolean direct) { super(sizeof, direct); } DDCAPS_DX7(VoidPointer base) { super(base); } DDCAPS_DX7(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwCaps(int val) { byteBase.setInt32(4, val); } public final int get_dwCaps() { return byteBase.getInt32(4); } public final void set_dwCaps2(int val) { byteBase.setInt32(8, val); } public final int get_dwCaps2() { return byteBase.getInt32(8); } public final void set_dwCKeyCaps(int val) { byteBase.setInt32(12, val); } public final int get_dwCKeyCaps() { return byteBase.getInt32(12); } public final void set_dwFXCaps(int val) { byteBase.setInt32(16, val); } public final int get_dwFXCaps() { return byteBase.getInt32(16); } public final void set_dwFXAlphaCaps(int val) { byteBase.setInt32(20, val); } public final int get_dwFXAlphaCaps() { return byteBase.getInt32(20); } public final void set_dwPalCaps(int val) { byteBase.setInt32(24, val); } public final int get_dwPalCaps() { return byteBase.getInt32(24); } public final void set_dwSVCaps(int val) { byteBase.setInt32(28, val); } public final int get_dwSVCaps() { return byteBase.getInt32(28); } public final void set_dwAlphaBltConstBitDepths(int val) { byteBase.setInt32(32, val); } public final int get_dwAlphaBltConstBitDepths() { return byteBase.getInt32(32); } public final void set_dwAlphaBltPixelBitDepths(int val) { byteBase.setInt32(36, val); } public final int get_dwAlphaBltPixelBitDepths() { return byteBase.getInt32(36); } public final void set_dwAlphaBltSurfaceBitDepths(int val) { byteBase.setInt32(40, val); } public final int get_dwAlphaBltSurfaceBitDepths() { return byteBase.getInt32(40); } public final void set_dwAlphaOverlayConstBitDepths(int val) { byteBase.setInt32(44, val); } public final int get_dwAlphaOverlayConstBitDepths() { return byteBase.getInt32(44); } public final void set_dwAlphaOverlayPixelBitDepths(int val) { byteBase.setInt32(48, val); } public final int get_dwAlphaOverlayPixelBitDepths() { return byteBase.getInt32(48); } public final void set_dwAlphaOverlaySurfaceBitDepths(int val) { byteBase.setInt32(52, val); } public final int get_dwAlphaOverlaySurfaceBitDepths() { return byteBase.getInt32(52); } public final void set_dwZBufferBitDepths(int val) { byteBase.setInt32(56, val); } public final int get_dwZBufferBitDepths() { return byteBase.getInt32(56); } public final void set_dwVidMemTotal(int val) { byteBase.setInt32(60, val); } public final int get_dwVidMemTotal() { return byteBase.getInt32(60); } public final void set_dwVidMemFree(int val) { byteBase.setInt32(64, val); } public final int get_dwVidMemFree() { return byteBase.getInt32(64); } public final void set_dwMaxVisibleOverlays(int val) { byteBase.setInt32(68, val); } public final int get_dwMaxVisibleOverlays() { return byteBase.getInt32(68); } public final void set_dwCurrVisibleOverlays(int val) { byteBase.setInt32(72, val); } public final int get_dwCurrVisibleOverlays() { return byteBase.getInt32(72); } public final void set_dwNumFourCCCodes(int val) { byteBase.setInt32(76, val); } public final int get_dwNumFourCCCodes() { return byteBase.getInt32(76); } public final void set_dwAlignBoundarySrc(int val) { byteBase.setInt32(80, val); } public final int get_dwAlignBoundarySrc() { return byteBase.getInt32(80); } public final void set_dwAlignSizeSrc(int val) { byteBase.setInt32(84, val); } public final int get_dwAlignSizeSrc() { return byteBase.getInt32(84); } public final void set_dwAlignBoundaryDest(int val) { byteBase.setInt32(88, val); } public final int get_dwAlignBoundaryDest() { return byteBase.getInt32(88); } public final void set_dwAlignSizeDest(int val) { byteBase.setInt32(92, val); } public final int get_dwAlignSizeDest() { return byteBase.getInt32(92); } public final void set_dwAlignStrideAlign(int val) { byteBase.setInt32(96, val); } public final int get_dwAlignStrideAlign() { return byteBase.getInt32(96); } public final Int32Pointer get_dwRops() { return nb.createInt32Pointer(getElementPointer(100)); } public final DDSCAPS get_ddsOldCaps() { return instance.createDDSCAPS(getElementPointer(104)); } public final void set_dwMinOverlayStretch(int val) { byteBase.setInt32(108, val); } public final int get_dwMinOverlayStretch() { return byteBase.getInt32(108); } public final void set_dwMaxOverlayStretch(int val) { byteBase.setInt32(112, val); } public final int get_dwMaxOverlayStretch() { return byteBase.getInt32(112); } public final void set_dwMinLiveVideoStretch(int val) { byteBase.setInt32(116, val); } public final int get_dwMinLiveVideoStretch() { return byteBase.getInt32(116); } public final void set_dwMaxLiveVideoStretch(int val) { byteBase.setInt32(120, val); } public final int get_dwMaxLiveVideoStretch() { return byteBase.getInt32(120); } public final void set_dwMinHwCodecStretch(int val) { byteBase.setInt32(124, val); } public final int get_dwMinHwCodecStretch() { return byteBase.getInt32(124); } public final void set_dwMaxHwCodecStretch(int val) { byteBase.setInt32(128, val); } public final int get_dwMaxHwCodecStretch() { return byteBase.getInt32(128); } public final void set_dwReserved1(int val) { byteBase.setInt32(132, val); } public final int get_dwReserved1() { return byteBase.getInt32(132); } public final void set_dwReserved2(int val) { byteBase.setInt32(136, val); } public final int get_dwReserved2() { return byteBase.getInt32(136); } public final void set_dwReserved3(int val) { byteBase.setInt32(140, val); } public final int get_dwReserved3() { return byteBase.getInt32(140); } public final void set_dwSVBCaps(int val) { byteBase.setInt32(144, val); } public final int get_dwSVBCaps() { return byteBase.getInt32(144); } public final void set_dwSVBCKeyCaps(int val) { byteBase.setInt32(148, val); } public final int get_dwSVBCKeyCaps() { return byteBase.getInt32(148); } public final void set_dwSVBFXCaps(int val) { byteBase.setInt32(152, val); } public final int get_dwSVBFXCaps() { return byteBase.getInt32(152); } public final Int32Pointer get_dwSVBRops() { return nb.createInt32Pointer(getElementPointer(156)); } public final void set_dwVSBCaps(int val) { byteBase.setInt32(160, val); } public final int get_dwVSBCaps() { return byteBase.getInt32(160); } public final void set_dwVSBCKeyCaps(int val) { byteBase.setInt32(164, val); } public final int get_dwVSBCKeyCaps() { return byteBase.getInt32(164); } public final void set_dwVSBFXCaps(int val) { byteBase.setInt32(168, val); } public final int get_dwVSBFXCaps() { return byteBase.getInt32(168); } public final Int32Pointer get_dwVSBRops() { return nb.createInt32Pointer(getElementPointer(172)); } public final void set_dwSSBCaps(int val) { byteBase.setInt32(176, val); } public final int get_dwSSBCaps() { return byteBase.getInt32(176); } public final void set_dwSSBCKeyCaps(int val) { byteBase.setInt32(180, val); } public final int get_dwSSBCKeyCaps() { return byteBase.getInt32(180); } public final void set_dwSSBFXCaps(int val) { byteBase.setInt32(184, val); } public final int get_dwSSBFXCaps() { return byteBase.getInt32(184); } public final Int32Pointer get_dwSSBRops() { return nb.createInt32Pointer(getElementPointer(188)); } public final void set_dwMaxVideoPorts(int val) { byteBase.setInt32(192, val); } public final int get_dwMaxVideoPorts() { return byteBase.getInt32(192); } public final void set_dwCurrVideoPorts(int val) { byteBase.setInt32(196, val); } public final int get_dwCurrVideoPorts() { return byteBase.getInt32(196); } public final void set_dwSVBCaps2(int val) { byteBase.setInt32(200, val); } public final int get_dwSVBCaps2() { return byteBase.getInt32(200); } public final void set_dwNLVBCaps(int val) { byteBase.setInt32(204, val); } public final int get_dwNLVBCaps() { return byteBase.getInt32(204); } public final void set_dwNLVBCaps2(int val) { byteBase.setInt32(208, val); } public final int get_dwNLVBCaps2() { return byteBase.getInt32(208); } public final void set_dwNLVBCKeyCaps(int val) { byteBase.setInt32(212, val); } public final int get_dwNLVBCKeyCaps() { return byteBase.getInt32(212); } public final void set_dwNLVBFXCaps(int val) { byteBase.setInt32(216, val); } public final int get_dwNLVBFXCaps() { return byteBase.getInt32(216); } public final Int32Pointer get_dwNLVBRops() { return nb.createInt32Pointer(getElementPointer(220)); } public final Win32.DDSCAPS2 get_ddsCaps() { return Win32.instance.createDDSCAPS2(getElementPointer(224)); } @Override public int size() { return sizeof; } } public final DDCAPS_DX7 createDDCAPS_DX7(boolean direct) { return new DDCAPS_DX7(direct); } public final DDCAPS_DX7 createDDCAPS_DX7(VoidPointer base) { return new DDCAPS_DX7(base); } public final DDCAPS_DX7 createDDCAPS_DX7(long addr) { return new DDCAPS_DX7(addr); } public static class DDSURFACEDESC2 extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 136 : 124; DDSURFACEDESC2(boolean direct) { super(sizeof, direct); } DDSURFACEDESC2(VoidPointer base) { super(base); } DDSURFACEDESC2(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_dwHeight(int val) { byteBase.setInt32(8, val); } public final int get_dwHeight() { return byteBase.getInt32(8); } public final void set_dwWidth(int val) { byteBase.setInt32(12, val); } public final int get_dwWidth() { return byteBase.getInt32(12); } public final void set_lPitch(int val) { byteBase.setInt32(16, val); } public final int get_lPitch() { return byteBase.getInt32(16); } public final void set_dwLinearSize(int val) { byteBase.setInt32(16, val); } public final int get_dwLinearSize() { return byteBase.getInt32(16); } public final void set_dwBackBufferCount(int val) { byteBase.setInt32(20, val); } public final int get_dwBackBufferCount() { return byteBase.getInt32(20); } public final void set_dwDepth(int val) { byteBase.setInt32(20, val); } public final int get_dwDepth() { return byteBase.getInt32(20); } public final void set_dwMipMapCount(int val) { byteBase.setInt32(24, val); } public final int get_dwMipMapCount() { return byteBase.getInt32(24); } public final void set_dwRefreshRate(int val) { byteBase.setInt32(24, val); } public final int get_dwRefreshRate() { return byteBase.getInt32(24); } public final void set_dwSrcVBHandle(int val) { byteBase.setInt32(24, val); } public final int get_dwSrcVBHandle() { return byteBase.getInt32(24); } public final void set_dwAlphaBitDepth(int val) { byteBase.setInt32(28, val); } public final int get_dwAlphaBitDepth() { return byteBase.getInt32(28); } public final void set_dwReserved(int val) { byteBase.setInt32(32, val); } public final int get_dwReserved() { return byteBase.getInt32(32); } public final void set_lpSurface(VoidPointer val) { byteBase.setPointer(NativeBridge.is64 ? 40 : 36, val); } public final VoidPointer get_lpSurface() { return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 40 : 36)); } public final DDCOLORKEY get_ddckCKDestOverlay() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 48 : 40)); } public final void set_dwEmptyFaceColor(int val) { byteBase.setInt32(NativeBridge.is64 ? 48 : 40, val); } public final int get_dwEmptyFaceColor() { return byteBase.getInt32(NativeBridge.is64 ? 48 : 40); } public final DDCOLORKEY get_ddckCKDestBlt() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 56 : 48)); } public final DDCOLORKEY get_ddckCKSrcOverlay() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 64 : 56)); } public final DDCOLORKEY get_ddckCKSrcBlt() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 72 : 64)); } public final DDPIXELFORMAT get_ddpfPixelFormat() { return instance.createDDPIXELFORMAT(getElementPointer(NativeBridge.is64 ? 80 : 72)); } public final void set_dwFVF(int val) { byteBase.setInt32(NativeBridge.is64 ? 80 : 72, val); } public final int get_dwFVF() { return byteBase.getInt32(NativeBridge.is64 ? 80 : 72); } public final Win32.DDSCAPS2 get_ddsCaps() { return Win32.instance.createDDSCAPS2(getElementPointer(NativeBridge.is64 ? 112 : 104)); } public final void set_dwTextureStage(int val) { byteBase.setInt32(NativeBridge.is64 ? 128 : 120, val); } public final int get_dwTextureStage() { return byteBase.getInt32(NativeBridge.is64 ? 128 : 120); } @Override public int size() { return sizeof; } } public final DDSURFACEDESC2 createDDSURFACEDESC2(boolean direct) { return new DDSURFACEDESC2(direct); } public final DDSURFACEDESC2 createDDSURFACEDESC2(VoidPointer base) { return new DDSURFACEDESC2(base); } public final DDSURFACEDESC2 createDDSURFACEDESC2(long addr) { return new DDSURFACEDESC2(addr); } public static class IDirectDrawSurface7 extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 8 : 4; IDirectDrawSurface7Vtbl vtbl; IDirectDrawSurface7(long addr) { super(addr); vtbl = get_lpVtbl(); } public final IDirectDrawSurface7Vtbl get_lpVtbl() { return instance.createIDirectDrawSurface7Vtbl(byteBase.getAddress(0)); } public final int QueryInterface(Win32.GUID riid, PointerPointer ppvObj) { return vtbl.QueryInterface(this, riid, ppvObj); } public final int AddRef() { return vtbl.AddRef(this); } public final int Release() { return vtbl.Release(this); } public final int AddAttachedSurface(IDirectDrawSurface7 param_1) { return vtbl.AddAttachedSurface(this, param_1); } public final int AddOverlayDirtyRect(Win32.RECT param_1) { return vtbl.AddOverlayDirtyRect(this, param_1); } public final int Blt(Win32.RECT param_1, IDirectDrawSurface7 param_2, Win32.RECT param_3, int param_4, DDBLTFX param_5) { return vtbl.Blt(this, param_1, param_2, param_3, param_4, param_5); } public final int BltBatch(DDBLTBATCH param_1, int param_2, int param_3) { return vtbl.BltBatch(this, param_1, param_2, param_3); } public final int BltFast(int param_1, int param_2, IDirectDrawSurface7 param_3, Win32.RECT param_4, int param_5) { return vtbl.BltFast(this, param_1, param_2, param_3, param_4, param_5); } public final int DeleteAttachedSurface(int param_1, IDirectDrawSurface7 param_2) { return vtbl.DeleteAttachedSurface(this, param_1, param_2); } public final int EnumAttachedSurfaces(VoidPointer param_1, long param_2) { return vtbl.EnumAttachedSurfaces(this, param_1, param_2); } public final int EnumOverlayZOrders(int param_1, VoidPointer param_2, long param_3) { return vtbl.EnumOverlayZOrders(this, param_1, param_2, param_3); } public final int Flip(IDirectDrawSurface7 param_1, int param_2) { return vtbl.Flip(this, param_1, param_2); } public final int GetAttachedSurface(Win32.DDSCAPS2 param_1, PointerPointer param_2) { return vtbl.GetAttachedSurface(this, param_1, param_2); } public final int GetBltStatus(int param_1) { return vtbl.GetBltStatus(this, param_1); } public final int GetCaps(Win32.DDSCAPS2 param_1) { return vtbl.GetCaps(this, param_1); } public final int GetClipper(PointerPointer param_1) { return vtbl.GetClipper(this, param_1); } public final int GetColorKey(int param_1, DDCOLORKEY param_2) { return vtbl.GetColorKey(this, param_1, param_2); } public final int GetDC(PointerPointer param_1) { return vtbl.GetDC(this, param_1); } public final int GetFlipStatus(int param_1) { return vtbl.GetFlipStatus(this, param_1); } public final int GetOverlayPosition(Int32Pointer param_1, Int32Pointer param_2) { return vtbl.GetOverlayPosition(this, param_1, param_2); } public final int GetPalette(PointerPointer param_1) { return vtbl.GetPalette(this, param_1); } public final int GetPixelFormat(DDPIXELFORMAT param_1) { return vtbl.GetPixelFormat(this, param_1); } public final int GetSurfaceDesc(Win32.DDSURFACEDESC2 param_1) { return vtbl.GetSurfaceDesc(this, param_1); } public final int Initialize(Win32.IDirectDraw param_1, Win32.DDSURFACEDESC2 param_2) { return vtbl.Initialize(this, param_1, param_2); } public final int IsLost() { return vtbl.IsLost(this); } public final int Lock(Win32.RECT param_1, Win32.DDSURFACEDESC2 param_2, int param_3, VoidPointer param_4) { return vtbl.Lock(this, param_1, param_2, param_3, param_4); } public final int ReleaseDC(long param_1) { return vtbl.ReleaseDC(this, param_1); } public final int Restore() { return vtbl.Restore(this); } public final int SetClipper(Win32.IDirectDrawClipper param_1) { return vtbl.SetClipper(this, param_1); } public final int SetColorKey(int param_1, DDCOLORKEY param_2) { return vtbl.SetColorKey(this, param_1, param_2); } public final int SetOverlayPosition(int param_1, int param_2) { return vtbl.SetOverlayPosition(this, param_1, param_2); } public final int SetPalette(Win32.IDirectDrawPalette param_1) { return vtbl.SetPalette(this, param_1); } public final int Unlock(Win32.RECT param_1) { return vtbl.Unlock(this, param_1); } public final int UpdateOverlay(Win32.RECT param_1, IDirectDrawSurface7 param_2, Win32.RECT param_3, int param_4, DDOVERLAYFX param_5) { return vtbl.UpdateOverlay(this, param_1, param_2, param_3, param_4, param_5); } public final int UpdateOverlayDisplay(int param_1) { return vtbl.UpdateOverlayDisplay(this, param_1); } public final int UpdateOverlayZOrder(int param_1, IDirectDrawSurface7 param_2) { return vtbl.UpdateOverlayZOrder(this, param_1, param_2); } public final int GetDDInterface(PointerPointer param_1) { return vtbl.GetDDInterface(this, param_1); } public final int PageLock(int param_1) { return vtbl.PageLock(this, param_1); } public final int PageUnlock(int param_1) { return vtbl.PageUnlock(this, param_1); } public final int SetSurfaceDesc(Win32.DDSURFACEDESC2 param_1, int param_2) { return vtbl.SetSurfaceDesc(this, param_1, param_2); } public final int SetPrivateData(Win32.GUID param_1, VoidPointer param_2, int param_3, int param_4) { return vtbl.SetPrivateData(this, param_1, param_2, param_3, param_4); } public final int GetPrivateData(Win32.GUID param_1, VoidPointer param_2, Int32Pointer param_3) { return vtbl.GetPrivateData(this, param_1, param_2, param_3); } public final int FreePrivateData(Win32.GUID param_1) { return vtbl.FreePrivateData(this, param_1); } public final int GetUniquenessValue(Int32Pointer param_1) { return vtbl.GetUniquenessValue(this, param_1); } public final int ChangeUniquenessValue() { return vtbl.ChangeUniquenessValue(this); } public final int SetPriority(int param_1) { return vtbl.SetPriority(this, param_1); } public final int GetPriority(Int32Pointer param_1) { return vtbl.GetPriority(this, param_1); } public final int SetLOD(int param_1) { return vtbl.SetLOD(this, param_1); } public final int GetLOD(Int32Pointer param_1) { return vtbl.GetLOD(this, param_1); } @Override public int size() { return sizeof; } } public final IDirectDrawSurface7 createIDirectDrawSurface7(long addr) { return new IDirectDrawSurface7(addr); } public static class DDDEVICEIDENTIFIER2 extends CommonStructWrapper { public static final int sizeof = 1072; DDDEVICEIDENTIFIER2(boolean direct) { super(sizeof, direct); } DDDEVICEIDENTIFIER2(VoidPointer base) { super(base); } DDDEVICEIDENTIFIER2(long addr) { super(addr); } public final Int8Pointer get_szDriver() { return nb.createInt8Pointer(getElementPointer(0)); } public final Int8Pointer get_szDescription() { return nb.createInt8Pointer(getElementPointer(512)); } public final LARGE_INTEGER get_liDriverVersion() { return instance.createLARGE_INTEGER(getElementPointer(1024)); } public final void set_dwVendorId(int val) { byteBase.setInt32(1032, val); } public final int get_dwVendorId() { return byteBase.getInt32(1032); } public final void set_dwDeviceId(int val) { byteBase.setInt32(1036, val); } public final int get_dwDeviceId() { return byteBase.getInt32(1036); } public final void set_dwSubSysId(int val) { byteBase.setInt32(1040, val); } public final int get_dwSubSysId() { return byteBase.getInt32(1040); } public final void set_dwRevision(int val) { byteBase.setInt32(1044, val); } public final int get_dwRevision() { return byteBase.getInt32(1044); } public final Win32.GUID get_guidDeviceIdentifier() { return Win32.instance.createGUID(getElementPointer(1048)); } public final void set_dwWHQLLevel(int val) { byteBase.setInt32(1064, val); } public final int get_dwWHQLLevel() { return byteBase.getInt32(1064); } @Override public int size() { return sizeof; } } public final DDDEVICEIDENTIFIER2 createDDDEVICEIDENTIFIER2(boolean direct) { return new DDDEVICEIDENTIFIER2(direct); } public final DDDEVICEIDENTIFIER2 createDDDEVICEIDENTIFIER2(VoidPointer base) { return new DDDEVICEIDENTIFIER2(base); } public final DDDEVICEIDENTIFIER2 createDDDEVICEIDENTIFIER2(long addr) { return new DDDEVICEIDENTIFIER2(addr); } public static class DDOVERLAYFX extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 72 : 56; DDOVERLAYFX(boolean direct) { super(sizeof, direct); } DDOVERLAYFX(VoidPointer base) { super(base); } DDOVERLAYFX(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwAlphaEdgeBlendBitDepth(int val) { byteBase.setInt32(4, val); } public final int get_dwAlphaEdgeBlendBitDepth() { return byteBase.getInt32(4); } public final void set_dwAlphaEdgeBlend(int val) { byteBase.setInt32(8, val); } public final int get_dwAlphaEdgeBlend() { return byteBase.getInt32(8); } public final void set_dwReserved(int val) { byteBase.setInt32(12, val); } public final int get_dwReserved() { return byteBase.getInt32(12); } public final void set_dwAlphaDestConstBitDepth(int val) { byteBase.setInt32(16, val); } public final int get_dwAlphaDestConstBitDepth() { return byteBase.getInt32(16); } public final void set_dwAlphaDestConst(int val) { byteBase.setInt32(NativeBridge.is64 ? 24 : 20, val); } public final int get_dwAlphaDestConst() { return byteBase.getInt32(NativeBridge.is64 ? 24 : 20); } public final Win32.IDirectDrawSurface get_lpDDSAlphaDest() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 24 : 20)); } public final void set_dwAlphaSrcConstBitDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 32 : 24, val); } public final int get_dwAlphaSrcConstBitDepth() { return byteBase.getInt32(NativeBridge.is64 ? 32 : 24); } public final void set_dwAlphaSrcConst(int val) { byteBase.setInt32(NativeBridge.is64 ? 40 : 28, val); } public final int get_dwAlphaSrcConst() { return byteBase.getInt32(NativeBridge.is64 ? 40 : 28); } public final Win32.IDirectDrawSurface get_lpDDSAlphaSrc() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 40 : 28)); } public final DDCOLORKEY get_dckDestColorkey() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 48 : 32)); } public final DDCOLORKEY get_dckSrcColorkey() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 56 : 40)); } public final void set_dwDDFX(int val) { byteBase.setInt32(NativeBridge.is64 ? 64 : 48, val); } public final int get_dwDDFX() { return byteBase.getInt32(NativeBridge.is64 ? 64 : 48); } public final void set_dwFlags(int val) { byteBase.setInt32(NativeBridge.is64 ? 68 : 52, val); } public final int get_dwFlags() { return byteBase.getInt32(NativeBridge.is64 ? 68 : 52); } @Override public int size() { return sizeof; } } public final DDOVERLAYFX createDDOVERLAYFX(boolean direct) { return new DDOVERLAYFX(direct); } public final DDOVERLAYFX createDDOVERLAYFX(VoidPointer base) { return new DDOVERLAYFX(base); } public final DDOVERLAYFX createDDOVERLAYFX(long addr) { return new DDOVERLAYFX(addr); } public static class DDBLTFX extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 128 : 100; DDBLTFX(boolean direct) { super(sizeof, direct); } DDBLTFX(VoidPointer base) { super(base); } DDBLTFX(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwDDFX(int val) { byteBase.setInt32(4, val); } public final int get_dwDDFX() { return byteBase.getInt32(4); } public final void set_dwROP(int val) { byteBase.setInt32(8, val); } public final int get_dwROP() { return byteBase.getInt32(8); } public final void set_dwDDROP(int val) { byteBase.setInt32(12, val); } public final int get_dwDDROP() { return byteBase.getInt32(12); } public final void set_dwRotationAngle(int val) { byteBase.setInt32(16, val); } public final int get_dwRotationAngle() { return byteBase.getInt32(16); } public final void set_dwZBufferOpCode(int val) { byteBase.setInt32(20, val); } public final int get_dwZBufferOpCode() { return byteBase.getInt32(20); } public final void set_dwZBufferLow(int val) { byteBase.setInt32(24, val); } public final int get_dwZBufferLow() { return byteBase.getInt32(24); } public final void set_dwZBufferHigh(int val) { byteBase.setInt32(28, val); } public final int get_dwZBufferHigh() { return byteBase.getInt32(28); } public final void set_dwZBufferBaseDest(int val) { byteBase.setInt32(32, val); } public final int get_dwZBufferBaseDest() { return byteBase.getInt32(32); } public final void set_dwZDestConstBitDepth(int val) { byteBase.setInt32(36, val); } public final int get_dwZDestConstBitDepth() { return byteBase.getInt32(36); } public final void set_dwZDestConst(int val) { byteBase.setInt32(40, val); } public final int get_dwZDestConst() { return byteBase.getInt32(40); } public final Win32.IDirectDrawSurface get_lpDDSZBufferDest() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(40)); } public final void set_dwZSrcConstBitDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 48 : 44, val); } public final int get_dwZSrcConstBitDepth() { return byteBase.getInt32(NativeBridge.is64 ? 48 : 44); } public final void set_dwZSrcConst(int val) { byteBase.setInt32(NativeBridge.is64 ? 56 : 48, val); } public final int get_dwZSrcConst() { return byteBase.getInt32(NativeBridge.is64 ? 56 : 48); } public final Win32.IDirectDrawSurface get_lpDDSZBufferSrc() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 56 : 48)); } public final void set_dwAlphaEdgeBlendBitDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 64 : 52, val); } public final int get_dwAlphaEdgeBlendBitDepth() { return byteBase.getInt32(NativeBridge.is64 ? 64 : 52); } public final void set_dwAlphaEdgeBlend(int val) { byteBase.setInt32(NativeBridge.is64 ? 68 : 56, val); } public final int get_dwAlphaEdgeBlend() { return byteBase.getInt32(NativeBridge.is64 ? 68 : 56); } public final void set_dwReserved(int val) { byteBase.setInt32(NativeBridge.is64 ? 72 : 60, val); } public final int get_dwReserved() { return byteBase.getInt32(NativeBridge.is64 ? 72 : 60); } public final void set_dwAlphaDestConstBitDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 76 : 64, val); } public final int get_dwAlphaDestConstBitDepth() { return byteBase.getInt32(NativeBridge.is64 ? 76 : 64); } public final void set_dwAlphaDestConst(int val) { byteBase.setInt32(NativeBridge.is64 ? 80 : 68, val); } public final int get_dwAlphaDestConst() { return byteBase.getInt32(NativeBridge.is64 ? 80 : 68); } public final Win32.IDirectDrawSurface get_lpDDSAlphaDest() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 80 : 68)); } public final void set_dwAlphaSrcConstBitDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 88 : 72, val); } public final int get_dwAlphaSrcConstBitDepth() { return byteBase.getInt32(NativeBridge.is64 ? 88 : 72); } public final void set_dwAlphaSrcConst(int val) { byteBase.setInt32(NativeBridge.is64 ? 96 : 76, val); } public final int get_dwAlphaSrcConst() { return byteBase.getInt32(NativeBridge.is64 ? 96 : 76); } public final Win32.IDirectDrawSurface get_lpDDSAlphaSrc() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 96 : 76)); } public final void set_dwFillColor(int val) { byteBase.setInt32(NativeBridge.is64 ? 104 : 80, val); } public final int get_dwFillColor() { return byteBase.getInt32(NativeBridge.is64 ? 104 : 80); } public final void set_dwFillDepth(int val) { byteBase.setInt32(NativeBridge.is64 ? 104 : 80, val); } public final int get_dwFillDepth() { return byteBase.getInt32(NativeBridge.is64 ? 104 : 80); } public final void set_dwFillPixel(int val) { byteBase.setInt32(NativeBridge.is64 ? 104 : 80, val); } public final int get_dwFillPixel() { return byteBase.getInt32(NativeBridge.is64 ? 104 : 80); } public final Win32.IDirectDrawSurface get_lpDDSPattern() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 104 : 80)); } public final DDCOLORKEY get_ddckDestColorkey() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 112 : 84)); } public final DDCOLORKEY get_ddckSrcColorkey() { return instance.createDDCOLORKEY(getElementPointer(NativeBridge.is64 ? 120 : 92)); } @Override public int size() { return sizeof; } } public final DDBLTFX createDDBLTFX(boolean direct) { return new DDBLTFX(direct); } public final DDBLTFX createDDBLTFX(VoidPointer base) { return new DDBLTFX(base); } public final DDBLTFX createDDBLTFX(long addr) { return new DDBLTFX(addr); } public static class DDPIXELFORMAT extends CommonStructWrapper { public static final int sizeof = 32; DDPIXELFORMAT(boolean direct) { super(sizeof, direct); } DDPIXELFORMAT(VoidPointer base) { super(base); } DDPIXELFORMAT(long addr) { super(addr); } public final void set_dwSize(int val) { byteBase.setInt32(0, val); } public final int get_dwSize() { return byteBase.getInt32(0); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_dwFourCC(int val) { byteBase.setInt32(8, val); } public final int get_dwFourCC() { return byteBase.getInt32(8); } public final void set_dwRGBBitCount(int val) { byteBase.setInt32(12, val); } public final int get_dwRGBBitCount() { return byteBase.getInt32(12); } public final void set_dwYUVBitCount(int val) { byteBase.setInt32(12, val); } public final int get_dwYUVBitCount() { return byteBase.getInt32(12); } public final void set_dwZBufferBitDepth(int val) { byteBase.setInt32(12, val); } public final int get_dwZBufferBitDepth() { return byteBase.getInt32(12); } public final void set_dwAlphaBitDepth(int val) { byteBase.setInt32(12, val); } public final int get_dwAlphaBitDepth() { return byteBase.getInt32(12); } public final void set_dwLuminanceBitCount(int val) { byteBase.setInt32(12, val); } public final int get_dwLuminanceBitCount() { return byteBase.getInt32(12); } public final void set_dwBumpBitCount(int val) { byteBase.setInt32(12, val); } public final int get_dwBumpBitCount() { return byteBase.getInt32(12); } public final void set_dwPrivateFormatBitCount(int val) { byteBase.setInt32(12, val); } public final int get_dwPrivateFormatBitCount() { return byteBase.getInt32(12); } public final void set_dwRBitMask(int val) { byteBase.setInt32(16, val); } public final int get_dwRBitMask() { return byteBase.getInt32(16); } public final void set_dwYBitMask(int val) { byteBase.setInt32(16, val); } public final int get_dwYBitMask() { return byteBase.getInt32(16); } public final void set_dwStencilBitDepth(int val) { byteBase.setInt32(16, val); } public final int get_dwStencilBitDepth() { return byteBase.getInt32(16); } public final void set_dwLuminanceBitMask(int val) { byteBase.setInt32(16, val); } public final int get_dwLuminanceBitMask() { return byteBase.getInt32(16); } public final void set_dwBumpDuBitMask(int val) { byteBase.setInt32(16, val); } public final int get_dwBumpDuBitMask() { return byteBase.getInt32(16); } public final void set_dwOperations(int val) { byteBase.setInt32(16, val); } public final int get_dwOperations() { return byteBase.getInt32(16); } public final void set_dwGBitMask(int val) { byteBase.setInt32(20, val); } public final int get_dwGBitMask() { return byteBase.getInt32(20); } public final void set_dwUBitMask(int val) { byteBase.setInt32(20, val); } public final int get_dwUBitMask() { return byteBase.getInt32(20); } public final void set_dwZBitMask(int val) { byteBase.setInt32(20, val); } public final int get_dwZBitMask() { return byteBase.getInt32(20); } public final void set_dwBumpDvBitMask(int val) { byteBase.setInt32(20, val); } public final int get_dwBumpDvBitMask() { return byteBase.getInt32(20); } public final void set_MultiSampleCaps_wFlipMSTypes(short val) { byteBase.setInt16(20, val); } public final short get_MultiSampleCaps_wFlipMSTypes() { return byteBase.getInt16(20); } public final void set_MultiSampleCaps_wBltMSTypes(short val) { byteBase.setInt16(22, val); } public final short get_MultiSampleCaps_wBltMSTypes() { return byteBase.getInt16(22); } public final void set_dwBBitMask(int val) { byteBase.setInt32(24, val); } public final int get_dwBBitMask() { return byteBase.getInt32(24); } public final void set_dwVBitMask(int val) { byteBase.setInt32(24, val); } public final int get_dwVBitMask() { return byteBase.getInt32(24); } public final void set_dwStencilBitMask(int val) { byteBase.setInt32(24, val); } public final int get_dwStencilBitMask() { return byteBase.getInt32(24); } public final void set_dwBumpLuminanceBitMask(int val) { byteBase.setInt32(24, val); } public final int get_dwBumpLuminanceBitMask() { return byteBase.getInt32(24); } public final void set_dwRGBAlphaBitMask(int val) { byteBase.setInt32(28, val); } public final int get_dwRGBAlphaBitMask() { return byteBase.getInt32(28); } public final void set_dwYUVAlphaBitMask(int val) { byteBase.setInt32(28, val); } public final int get_dwYUVAlphaBitMask() { return byteBase.getInt32(28); } public final void set_dwLuminanceAlphaBitMask(int val) { byteBase.setInt32(28, val); } public final int get_dwLuminanceAlphaBitMask() { return byteBase.getInt32(28); } public final void set_dwRGBZBitMask(int val) { byteBase.setInt32(28, val); } public final int get_dwRGBZBitMask() { return byteBase.getInt32(28); } public final void set_dwYUVZBitMask(int val) { byteBase.setInt32(28, val); } public final int get_dwYUVZBitMask() { return byteBase.getInt32(28); } @Override public int size() { return sizeof; } } public final DDPIXELFORMAT createDDPIXELFORMAT(boolean direct) { return new DDPIXELFORMAT(direct); } public final DDPIXELFORMAT createDDPIXELFORMAT(VoidPointer base) { return new DDPIXELFORMAT(base); } public final DDPIXELFORMAT createDDPIXELFORMAT(long addr) { return new DDPIXELFORMAT(addr); } public static class IDirectDrawSurface7Vtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 392 : 196; IDirectDrawSurface7Vtbl(boolean direct) { super(sizeof, direct); } IDirectDrawSurface7Vtbl(VoidPointer base) { super(base); } IDirectDrawSurface7Vtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDrawSurface7 This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall107(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDrawSurface7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall108(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDrawSurface7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall109(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_AddAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_AddAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int AddAttachedSurface(Win32.IDirectDrawSurface7 This, Win32.IDirectDrawSurface7 param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall110(get_AddAttachedSurface(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_AddOverlayDirtyRect(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_AddOverlayDirtyRect() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int AddOverlayDirtyRect(Win32.IDirectDrawSurface7 This, Win32.RECT param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall111(get_AddOverlayDirtyRect(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Blt(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_Blt() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int Blt(Win32.IDirectDrawSurface7 This, Win32.RECT param_1, Win32.IDirectDrawSurface7 param_2, Win32.RECT param_3, int param_4, Win32.DDBLTFX param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_4 = param_5 == null ? 0 : param_5.longLockPointer(); int tmp_ret = instance.proxycall112(get_Blt(), tmp_0, tmp_1, tmp_2, tmp_3, param_4, tmp_4); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_5 != null) { param_5.unlock(); } return tmp_ret; } public final void set_BltBatch(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_BltBatch() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int BltBatch(Win32.IDirectDrawSurface7 This, DDBLTBATCH param_1, int param_2, int param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall113(get_BltBatch(), tmp_0, tmp_1, param_2, param_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_BltFast(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_BltFast() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int BltFast(Win32.IDirectDrawSurface7 This, int param_1, int param_2, Win32.IDirectDrawSurface7 param_3, Win32.RECT param_4, int param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall114(get_BltFast(), tmp_0, param_1, param_2, tmp_1, tmp_2, param_5); if (This != null) { This.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_DeleteAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_DeleteAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int DeleteAttachedSurface(Win32.IDirectDrawSurface7 This, int param_1, Win32.IDirectDrawSurface7 param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall115(get_DeleteAttachedSurface(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_EnumAttachedSurfaces(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_EnumAttachedSurfaces() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int EnumAttachedSurfaces(Win32.IDirectDrawSurface7 This, VoidPointer param_1, long param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall116(get_EnumAttachedSurfaces(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_EnumOverlayZOrders(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_EnumOverlayZOrders() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int EnumOverlayZOrders(Win32.IDirectDrawSurface7 This, int param_1, VoidPointer param_2, long param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall117(get_EnumOverlayZOrders(), tmp_0, param_1, tmp_1, param_3); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_Flip(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_Flip() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int Flip(Win32.IDirectDrawSurface7 This, Win32.IDirectDrawSurface7 param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall118(get_Flip(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_GetAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int GetAttachedSurface(Win32.IDirectDrawSurface7 This, Win32.DDSCAPS2 param_1, PointerPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall119(get_GetAttachedSurface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetBltStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 104 : 52, val); } public final long get_GetBltStatus() { return byteBase.getAddress(NativeBridge.is64 ? 104 : 52); } public final int GetBltStatus(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall120(get_GetBltStatus(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetCaps(long val) { byteBase.setAddress(NativeBridge.is64 ? 112 : 56, val); } public final long get_GetCaps() { return byteBase.getAddress(NativeBridge.is64 ? 112 : 56); } public final int GetCaps(Win32.IDirectDrawSurface7 This, Win32.DDSCAPS2 param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall121(get_GetCaps(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 120 : 60, val); } public final long get_GetClipper() { return byteBase.getAddress(NativeBridge.is64 ? 120 : 60); } public final int GetClipper(Win32.IDirectDrawSurface7 This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall122(get_GetClipper(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetColorKey(long val) { byteBase.setAddress(NativeBridge.is64 ? 128 : 64, val); } public final long get_GetColorKey() { return byteBase.getAddress(NativeBridge.is64 ? 128 : 64); } public final int GetColorKey(Win32.IDirectDrawSurface7 This, int param_1, DDCOLORKEY param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall123(get_GetColorKey(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetDC(long val) { byteBase.setAddress(NativeBridge.is64 ? 136 : 68, val); } public final long get_GetDC() { return byteBase.getAddress(NativeBridge.is64 ? 136 : 68); } public final int GetDC(Win32.IDirectDrawSurface7 This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall124(get_GetDC(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetFlipStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 144 : 72, val); } public final long get_GetFlipStatus() { return byteBase.getAddress(NativeBridge.is64 ? 144 : 72); } public final int GetFlipStatus(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall125(get_GetFlipStatus(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetOverlayPosition(long val) { byteBase.setAddress(NativeBridge.is64 ? 152 : 76, val); } public final long get_GetOverlayPosition() { return byteBase.getAddress(NativeBridge.is64 ? 152 : 76); } public final int GetOverlayPosition(Win32.IDirectDrawSurface7 This, Int32Pointer param_1, Int32Pointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall126(get_GetOverlayPosition(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetPalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 160 : 80, val); } public final long get_GetPalette() { return byteBase.getAddress(NativeBridge.is64 ? 160 : 80); } public final int GetPalette(Win32.IDirectDrawSurface7 This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall127(get_GetPalette(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetPixelFormat(long val) { byteBase.setAddress(NativeBridge.is64 ? 168 : 84, val); } public final long get_GetPixelFormat() { return byteBase.getAddress(NativeBridge.is64 ? 168 : 84); } public final int GetPixelFormat(Win32.IDirectDrawSurface7 This, Win32.DDPIXELFORMAT param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall128(get_GetPixelFormat(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetSurfaceDesc(long val) { byteBase.setAddress(NativeBridge.is64 ? 176 : 88, val); } public final long get_GetSurfaceDesc() { return byteBase.getAddress(NativeBridge.is64 ? 176 : 88); } public final int GetSurfaceDesc(Win32.IDirectDrawSurface7 This, Win32.DDSURFACEDESC2 param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall129(get_GetSurfaceDesc(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 184 : 92, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 184 : 92); } public final int Initialize(Win32.IDirectDrawSurface7 This, Win32.IDirectDraw param_1, Win32.DDSURFACEDESC2 param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall130(get_Initialize(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_IsLost(long val) { byteBase.setAddress(NativeBridge.is64 ? 192 : 96, val); } public final long get_IsLost() { return byteBase.getAddress(NativeBridge.is64 ? 192 : 96); } public final int IsLost(Win32.IDirectDrawSurface7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall131(get_IsLost(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Lock(long val) { byteBase.setAddress(NativeBridge.is64 ? 200 : 100, val); } public final long get_Lock() { return byteBase.getAddress(NativeBridge.is64 ? 200 : 100); } public final int Lock(Win32.IDirectDrawSurface7 This, Win32.RECT param_1, Win32.DDSURFACEDESC2 param_2, int param_3, VoidPointer param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall132(get_Lock(), tmp_0, tmp_1, tmp_2, param_3, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_ReleaseDC(long val) { byteBase.setAddress(NativeBridge.is64 ? 208 : 104, val); } public final long get_ReleaseDC() { return byteBase.getAddress(NativeBridge.is64 ? 208 : 104); } public final int ReleaseDC(Win32.IDirectDrawSurface7 This, long param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall133(get_ReleaseDC(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Restore(long val) { byteBase.setAddress(NativeBridge.is64 ? 216 : 108, val); } public final long get_Restore() { return byteBase.getAddress(NativeBridge.is64 ? 216 : 108); } public final int Restore(Win32.IDirectDrawSurface7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall134(get_Restore(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 224 : 112, val); } public final long get_SetClipper() { return byteBase.getAddress(NativeBridge.is64 ? 224 : 112); } public final int SetClipper(Win32.IDirectDrawSurface7 This, Win32.IDirectDrawClipper param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall135(get_SetClipper(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetColorKey(long val) { byteBase.setAddress(NativeBridge.is64 ? 232 : 116, val); } public final long get_SetColorKey() { return byteBase.getAddress(NativeBridge.is64 ? 232 : 116); } public final int SetColorKey(Win32.IDirectDrawSurface7 This, int param_1, DDCOLORKEY param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall136(get_SetColorKey(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_SetOverlayPosition(long val) { byteBase.setAddress(NativeBridge.is64 ? 240 : 120, val); } public final long get_SetOverlayPosition() { return byteBase.getAddress(NativeBridge.is64 ? 240 : 120); } public final int SetOverlayPosition(Win32.IDirectDrawSurface7 This, int param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall137(get_SetOverlayPosition(), tmp_0, param_1, param_2); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetPalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 248 : 124, val); } public final long get_SetPalette() { return byteBase.getAddress(NativeBridge.is64 ? 248 : 124); } public final int SetPalette(Win32.IDirectDrawSurface7 This, Win32.IDirectDrawPalette param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall138(get_SetPalette(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Unlock(long val) { byteBase.setAddress(NativeBridge.is64 ? 256 : 128, val); } public final long get_Unlock() { return byteBase.getAddress(NativeBridge.is64 ? 256 : 128); } public final int Unlock(Win32.IDirectDrawSurface7 This, Win32.RECT param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall139(get_Unlock(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_UpdateOverlay(long val) { byteBase.setAddress(NativeBridge.is64 ? 264 : 132, val); } public final long get_UpdateOverlay() { return byteBase.getAddress(NativeBridge.is64 ? 264 : 132); } public final int UpdateOverlay(Win32.IDirectDrawSurface7 This, Win32.RECT param_1, Win32.IDirectDrawSurface7 param_2, Win32.RECT param_3, int param_4, Win32.DDOVERLAYFX param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_4 = param_5 == null ? 0 : param_5.longLockPointer(); int tmp_ret = instance.proxycall140(get_UpdateOverlay(), tmp_0, tmp_1, tmp_2, tmp_3, param_4, tmp_4); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_5 != null) { param_5.unlock(); } return tmp_ret; } public final void set_UpdateOverlayDisplay(long val) { byteBase.setAddress(NativeBridge.is64 ? 272 : 136, val); } public final long get_UpdateOverlayDisplay() { return byteBase.getAddress(NativeBridge.is64 ? 272 : 136); } public final int UpdateOverlayDisplay(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall141(get_UpdateOverlayDisplay(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_UpdateOverlayZOrder(long val) { byteBase.setAddress(NativeBridge.is64 ? 280 : 140, val); } public final long get_UpdateOverlayZOrder() { return byteBase.getAddress(NativeBridge.is64 ? 280 : 140); } public final int UpdateOverlayZOrder(Win32.IDirectDrawSurface7 This, int param_1, Win32.IDirectDrawSurface7 param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall142(get_UpdateOverlayZOrder(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetDDInterface(long val) { byteBase.setAddress(NativeBridge.is64 ? 288 : 144, val); } public final long get_GetDDInterface() { return byteBase.getAddress(NativeBridge.is64 ? 288 : 144); } public final int GetDDInterface(Win32.IDirectDrawSurface7 This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall143(get_GetDDInterface(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_PageLock(long val) { byteBase.setAddress(NativeBridge.is64 ? 296 : 148, val); } public final long get_PageLock() { return byteBase.getAddress(NativeBridge.is64 ? 296 : 148); } public final int PageLock(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall144(get_PageLock(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_PageUnlock(long val) { byteBase.setAddress(NativeBridge.is64 ? 304 : 152, val); } public final long get_PageUnlock() { return byteBase.getAddress(NativeBridge.is64 ? 304 : 152); } public final int PageUnlock(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall145(get_PageUnlock(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetSurfaceDesc(long val) { byteBase.setAddress(NativeBridge.is64 ? 312 : 156, val); } public final long get_SetSurfaceDesc() { return byteBase.getAddress(NativeBridge.is64 ? 312 : 156); } public final int SetSurfaceDesc(Win32.IDirectDrawSurface7 This, Win32.DDSURFACEDESC2 param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall146(get_SetSurfaceDesc(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetPrivateData(long val) { byteBase.setAddress(NativeBridge.is64 ? 320 : 160, val); } public final long get_SetPrivateData() { return byteBase.getAddress(NativeBridge.is64 ? 320 : 160); } public final int SetPrivateData(Win32.IDirectDrawSurface7 This, Win32.GUID param_1, VoidPointer param_2, int param_3, int param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall147(get_SetPrivateData(), tmp_0, tmp_1, tmp_2, param_3, param_4); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetPrivateData(long val) { byteBase.setAddress(NativeBridge.is64 ? 328 : 164, val); } public final long get_GetPrivateData() { return byteBase.getAddress(NativeBridge.is64 ? 328 : 164); } public final int GetPrivateData(Win32.IDirectDrawSurface7 This, Win32.GUID param_1, VoidPointer param_2, Int32Pointer param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); int tmp_ret = instance.proxycall148(get_GetPrivateData(), tmp_0, tmp_1, tmp_2, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } return tmp_ret; } public final void set_FreePrivateData(long val) { byteBase.setAddress(NativeBridge.is64 ? 336 : 168, val); } public final long get_FreePrivateData() { return byteBase.getAddress(NativeBridge.is64 ? 336 : 168); } public final int FreePrivateData(Win32.IDirectDrawSurface7 This, Win32.GUID param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall149(get_FreePrivateData(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetUniquenessValue(long val) { byteBase.setAddress(NativeBridge.is64 ? 344 : 172, val); } public final long get_GetUniquenessValue() { return byteBase.getAddress(NativeBridge.is64 ? 344 : 172); } public final int GetUniquenessValue(Win32.IDirectDrawSurface7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall150(get_GetUniquenessValue(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_ChangeUniquenessValue(long val) { byteBase.setAddress(NativeBridge.is64 ? 352 : 176, val); } public final long get_ChangeUniquenessValue() { return byteBase.getAddress(NativeBridge.is64 ? 352 : 176); } public final int ChangeUniquenessValue(Win32.IDirectDrawSurface7 This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall151(get_ChangeUniquenessValue(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetPriority(long val) { byteBase.setAddress(NativeBridge.is64 ? 360 : 180, val); } public final long get_SetPriority() { return byteBase.getAddress(NativeBridge.is64 ? 360 : 180); } public final int SetPriority(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall152(get_SetPriority(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetPriority(long val) { byteBase.setAddress(NativeBridge.is64 ? 368 : 184, val); } public final long get_GetPriority() { return byteBase.getAddress(NativeBridge.is64 ? 368 : 184); } public final int GetPriority(Win32.IDirectDrawSurface7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall153(get_GetPriority(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetLOD(long val) { byteBase.setAddress(NativeBridge.is64 ? 376 : 188, val); } public final long get_SetLOD() { return byteBase.getAddress(NativeBridge.is64 ? 376 : 188); } public final int SetLOD(Win32.IDirectDrawSurface7 This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall154(get_SetLOD(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetLOD(long val) { byteBase.setAddress(NativeBridge.is64 ? 384 : 192, val); } public final long get_GetLOD() { return byteBase.getAddress(NativeBridge.is64 ? 384 : 192); } public final int GetLOD(Win32.IDirectDrawSurface7 This, Int32Pointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall155(get_GetLOD(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDrawSurface7Vtbl createIDirectDrawSurface7Vtbl(boolean direct) { return new IDirectDrawSurface7Vtbl(direct); } public final IDirectDrawSurface7Vtbl createIDirectDrawSurface7Vtbl(VoidPointer base) { return new IDirectDrawSurface7Vtbl(base); } public final IDirectDrawSurface7Vtbl createIDirectDrawSurface7Vtbl(long addr) { return new IDirectDrawSurface7Vtbl(addr); } public static class DDCOLORKEY extends CommonStructWrapper { public static final int sizeof = 8; DDCOLORKEY(boolean direct) { super(sizeof, direct); } DDCOLORKEY(VoidPointer base) { super(base); } DDCOLORKEY(long addr) { super(addr); } public final void set_dwColorSpaceLowValue(int val) { byteBase.setInt32(0, val); } public final int get_dwColorSpaceLowValue() { return byteBase.getInt32(0); } public final void set_dwColorSpaceHighValue(int val) { byteBase.setInt32(4, val); } public final int get_dwColorSpaceHighValue() { return byteBase.getInt32(4); } @Override public int size() { return sizeof; } } public final DDCOLORKEY createDDCOLORKEY(boolean direct) { return new DDCOLORKEY(direct); } public final DDCOLORKEY createDDCOLORKEY(VoidPointer base) { return new DDCOLORKEY(base); } public final DDCOLORKEY createDDCOLORKEY(long addr) { return new DDCOLORKEY(addr); } public static class DDBLTBATCH extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 40 : 20; DDBLTBATCH(boolean direct) { super(sizeof, direct); } DDBLTBATCH(VoidPointer base) { super(base); } DDBLTBATCH(long addr) { super(addr); } public final Win32.RECT get_lprDest() { return Win32.instance.createRECT(byteBase.getAddress(0)); } public final Win32.IDirectDrawSurface get_lpDDSSrc() { return Win32.instance.createIDirectDrawSurface(byteBase.getAddress(NativeBridge.is64 ? 8 : 4)); } public final Win32.RECT get_lprSrc() { return Win32.instance.createRECT(byteBase.getAddress(NativeBridge.is64 ? 16 : 8)); } public final void set_dwFlags(int val) { byteBase.setInt32(NativeBridge.is64 ? 24 : 12, val); } public final int get_dwFlags() { return byteBase.getInt32(NativeBridge.is64 ? 24 : 12); } public final Win32.DDBLTFX get_lpDDBltFx() { return Win32.instance.createDDBLTFX(byteBase.getAddress(NativeBridge.is64 ? 32 : 16)); } @Override public int size() { return sizeof; } } public final DDBLTBATCH createDDBLTBATCH(boolean direct) { return new DDBLTBATCH(direct); } public final DDBLTBATCH createDDBLTBATCH(VoidPointer base) { return new DDBLTBATCH(base); } public final DDBLTBATCH createDDBLTBATCH(long addr) { return new DDBLTBATCH(addr); } public static class DDSCAPS extends CommonStructWrapper { public static final int sizeof = 4; DDSCAPS(boolean direct) { super(sizeof, direct); } DDSCAPS(VoidPointer base) { super(base); } DDSCAPS(long addr) { super(addr); } public final void set_dwCaps(int val) { byteBase.setInt32(0, val); } public final int get_dwCaps() { return byteBase.getInt32(0); } @Override public int size() { return sizeof; } } public final DDSCAPS createDDSCAPS(boolean direct) { return new DDSCAPS(direct); } public final DDSCAPS createDDSCAPS(VoidPointer base) { return new DDSCAPS(base); } public final DDSCAPS createDDSCAPS(long addr) { return new DDSCAPS(addr); } public static class LARGE_INTEGER extends CommonStructWrapper { public static final int sizeof = 8; LARGE_INTEGER(boolean direct) { super(sizeof, direct); } LARGE_INTEGER(VoidPointer base) { super(base); } LARGE_INTEGER(long addr) { super(addr); } public final void set_LowPart(int val) { byteBase.setInt32(0, val); } public final int get_LowPart() { return byteBase.getInt32(0); } public final void set_HighPart(int val) { byteBase.setInt32(4, val); } public final int get_HighPart() { return byteBase.getInt32(4); } public final void set_u_LowPart(int val) { byteBase.setInt32(0, val); } public final int get_u_LowPart() { return byteBase.getInt32(0); } public final void set_u_HighPart(int val) { byteBase.setInt32(4, val); } public final int get_u_HighPart() { return byteBase.getInt32(4); } public final void set_QuadPart(long val) { byteBase.setInt64(0, val); } public final long get_QuadPart() { return byteBase.getInt64(0); } @Override public int size() { return sizeof; } } public final LARGE_INTEGER createLARGE_INTEGER(boolean direct) { return new LARGE_INTEGER(direct); } public final LARGE_INTEGER createLARGE_INTEGER(VoidPointer base) { return new LARGE_INTEGER(base); } public final LARGE_INTEGER createLARGE_INTEGER(long addr) { return new LARGE_INTEGER(addr); } public static class IDirectDrawSurfaceVtbl extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 288 : 144; IDirectDrawSurfaceVtbl(boolean direct) { super(sizeof, direct); } IDirectDrawSurfaceVtbl(VoidPointer base) { super(base); } IDirectDrawSurfaceVtbl(long addr) { super(addr); } public final void set_QueryInterface(long val) { byteBase.setAddress(0, val); } public final long get_QueryInterface() { return byteBase.getAddress(0); } public final int QueryInterface(Win32.IDirectDrawSurface This, Win32.GUID riid, PointerPointer ppvObj) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = riid == null ? 0 : riid.longLockPointer(); long tmp_2 = ppvObj == null ? 0 : ppvObj.longLockPointer(); int tmp_ret = instance.proxycall156(get_QueryInterface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (riid != null) { riid.unlock(); } if (ppvObj != null) { ppvObj.unlock(); } return tmp_ret; } public final void set_AddRef(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_AddRef() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final int AddRef(Win32.IDirectDrawSurface This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall157(get_AddRef(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Release(long val) { byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val); } public final long get_Release() { return byteBase.getAddress(NativeBridge.is64 ? 16 : 8); } public final int Release(Win32.IDirectDrawSurface This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall158(get_Release(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_AddAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val); } public final long get_AddAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 24 : 12); } public final int AddAttachedSurface(Win32.IDirectDrawSurface This, Win32.IDirectDrawSurface param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall159(get_AddAttachedSurface(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_AddOverlayDirtyRect(long val) { byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val); } public final long get_AddOverlayDirtyRect() { return byteBase.getAddress(NativeBridge.is64 ? 32 : 16); } public final int AddOverlayDirtyRect(Win32.IDirectDrawSurface This, Win32.RECT param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall160(get_AddOverlayDirtyRect(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Blt(long val) { byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val); } public final long get_Blt() { return byteBase.getAddress(NativeBridge.is64 ? 40 : 20); } public final int Blt(Win32.IDirectDrawSurface This, Win32.RECT param_1, Win32.IDirectDrawSurface param_2, Win32.RECT param_3, int param_4, Win32.DDBLTFX param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_4 = param_5 == null ? 0 : param_5.longLockPointer(); int tmp_ret = instance.proxycall161(get_Blt(), tmp_0, tmp_1, tmp_2, tmp_3, param_4, tmp_4); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_5 != null) { param_5.unlock(); } return tmp_ret; } public final void set_BltBatch(long val) { byteBase.setAddress(NativeBridge.is64 ? 48 : 24, val); } public final long get_BltBatch() { return byteBase.getAddress(NativeBridge.is64 ? 48 : 24); } public final int BltBatch(Win32.IDirectDrawSurface This, Win32.DDBLTBATCH param_1, int param_2, int param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall162(get_BltBatch(), tmp_0, tmp_1, param_2, param_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_BltFast(long val) { byteBase.setAddress(NativeBridge.is64 ? 56 : 28, val); } public final long get_BltFast() { return byteBase.getAddress(NativeBridge.is64 ? 56 : 28); } public final int BltFast(Win32.IDirectDrawSurface This, int param_1, int param_2, Win32.IDirectDrawSurface param_3, Win32.RECT param_4, int param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall163(get_BltFast(), tmp_0, param_1, param_2, tmp_1, tmp_2, param_5); if (This != null) { This.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_DeleteAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 64 : 32, val); } public final long get_DeleteAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 64 : 32); } public final int DeleteAttachedSurface(Win32.IDirectDrawSurface This, int param_1, Win32.IDirectDrawSurface param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall164(get_DeleteAttachedSurface(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_EnumAttachedSurfaces(long val) { byteBase.setAddress(NativeBridge.is64 ? 72 : 36, val); } public final long get_EnumAttachedSurfaces() { return byteBase.getAddress(NativeBridge.is64 ? 72 : 36); } public final int EnumAttachedSurfaces(Win32.IDirectDrawSurface This, VoidPointer param_1, long param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall165(get_EnumAttachedSurfaces(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_EnumOverlayZOrders(long val) { byteBase.setAddress(NativeBridge.is64 ? 80 : 40, val); } public final long get_EnumOverlayZOrders() { return byteBase.getAddress(NativeBridge.is64 ? 80 : 40); } public final int EnumOverlayZOrders(Win32.IDirectDrawSurface This, int param_1, VoidPointer param_2, long param_3) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall166(get_EnumOverlayZOrders(), tmp_0, param_1, tmp_1, param_3); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_Flip(long val) { byteBase.setAddress(NativeBridge.is64 ? 88 : 44, val); } public final long get_Flip() { return byteBase.getAddress(NativeBridge.is64 ? 88 : 44); } public final int Flip(Win32.IDirectDrawSurface This, Win32.IDirectDrawSurface param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall167(get_Flip(), tmp_0, tmp_1, param_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetAttachedSurface(long val) { byteBase.setAddress(NativeBridge.is64 ? 96 : 48, val); } public final long get_GetAttachedSurface() { return byteBase.getAddress(NativeBridge.is64 ? 96 : 48); } public final int GetAttachedSurface(Win32.IDirectDrawSurface This, Win32.DDSCAPS param_1, PointerPointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall168(get_GetAttachedSurface(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetBltStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 104 : 52, val); } public final long get_GetBltStatus() { return byteBase.getAddress(NativeBridge.is64 ? 104 : 52); } public final int GetBltStatus(Win32.IDirectDrawSurface This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall169(get_GetBltStatus(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetCaps(long val) { byteBase.setAddress(NativeBridge.is64 ? 112 : 56, val); } public final long get_GetCaps() { return byteBase.getAddress(NativeBridge.is64 ? 112 : 56); } public final int GetCaps(Win32.IDirectDrawSurface This, Win32.DDSCAPS param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall170(get_GetCaps(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 120 : 60, val); } public final long get_GetClipper() { return byteBase.getAddress(NativeBridge.is64 ? 120 : 60); } public final int GetClipper(Win32.IDirectDrawSurface This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall171(get_GetClipper(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetColorKey(long val) { byteBase.setAddress(NativeBridge.is64 ? 128 : 64, val); } public final long get_GetColorKey() { return byteBase.getAddress(NativeBridge.is64 ? 128 : 64); } public final int GetColorKey(Win32.IDirectDrawSurface This, int param_1, Win32.DDCOLORKEY param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall172(get_GetColorKey(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetDC(long val) { byteBase.setAddress(NativeBridge.is64 ? 136 : 68, val); } public final long get_GetDC() { return byteBase.getAddress(NativeBridge.is64 ? 136 : 68); } public final int GetDC(Win32.IDirectDrawSurface This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall173(get_GetDC(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetFlipStatus(long val) { byteBase.setAddress(NativeBridge.is64 ? 144 : 72, val); } public final long get_GetFlipStatus() { return byteBase.getAddress(NativeBridge.is64 ? 144 : 72); } public final int GetFlipStatus(Win32.IDirectDrawSurface This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall174(get_GetFlipStatus(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_GetOverlayPosition(long val) { byteBase.setAddress(NativeBridge.is64 ? 152 : 76, val); } public final long get_GetOverlayPosition() { return byteBase.getAddress(NativeBridge.is64 ? 152 : 76); } public final int GetOverlayPosition(Win32.IDirectDrawSurface This, Int32Pointer param_1, Int32Pointer param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall175(get_GetOverlayPosition(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_GetPalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 160 : 80, val); } public final long get_GetPalette() { return byteBase.getAddress(NativeBridge.is64 ? 160 : 80); } public final int GetPalette(Win32.IDirectDrawSurface This, PointerPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall176(get_GetPalette(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetPixelFormat(long val) { byteBase.setAddress(NativeBridge.is64 ? 168 : 84, val); } public final long get_GetPixelFormat() { return byteBase.getAddress(NativeBridge.is64 ? 168 : 84); } public final int GetPixelFormat(Win32.IDirectDrawSurface This, Win32.DDPIXELFORMAT param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall177(get_GetPixelFormat(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_GetSurfaceDesc(long val) { byteBase.setAddress(NativeBridge.is64 ? 176 : 88, val); } public final long get_GetSurfaceDesc() { return byteBase.getAddress(NativeBridge.is64 ? 176 : 88); } public final int GetSurfaceDesc(Win32.IDirectDrawSurface This, Win32.DDSURFACEDESC param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall178(get_GetSurfaceDesc(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Initialize(long val) { byteBase.setAddress(NativeBridge.is64 ? 184 : 92, val); } public final long get_Initialize() { return byteBase.getAddress(NativeBridge.is64 ? 184 : 92); } public final int Initialize(Win32.IDirectDrawSurface This, Win32.IDirectDraw param_1, Win32.DDSURFACEDESC param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall179(get_Initialize(), tmp_0, tmp_1, tmp_2); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_IsLost(long val) { byteBase.setAddress(NativeBridge.is64 ? 192 : 96, val); } public final long get_IsLost() { return byteBase.getAddress(NativeBridge.is64 ? 192 : 96); } public final int IsLost(Win32.IDirectDrawSurface This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall180(get_IsLost(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Lock(long val) { byteBase.setAddress(NativeBridge.is64 ? 200 : 100, val); } public final long get_Lock() { return byteBase.getAddress(NativeBridge.is64 ? 200 : 100); } public final int Lock(Win32.IDirectDrawSurface This, Win32.RECT param_1, Win32.DDSURFACEDESC param_2, int param_3, VoidPointer param_4) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer(); int tmp_ret = instance.proxycall181(get_Lock(), tmp_0, tmp_1, tmp_2, param_3, tmp_3); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_4 != null) { param_4.unlock(); } return tmp_ret; } public final void set_ReleaseDC(long val) { byteBase.setAddress(NativeBridge.is64 ? 208 : 104, val); } public final long get_ReleaseDC() { return byteBase.getAddress(NativeBridge.is64 ? 208 : 104); } public final int ReleaseDC(Win32.IDirectDrawSurface This, long param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall182(get_ReleaseDC(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_Restore(long val) { byteBase.setAddress(NativeBridge.is64 ? 216 : 108, val); } public final long get_Restore() { return byteBase.getAddress(NativeBridge.is64 ? 216 : 108); } public final int Restore(Win32.IDirectDrawSurface This) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall183(get_Restore(), tmp_0); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetClipper(long val) { byteBase.setAddress(NativeBridge.is64 ? 224 : 112, val); } public final long get_SetClipper() { return byteBase.getAddress(NativeBridge.is64 ? 224 : 112); } public final int SetClipper(Win32.IDirectDrawSurface This, Win32.IDirectDrawClipper param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall184(get_SetClipper(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_SetColorKey(long val) { byteBase.setAddress(NativeBridge.is64 ? 232 : 116, val); } public final long get_SetColorKey() { return byteBase.getAddress(NativeBridge.is64 ? 232 : 116); } public final int SetColorKey(Win32.IDirectDrawSurface This, int param_1, Win32.DDCOLORKEY param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall185(get_SetColorKey(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } public final void set_SetOverlayPosition(long val) { byteBase.setAddress(NativeBridge.is64 ? 240 : 120, val); } public final long get_SetOverlayPosition() { return byteBase.getAddress(NativeBridge.is64 ? 240 : 120); } public final int SetOverlayPosition(Win32.IDirectDrawSurface This, int param_1, int param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall186(get_SetOverlayPosition(), tmp_0, param_1, param_2); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_SetPalette(long val) { byteBase.setAddress(NativeBridge.is64 ? 248 : 124, val); } public final long get_SetPalette() { return byteBase.getAddress(NativeBridge.is64 ? 248 : 124); } public final int SetPalette(Win32.IDirectDrawSurface This, Win32.IDirectDrawPalette param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall187(get_SetPalette(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_Unlock(long val) { byteBase.setAddress(NativeBridge.is64 ? 256 : 128, val); } public final long get_Unlock() { return byteBase.getAddress(NativeBridge.is64 ? 256 : 128); } public final int Unlock(Win32.IDirectDrawSurface This, VoidPointer param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); int tmp_ret = instance.proxycall188(get_Unlock(), tmp_0, tmp_1); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } return tmp_ret; } public final void set_UpdateOverlay(long val) { byteBase.setAddress(NativeBridge.is64 ? 264 : 132, val); } public final long get_UpdateOverlay() { return byteBase.getAddress(NativeBridge.is64 ? 264 : 132); } public final int UpdateOverlay(Win32.IDirectDrawSurface This, Win32.RECT param_1, Win32.IDirectDrawSurface param_2, Win32.RECT param_3, int param_4, Win32.DDOVERLAYFX param_5) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer(); long tmp_2 = param_2 == null ? 0 : param_2.longLockPointer(); long tmp_3 = param_3 == null ? 0 : param_3.longLockPointer(); long tmp_4 = param_5 == null ? 0 : param_5.longLockPointer(); int tmp_ret = instance.proxycall189(get_UpdateOverlay(), tmp_0, tmp_1, tmp_2, tmp_3, param_4, tmp_4); if (This != null) { This.unlock(); } if (param_1 != null) { param_1.unlock(); } if (param_2 != null) { param_2.unlock(); } if (param_3 != null) { param_3.unlock(); } if (param_5 != null) { param_5.unlock(); } return tmp_ret; } public final void set_UpdateOverlayDisplay(long val) { byteBase.setAddress(NativeBridge.is64 ? 272 : 136, val); } public final long get_UpdateOverlayDisplay() { return byteBase.getAddress(NativeBridge.is64 ? 272 : 136); } public final int UpdateOverlayDisplay(Win32.IDirectDrawSurface This, int param_1) { long tmp_0 = This == null ? 0 : This.longLockPointer(); int tmp_ret = instance.proxycall190(get_UpdateOverlayDisplay(), tmp_0, param_1); if (This != null) { This.unlock(); } return tmp_ret; } public final void set_UpdateOverlayZOrder(long val) { byteBase.setAddress(NativeBridge.is64 ? 280 : 140, val); } public final long get_UpdateOverlayZOrder() { return byteBase.getAddress(NativeBridge.is64 ? 280 : 140); } public final int UpdateOverlayZOrder(Win32.IDirectDrawSurface This, int param_1, Win32.IDirectDrawSurface param_2) { long tmp_0 = This == null ? 0 : This.longLockPointer(); long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer(); int tmp_ret = instance.proxycall191(get_UpdateOverlayZOrder(), tmp_0, param_1, tmp_1); if (This != null) { This.unlock(); } if (param_2 != null) { param_2.unlock(); } return tmp_ret; } @Override public int size() { return sizeof; } } public final IDirectDrawSurfaceVtbl createIDirectDrawSurfaceVtbl(boolean direct) { return new IDirectDrawSurfaceVtbl(direct); } public final IDirectDrawSurfaceVtbl createIDirectDrawSurfaceVtbl(VoidPointer base) { return new IDirectDrawSurfaceVtbl(base); } public final IDirectDrawSurfaceVtbl createIDirectDrawSurfaceVtbl(long addr) { return new IDirectDrawSurfaceVtbl(addr); } final native int proxycall31(long fnptr, long This, long riid, long ppvObj); final native int proxycall32(long fnptr, long This); final native int proxycall33(long fnptr, long This); final native int proxycall34(long fnptr, long This, long param_1); final native int proxycall35(long fnptr, long This, int param_1, int param_2, int param_3, long param_4); final native int proxycall36(long fnptr, long This, long param_1, int param_2, long param_3); final native int proxycall37(long fnptr, long This, int param_1, int param_2, int param_3, long param_4); final native int proxycall38(long fnptr, long This, long riid, long ppvObj); final native int proxycall39(long fnptr, long This); final native int proxycall40(long fnptr, long This); final native int proxycall41(long fnptr, long This); final native int proxycall42(long fnptr, long This, int param_1, long param_2, long param_3); final native int proxycall43(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall44(long fnptr, long This, long param_1, long param_2, long param_3); final native int proxycall45(long fnptr, long This, long param_1, long param_2); final native int proxycall46(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall47(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall48(long fnptr, long This); final native int proxycall49(long fnptr, long This, long param_1, long param_2); final native int proxycall50(long fnptr, long This, long param_1); final native int proxycall51(long fnptr, long This, long param_1, long param_2); final native int proxycall52(long fnptr, long This, long param_1); final native int proxycall53(long fnptr, long This, long param_1); final native int proxycall54(long fnptr, long This, long param_1); final native int proxycall55(long fnptr, long This, long param_1); final native int proxycall56(long fnptr, long This, long param_1); final native int proxycall57(long fnptr, long This); final native int proxycall58(long fnptr, long This, long param_1, int param_2); final native int proxycall59(long fnptr, long This, int param_1, int param_2, int param_3, int param_4, int param_5); final native int proxycall60(long fnptr, long This, int param_1, long param_2); final native int proxycall61(long fnptr, long This, long param_1, long param_2, long param_3); final native int proxycall62(long fnptr, long This, long param_1, long param_2); final native int proxycall63(long fnptr, long This); final native int proxycall64(long fnptr, long This); final native int proxycall65(long fnptr, long This, long param_1, int param_2); final native int proxycall66(long fnptr, long This, long param_1, int param_2, int param_3); final native int proxycall67(long fnptr, long This, int param_1, long param_2); final native int proxycall68(long fnptr, long This, long riid, long ppvObj); final native int proxycall69(long fnptr, long This); final native int proxycall70(long fnptr, long This); final native int proxycall71(long fnptr, long This, long param_1, long param_2, long param_3); final native int proxycall72(long fnptr, long This, long param_1); final native int proxycall73(long fnptr, long This, long param_1, int param_2); final native int proxycall74(long fnptr, long This, long param_1); final native int proxycall75(long fnptr, long This, long param_1, int param_2); final native int proxycall76(long fnptr, long This, int param_1, long param_2); final native int proxycall77(long fnptr, long This, long riid, long ppvObj); final native int proxycall78(long fnptr, long This); final native int proxycall79(long fnptr, long This); final native int proxycall80(long fnptr, long This); final native int proxycall81(long fnptr, long This, int param_1, long param_2, long param_3); final native int proxycall82(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall83(long fnptr, long This, long param_1, long param_2, long param_3); final native int proxycall84(long fnptr, long This, long param_1, long param_2); final native int proxycall85(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall86(long fnptr, long This, int param_1, long param_2, long param_3, long param_4); final native int proxycall87(long fnptr, long This); final native int proxycall88(long fnptr, long This, long param_1, long param_2); final native int proxycall89(long fnptr, long This, long param_1); final native int proxycall90(long fnptr, long This, long param_1, long param_2); final native int proxycall91(long fnptr, long This, long param_1); final native int proxycall92(long fnptr, long This, long param_1); final native int proxycall93(long fnptr, long This, long param_1); final native int proxycall94(long fnptr, long This, long param_1); final native int proxycall95(long fnptr, long This, long param_1); final native int proxycall96(long fnptr, long This); final native int proxycall97(long fnptr, long This, long param_1, int param_2); final native int proxycall98(long fnptr, long This, int param_1, int param_2, int param_3); final native int proxycall99(long fnptr, long This, int param_1, long param_2); final native int proxycall100(long fnptr, long This, long riid, long ppvObject); final native int proxycall101(long fnptr, long This); final native int proxycall102(long fnptr, long This); final native int proxycall103(long fnptr, long This, int celt, long rgelt, long pceltFetched); final native int proxycall104(long fnptr, long This, int celt); final native int proxycall105(long fnptr, long This); final native int proxycall106(long fnptr, long This, long ppenum); final native int proxycall107(long fnptr, long This, long riid, long ppvObj); final native int proxycall108(long fnptr, long This); final native int proxycall109(long fnptr, long This); final native int proxycall110(long fnptr, long This, long param_1); final native int proxycall111(long fnptr, long This, long param_1); final native int proxycall112(long fnptr, long This, long param_1, long param_2, long param_3, int param_4, long param_5); final native int proxycall113(long fnptr, long This, long param_1, int param_2, int param_3); final native int proxycall114(long fnptr, long This, int param_1, int param_2, long param_3, long param_4, int param_5); final native int proxycall115(long fnptr, long This, int param_1, long param_2); final native int proxycall116(long fnptr, long This, long param_1, long param_2); final native int proxycall117(long fnptr, long This, int param_1, long param_2, long param_3); final native int proxycall118(long fnptr, long This, long param_1, int param_2); final native int proxycall119(long fnptr, long This, long param_1, long param_2); final native int proxycall120(long fnptr, long This, int param_1); final native int proxycall121(long fnptr, long This, long param_1); final native int proxycall122(long fnptr, long This, long param_1); final native int proxycall123(long fnptr, long This, int param_1, long param_2); final native int proxycall124(long fnptr, long This, long param_1); final native int proxycall125(long fnptr, long This, int param_1); final native int proxycall126(long fnptr, long This, long param_1, long param_2); final native int proxycall127(long fnptr, long This, long param_1); final native int proxycall128(long fnptr, long This, long param_1); final native int proxycall129(long fnptr, long This, long param_1); final native int proxycall130(long fnptr, long This, long param_1, long param_2); final native int proxycall131(long fnptr, long This); final native int proxycall132(long fnptr, long This, long param_1, long param_2, int param_3, long param_4); final native int proxycall133(long fnptr, long This, long param_1); final native int proxycall134(long fnptr, long This); final native int proxycall135(long fnptr, long This, long param_1); final native int proxycall136(long fnptr, long This, int param_1, long param_2); final native int proxycall137(long fnptr, long This, int param_1, int param_2); final native int proxycall138(long fnptr, long This, long param_1); final native int proxycall139(long fnptr, long This, long param_1); final native int proxycall140(long fnptr, long This, long param_1, long param_2, long param_3, int param_4, long param_5); final native int proxycall141(long fnptr, long This, int param_1); final native int proxycall142(long fnptr, long This, int param_1, long param_2); final native int proxycall143(long fnptr, long This, long param_1); final native int proxycall144(long fnptr, long This, int param_1); final native int proxycall145(long fnptr, long This, int param_1); final native int proxycall146(long fnptr, long This, long param_1, int param_2); final native int proxycall147(long fnptr, long This, long param_1, long param_2, int param_3, int param_4); final native int proxycall148(long fnptr, long This, long param_1, long param_2, long param_3); final native int proxycall149(long fnptr, long This, long param_1); final native int proxycall150(long fnptr, long This, long param_1); final native int proxycall151(long fnptr, long This); final native int proxycall152(long fnptr, long This, int param_1); final native int proxycall153(long fnptr, long This, long param_1); final native int proxycall154(long fnptr, long This, int param_1); final native int proxycall155(long fnptr, long This, long param_1); final native int proxycall156(long fnptr, long This, long riid, long ppvObj); final native int proxycall157(long fnptr, long This); final native int proxycall158(long fnptr, long This); final native int proxycall159(long fnptr, long This, long param_1); final native int proxycall160(long fnptr, long This, long param_1); final native int proxycall161(long fnptr, long This, long param_1, long param_2, long param_3, int param_4, long param_5); final native int proxycall162(long fnptr, long This, long param_1, int param_2, int param_3); final native int proxycall163(long fnptr, long This, int param_1, int param_2, long param_3, long param_4, int param_5); final native int proxycall164(long fnptr, long This, int param_1, long param_2); final native int proxycall165(long fnptr, long This, long param_1, long param_2); final native int proxycall166(long fnptr, long This, int param_1, long param_2, long param_3); final native int proxycall167(long fnptr, long This, long param_1, int param_2); final native int proxycall168(long fnptr, long This, long param_1, long param_2); final native int proxycall169(long fnptr, long This, int param_1); final native int proxycall170(long fnptr, long This, long param_1); final native int proxycall171(long fnptr, long This, long param_1); final native int proxycall172(long fnptr, long This, int param_1, long param_2); final native int proxycall173(long fnptr, long This, long param_1); final native int proxycall174(long fnptr, long This, int param_1); final native int proxycall175(long fnptr, long This, long param_1, long param_2); final native int proxycall176(long fnptr, long This, long param_1); final native int proxycall177(long fnptr, long This, long param_1); final native int proxycall178(long fnptr, long This, long param_1); final native int proxycall179(long fnptr, long This, long param_1, long param_2); final native int proxycall180(long fnptr, long This); final native int proxycall181(long fnptr, long This, long param_1, long param_2, int param_3, long param_4); final native int proxycall182(long fnptr, long This, long param_1); final native int proxycall183(long fnptr, long This); final native int proxycall184(long fnptr, long This, long param_1); final native int proxycall185(long fnptr, long This, int param_1, long param_2); final native int proxycall186(long fnptr, long This, int param_1, int param_2); final native int proxycall187(long fnptr, long This, long param_1); final native int proxycall188(long fnptr, long This, long param_1); final native int proxycall189(long fnptr, long This, long param_1, long param_2, long param_3, int param_4, long param_5); final native int proxycall190(long fnptr, long This, int param_1); final native int proxycall191(long fnptr, long This, int param_1, long param_2); public static class LOGFONTW extends CommonStructWrapper { public static final int sizeof = 92; LOGFONTW(boolean direct) { super(sizeof, direct); } LOGFONTW(VoidPointer base) { super(base); } LOGFONTW(long addr) { super(addr); } public final void set_lfHeight(int val) { byteBase.setInt32(0, val); } public final int get_lfHeight() { return byteBase.getInt32(0); } public final void set_lfWidth(int val) { byteBase.setInt32(4, val); } public final int get_lfWidth() { return byteBase.getInt32(4); } public final void set_lfEscapement(int val) { byteBase.setInt32(8, val); } public final int get_lfEscapement() { return byteBase.getInt32(8); } public final void set_lfOrientation(int val) { byteBase.setInt32(12, val); } public final int get_lfOrientation() { return byteBase.getInt32(12); } public final void set_lfWeight(int val) { byteBase.setInt32(16, val); } public final int get_lfWeight() { return byteBase.getInt32(16); } public final void set_lfItalic(byte val) { byteBase.set(20, val); } public final byte get_lfItalic() { return byteBase.get(20); } public final void set_lfUnderline(byte val) { byteBase.set(21, val); } public final byte get_lfUnderline() { return byteBase.get(21); } public final void set_lfStrikeOut(byte val) { byteBase.set(22, val); } public final byte get_lfStrikeOut() { return byteBase.get(22); } public final void set_lfCharSet(byte val) { byteBase.set(23, val); } public final byte get_lfCharSet() { return byteBase.get(23); } public final void set_lfOutPrecision(byte val) { byteBase.set(24, val); } public final byte get_lfOutPrecision() { return byteBase.get(24); } public final void set_lfClipPrecision(byte val) { byteBase.set(25, val); } public final byte get_lfClipPrecision() { return byteBase.get(25); } public final void set_lfQuality(byte val) { byteBase.set(26, val); } public final byte get_lfQuality() { return byteBase.get(26); } public final void set_lfPitchAndFamily(byte val) { byteBase.set(27, val); } public final byte get_lfPitchAndFamily() { return byteBase.get(27); } public final Int16Pointer get_lfFaceName() { return nb.createInt16Pointer(getElementPointer(28)); } @Override public int size() { return sizeof; } } public final LOGFONTW createLOGFONTW(boolean direct) { return new LOGFONTW(direct); } public final LOGFONTW createLOGFONTW(VoidPointer base) { return new LOGFONTW(base); } public final LOGFONTW createLOGFONTW(long addr) { return new LOGFONTW(addr); } public static class HIGHCONTRASTA extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 16 : 12; HIGHCONTRASTA(boolean direct) { super(sizeof, direct); } HIGHCONTRASTA(VoidPointer base) { super(base); } HIGHCONTRASTA(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final void set_dwFlags(int val) { byteBase.setInt32(4, val); } public final int get_dwFlags() { return byteBase.getInt32(4); } public final void set_lpszDefaultScheme(Int8Pointer val) { byteBase.setPointer(8, val); } public final Int8Pointer get_lpszDefaultScheme() { return nb.createInt8Pointer(byteBase.getAddress(8)); } @Override public int size() { return sizeof; } } public final HIGHCONTRASTA createHIGHCONTRASTA(boolean direct) { return new HIGHCONTRASTA(direct); } public final HIGHCONTRASTA createHIGHCONTRASTA(VoidPointer base) { return new HIGHCONTRASTA(base); } public final HIGHCONTRASTA createHIGHCONTRASTA(long addr) { return new HIGHCONTRASTA(addr); } public static class OFNOTIFYEXW extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 48 : 24; OFNOTIFYEXW(boolean direct) { super(sizeof, direct); } OFNOTIFYEXW(VoidPointer base) { super(base); } OFNOTIFYEXW(long addr) { super(addr); } public final NMHDR get_hdr() { return instance.createNMHDR(getElementPointer(0)); } public final Win32.OPENFILENAMEW get_lpOFN() { return Win32.instance.createOPENFILENAMEW(byteBase.getAddress(NativeBridge.is64 ? 24 : 12)); } public final void set_psf(VoidPointer val) { byteBase.setPointer(NativeBridge.is64 ? 32 : 16, val); } public final VoidPointer get_psf() { return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 32 : 16)); } public final void set_pidl(VoidPointer val) { byteBase.setPointer(NativeBridge.is64 ? 40 : 20, val); } public final VoidPointer get_pidl() { return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 40 : 20)); } @Override public int size() { return sizeof; } } public final OFNOTIFYEXW createOFNOTIFYEXW(boolean direct) { return new OFNOTIFYEXW(direct); } public final OFNOTIFYEXW createOFNOTIFYEXW(VoidPointer base) { return new OFNOTIFYEXW(base); } public final OFNOTIFYEXW createOFNOTIFYEXW(long addr) { return new OFNOTIFYEXW(addr); } public static class ICONMETRICSW extends CommonStructWrapper { public static final int sizeof = 108; ICONMETRICSW(boolean direct) { super(sizeof, direct); } ICONMETRICSW(VoidPointer base) { super(base); } ICONMETRICSW(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final void set_iHorzSpacing(int val) { byteBase.setInt32(4, val); } public final int get_iHorzSpacing() { return byteBase.getInt32(4); } public final void set_iVertSpacing(int val) { byteBase.setInt32(8, val); } public final int get_iVertSpacing() { return byteBase.getInt32(8); } public final void set_iTitleWrap(int val) { byteBase.setInt32(12, val); } public final int get_iTitleWrap() { return byteBase.getInt32(12); } public final Win32.LOGFONTW get_lfFont() { return Win32.instance.createLOGFONTW(getElementPointer(16)); } @Override public int size() { return sizeof; } } public final ICONMETRICSW createICONMETRICSW(boolean direct) { return new ICONMETRICSW(direct); } public final ICONMETRICSW createICONMETRICSW(VoidPointer base) { return new ICONMETRICSW(base); } public final ICONMETRICSW createICONMETRICSW(long addr) { return new ICONMETRICSW(addr); } public static class TTPOLYGONHEADER extends CommonStructWrapper { public static final int sizeof = 16; TTPOLYGONHEADER(boolean direct) { super(sizeof, direct); } TTPOLYGONHEADER(VoidPointer base) { super(base); } TTPOLYGONHEADER(long addr) { super(addr); } public final void set_cb(int val) { byteBase.setInt32(0, val); } public final int get_cb() { return byteBase.getInt32(0); } public final void set_dwType(int val) { byteBase.setInt32(4, val); } public final int get_dwType() { return byteBase.getInt32(4); } public final POINTFX get_pfxStart() { return instance.createPOINTFX(getElementPointer(8)); } @Override public int size() { return sizeof; } } public final TTPOLYGONHEADER createTTPOLYGONHEADER(boolean direct) { return new TTPOLYGONHEADER(direct); } public final TTPOLYGONHEADER createTTPOLYGONHEADER(VoidPointer base) { return new TTPOLYGONHEADER(base); } public final TTPOLYGONHEADER createTTPOLYGONHEADER(long addr) { return new TTPOLYGONHEADER(addr); } public static class NONCLIENTMETRICSW extends CommonStructWrapper { public static final int sizeof = 500; NONCLIENTMETRICSW(boolean direct) { super(sizeof, direct); } NONCLIENTMETRICSW(VoidPointer base) { super(base); } NONCLIENTMETRICSW(long addr) { super(addr); } public final void set_cbSize(int val) { byteBase.setInt32(0, val); } public final int get_cbSize() { return byteBase.getInt32(0); } public final void set_iBorderWidth(int val) { byteBase.setInt32(4, val); } public final int get_iBorderWidth() { return byteBase.getInt32(4); } public final void set_iScrollWidth(int val) { byteBase.setInt32(8, val); } public final int get_iScrollWidth() { return byteBase.getInt32(8); } public final void set_iScrollHeight(int val) { byteBase.setInt32(12, val); } public final int get_iScrollHeight() { return byteBase.getInt32(12); } public final void set_iCaptionWidth(int val) { byteBase.setInt32(16, val); } public final int get_iCaptionWidth() { return byteBase.getInt32(16); } public final void set_iCaptionHeight(int val) { byteBase.setInt32(20, val); } public final int get_iCaptionHeight() { return byteBase.getInt32(20); } public final Win32.LOGFONTW get_lfCaptionFont() { return Win32.instance.createLOGFONTW(getElementPointer(24)); } public final void set_iSmCaptionWidth(int val) { byteBase.setInt32(116, val); } public final int get_iSmCaptionWidth() { return byteBase.getInt32(116); } public final void set_iSmCaptionHeight(int val) { byteBase.setInt32(120, val); } public final int get_iSmCaptionHeight() { return byteBase.getInt32(120); } public final Win32.LOGFONTW get_lfSmCaptionFont() { return Win32.instance.createLOGFONTW(getElementPointer(124)); } public final void set_iMenuWidth(int val) { byteBase.setInt32(216, val); } public final int get_iMenuWidth() { return byteBase.getInt32(216); } public final void set_iMenuHeight(int val) { byteBase.setInt32(220, val); } public final int get_iMenuHeight() { return byteBase.getInt32(220); } public final Win32.LOGFONTW get_lfMenuFont() { return Win32.instance.createLOGFONTW(getElementPointer(224)); } public final Win32.LOGFONTW get_lfStatusFont() { return Win32.instance.createLOGFONTW(getElementPointer(316)); } public final Win32.LOGFONTW get_lfMessageFont() { return Win32.instance.createLOGFONTW(getElementPointer(408)); } @Override public int size() { return sizeof; } } public final NONCLIENTMETRICSW createNONCLIENTMETRICSW(boolean direct) { return new NONCLIENTMETRICSW(direct); } public final NONCLIENTMETRICSW createNONCLIENTMETRICSW(VoidPointer base) { return new NONCLIENTMETRICSW(base); } public final NONCLIENTMETRICSW createNONCLIENTMETRICSW(long addr) { return new NONCLIENTMETRICSW(addr); } public static class MINMAXINFO extends CommonStructWrapper { public static final int sizeof = 40; MINMAXINFO(boolean direct) { super(sizeof, direct); } MINMAXINFO(VoidPointer base) { super(base); } MINMAXINFO(long addr) { super(addr); } public final Win32.POINT get_ptReserved() { return Win32.instance.createPOINT(getElementPointer(0)); } public final Win32.POINT get_ptMaxSize() { return Win32.instance.createPOINT(getElementPointer(8)); } public final Win32.POINT get_ptMaxPosition() { return Win32.instance.createPOINT(getElementPointer(16)); } public final Win32.POINT get_ptMinTrackSize() { return Win32.instance.createPOINT(getElementPointer(24)); } public final Win32.POINT get_ptMaxTrackSize() { return Win32.instance.createPOINT(getElementPointer(32)); } @Override public int size() { return sizeof; } } public final MINMAXINFO createMINMAXINFO(boolean direct) { return new MINMAXINFO(direct); } public final MINMAXINFO createMINMAXINFO(VoidPointer base) { return new MINMAXINFO(base); } public final MINMAXINFO createMINMAXINFO(long addr) { return new MINMAXINFO(addr); } public static class SHDESCRIPTIONID extends CommonStructWrapper { public static final int sizeof = 20; SHDESCRIPTIONID(boolean direct) { super(sizeof, direct); } SHDESCRIPTIONID(VoidPointer base) { super(base); } SHDESCRIPTIONID(long addr) { super(addr); } public final void set_dwDescriptionId(int val) { byteBase.setInt32(0, val); } public final int get_dwDescriptionId() { return byteBase.getInt32(0); } public final Win32.GUID get_clsid() { return Win32.instance.createGUID(getElementPointer(4)); } @Override public int size() { return sizeof; } } public final SHDESCRIPTIONID createSHDESCRIPTIONID(boolean direct) { return new SHDESCRIPTIONID(direct); } public final SHDESCRIPTIONID createSHDESCRIPTIONID(VoidPointer base) { return new SHDESCRIPTIONID(base); } public final SHDESCRIPTIONID createSHDESCRIPTIONID(long addr) { return new SHDESCRIPTIONID(addr); } public static class STYLESTRUCT extends CommonStructWrapper { public static final int sizeof = 8; STYLESTRUCT(boolean direct) { super(sizeof, direct); } STYLESTRUCT(VoidPointer base) { super(base); } STYLESTRUCT(long addr) { super(addr); } public final void set_styleOld(int val) { byteBase.setInt32(0, val); } public final int get_styleOld() { return byteBase.getInt32(0); } public final void set_styleNew(int val) { byteBase.setInt32(4, val); } public final int get_styleNew() { return byteBase.getInt32(4); } @Override public int size() { return sizeof; } } public final STYLESTRUCT createSTYLESTRUCT(boolean direct) { return new STYLESTRUCT(direct); } public final STYLESTRUCT createSTYLESTRUCT(VoidPointer base) { return new STYLESTRUCT(base); } public final STYLESTRUCT createSTYLESTRUCT(long addr) { return new STYLESTRUCT(addr); } public static class TTPOLYCURVE extends CommonStructWrapper { public static final int sizeof = 12; TTPOLYCURVE(boolean direct) { super(sizeof, direct); } TTPOLYCURVE(VoidPointer base) { super(base); } TTPOLYCURVE(long addr) { super(addr); } public final void set_wType(short val) { byteBase.setInt16(0, val); } public final short get_wType() { return byteBase.getInt16(0); } public final void set_cpfx(short val) { byteBase.setInt16(2, val); } public final short get_cpfx() { return byteBase.getInt16(2); } public final Int8Pointer get_apfx() { return nb.createInt8Pointer(getElementPointer(4)); } @Override public int size() { return sizeof; } } public final TTPOLYCURVE createTTPOLYCURVE(boolean direct) { return new TTPOLYCURVE(direct); } public final TTPOLYCURVE createTTPOLYCURVE(VoidPointer base) { return new TTPOLYCURVE(base); } public final TTPOLYCURVE createTTPOLYCURVE(long addr) { return new TTPOLYCURVE(addr); } public static class MONITORINFOEXW extends CommonStructWrapper { public static final int sizeof = 104; MONITORINFOEXW(boolean direct) { super(sizeof, direct); } MONITORINFOEXW(VoidPointer base) { super(base); } MONITORINFOEXW(long addr) { super(addr); } public final Win32.MONITORINFO get_MONITORINFO() { return Win32.instance.createMONITORINFO(getElementPointer(0)); } public final Int16Pointer get_szDevice() { return nb.createInt16Pointer(getElementPointer(40)); } @Override public int size() { return sizeof; } } public final MONITORINFOEXW createMONITORINFOEXW(boolean direct) { return new MONITORINFOEXW(direct); } public final MONITORINFOEXW createMONITORINFOEXW(VoidPointer base) { return new MONITORINFOEXW(base); } public final MONITORINFOEXW createMONITORINFOEXW(long addr) { return new MONITORINFOEXW(addr); } public static class WINDOWPOS extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 40 : 28; WINDOWPOS(boolean direct) { super(sizeof, direct); } WINDOWPOS(VoidPointer base) { super(base); } WINDOWPOS(long addr) { super(addr); } public final void set_hwnd(long val) { byteBase.setAddress(0, val); } public final long get_hwnd() { return byteBase.getAddress(0); } public final void set_hwndInsertAfter(long val) { byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val); } public final long get_hwndInsertAfter() { return byteBase.getAddress(NativeBridge.is64 ? 8 : 4); } public final void set_x(int val) { byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val); } public final int get_x() { return byteBase.getInt32(NativeBridge.is64 ? 16 : 8); } public final void set_y(int val) { byteBase.setInt32(NativeBridge.is64 ? 20 : 12, val); } public final int get_y() { return byteBase.getInt32(NativeBridge.is64 ? 20 : 12); } public final void set_cx(int val) { byteBase.setInt32(NativeBridge.is64 ? 24 : 16, val); } public final int get_cx() { return byteBase.getInt32(NativeBridge.is64 ? 24 : 16); } public final void set_cy(int val) { byteBase.setInt32(NativeBridge.is64 ? 28 : 20, val); } public final int get_cy() { return byteBase.getInt32(NativeBridge.is64 ? 28 : 20); } public final void set_flags(int val) { byteBase.setInt32(NativeBridge.is64 ? 32 : 24, val); } public final int get_flags() { return byteBase.getInt32(NativeBridge.is64 ? 32 : 24); } @Override public int size() { return sizeof; } } public final WINDOWPOS createWINDOWPOS(boolean direct) { return new WINDOWPOS(direct); } public final WINDOWPOS createWINDOWPOS(VoidPointer base) { return new WINDOWPOS(base); } public final WINDOWPOS createWINDOWPOS(long addr) { return new WINDOWPOS(addr); } public static class NMHDR extends CommonStructWrapper { public static final int sizeof = NativeBridge.is64 ? 24 : 12; NMHDR(boolean direct) { super(sizeof, direct); } NMHDR(VoidPointer base) { super(base); } NMHDR(long addr) { super(addr); } public final void set_hwndFrom(long val) { byteBase.setAddress(0, val); } public final long get_hwndFrom() { return byteBase.getAddress(0); } public final void set_idFrom(long val) { byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val); } public final long get_idFrom() { return byteBase.getCLong(NativeBridge.is64 ? 8 : 4); } public final void set_code(int val) { byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val); } public final int get_code() { return byteBase.getInt32(NativeBridge.is64 ? 16 : 8); } @Override public int size() { return sizeof; } } public final NMHDR createNMHDR(boolean direct) { return new NMHDR(direct); } public final NMHDR createNMHDR(VoidPointer base) { return new NMHDR(base); } public final NMHDR createNMHDR(long addr) { return new NMHDR(addr); } public static class POINTFX extends CommonStructWrapper { public static final int sizeof = 8; POINTFX(boolean direct) { super(sizeof, direct); } POINTFX(VoidPointer base) { super(base); } POINTFX(long addr) { super(addr); } public final FIXED get_x() { return instance.createFIXED(getElementPointer(0)); } public final FIXED get_y() { return instance.createFIXED(getElementPointer(4)); } @Override public int size() { return sizeof; } } public final POINTFX createPOINTFX(boolean direct) { return new POINTFX(direct); } public final POINTFX createPOINTFX(VoidPointer base) { return new POINTFX(base); } public final POINTFX createPOINTFX(long addr) { return new POINTFX(addr); } public static class FIXED extends CommonStructWrapper { public static final int sizeof = 4; FIXED(boolean direct) { super(sizeof, direct); } FIXED(VoidPointer base) { super(base); } FIXED(long addr) { super(addr); } public final void set_fract(short val) { byteBase.setInt16(0, val); } public final short get_fract() { return byteBase.getInt16(0); } public final void set_value(short val) { byteBase.setInt16(2, val); } public final short get_value() { return byteBase.getInt16(2); } @Override public int size() { return sizeof; } } public final FIXED createFIXED(boolean direct) { return new FIXED(direct); } public final FIXED createFIXED(VoidPointer base) { return new FIXED(base); } public final FIXED createFIXED(long addr) { return new FIXED(addr); } }
38.276237
225
0.584352
07c2c318cf33258d55a1b6a76b8a2a77b29c34a9
19,849
/* * Molecule API Documentation * The Hydrogen Molecule API * * OpenAPI spec version: 1.3.0 * Contact: info@hydrogenplatform.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.hydrogen.molecule.api; import com.hydrogen.molecule.ApiCallback; import com.hydrogen.molecule.ApiClient; import com.hydrogen.molecule.ApiException; import com.hydrogen.molecule.ApiResponse; import com.hydrogen.molecule.Configuration; import com.hydrogen.molecule.Pair; import com.hydrogen.molecule.ProgressRequestBody; import com.hydrogen.molecule.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; import com.hydrogen.molecule.model.DocumentParams; import com.hydrogen.molecule.model.DocumentResponse; import com.hydrogen.molecule.model.DocumentVerifyResponse; import com.hydrogen.molecule.model.TransactionSuccessResponse; import java.util.UUID; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class DocumentApi { private ApiClient apiClient; public DocumentApi() { this(Configuration.getDefaultApiClient()); } public DocumentApi(ApiClient apiClient) { this.apiClient = apiClient; } public ApiClient getApiClient() { return apiClient; } public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } /** * Build call for createDocumentUsingPost * @param documentParams Enables a user to store a Document hash on the blockchain (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ public com.squareup.okhttp.Call createDocumentUsingPostCall(DocumentParams documentParams, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = documentParams; // create path and map variables String localVarPath = "/document"; List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if(progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)) .build(); } }); } String[] localVarAuthNames = new String[] { "oauth2" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createDocumentUsingPostValidateBeforeCall(DocumentParams documentParams, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'documentParams' is set if (documentParams == null) { throw new ApiException("Missing the required parameter 'documentParams' when calling createDocumentUsingPost(Async)"); } com.squareup.okhttp.Call call = createDocumentUsingPostCall(documentParams, progressListener, progressRequestListener); return call; } /** * Create a new Document * * @param documentParams Enables a user to store a Document hash on the blockchain (required) * @return TransactionSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public TransactionSuccessResponse createDocumentUsingPost(DocumentParams documentParams) throws ApiException { ApiResponse<TransactionSuccessResponse> resp = createDocumentUsingPostWithHttpInfo(documentParams); return resp.getData(); } /** * Create a new Document * * @param documentParams Enables a user to store a Document hash on the blockchain (required) * @return ApiResponse&lt;TransactionSuccessResponse&gt; * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<TransactionSuccessResponse> createDocumentUsingPostWithHttpInfo(DocumentParams documentParams) throws ApiException { com.squareup.okhttp.Call call = createDocumentUsingPostValidateBeforeCall(documentParams, null, null); Type localVarReturnType = new TypeToken<TransactionSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * Create a new Document (asynchronously) * * @param documentParams Enables a user to store a Document hash on the blockchain (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call createDocumentUsingPostAsync(DocumentParams documentParams, final ApiCallback<TransactionSuccessResponse> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = createDocumentUsingPostValidateBeforeCall(documentParams, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<TransactionSuccessResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /** * Build call for getDocumentUsingGet * @param documentId Document ID (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ public com.squareup.okhttp.Call getDocumentUsingGetCall(UUID documentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/document/{document_id}" .replaceAll("\\{" + "document_id" + "\\}", apiClient.escapeString(documentId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if(progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)) .build(); } }); } String[] localVarAuthNames = new String[] { "oauth2" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getDocumentUsingGetValidateBeforeCall(UUID documentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'documentId' is set if (documentId == null) { throw new ApiException("Missing the required parameter 'documentId' when calling getDocumentUsingGet(Async)"); } com.squareup.okhttp.Call call = getDocumentUsingGetCall(documentId, progressListener, progressRequestListener); return call; } /** * Retrieve a Document * * @param documentId Document ID (required) * @return DocumentResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public DocumentResponse getDocumentUsingGet(UUID documentId) throws ApiException { ApiResponse<DocumentResponse> resp = getDocumentUsingGetWithHttpInfo(documentId); return resp.getData(); } /** * Retrieve a Document * * @param documentId Document ID (required) * @return ApiResponse&lt;DocumentResponse&gt; * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<DocumentResponse> getDocumentUsingGetWithHttpInfo(UUID documentId) throws ApiException { com.squareup.okhttp.Call call = getDocumentUsingGetValidateBeforeCall(documentId, null, null); Type localVarReturnType = new TypeToken<DocumentResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * Retrieve a Document (asynchronously) * * @param documentId Document ID (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call getDocumentUsingGetAsync(UUID documentId, final ApiCallback<DocumentResponse> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = getDocumentUsingGetValidateBeforeCall(documentId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<DocumentResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /** * Build call for verifyDocumentUsingPost * @param documentParams Enables a user to verify a Document has not been changed (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object */ public com.squareup.okhttp.Call verifyDocumentUsingPostCall(DocumentParams documentParams, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = documentParams; // create path and map variables String localVarPath = "/document/verify"; List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if(progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)) .build(); } }); } String[] localVarAuthNames = new String[] { "oauth2" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call verifyDocumentUsingPostValidateBeforeCall(DocumentParams documentParams, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { // verify the required parameter 'documentParams' is set if (documentParams == null) { throw new ApiException("Missing the required parameter 'documentParams' when calling verifyDocumentUsingPost(Async)"); } com.squareup.okhttp.Call call = verifyDocumentUsingPostCall(documentParams, progressListener, progressRequestListener); return call; } /** * Verify a Document * * @param documentParams Enables a user to verify a Document has not been changed (required) * @return DocumentVerifyResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public DocumentVerifyResponse verifyDocumentUsingPost(DocumentParams documentParams) throws ApiException { ApiResponse<DocumentVerifyResponse> resp = verifyDocumentUsingPostWithHttpInfo(documentParams); return resp.getData(); } /** * Verify a Document * * @param documentParams Enables a user to verify a Document has not been changed (required) * @return ApiResponse&lt;DocumentVerifyResponse&gt; * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<DocumentVerifyResponse> verifyDocumentUsingPostWithHttpInfo(DocumentParams documentParams) throws ApiException { com.squareup.okhttp.Call call = verifyDocumentUsingPostValidateBeforeCall(documentParams, null, null); Type localVarReturnType = new TypeToken<DocumentVerifyResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * Verify a Document (asynchronously) * * @param documentParams Enables a user to verify a Document has not been changed (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call verifyDocumentUsingPostAsync(DocumentParams documentParams, final ApiCallback<DocumentVerifyResponse> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = verifyDocumentUsingPostValidateBeforeCall(documentParams, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<DocumentVerifyResponse>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } }
46.268065
268
0.704922
dcd3073fe35fa8b49bf628d956994a97b549c9fd
3,271
package com.example.zniannar.measureisland; import android.content.Intent; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.example.nick.measureisland.R; public class Main4Activity extends AppCompatActivity { public int counter = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main4); } public void open1(){ ((TextView) findViewById(R.id.squiggle)).setText("Hello..."); } public void open2(){ ((TextView) findViewById(R.id.squiggle2)).setText("Hello...?"); } public void open3(){ ((TextView) findViewById(R.id.squiggle3)).setText(" After calling for hours, you finally come to your senses, escpaing from what seemed like an endless coma."); } public void open4(){ ((TextView) findViewById(R.id.squiggle4)).setText(" You are now on an island, presumably the evil 'Measure Island' that the strange men had mentioned."); } public void open5(){ ((TextView) findViewById(R.id.squiggle5)).setText(" You can remember all of what happened...It was a peaceful day in Mr. Moore's class when some strange men burst through the door, said they were taking over class, and banished you from Simmons for good. You posed a threat to them since you were the smartest kids in class, but now..."); } public void open6(){ ((TextView) findViewById(R.id.squiggle6)).setText(" ...now, you're obviously far from any classroom."); } public void open7(){ ((TextView) findViewById(R.id.squiggle7)).setText(" You're all nerds. Therefore, the only way you can leave this desert island is to channel your 'psychic energy' by solving the world's hardest math problems."); } public void open8(){ ((TextView) findViewById(R.id.squiggle8)).setText(" The fate of Simmons Elementary relies on you. Solve those problems and save the day!"); } public void open9() { startActivity(new Intent(Main4Activity.this, Main3Activity.class)); } public void openButton(View v){ switch(counter){ case 0: counter++; open1(); break; case 1: counter++; open2(); break; case 2: counter++; open3(); break; case 3: counter++; open4(); break; case 4: counter++; open5(); break; case 5: counter++; open6(); break; case 6: counter++; open7(); break; case 7: counter++; open8(); break; case 8: counter++; open9(); break; } } }
34.431579
350
0.55029
a2fc2182f62b011979c7fdbdef546ff0f6e477e9
3,785
/* Copyright (c) 2017-2021, Carlos Amengual. SPDX-License-Identifier: BSD-3-Clause Licensed under a BSD-style License. You can find the license here: https://css4j.github.io/LICENSE.txt */ package io.github.css4j.ci; import java.io.IOException; import java.net.URL; import java.util.List; import java.util.ListIterator; import org.dom4j.dom.DOMElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.DOMException; import org.w3c.dom.stylesheets.StyleSheet; import io.sf.carte.doc.style.css.CSSElement; import io.sf.carte.doc.style.css.CSSRule; import io.sf.carte.doc.style.css.CSSStyleSheet; import io.sf.carte.doc.style.css.SACErrorHandler; import io.sf.carte.doc.style.css.nsac.CSSParseException; import io.sf.carte.doc.style.css.om.DefaultSheetErrorHandler; public class LogSiteErrorReporter extends BaseSiteErrorReporter { final static Logger log = LoggerFactory.getLogger(LogSiteErrorReporter.class.getName()); private int lastSheetIndex = -1; private int lastWarningSheetIndex = -1; @Override public void startSiteReport(URL url) throws IOException { } @Override void writeError(String message, Throwable exception) { log.error(message, exception); } @Override void writeError(String message) { log.error(message); } @Override void writeMinificationError(String message) { log.error(message); } @Override void writeSerializationError(String message) { log.error(message); } @Override void writeSerializationError(String message, DOMException exception) { log.error(message, exception); } @Override void writeWarning(String message) { log.warn(message); } @Override void selectErrorTargetSheet(StyleSheet sheet, int sheetIndex) { if (lastSheetIndex != sheetIndex) { selectTargetSheet(sheet, sheetIndex, false); lastSheetIndex = sheetIndex; } } @Override void selectWarningTargetSheet(StyleSheet sheet, int sheetIndex) { if (lastWarningSheetIndex != sheetIndex) { selectTargetSheet(sheet, sheetIndex, true); lastWarningSheetIndex = sheetIndex; } } private void selectTargetSheet(StyleSheet sheet, int sheetIndex, boolean warn) { CSSElement owner; if ((owner = (CSSElement) sheet.getOwnerNode()) != null && "style".equalsIgnoreCase(owner.getTagName())) { String text; if (owner instanceof DOMElement) { text = ((DOMElement) owner).getText(); } else { text = owner.getTextContent(); } writeWarning("Sheet:\n" + text); } else { String uri = sheet.getHref(); if (uri != null) { writeWarning("Sheet at " + uri); } } } @Override public void sacIssues(CSSStyleSheet<? extends CSSRule> sheet, int sheetIndex, SACErrorHandler errHandler) { selectTargetSheet(sheet, sheetIndex, !errHandler.hasSacErrors()); writeError(errHandler.toString()); if (errHandler instanceof DefaultSheetErrorHandler) { DefaultSheetErrorHandler dseh = (DefaultSheetErrorHandler) errHandler; logSacErrors(dseh.getSacErrors()); logSacWarnings(dseh.getSacWarnings()); } } private void logSacErrors(List<CSSParseException> sacErrors) { if (sacErrors != null) { ListIterator<CSSParseException> it = sacErrors.listIterator(); while (it.hasNext()) { CSSParseException ex = it.next(); log.error("SAC error at [" + ex.getLineNumber() + "," + ex.getColumnNumber() + "]: " + ex.getMessage()); } } } private void logSacWarnings(List<CSSParseException> sacWarnings) { if (sacWarnings != null) { ListIterator<CSSParseException> it = sacWarnings.listIterator(); while (it.hasNext()) { CSSParseException ex = it.next(); log.warn( "SAC warning at [" + ex.getLineNumber() + "," + ex.getColumnNumber() + "]: " + ex.getMessage()); } } } @Override public void close() throws IOException { } }
26.284722
108
0.726816
18f10da67b984cd44a39ad626ec91917357b329b
661
package rongqicunchu.shuzu; public class Person { private String pname; private int age; public Person() { } public Person(String pname, int age) { this.pname = pname; this.age = age; } public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "Person{" + "pname='" + pname + '\'' + ", age=" + age + '}'; } }
16.948718
42
0.488654
2e8f1c1c9ceeb68cd6a881feb9599980c459a199
2,441
package edu.psu.ist.acs.micro.event.data.annotation.nlp.event; import java.util.List; import java.util.Map; import edu.cmu.ml.rtw.generic.data.annotation.DataSet; import edu.cmu.ml.rtw.generic.data.annotation.DatumContext; import edu.cmu.ml.rtw.generic.data.annotation.Datum.Tools.Structurizer; import edu.cmu.ml.rtw.generic.data.annotation.nlp.StructurizerGraph; import edu.cmu.ml.rtw.generic.structure.WeightedStructureGraph; import edu.cmu.ml.rtw.generic.structure.WeightedStructureRelation; import edu.cmu.ml.rtw.generic.structure.WeightedStructureRelationBinary; import edu.cmu.ml.rtw.generic.structure.WeightedStructureRelationUnary; public class StructurizerGraphTimePair<L> extends StructurizerGraph<TimePairDatum<L>, L> { public StructurizerGraphTimePair() { super(); } public StructurizerGraphTimePair(DatumContext<TimePairDatum<L>, L> context) { super(context); } @Override protected WeightedStructureRelation makeDatumStructure(TimePairDatum<L> datum, L label) { if (label == null) return null; WeightedStructureRelationBinary binaryRel = (WeightedStructureRelationBinary)this.context.getDatumTools().getDataTools().makeWeightedStructure(label.toString(), this.context); return new WeightedStructureRelationBinary( label.toString(), this.context, String.valueOf(datum.getId()), new WeightedStructureRelationUnary("O", this.context, datum.getSource().getId()), new WeightedStructureRelationUnary("O", this.context, datum.getTarget().getId()), binaryRel.isOrdered()); } @Override protected String getStructureId(TimePairDatum<L> datum) { return "0"; } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected List<WeightedStructureRelation> getDatumRelations(TimePairDatum<L> datum, WeightedStructureGraph graph) { return (List<WeightedStructureRelation>)(List)graph.getEdges(datum.getSource().getId(), datum.getTarget().getId()); } @Override public Structurizer<TimePairDatum<L>, L, WeightedStructureGraph> makeInstance(DatumContext<TimePairDatum<L>, L> context) { return new StructurizerGraphTimePair<L>(context); } @Override public String getGenericName() { return "GraphTimePair"; } @Override public DataSet<TimePairDatum<L>, L> makeData( DataSet<TimePairDatum<L>, L> existingData, Map<String, WeightedStructureGraph> structures) { return existingData; } }
36.432836
178
0.759934
f5133ad05ce149aa4d374909f99eb1ae16bc02b0
2,920
package cn.iocoder.yudao.coreservice.modules.pay.enums; import cn.iocoder.yudao.framework.common.exception.ErrorCode; /** * Pay 错误码 Core 枚举类 * * pay 系统,使用 1-007-000-000 段 */ public interface PayErrorCodeCoreConstants { /** * ========== APP 模块 1-007-000-000 ========== */ ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1007000000, "App 不存在"); ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1007000002, "App 已经被禁用"); ErrorCode PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE = new ErrorCode(1007000003, "支付应用存在交易中的订单,无法删除"); /** * ========== CHANNEL 模块 1-007-001-000 ========== */ ErrorCode PAY_CHANNEL_NOT_FOUND = new ErrorCode(1007001000, "支付渠道的配置不存在"); ErrorCode PAY_CHANNEL_IS_DISABLE = new ErrorCode(1007001001, "支付渠道已经禁用"); ErrorCode PAY_CHANNEL_CLIENT_NOT_FOUND = new ErrorCode(1007001002, "支付渠道的客户端不存在"); ErrorCode CHANNEL_NOT_EXISTS = new ErrorCode(1007001003, "支付渠道不存在"); ErrorCode CHANNEL_EXIST_SAME_CHANNEL_ERROR = new ErrorCode(1007001005, "已存在相同的渠道"); ErrorCode CHANNEL_WECHAT_VERSION_2_MCH_KEY_IS_NULL = new ErrorCode(1007001006,"微信渠道v2版本中商户密钥不可为空"); ErrorCode CHANNEL_WECHAT_VERSION_3_PRIVATE_KEY_IS_NULL = new ErrorCode(1007001007,"微信渠道v3版本apiclient_key.pem不可为空"); ErrorCode CHANNEL_WECHAT_VERSION_3_CERT_KEY_IS_NULL = new ErrorCode(1007001008,"微信渠道v3版本中apiclient_cert.pem不可为空"); ErrorCode PAY_CHANNEL_NOTIFY_VERIFY_FAILED = new ErrorCode(1007001009, "渠道通知校验失败"); /** * ========== ORDER 模块 1-007-002-000 ========== */ ErrorCode PAY_ORDER_NOT_FOUND = new ErrorCode(1007002000, "支付订单不存在"); ErrorCode PAY_ORDER_STATUS_IS_NOT_WAITING = new ErrorCode(1007002001, "支付订单不处于待支付"); ErrorCode PAY_ORDER_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007002002, "支付订单不处于已支付"); ErrorCode PAY_ORDER_ERROR_USER = new ErrorCode(1007002003, "支付订单用户不正确"); /** * ========== ORDER 模块(拓展单) 1-007-003-000 ========== */ ErrorCode PAY_ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1007003000, "支付交易拓展单不存在"); ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(1007003001, "支付交易拓展单不处于待支付"); ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007003002, "支付订单不处于已支付"); // ========== 支付模块(退款) 1-007-006-000 ========== ErrorCode PAY_REFUND_AMOUNT_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额"); ErrorCode PAY_REFUND_ALL_REFUNDED = new ErrorCode(1007006001, "订单已经全额退款"); ErrorCode PAY_REFUND_CHN_ORDER_NO_IS_NULL = new ErrorCode(1007006002, "该订单的渠道订单为空"); ErrorCode PAY_REFUND_SUCCEED = new ErrorCode(1007006003, "已经退款成功"); ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(1007006004, "支付退款单不存在"); /** * ========== 支付商户信息 1-007-004-000 ========== */ ErrorCode PAY_MERCHANT_NOT_EXISTS = new ErrorCode(1007004000, "支付商户信息不存在"); ErrorCode PAY_MERCHANT_EXIST_APP_CANT_DELETE = new ErrorCode(1007004001, "支付商户存在支付应用,无法删除"); }
44.923077
119
0.724315
9ca49cbecb79808209d9a49920208f30bea7ef19
1,378
package org.competition.leetcode.linkedlist; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.competition.leetcode.linkedlist.ListNode.array; import static org.competition.leetcode.linkedlist.ListNode.list; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertNotNull; public class DeleteNthNodeTest { private DeleteNthNode deleteNthNode; @Before public void before() { deleteNthNode = new DeleteNthNode(); } @Test public void testDeleteNthNode() { assertNotNull(deleteNthNode); assertArrayEquals(new int[]{1, 2, 3, 5}, array(deleteNthNode.deleteNthNodeFromEnd(list(1, 2, 3, 4, 5), 2))); assertArrayEquals(new int[]{2}, array(deleteNthNode.deleteNthNodeFromEnd(list(1, 2), 2))); assertArrayEquals(new int[]{1}, array(deleteNthNode.deleteNthNodeFromEnd(list(1, 2), 1))); } @Test public void testDeleteNthNode2Pointer() { assertNotNull(deleteNthNode); assertArrayEquals(new int[]{1, 2, 3, 5}, array(deleteNthNode.twoPointerApproach(list(1, 2, 3, 4, 5), 2))); assertArrayEquals(new int[]{2}, array(deleteNthNode.twoPointerApproach(list(1, 2), 2))); assertArrayEquals(new int[]{1}, array(deleteNthNode.twoPointerApproach(list(1, 2), 1))); } @After public void after() { } }
32.809524
116
0.70029
fea5847db7216134d3848ab90fa1df50a66d7ee4
3,029
package org.uniprot.store.indexer.uniprotkb.processor; import static org.junit.jupiter.api.Assertions.*; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; import org.uniprot.core.util.Utils; import org.uniprot.store.indexer.uniprot.inactiveentry.InactiveUniProtEntry; import org.uniprot.store.search.document.uniprot.UniProtDocument; /** * @author lgonzales * @since 01/07/2021 */ class InactiveEntryConverterTest { @Test void convertDeleted() { InactiveEntryConverter converter = new InactiveEntryConverter(); InactiveUniProtEntry entry = new InactiveUniProtEntry("P12345", null, "DELETED", Collections.emptyList()); UniProtDocument result = converter.convert(entry); assertNotNull(result); assertEquals("P12345", result.accession); assertNull(result.id); assertTrue(Utils.nullOrEmpty(result.idDefault)); assertNull(result.idInactive); assertEquals("DELETED", result.inactiveReason); assertFalse(result.active); } @Test void convertDeletedWithId() { InactiveEntryConverter converter = new InactiveEntryConverter(); InactiveUniProtEntry entry = new InactiveUniProtEntry("P12345", "ID", "DELETED", Collections.emptyList()); UniProtDocument result = converter.convert(entry); assertNotNull(result); assertEquals("P12345", result.accession); assertEquals("ID", result.id); assertTrue(Utils.nullOrEmpty(result.idDefault)); assertEquals("ID", result.idInactive); assertEquals("DELETED", result.inactiveReason); assertFalse(result.active); } @Test void convertMerged() { InactiveEntryConverter converter = new InactiveEntryConverter(); List<String> mergedTo = List.of("P11111"); InactiveUniProtEntry entry = new InactiveUniProtEntry("P12345", "ID1", "MERGED", mergedTo); UniProtDocument result = converter.convert(entry); assertNotNull(result); assertEquals("P12345", result.accession); assertEquals("ID1", result.id); assertTrue(Utils.nullOrEmpty(result.idDefault)); assertEquals("ID1", result.idInactive); assertEquals("MERGED:P11111", result.inactiveReason); assertFalse(result.active); } @Test void convertDeMerged() { InactiveEntryConverter converter = new InactiveEntryConverter(); List<String> demergedTo = List.of("P11111", "P22222"); InactiveUniProtEntry entry = new InactiveUniProtEntry("P12345", "ID1", "DEMERGED", demergedTo); UniProtDocument result = converter.convert(entry); assertNotNull(result); assertEquals("P12345", result.accession); assertEquals("ID1", result.id); assertNull(result.idDefault); assertEquals("DEMERGED:P11111,P22222", result.inactiveReason); assertFalse(result.active); assertTrue(result.content.isEmpty()); } }
36.059524
99
0.681413
3e85a07b40bdf048ff977306ae7a51b3b968d42c
3,410
/* * Copyright 2010-2018 Boxfuse GmbH * * 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.flywaydb.core.internal.database.hsqldb; import org.flywaydb.core.api.configuration.Configuration; import org.flywaydb.core.internal.database.base.Database; import org.flywaydb.core.internal.placeholder.PlaceholderReplacer; import org.flywaydb.core.internal.resource.ResourceProvider; import org.flywaydb.core.internal.sqlscript.AbstractSqlStatementBuilderFactory; import org.flywaydb.core.internal.sqlscript.SqlStatementBuilder; import org.flywaydb.core.internal.sqlscript.SqlStatementBuilderFactory; import java.sql.Connection; /** * HSQLDB database. */ public class HSQLDBDatabase extends Database<HSQLDBConnection> { /** * Creates a new instance. * * @param configuration The Flyway configuration. * @param connection The connection to use. */ public HSQLDBDatabase(Configuration configuration, Connection connection, boolean originalAutoCommit ) { super(configuration, connection, originalAutoCommit ); } @Override protected HSQLDBConnection getConnection(Connection connection ) { return new HSQLDBConnection(configuration, this, connection, originalAutoCommit ); } @Override public final void ensureSupported() { ensureDatabaseIsRecentEnough("1.8"); ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition("2.3", org.flywaydb.core.internal.license.Edition.ENTERPRISE); recommendFlywayUpgradeIfNecessary("2.4"); } @Override protected SqlStatementBuilderFactory createSqlStatementBuilderFactory(PlaceholderReplacer placeholderReplacer ) { return new HSQLDBSqlStatementBuilderFactory(placeholderReplacer); } @Override public String getDbName() { return "hsqldb"; } @Override public boolean supportsDdlTransactions() { return false; } @Override public boolean supportsChangingCurrentSchema() { return true; } @Override public String getBooleanTrue() { return "1"; } @Override public String getBooleanFalse() { return "0"; } @Override public String doQuote(String identifier) { return "\"" + identifier + "\""; } @Override public boolean catalogIsSchema() { return false; } @Override public boolean useSingleConnection() { return true; } private static class HSQLDBSqlStatementBuilderFactory extends AbstractSqlStatementBuilderFactory { public HSQLDBSqlStatementBuilderFactory(PlaceholderReplacer placeholderReplacer) { super(placeholderReplacer); } @Override public SqlStatementBuilder createSqlStatementBuilder() { return new HSQLDBSqlStatementBuilder(); } } }
26.030534
137
0.709384
623bd17fac815f222fe320d21d4f2af24050414e
1,086
package com.qianyitian.hope2.analyzer.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController public class DemarkController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired DemarkService demarkService; public DemarkController() { } @GetMapping(value = "/cache/stock/status") public String cacheStatus() { return demarkService.getStockCacheStatus(); } @RequestMapping("/demark/{portfolio}") @CrossOrigin public String demark(@PathVariable String portfolio, @RequestParam(value = "days2Now", required = false) Integer days2Now) { return demarkService.demark(portfolio, days2Now); } @CrossOrigin @RequestMapping("/demark-backtrack/{code}") public String demarkBacktrack(@PathVariable String code, @RequestParam(value = "days2Now", required = false) Integer days2Now) { return demarkService.demarkBacktrack(code, days2Now); } }
31.028571
132
0.733886
23fd77888aeddc6506189f982c13722a3e7a77c5
4,917
package com.bizmda.bizsip.serveradaptor; import cn.hutool.json.JSONObject; import com.alibaba.nacos.api.NacosFactory; import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.exception.NacosException; import com.bizmda.bizsip.common.BizConstant; import com.bizmda.bizsip.common.BizException; import com.bizmda.bizsip.common.BizResultEnum; import com.bizmda.bizsip.config.AbstractServerAdaptorConfig; import com.bizmda.bizsip.config.ServerAdaptorConfigMapping; import com.bizmda.bizsip.message.AbstractMessageProcessor; import com.bizmda.bizsip.serveradaptor.listener.ServerAdaptorListener; import com.bizmda.bizsip.serveradaptor.protocol.AbstractServerProtocolProcessor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.stereotype.Service; import java.lang.reflect.InvocationTargetException; import java.util.Properties; /** * @author 史正烨 */ @Slf4j @Service @Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS) public class ServerAdaptor { @Value("${bizsip.config-path}") private String configPath; @Value("${spring.cloud.nacos.discovery.server-addr}") private String serverAddr; private String serverAdaptorId; @Autowired private ServerAdaptorConfigMapping serverAdaptorConfigMapping; private AbstractMessageProcessor<Object> messageProcessor; private AbstractServerProtocolProcessor protocolProcessor; public void init(String adaptorId) throws BizException { ConfigService configService; this.serverAdaptorId = adaptorId; this.load(); Properties properties = new Properties(); properties.put("serverAddr", this.serverAddr); try { configService = NacosFactory.createConfigService(properties); configService.addListener(BizConstant.REFRESH_SERVER_ADAPTOR_DATA_ID, BizConstant.NACOS_GROUP, new ServerAdaptorListener(this) { @Override public void receiveConfigInfo(String config) { log.info("刷新服务端适配器[{}]配置",this.serverAdaptor.serverAdaptorId); try { this.serverAdaptor.serverAdaptorConfigMapping = new ServerAdaptorConfigMapping(this.serverAdaptor.configPath); this.serverAdaptor.load(); } catch (BizException e) { e.printStackTrace(); } } }); } catch (NacosException e) { throw new BizException(BizResultEnum.NACOS_ERROR); } log.info("配置刷新监控初始化成功!"); } public void load() throws BizException { AbstractServerAdaptorConfig serverAdaptorConfig = this.serverAdaptorConfigMapping.getServerAdaptorConfig(this.serverAdaptorId); String messageType = (String) serverAdaptorConfig.getMessageMap().get("type"); Class<Object> clazz = (Class<Object>)AbstractMessageProcessor.MESSAGE_TYPE_MAP.get(messageType); if (clazz == null) { throw new BizException(BizResultEnum.NO_MESSAGE_PROCESSOR); } try { this.messageProcessor = (AbstractMessageProcessor<Object>)clazz.getDeclaredConstructor().newInstance(); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new BizException(BizResultEnum.MESSAGE_CREATE_ERROR, e); } this.messageProcessor.init(configPath, serverAdaptorConfig.getMessageMap()); String protocolType = (String) serverAdaptorConfig.getProtocolMap().get("type"); clazz = (Class)AbstractServerProtocolProcessor.PROTOCOL_TYPE_MAP.get(protocolType); if (clazz == null) { throw new BizException(BizResultEnum.SERVER_NO_PROTOCOL_PROCESSOR); } try { this.protocolProcessor = (AbstractServerProtocolProcessor) clazz.getDeclaredConstructor().newInstance(); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new BizException(BizResultEnum.SERVER_PROTOCOL_CREATE_ERROR, e); } this.protocolProcessor.init(serverAdaptorConfig); } public JSONObject process(JSONObject inMessage) throws BizException { log.debug("服务端处理器传入消息:{}", inMessage); Object message = this.messageProcessor.pack(inMessage); log.debug("打包后消息:{}", message); message = this.protocolProcessor.process(message); log.debug("应用返回消息:{}", message); JSONObject jsonObject = this.messageProcessor.unpack(message); log.debug("解包后消息:{}", jsonObject); return jsonObject; } }
42.025641
140
0.715884
d985a9db45f919f634c2df3b83b45a010549f097
1,375
package de.justinharder.trainharder.model.services.berechnung; import de.justinharder.trainharder.model.domain.Konstanten; public class Volumenrechner { /* * Kniebeuge Bankdrücken Kreuzheben * Hypertrophie 0,0 0,1 0,2 * Kraft 1,0 1,1 1,2 * Peaking 2,0 2,1 2,2 */ private final double[][] empfehlungen = new double[3][3]; public Volumenrechner(int anpassungsfaktor) { for (int uebung = 0; uebung < empfehlungen.length; uebung++) { for (int phase = 0; phase < empfehlungen[uebung].length; phase++) { var mev = Konstanten.MINIMUM_EFFECTIVE_VOLUME.get(uebung).get(phase) + anpassungsfaktor; var mrv = Konstanten.MAXIMUM_RECOVERABLE_VOLUME.get(uebung).get(phase) + anpassungsfaktor; empfehlungen[uebung][phase] = (mev + mrv) / 2; } } } public int[] getVolumenHypertrophiePhase() { return new int[] { mappeZuInt(empfehlungen[0][0]), mappeZuInt(empfehlungen[0][1]), mappeZuInt(empfehlungen[0][2]) }; } public int[] getVolumenKraftPhase() { return new int[] { mappeZuInt(empfehlungen[1][0]), mappeZuInt(empfehlungen[1][1]), mappeZuInt(empfehlungen[1][2]) }; } public int[] getVolumenPeakingPhase() { return new int[] { mappeZuInt(empfehlungen[2][0]), mappeZuInt(empfehlungen[2][1]), mappeZuInt(empfehlungen[2][2]) }; } private int mappeZuInt(double zahl) { return (int) Math.round(zahl); } }
28.645833
118
0.691636
08a1aaff76cfc58f19944ae5abc6450cbb9c2a1c
211
package org.chzcb.rocketmq; /** * MQ消息的消费者 */ public class MessageConsumer { public void unsubscribe(String topic, String tags) { } public void subscribe(String topic, String tags) { } }
12.411765
56
0.658768
fceaa89505c92868f65763177b9b5620eeacacd2
36,933
/*=========================================================================== Copyright (C) 2010 by the Okapi Framework 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 net.sf.okapi.common; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Converts Microsoft's LCID to Okapi LocaleId back and forth. * @see <a href="http://msdn.microsoft.com/en-us/library/cc233968%28PROT.10%29.aspx">Microsoft LCID Structure</a> * @see <a href="http://msdn.microsoft.com/en-us/library/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c%28v=PROT.10%29#id8">LCID List</a> * @see <a href="http://msdn.microsoft.com/en-us/library/cc233982%28PROT.10%29.aspx">Microsoft LCID Structure</a> */ public class LCIDUtil { class LCIDDescr { String language; String region; int lcid; String tag; public LCIDDescr(String language, String region, int lcid, String tag) { super(); this.language = language; this.region = region; this.lcid = lcid; this.tag = tag; } } private static List<LCIDDescr> descriptors = new ArrayList<LCIDDescr> (); private static HashMap<Integer, LCIDDescr> tagLookup = new HashMap<Integer, LCIDDescr>(); private static HashMap<String, LCIDDescr> lcidLookup = new HashMap<String, LCIDDescr>(); private static LCIDUtil inst; /** * Registers an LCID for a given language and region. * @param language the language code. * @param region the region code. * @param lcid the LCID value. */ private static void registerLCID (String language, String region, int lcid) { LCIDDescr descr0 = tagLookup.get(lcid); if (descr0 != null) { String lang0 = descr0.language; String reg0 = descr0.region; String st = Util.isEmpty(reg0) ? lang0 : String.format("%s (%s)", lang0, reg0); if (language.equals(lang0) && region.equals(reg0)) { Logger localLogger = LoggerFactory.getLogger(LCIDUtil.class); localLogger.warn(String.format("Already registered LCID: (0x%04x) %s", lcid, st)); } } if (inst == null) inst = new LCIDUtil(); LCIDDescr descr = inst.new LCIDDescr(language, region, lcid, null); descriptors.add(descr); // String tag = getTag(lcid); // //if (tagLookup.get(lcid) != null) // if (!Util.isEmpty(tag)) // logger.warn(String.format("Already registered LCID: 0x%04x", // lcid)); // tagLookup.put(lcid, descr); } /** * Registers an LCID for a language tag. * @param lcid the LCID value. * @param tag the language tag. */ private static void registerTag(int lcid, String tag) { LCIDDescr descr; descr = tagLookup.get(lcid); if (descr == null) { Logger localLogger = LoggerFactory.getLogger(LCIDUtil.class); // logger.warn(String.format("Unregistered LCID: 0x%04x %s -- %s\n" + // "registerLCID(\"%s\", \"\", 0x%04x);\n", lcid, tag, // LanguageList.getDisplayName(tag), LanguageList.getDisplayName(tag), lcid)); localLogger.warn(String.format("Unregistered LCID: 0x%04x %s\n", lcid, tag)); return; } tag = LocaleId.fromString(tag).toString(); descr.tag = tag; lcidLookup.put(tag, descr); } static { // LCID registerLCID("Afrikaans", "South Africa", 0x0436); registerLCID("Albanian", "Albania", 0x041c); registerLCID("Alsatian", "France", 0x0484); registerLCID("Amharic", "Ethiopia", 0x045e); registerLCID("Arabic", "Saudi Arabia", 0x0401); registerLCID("Arabic", "Iraq", 0x0801); registerLCID("Arabic", "Egypt", 0x0c01); registerLCID("Arabic", "Libya", 0x1001); registerLCID("Arabic", "Algeria", 0x1401); registerLCID("Arabic", "Morocco", 0x1801); registerLCID("Arabic", "Tunisia", 0x1c01); registerLCID("Arabic", "Oman", 0x2001); registerLCID("Arabic", "Yemen", 0x2401); registerLCID("Arabic", "Syria", 0x2801); registerLCID("Arabic", "Jordan", 0x2c01); registerLCID("Arabic", "Lebanon", 0x3001); registerLCID("Arabic", "Kuwait", 0x3401); registerLCID("Arabic", "U.A.E.", 0x3801); registerLCID("Arabic", "Kingdom of Bahrain", 0x3c01); registerLCID("Arabic", "Qatar", 0x4001); registerLCID("Armenian", "Armenia", 0x042b); registerLCID("Assamese", "India", 0x044d); registerLCID("Azeri (Cyrillic)", "Azerbaijan", 0x082c); registerLCID("Azeri (Latin)", "Azerbaijan", 0x042c); registerLCID("Bashkir", "Russia", 0x046d); registerLCID("Basque", "Spain", 0x042d); registerLCID("Belarusian", "Belarus", 0x0423); registerLCID("Bengali", "India", 0x0445); registerLCID("Bengali", "Bangladesh", 0x0845); registerLCID("Bosnian (Cyrillic)", "Bosnia and Herzegovina", 0x201a); registerLCID("Bosnian (Latin)", "Bosnia and Herzegovina", 0x141a); registerLCID("Breton", "France", 0x047e); registerLCID("Bulgarian", "Bulgaria", 0x0402); registerLCID("Catalan", "(Catalan)", 0x0403); registerLCID("Chinese", "Simplified", 0x0004); registerLCID("Chinese", "Taiwan", 0x0404); registerLCID("Chinese", "People's Republic of China", 0x0804); registerLCID("Chinese", "Hong Kong SAR", 0x0c04); registerLCID("Chinese", "Singapore", 0x1004); registerLCID("Chinese", "Macao SAR", 0x1404); registerLCID("Chinese", "Traditional", 0x7c04); registerLCID("Corsican", "France", 0x0483); registerLCID("Croatian", "Croatia", 0x041a); registerLCID("Croatian (Latin)", "Bosnia and Herzegovina", 0x101a); registerLCID("Czech", "Czech Republic", 0x0405); registerLCID("Danish", "Denmark", 0x0406); registerLCID("Dari", "Afghanistan", 0x048c); registerLCID("Divehi", "Maldives", 0x0465); registerLCID("Dutch", "Belgium", 0x0813); registerLCID("Dutch", "Netherlands", 0x0413); registerLCID("English", "Canada", 0x1009); registerLCID("English", "Jamaica", 0x2009); registerLCID("English", "Caribbean", 0x2409); registerLCID("English", "Belize", 0x2809); registerLCID("English", "Trinidad", 0x2c09); registerLCID("English", "United Kingdom", 0x0809); registerLCID("English", "Ireland", 0x1809); registerLCID("English", "India", 0x4009); registerLCID("English", "South Africa", 0x1c09); registerLCID("English", "Zimbabwe", 0x3009); registerLCID("English", "Australia", 0x0c09); registerLCID("English", "New Zealand", 0x1409); registerLCID("English", "Philippines", 0x3409); registerLCID("English", "United States", 0x0409); registerLCID("English", "Malaysia", 0x4409); registerLCID("English", "Singapore", 0x4809); registerLCID("Estonian", "Estonia", 0x0425); registerLCID("Faroese", "Faroe Islands", 0x0438); registerLCID("Filipino", "Philippines", 0x0464); registerLCID("Finnish", "Finland", 0x040b); registerLCID("French", "Canada", 0x0c0c); registerLCID("French", "France", 0x040c); registerLCID("French", "Monaco", 0x180c); registerLCID("French", "Switzerland", 0x100c); registerLCID("French", "Belgium", 0x080c); registerLCID("French", "Luxembourg", 0x140c); registerLCID("Frisian", "Netherlands", 0x0462); registerLCID("Galician", "Galician", 0x0456); registerLCID("Georgian", "Georgia", 0x0437); registerLCID("German", "Germany", 0x0407); registerLCID("German", "Switzerland", 0x0807); registerLCID("German", "Austria", 0x0c07); registerLCID("German", "Liechtenstein", 0x1407); registerLCID("German", "Luxembourg", 0x1007); registerLCID("Greek", "Greece", 0x0408); registerLCID("Greenlandic", "Greenland", 0x046f); registerLCID("Gujarati", "India", 0x0447); registerLCID("Hausa", "Nigeria", 0x0468); registerLCID("Hebrew", "Israel", 0x040d); registerLCID("Hindi", "India", 0x0439); registerLCID("Hungarian", "Hungary", 0x040e); registerLCID("Icelandic", "Iceland", 0x040f); registerLCID("Igbo", "Nigeria", 0x0470); registerLCID("Indonesian", "Indonesia", 0x0421); registerLCID("Inuktitut (Syllabics)", "Canada", 0x045d); registerLCID("Inuktitut (Latin)", "Canada", 0x085d); registerLCID("Irish", "Ireland", 0x083c); registerLCID("isiXhosa", "South Africa", 0x0434); registerLCID("isiZulu", "South Africa", 0x0435); registerLCID("Italian", "Italy", 0x0410); registerLCID("Italian", "Switzerland", 0x0810); registerLCID("Japanese", "Japan", 0x0411); registerLCID("Kannada", "India", 0x044b); registerLCID("Kazakh", "Kazakhstan", 0x043f); registerLCID("Khmer", "Cambodia", 0x0453); registerLCID("K'iche", "Guatemala", 0x0486); registerLCID("Kinyarwanda", "Rwanda", 0x0487); registerLCID("Kiswahili", "Kenya", 0x0441); registerLCID("Konkani", "India", 0x0457); registerLCID("Korean", "Korea", 0x0412); registerLCID("Kyrgyz", "Kyrgyzstan", 0x0440); registerLCID("Lao", "Lao PDR", 0x0454); registerLCID("Latvian", "Latvia", 0x0426); registerLCID("Lithuanian", "Lithuania", 0x0427); registerLCID("Lower Sorbian", "Germany", 0x082e); registerLCID("Luxembourgish", "Luxembourg", 0x046e); registerLCID("Macedonian (FYROM)", "Macedonia, Former Yugoslav Republic of", 0x042f); registerLCID("Malay", "Malaysia", 0x043e); registerLCID("Malay", "Brunei Darussalam", 0x083e); registerLCID("Malayalam", "India", 0x044c); registerLCID("Maltese", "Malta", 0x043a); registerLCID("Maori", "New Zealand", 0x0481); registerLCID("Mapudungun ", "Chile", 0x047a); registerLCID("Marathi", "India", 0x044e); registerLCID("Mohawk", "Mohawk", 0x047c); registerLCID("Mongolian (Cyrillic)", "Mongolia", 0x0450); registerLCID("Mongolian (Mongolian)", "People's Republic of China", 0x0850); registerLCID("Nepali", "Nepal", 0x0461); registerLCID("Norwegian (Bokmal)", "Norway", 0x0414); registerLCID("Norwegian (Nynorsk)", "Norway", 0x0814); registerLCID("Occitan", "France", 0x0482); registerLCID("Oriya", "India", 0x0448); registerLCID("Pashto", "Afghanistan", 0x0463); registerLCID("Persian", "Iran", 0x0429); registerLCID("Polish", "Poland", 0x0415); registerLCID("Portuguese", "Brazil", 0x0416); registerLCID("Portuguese", "Portugal", 0x0816); registerLCID("Punjabi (Gurmukhi)", "India", 0x0446); registerLCID("Quechua", "Bolivia", 0x046b); registerLCID("Quechua", "Ecuador", 0x086b); registerLCID("Quechua", "Peru", 0x0c6b); registerLCID("Romanian", "Romania", 0x0418); registerLCID("Romansh", "Switzerland", 0x0417); registerLCID("Russian", "Russia", 0x0419); registerLCID("Sakha", "Russia", 0x0485); registerLCID("Sami, Inari", "Finland", 0x243b); registerLCID("Sami, Lule", "Sweden", 0x143b); registerLCID("Sami, Lule", "Norway", 0x103b); registerLCID("Sami, Northern", "Norway", 0x043b); registerLCID("Sami, Northern", "Sweden", 0x083b); registerLCID("Sami, Northern", "Finland", 0x0c3b); registerLCID("Sami, Skolt", "Finland", 0x203b); registerLCID("Sami, Southern", "Norway", 0x183b); registerLCID("Sami, Southern", "Sweden", 0x1c3b); registerLCID("Sanskrit", "India", 0x044f); registerLCID("Scottish Gaelic", "United Kingdom", 0x0491); registerLCID("Serbian (Cyrillic) sr-Cyrl-CS", "Serbia and Montenegro (Former)", 0x0c1a); registerLCID("Serbian (Cyrillic) sr-Cyrl-RS", "Serbia", 0x281a); registerLCID("Serbian(Cyrillic) sr-Cyrl-ME", "Montenegro", 0x301a); registerLCID("Serbian (Cyrillic)", "Bosnia and Herzegovina", 0x1c1a); registerLCID("Serbian (Latin) sr-Latn-RS", "Serbia", 0x241a); registerLCID("Serbian (Latin) Sr-Latn-ME", "Montenegro", 0x2c1a); registerLCID("Serbian (Latin)", "Montenegro", 0x081a); registerLCID("Serbian (Latin)", "Bosnia and Herzegovina", 0x181a); registerLCID("Sesotho sa Leboa", "South Africa", 0x046c); registerLCID("Setswana", "South Africa", 0x0432); registerLCID("Sinhala", "Sri Lanka", 0x045b); registerLCID("Slovak", "Slovakia", 0x041b); registerLCID("Slovenian", "Slovenia", 0x0424); registerLCID("Spanish", "Mexico", 0x080a); registerLCID("Spanish", "Guatemala", 0x100a); registerLCID("Spanish", "Costa Rica", 0x140a); registerLCID("Spanish", "Panama", 0x180a); registerLCID("Spanish", "Dominican Republic", 0x1c0a); registerLCID("Spanish", "Venezuela", 0x200a); registerLCID("Spanish", "Colombia", 0x240a); registerLCID("Spanish", "Peru", 0x280a); registerLCID("Spanish", "Argentina", 0x2c0a); registerLCID("Spanish", "Ecuador", 0x300a); registerLCID("Spanish", "Chile", 0x340a); registerLCID("Spanish", "Paraguay", 0x3c0a); registerLCID("Spanish", "Bolivia", 0x400a); registerLCID("Spanish", "El Salvador", 0x440a); registerLCID("Spanish", "Honduras", 0x480a); registerLCID("Spanish", "Nicaragua", 0x4c0a); registerLCID("Spanish", "Commonwealth of Puerto Rico", 0x500a); registerLCID("Spanish", "United States", 0x540a); registerLCID("Spanish", "Uruguay", 0x380a); registerLCID("Spanish (International Sort)", "Spain", 0x0c0a); registerLCID("Spanish (Traditional Sort)", "Spain", 0x040a); registerLCID("Sutu", "South Africa", 0x0430); registerLCID("Swedish", "Sweden", 0x041d); registerLCID("Swedish", "Finland", 0x081d); registerLCID("Syriac", "Syria", 0x045a); registerLCID("Tajik", "Tajikistan", 0x0428); registerLCID("Tamazight (Latin)", "Algeria", 0x085f); registerLCID("Tamil", "India", 0x0449); registerLCID("Tatar", "Russia", 0x0444); registerLCID("Telugu", "India", 0x044a); registerLCID("Thai", "Thailand", 0x041e); registerLCID("Tibetan", "People's Republic of China", 0x0451); registerLCID("Turkish", "Turkey", 0x041f); registerLCID("Turkmen", "Turkmenistan", 0x0442); registerLCID("Uighur", "People's Republic of China", 0x0480); registerLCID("Ukrainian", "Ukraine", 0x0422); registerLCID("Upper Sorbian", "Germany", 0x042e); registerLCID("Urdu", "Pakistan", 0x0420); registerLCID("Uzbek (Cyrillic)", "Uzbekistan", 0x0843); registerLCID("Uzbek (Latin)", "Uzbekistan", 0x0443); registerLCID("Vietnamese", "Vietnam", 0x042a); registerLCID("Welsh", "United Kingdom", 0x0452); registerLCID("Wolof", "Senegal", 0x0488); registerLCID("Yi", "People's Republic of China", 0x0478); registerLCID("Yoruba", "Nigeria", 0x046a); registerLCID("Arabic", "", 0x0001); registerLCID("Bulgarian", "", 0x0002); registerLCID("Catalan", "", 0x0003); registerLCID("Czech", "", 0x0005); registerLCID("Danish", "", 0x0006); registerLCID("German", "", 0x0007); registerLCID("Greek", "", 0x0008); registerLCID("English", "", 0x0009); registerLCID("Spanish", "", 0x000a); registerLCID("Finnish", "", 0x000b); registerLCID("French", "", 0x000c); registerLCID("Hebrew", "", 0x000d); registerLCID("Hungarian", "", 0x000e); registerLCID("Icelandic", "", 0x000f); registerLCID("Italian", "", 0x0010); registerLCID("Japanese", "", 0x0011); registerLCID("Korean", "", 0x0012); registerLCID("Dutch", "", 0x0013); registerLCID("", "", 0x0014); registerLCID("Polish", "", 0x0015); registerLCID("Portuguese", "", 0x0016); registerLCID("", "", 0x0017); registerLCID("Romanian", "", 0x0018); registerLCID("Russian", "", 0x0019); registerLCID("Croatian", "", 0x001a); registerLCID("Slovak", "", 0x001b); registerLCID("Albanian", "", 0x001c); registerLCID("Swedish", "", 0x001d); registerLCID("Thai", "", 0x001e); registerLCID("Turkish", "", 0x001f); registerLCID("Urdu", "", 0x0020); registerLCID("Indonesian", "", 0x0021); registerLCID("Ukrainian", "", 0x0022); registerLCID("Belarusian", "", 0x0023); registerLCID("Slovenian", "", 0x0024); registerLCID("Estonian", "", 0x0025); registerLCID("Latvian", "", 0x0026); registerLCID("Lithuanian", "", 0x0027); registerLCID("Persian", "", 0x0029); registerLCID("Vietnamese", "", 0x002a); registerLCID("Armenian", "", 0x002b); registerLCID("Azerbaijani", "", 0x002c); registerLCID("Basque", "", 0x002d); registerLCID("Macedonian", "", 0x002f); registerLCID("Afrikaans", "", 0x0036); registerLCID("Georgian", "", 0x0037); registerLCID("Faroese", "", 0x0038); registerLCID("Hindi", "", 0x0039); registerLCID("Maltese", "", 0x003a); registerLCID("Irish", "", 0x003c); registerLCID("Malay", "", 0x003e); registerLCID("Kazakh", "", 0x003f); registerLCID("Swahili", "", 0x0041); registerLCID("Uzbek", "", 0x0043); registerLCID("Bengali", "", 0x0045); registerLCID("Punjabi", "", 0x0046); registerLCID("Gujarati", "", 0x0047); registerLCID("Oriya", "", 0x0048); registerLCID("Tamil", "", 0x0049); registerLCID("Telugu", "", 0x004a); registerLCID("Kannada", "", 0x004b); registerLCID("Malayalam", "", 0x004c); registerLCID("Assamese", "", 0x004d); registerLCID("Marathi", "", 0x004e); registerLCID("Welsh", "", 0x0052); registerLCID("Khmer", "", 0x0053); registerLCID("Galician", "", 0x0056); registerLCID("Konkani", "", 0x0057); registerLCID("Sinhala", "", 0x005b); registerLCID("Amharic", "", 0x005e); registerLCID("Nepali", "", 0x0061); registerLCID("Pashto", "", 0x0063); registerLCID("Hausa", "", 0x0068); registerLCID("Kalaallisut", "", 0x006f); registerLCID("Sichuan yi", "", 0x0078); registerLCID("Tigrinya", "", 0x0473); registerLCID("Hawaiian", "", 0x0475); registerLCID("Somali", "", 0x0477); registerLCID("Urdu", "", 0x0820); registerLCID("Nepali", "", 0x0861); registerLCID("Tigrinya", "", 0x0873); registerLCID("French", "SN", 0x280c); registerLCID("English", "HK", 0x3c09); registerLCID("Serbian", "Cyrillic", 0x6c1a); registerLCID("Serbian", "Latin", 0x701a); registerLCID("Azerbaijani", "Cyrillic", 0x742c); registerLCID("Chinese", "", 0x7804); registerLCID("Norwegian", "nynorsk", 0x7814); registerLCID("Azerbaijani", "Latin", 0x782c); registerLCID("Uzbek", "Cyrillic", 0x7843); registerLCID("Norwegian", "bokmol", 0x7c14); registerLCID("Serbian", "", 0x7c1a); registerLCID("Uzbek", "Latin", 0x7c43); registerLCID("Hausa", "Latin", 0x7c68); registerLCID("Tajik", "", 0x0028); registerLCID("Sorbian", "", 0x002e); registerLCID("Setswana", "", 0x0032); registerLCID("isiXhosa", "", 0x0034); registerLCID("isiZulu", "", 0x0035); registerLCID("Sami", "", 0x003b); registerLCID("Kyrgyz", "", 0x0040); registerLCID("Turkmen", "", 0x0042); registerLCID("Tatar", "", 0x0044); registerLCID("Sanskrit", "", 0x004f); registerLCID("Mongolian", "", 0x0050); registerLCID("Tibetan", "", 0x0051); registerLCID("Lao", "", 0x0054); registerLCID("Syriac", "", 0x005a); registerLCID("Inuktitut", "", 0x005d); registerLCID("Tamazight", "", 0x005f); registerLCID("Frisian", "", 0x0062); registerLCID("Filipino", "", 0x0064); registerLCID("Divehi", "", 0x0065); registerLCID("Yoruba", "", 0x006a); registerLCID("Quechua", "", 0x006b); registerLCID("Northern Sotho", "", 0x006c); registerLCID("Bashkir", "", 0x006d); registerLCID("Luxembourgish", "", 0x006e); registerLCID("Igbo", "", 0x0070); registerLCID("Mapudungun", "", 0x007a); registerLCID("Mohawk", "", 0x007c); registerLCID("Breton", "", 0x007e); registerLCID("Uighur", "", 0x0080); registerLCID("Maori", "", 0x0081); registerLCID("Occitan", "", 0x0082); registerLCID("Corsican", "", 0x0083); registerLCID("Alsatian", "", 0x0084); registerLCID("Yakut", "", 0x0085); registerLCID("K'iche", "", 0x0086); registerLCID("Kinyarwanda", "", 0x0087); registerLCID("Wolof", "", 0x0088); registerLCID("Dari", "", 0x008c); registerLCID("Gaelic", "", 0x0091); registerLCID("Tsonga", "", 0x0431); registerLCID("Venda", "South Africa", 0x0433); registerLCID("Burmese", "Myanmar", 0x0455); registerLCID("Manipuri", "India", 0x0458); registerLCID("Sindhi", "India", 0x0459); registerLCID("Cherokee", "United States", 0x045c); registerLCID("Tamazight", "Morocco", 0x045f); registerLCID("Edo", "Nigeria", 0x0466); registerLCID("Fulfulde", "Nigeria", 0x0467); registerLCID("Ibibio", "Nigeria", 0x0469); registerLCID("Kanuri", "Nigeria", 0x0471); registerLCID("West Central Oromo", "Ethiopia", 0x0472); registerLCID("Guarani", "Paraguay", 0x0474); registerLCID("Papiamento", "Netherlands Antilles", 0x0479); registerLCID("Plateau Malagasy", "Madagascar", 0x048d); registerLCID("Romanian", "Macao", 0x0818); registerLCID("Russian", "Macao", 0x0819); registerLCID("Panjabi", "Pakistan", 0x0846); registerLCID("Tibetan", "Bhutan", 0x0851); registerLCID("Sindhi", "Pakistan", 0x0859); registerLCID("Tamanaku", "Morocco", 0x0c5f); registerLCID("French", "", 0x1c0c); registerLCID("French", "Reunion", 0x200c); registerLCID("French", "Congo", 0x240c); registerLCID("French", "Cameroon", 0x2c0c); registerLCID("French", "Cote d'Ivoire", 0x300c); registerLCID("French", "Mali", 0x340c); registerLCID("English", "Indonesia", 0x3809); registerLCID("French", "Morocco", 0x380c); registerLCID("French", "Haiti", 0x3c0c); registerLCID("Bosnian", "Cyrillic", 0x641a); registerLCID("Bosnian", "Latin", 0x681a); registerLCID("Inari Sami", "", 0x703b); registerLCID("Skolt Sami", "", 0x743b); registerLCID("Bosnian", "", 0x781a); registerLCID("Southern Sami", "", 0x783b); registerLCID("Mongolian", "Cyrillic", 0x7850); registerLCID("Inuktitut", "Unified Canadian Aboriginal Syllabics", 0x785d); registerLCID("Tajik", "Cyrillic", 0x7c28); registerLCID("Lower Sorbian", "", 0x7c2e); registerLCID("Lule Sami", "", 0x7c3b); registerLCID("Mongolian", "Mongolia", 0x7c50); registerLCID("Inuktitut", "Latin", 0x7c5d); registerLCID("Central Atlas Tamazight", "Latin", 0x7c5f); registerLCID("Greek 2", "Greece", 0x2008); registerLCID("Lithuanian", "Lithuania", 0x0827); registerLCID("Sutu", "", 0x0030); registerLCID("Gaelic", "Scotland", 0x043c); registerLCID("Sindhi", "", 0x0059); registerLCID("Somali", "", 0x0077); // Language tags registerTag(0x0001, "ar"); registerTag(0x0002, "bg"); registerTag(0x0003, "ca"); registerTag(0x0004, "zh"); registerTag(0x0005, "cs"); registerTag(0x0006, "da"); registerTag(0x0007, "de"); registerTag(0x0008, "el"); registerTag(0x0009, "en"); registerTag(0x000a, "es"); registerTag(0x000b, "fi"); registerTag(0x000c, "fr"); registerTag(0x000d, "he"); registerTag(0x000e, "hu"); registerTag(0x000f, "is"); registerTag(0x0010, "it"); registerTag(0x0011, "ja"); registerTag(0x0012, "ko"); registerTag(0x0013, "nl"); registerTag(0x0014, "nb"); registerTag(0x0015, "pl"); registerTag(0x0016, "pt"); registerTag(0x0017, "rm"); registerTag(0x0018, "ro"); registerTag(0x0019, "ru"); registerTag(0x001a, "hr"); registerTag(0x001b, "sk"); registerTag(0x001c, "sq"); registerTag(0x001d, "sv"); registerTag(0x001e, "th"); registerTag(0x001f, "tr"); registerTag(0x0020, "ur"); registerTag(0x0021, "id"); registerTag(0x0022, "uk"); registerTag(0x0023, "be"); registerTag(0x0024, "sl"); registerTag(0x0025, "et"); registerTag(0x0026, "lv"); registerTag(0x0027, "lt"); registerTag(0x0028, "tg"); registerTag(0x0029, "fa"); registerTag(0x002a, "vi"); registerTag(0x002b, "hy"); registerTag(0x002c, "az"); registerTag(0x002d, "eu"); registerTag(0x002e, "hsb"); registerTag(0x002f, "mk"); registerTag(0x0032, "tn"); //registerTag(0x0033, "ven"); registerTag(0x0034, "xh"); registerTag(0x0035, "zu"); registerTag(0x0036, "af"); registerTag(0x0037, "ka"); registerTag(0x0038, "fo"); registerTag(0x0039, "hi"); registerTag(0x003a, "mt"); registerTag(0x003b, "se"); registerTag(0x003c, "ga"); registerTag(0x003e, "ms"); registerTag(0x003f, "kk"); registerTag(0x0040, "ky"); registerTag(0x0041, "sw"); registerTag(0x0042, "tk"); registerTag(0x0043, "uz"); registerTag(0x0044, "tt"); registerTag(0x0045, "bn"); registerTag(0x0046, "pa"); registerTag(0x0047, "gu"); registerTag(0x0048, "or"); registerTag(0x0049, "ta"); registerTag(0x004a, "te"); registerTag(0x004b, "kn"); registerTag(0x004c, "ml"); registerTag(0x004d, "as"); registerTag(0x004e, "mr"); registerTag(0x004f, "sa"); registerTag(0x0050, "mn"); registerTag(0x0051, "bo"); registerTag(0x0052, "cy"); registerTag(0x0053, "km"); registerTag(0x0054, "lo"); registerTag(0x0056, "gl"); registerTag(0x0057, "kok"); registerTag(0x005a, "syr"); registerTag(0x005b, "si"); registerTag(0x005d, "iu"); registerTag(0x005e, "am"); registerTag(0x005f, "tzm"); registerTag(0x0061, "ne"); registerTag(0x0062, "fy"); registerTag(0x0063, "ps"); registerTag(0x0064, "fil"); registerTag(0x0065, "dv"); registerTag(0x0068, "ha"); registerTag(0x006a, "yo"); registerTag(0x006b, "quz"); registerTag(0x006c, "nso"); registerTag(0x006d, "ba"); registerTag(0x006e, "lb"); registerTag(0x006f, "kl"); registerTag(0x0070, "ig"); registerTag(0x0078, "ii"); registerTag(0x007a, "arn"); registerTag(0x007c, "moh"); registerTag(0x007e, "br"); registerTag(0x0080, "ug"); registerTag(0x0081, "mi"); registerTag(0x0082, "oc"); registerTag(0x0083, "co"); registerTag(0x0084, "gsw"); registerTag(0x0085, "sah"); registerTag(0x0086, "qut"); registerTag(0x0087, "rw"); registerTag(0x0088, "wo"); registerTag(0x008c, "prs"); registerTag(0x0091, "gd"); registerTag(0x0401, "ar-SA"); registerTag(0x0402, "bg-BG"); registerTag(0x0403, "ca-ES"); registerTag(0x0404, "zh-TW"); //registerTag(0x0004, "zh-Hans"); registerTag(0x7c04, "zh-Hant"); registerTag(0x0405, "cs-CZ"); registerTag(0x0406, "da-DK"); registerTag(0x0407, "de-DE"); registerTag(0x0408, "el-GR"); registerTag(0x0409, "en-US"); registerTag(0x040A, "es-ES_tradnl"); registerTag(0x040B, "fi-FI"); registerTag(0x040C, "fr-FR"); registerTag(0x040D, "he-IL"); registerTag(0x040E, "hu-HU"); registerTag(0x040F, "is-IS"); registerTag(0x0410, "it-IT"); registerTag(0x0411, "ja-JP"); registerTag(0x0412, "ko-KR"); registerTag(0x0413, "nl-NL"); registerTag(0x0414, "nb-NO"); registerTag(0x0415, "pl-PL"); registerTag(0x0416, "pt-BR"); registerTag(0x0417, "rm-CH"); registerTag(0x0418, "ro-RO"); registerTag(0x0419, "ru-RU"); registerTag(0x041A, "hr-HR"); registerTag(0x041B, "sk-SK"); registerTag(0x041C, "sq-AL"); registerTag(0x041D, "sv-SE"); registerTag(0x041E, "th-TH"); registerTag(0x041F, "tr-TR"); registerTag(0x0420, "ur-PK"); registerTag(0x0421, "id-ID"); registerTag(0x0422, "uk-UA"); registerTag(0x0423, "be-BY"); registerTag(0x0424, "sl-SI"); registerTag(0x0425, "et-EE"); registerTag(0x0426, "lv-LV"); registerTag(0x0427, "lt-LT"); registerTag(0x0428, "tg-Cyrl-TJ"); registerTag(0x0429, "fa-IR"); registerTag(0x042A, "vi-VN"); registerTag(0x042B, "hy-AM"); registerTag(0x042C, "az-Latn-AZ"); registerTag(0x042D, "eu-ES"); registerTag(0x042E, "wen-DE"); registerTag(0x042F, "mk-MK"); registerTag(0x0430, "st-ZA"); registerTag(0x0431, "ts-ZA"); registerTag(0x0432, "tn-ZA"); registerTag(0x0433, "ven-ZA"); registerTag(0x0434, "xh-ZA"); registerTag(0x0435, "zu-ZA"); registerTag(0x0436, "af-ZA"); registerTag(0x0437, "ka-GE"); registerTag(0x0438, "fo-FO"); registerTag(0x0439, "hi-IN"); registerTag(0x043A, "mt-MT"); registerTag(0x043B, "se-NO"); registerTag(0x043E, "ms-MY"); registerTag(0x043F, "kk-KZ"); registerTag(0x0440, "ky-KG"); registerTag(0x0441, "sw-KE"); registerTag(0x0442, "tk-TM"); registerTag(0x0443, "uz-Latn-UZ"); registerTag(0x0444, "tt-RU"); registerTag(0x0445, "bn-IN"); registerTag(0x0446, "pa-IN"); registerTag(0x0447, "gu-IN"); registerTag(0x0448, "or-IN"); registerTag(0x0449, "ta-IN"); registerTag(0x044A, "te-IN"); registerTag(0x044B, "kn-IN"); registerTag(0x044C, "ml-IN"); registerTag(0x044D, "as-IN"); registerTag(0x044E, "mr-IN"); registerTag(0x044F, "sa-IN"); registerTag(0x0450, "mn-MN"); registerTag(0x0451, "bo-CN"); registerTag(0x0452, "cy-GB"); registerTag(0x0453, "km-KH"); registerTag(0x0454, "lo-LA"); registerTag(0x0455, "my-MM"); registerTag(0x0456, "gl-ES"); registerTag(0x0457, "kok-IN"); registerTag(0x0458, "mni"); registerTag(0x0459, "sd-IN"); registerTag(0x045A, "syr-SY"); registerTag(0x045B, "si-LK"); registerTag(0x045C, "chr-US"); registerTag(0x045D, "iu-Cans-CA"); registerTag(0x045E, "am-ET"); registerTag(0x045F, "tmz"); registerTag(0x0461, "ne-NP"); registerTag(0x0462, "fy-NL"); registerTag(0x0463, "ps-AF"); registerTag(0x0464, "fil-PH"); registerTag(0x0465, "dv-MV"); registerTag(0x0466, "bin-NG"); registerTag(0x0467, "fuv-NG"); registerTag(0x0468, "ha-Latn-NG"); registerTag(0x0469, "ibb-NG"); registerTag(0x046A, "yo-NG"); registerTag(0x046B, "quz-BO"); registerTag(0x046C, "nso-ZA"); registerTag(0x046D, "ba-RU"); registerTag(0x046E, "lb-LU"); registerTag(0x046F, "kl-GL"); registerTag(0x0470, "ig-NG"); registerTag(0x0471, "kr-NG"); registerTag(0x0472, "gaz-ET"); registerTag(0x0473, "ti-ER"); registerTag(0x0474, "gn-PY"); registerTag(0x0475, "haw-US"); registerTag(0x0477, "so-SO"); registerTag(0x0478, "ii-CN"); registerTag(0x0479, "pap-AN"); registerTag(0x047A, "arn-CL"); registerTag(0x047C, "moh-CA"); registerTag(0x047E, "br-FR"); registerTag(0x0480, "ug-CN"); registerTag(0x0481, "mi-NZ"); registerTag(0x0482, "oc-FR"); registerTag(0x0483, "co-FR"); registerTag(0x0484, "gsw-FR"); registerTag(0x0485, "sah-RU"); registerTag(0x0486, "qut-GT"); registerTag(0x0487, "rw-RW"); registerTag(0x0488, "wo-SN"); registerTag(0x048C, "prs-AF"); registerTag(0x048D, "plt-MG"); registerTag(0x0491, "gd-GB"); registerTag(0x0801, "ar-IQ"); registerTag(0x0804, "zh-CN"); registerTag(0x0807, "de-CH"); registerTag(0x0809, "en-GB"); registerTag(0x080A, "es-MX"); registerTag(0x080C, "fr-BE"); registerTag(0x0810, "it-CH"); registerTag(0x0813, "nl-BE"); registerTag(0x0814, "nn-NO"); registerTag(0x0816, "pt-PT"); registerTag(0x0818, "ro-MO"); registerTag(0x0819, "ru-MO"); registerTag(0x081A, "sr-Latn-CS"); registerTag(0x081D, "sv-FI"); registerTag(0x0820, "ur-IN"); registerTag(0x082C, "az-Cyrl-AZ"); registerTag(0x082E, "dsb-DE"); registerTag(0x083B, "se-SE"); registerTag(0x083C, "ga-IE"); registerTag(0x083E, "ms-BN"); registerTag(0x0843, "uz-Cyrl-UZ"); registerTag(0x0845, "bn-BD"); registerTag(0x0846, "pa-PK"); registerTag(0x0850, "mn-Mong-CN"); registerTag(0x0851, "bo-BT"); registerTag(0x0859, "sd-PK"); registerTag(0x085D, "iu-Latn-CA"); registerTag(0x085F, "tzm-Latn-DZ"); registerTag(0x0861, "ne-IN"); registerTag(0x086B, "quz-EC"); registerTag(0x0873, "ti-ET"); registerTag(0x0C01, "ar-EG"); registerTag(0x0C04, "zh-HK"); registerTag(0x0C07, "de-AT"); registerTag(0x0C09, "en-AU"); registerTag(0x0C0A, "es-ES"); registerTag(0x0C0C, "fr-CA"); registerTag(0x0C1A, "sr-Cyrl-CS"); registerTag(0x0C3B, "se-FI"); registerTag(0x0C5F, "tmz-MA"); registerTag(0x0C6B, "quz-PE"); registerTag(0x1001, "ar-LY"); registerTag(0x1004, "zh-SG"); registerTag(0x1007, "de-LU"); registerTag(0x1009, "en-CA"); registerTag(0x100A, "es-GT"); registerTag(0x100C, "fr-CH"); registerTag(0x101A, "hr-BA"); registerTag(0x103B, "smj-NO"); registerTag(0x1401, "ar-DZ"); registerTag(0x1404, "zh-MO"); registerTag(0x1407, "de-LI"); registerTag(0x1409, "en-NZ"); registerTag(0x140A, "es-CR"); registerTag(0x140C, "fr-LU"); registerTag(0x141A, "bs-Latn-BA"); registerTag(0x143B, "smj-SE"); registerTag(0x1801, "ar-MA"); registerTag(0x1809, "en-IE"); registerTag(0x180A, "es-PA"); registerTag(0x180C, "fr-MC"); registerTag(0x181A, "sr-Latn-BA"); registerTag(0x183B, "sma-NO"); registerTag(0x1C01, "ar-TN"); registerTag(0x1C09, "en-ZA"); registerTag(0x1C0A, "es-DO"); registerTag(0x1C0C, "fr-West-Indies"); registerTag(0x1C1A, "sr-Cyrl-BA"); registerTag(0x1C3B, "sma-SE"); registerTag(0x2001, "ar-OM"); registerTag(0x2009, "en-JM"); registerTag(0x200A, "es-VE"); registerTag(0x200C, "fr-RE"); registerTag(0x201A, "bs-Cyrl-BA"); registerTag(0x203B, "sms-FI"); registerTag(0x2401, "ar-YE"); registerTag(0x2409, "en-CB"); registerTag(0x240A, "es-CO"); registerTag(0x240C, "fr-CG"); registerTag(0x241a, "sr-Latn-RS"); registerTag(0x243B, "smn-FI"); registerTag(0x2801, "ar-SY"); registerTag(0x2809, "en-BZ"); registerTag(0x280A, "es-PE"); registerTag(0x280C, "fr-SN"); registerTag(0x281a, "sr-Cyrl-RS"); registerTag(0x2C01, "ar-JO"); registerTag(0x2C09, "en-TT"); registerTag(0x2C0A, "es-AR"); registerTag(0x2C0C, "fr-CM"); registerTag(0x2c1a, "sr-Latn-ME"); registerTag(0x3001, "ar-LB"); registerTag(0x3009, "en-ZW"); registerTag(0x300A, "es-EC"); registerTag(0x300C, "fr-CI"); registerTag(0x301a, "sr-Cyrl-ME"); registerTag(0x3401, "ar-KW"); registerTag(0x3409, "en-PH"); registerTag(0x340A, "es-CL"); registerTag(0x340C, "fr-ML"); registerTag(0x3801, "ar-AE"); registerTag(0x3809, "en-ID"); registerTag(0x380A, "es-UY"); registerTag(0x380C, "fr-MA"); registerTag(0x3C01, "ar-BH"); registerTag(0x3C09, "en-HK"); registerTag(0x3c0a, "es-PY"); registerTag(0x3C0C, "fr-HT"); registerTag(0x4001, "ar-QA"); registerTag(0x4009, "en-IN"); registerTag(0x400A, "es-BO"); registerTag(0x4409, "en-MY"); registerTag(0x440A, "es-SV"); registerTag(0x4809, "en-SG"); registerTag(0x480A, "es-HN"); registerTag(0x4C0A, "es-NI"); registerTag(0x500A, "es-PR"); registerTag(0x540A, "es-US"); registerTag(0x641a, "bs-Cyrl"); registerTag(0x681a, "bs-Latn"); registerTag(0x6c1a, "sr-Cyrl"); registerTag(0x701a, "sr-Latn"); registerTag(0x703b, "smn"); registerTag(0x742c, "az-Cyrl"); registerTag(0x743b, "sms"); registerTag(0x7804, "zh"); registerTag(0x7814, "nn"); registerTag(0x781a, "bs"); registerTag(0x782c, "az-Latn"); registerTag(0x783b, "sma"); registerTag(0x7843, "uz-Cyrl"); registerTag(0x7850, "mn-Cyrl"); registerTag(0x785d, "iu-Cans"); registerTag(0x7c14, "nb"); registerTag(0x7c1a, "sr"); registerTag(0x7c28, "tg-Cyrl"); registerTag(0x7c2e, "dsb"); registerTag(0x7c3b, "smj"); registerTag(0x7c43, "uz-Latn"); registerTag(0x7c50, "mn-Mong"); registerTag(0x7c5d, "iu-Latn"); registerTag(0x7c5f, "tzm-Latn"); registerTag(0x7c68, "ha-Latn"); registerTag(0x2008, "el-GR"); registerTag(0x0827, "lt-LT"); registerTag(0x0030, "st"); registerTag(0x043c, "gd"); registerTag(0x0059, "sd"); registerTag(0x0077, "so"); } /** * Gets a list of all descriptors for the registered LCID. * @return a list of all descriptors for the registered LCID. */ public static List<LCIDDescr> getDescriptors () { return descriptors; } /** * Gets the language tag for a given LCID. * @param lcid the LCID value. * @return the language tag found or an empty string */ public static String getTag (int lcid) { LCIDDescr descr = tagLookup.get(lcid); return descr != null ? descr.tag : ""; } /** * Gets an LCID for a given language tag. * @param tag the language tag to lookup. * @return the LCID value found. */ public static int getLCID (String tag) { return getLCID(LocaleId.fromString(tag)); } /** * Gets the language tag for a given locale id. * @param locId the locale id to lookup. * @return the language tag found, or an empty string. */ public static String getTag (LocaleId locId) { LCIDDescr descr = lcidLookup.get(locId.toString()); return descr != null ? descr.tag : ""; } /** * Gets the LCID for a given locale id. * @param locId the locale id to lookup. * @return the LCID value found, or 0 if nothing is found. */ public static int getLCID (LocaleId locId) { LCIDDescr descr = lcidLookup.get(locId.toString()); return descr != null ? descr.lcid : 0; } /** * Gets the LCID as a string, for a given locale id. * @param locId the localie id to lookup. * @return the LCID found, as a string. */ public static String getLCID_asString (LocaleId locId) { return Util.intToStr(getLCID(locId)); } /** * Creates a locale id for a given language tag. * <p>This method is the same as calling <code>new LocaleId(tag)</code>. * @param tag the language tag. * @return a new locale id for the given language tag. */ public static LocaleId getLocaleId (String tag) { return new LocaleId(tag); } /** * Creates a locale id for a given LCID value. * @param lcid the LCID to lookup. * @return a new locale id for the given LCID value. */ public static LocaleId getLocaleId (int lcid) { return new LocaleId(getTag(lcid)); } public static HashMap<Integer, LCIDDescr> getTagLookup() { return tagLookup; } public static HashMap<String, LCIDDescr> getLcidLookup() { return lcidLookup; } }
37.081325
127
0.671053
427f002f744140876d81648289525f8f2dc09b42
8,012
package com.inz.z.note_book.database; import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; import com.inz.z.note_book.bean.OperationLogInfo; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "operation_log_info". */ public class OperationLogInfoDao extends AbstractDao<OperationLogInfo, String> { public static final String TABLENAME = "operation_log_info"; /** * Properties of entity OperationLogInfo.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property OperationLogId = new Property(0, String.class, "operationLogId", true, "OPERATION_LOG_ID"); public final static Property TableName = new Property(1, String.class, "tableName", false, "TABLE_NAME"); public final static Property OperationType = new Property(2, String.class, "operationType", false, "OPERATION_TYPE"); public final static Property OperationDescribe = new Property(3, String.class, "operationDescribe", false, "OPERATION_DESCRIBE"); public final static Property OperationData = new Property(4, String.class, "operationData", false, "OPERATION_DATA"); public final static Property CreateTime = new Property(5, java.util.Date.class, "createTime", false, "CREATE_TIME"); public final static Property UpdateTime = new Property(6, java.util.Date.class, "updateTime", false, "UPDATE_TIME"); } public OperationLogInfoDao(DaoConfig config) { super(config); } public OperationLogInfoDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"operation_log_info\" (" + // "\"OPERATION_LOG_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: operationLogId "\"TABLE_NAME\" TEXT," + // 1: tableName "\"OPERATION_TYPE\" TEXT," + // 2: operationType "\"OPERATION_DESCRIBE\" TEXT," + // 3: operationDescribe "\"OPERATION_DATA\" TEXT," + // 4: operationData "\"CREATE_TIME\" INTEGER," + // 5: createTime "\"UPDATE_TIME\" INTEGER);"); // 6: updateTime // Add Indexes db.execSQL("CREATE UNIQUE INDEX " + constraint + "IDX_operation_log_info_OPERATION_LOG_ID ON \"operation_log_info\"" + " (\"OPERATION_LOG_ID\" ASC);"); } /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"operation_log_info\""; db.execSQL(sql); } @Override protected final void bindValues(DatabaseStatement stmt, OperationLogInfo entity) { stmt.clearBindings(); String operationLogId = entity.getOperationLogId(); if (operationLogId != null) { stmt.bindString(1, operationLogId); } String tableName = entity.getTableName(); if (tableName != null) { stmt.bindString(2, tableName); } String operationType = entity.getOperationType(); if (operationType != null) { stmt.bindString(3, operationType); } String operationDescribe = entity.getOperationDescribe(); if (operationDescribe != null) { stmt.bindString(4, operationDescribe); } String operationData = entity.getOperationData(); if (operationData != null) { stmt.bindString(5, operationData); } java.util.Date createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindLong(6, createTime.getTime()); } java.util.Date updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindLong(7, updateTime.getTime()); } } @Override protected final void bindValues(SQLiteStatement stmt, OperationLogInfo entity) { stmt.clearBindings(); String operationLogId = entity.getOperationLogId(); if (operationLogId != null) { stmt.bindString(1, operationLogId); } String tableName = entity.getTableName(); if (tableName != null) { stmt.bindString(2, tableName); } String operationType = entity.getOperationType(); if (operationType != null) { stmt.bindString(3, operationType); } String operationDescribe = entity.getOperationDescribe(); if (operationDescribe != null) { stmt.bindString(4, operationDescribe); } String operationData = entity.getOperationData(); if (operationData != null) { stmt.bindString(5, operationData); } java.util.Date createTime = entity.getCreateTime(); if (createTime != null) { stmt.bindLong(6, createTime.getTime()); } java.util.Date updateTime = entity.getUpdateTime(); if (updateTime != null) { stmt.bindLong(7, updateTime.getTime()); } } @Override public String readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0); } @Override public OperationLogInfo readEntity(Cursor cursor, int offset) { OperationLogInfo entity = new OperationLogInfo( // cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // operationLogId cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // tableName cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // operationType cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // operationDescribe cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // operationData cursor.isNull(offset + 5) ? null : new java.util.Date(cursor.getLong(offset + 5)), // createTime cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)) // updateTime ); return entity; } @Override public void readEntity(Cursor cursor, OperationLogInfo entity, int offset) { entity.setOperationLogId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0)); entity.setTableName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setOperationType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setOperationDescribe(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setOperationData(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setCreateTime(cursor.isNull(offset + 5) ? null : new java.util.Date(cursor.getLong(offset + 5))); entity.setUpdateTime(cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6))); } @Override protected final String updateKeyAfterInsert(OperationLogInfo entity, long rowId) { return entity.getOperationLogId(); } @Override public String getKey(OperationLogInfo entity) { if(entity != null) { return entity.getOperationLogId(); } else { return null; } } @Override public boolean hasKey(OperationLogInfo entity) { return entity.getOperationLogId() != null; } @Override protected final boolean isEntityUpdateable() { return true; } }
39.663366
137
0.635796
4ef9473d66d0e09f0178bcdf8d45596945fe5a81
357
class sd { public static void main(int n) { int i,j,k,m; m=15; for(i=1;i<=n;i++) { for(k=1;k<=m;k++) System.out.print(" "); for(j=i;j>=1;j--) { if((j==1)||(j%2!=0)) System.out.print("*"+" "+" "+" "); else System.out.print("#"+" "+" "+" "); } System.out.println(); m=m-2; } } }
16.227273
47
0.383754
4593f15105057faf2b3533d29b9f1a8aa548bad0
2,676
package game.models; import configuration.models.ModelConfig; /** * This interface represents models that are capable of learning. */ public interface ModelLearnable extends Model { /** * This function is used to intialise the model acording to the template configuration bean * * @param cfg */ public void init(ModelConfig cfg); /** * This member fuction runs the learnig algorithm of the model */ public void learn(); /** * @return maximum number of vectors that can be used to train model */ public int getMaxLearningVectors(); /** * @param maxVectors Set maximum number of vectors that can be used for learning. */ public void setMaxLearningVectors(int maxVectors); /** * Adds particular data vector to the learnig data set of the model - allows you to add data indepentently from GlobalData * * @param input input vector * @param output target variable */ public void storeLearningVector(double[] input, double output); /** * Deletes all learning vectors in this model and all submodels */ public void deleteLearningVectors(); /** * @return true if model is learned. */ public boolean isLearned(); /** * Resets internal pointer for learning vectors to 0, ie erases all learning data, but leaves memory allocated. */ public void resetLearningData(); /** * Performs initialization of all internal structures depending on number of inputs. * * @param inputs Number of inputs for given model. */ public void setInputsNumber(int inputs); /** * Returns number of inputs. * * @return Number of inputs for given model. */ public int getInputsNumber(); /** * Returns all input vectors being stored in learning data. * The resulting array is formed in same way as the array got by {@link game.data.GameData.getInputVectors()}, * which means, that while addressing a value, the top-level array index is a number of input, * the second-level array index is a number of data instance. * * @return array with inputs of all learning vectors */ public double[][] getLearningInputVectors(); /** * Returns target variable values of all data instances in learning data. * The values are ordered to match instance ordering in {@link #getLearningInputVectors()}. * * @return array with target variable values of all learning vectors */ public double[] getLearningOutputVectors(); }
29.733333
127
0.643871
8f5534bb4a8a5fa7d4b0e02af6605758dfa308bc
618
/** * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caintegrator/LICENSE.txt for details. */ package gov.nih.nci.caintegrator.application.arraydata; /** * Indicates that array data couldn't be written or retrieved. */ public class ArrayDataStorageException extends RuntimeException { private static final long serialVersionUID = 1L; ArrayDataStorageException(String message, Throwable t) { super(message, t); } ArrayDataStorageException(String message) { super(message); } }
24.72
67
0.720065
cd3fa2bdbaf8560a383bdeb1eddc44cd87ceaea3
5,287
package org.ovirt.engine.core.bll.storage.disk.managedblock; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.inject.Inject; import org.ovirt.engine.core.bll.CommandBase; import org.ovirt.engine.core.bll.InternalCommandAttribute; import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.bll.storage.disk.image.DisksFilter; import org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil; import org.ovirt.engine.core.bll.utils.PermissionSubject; import org.ovirt.engine.core.common.action.ActionParametersBase.EndProcedure; import org.ovirt.engine.core.common.action.ActionReturnValue; import org.ovirt.engine.core.common.action.ActionType; import org.ovirt.engine.core.common.action.RemoveAllManagedBlockStorageDisksParameters; import org.ovirt.engine.core.common.action.RemoveDiskParameters; import org.ovirt.engine.core.common.businessentities.storage.ManagedBlockStorageDisk; import org.ovirt.engine.core.common.utils.Pair; import org.ovirt.engine.core.dao.DiskDao; @InternalCommandAttribute public class RemoveAllManagedBlockStorageDisksCommand<T extends RemoveAllManagedBlockStorageDisksParameters> extends CommandBase<T> { @Inject private DiskDao diskDao; @Inject private CommandCoordinatorUtil commandCoordinatorUtil; public RemoveAllManagedBlockStorageDisksCommand(T parameters, CommandContext commandContext) { super(parameters, commandContext); } @Override public boolean validate() { return true; } @Override protected void executeCommand() { Collection<ManagedBlockStorageDisk> failedRemoving = new LinkedList<>(); for (final ManagedBlockStorageDisk managedBlockDisk : getManagedBlockDisksToBeRemoved()) { if (Boolean.TRUE.equals(managedBlockDisk.getActive())) { ActionReturnValue actionReturnValuernValue = removeManagedBlockDisk(managedBlockDisk); if (actionReturnValuernValue == null || !actionReturnValuernValue.getSucceeded()) { failedRemoving.add(managedBlockDisk); logRemoveManagedBlockDiskError(managedBlockDisk, actionReturnValuernValue); } } } setActionReturnValue(failedRemoving); persistCommand(getParameters().getParentCommand(), false); setSucceeded(true); } private void logRemoveManagedBlockDiskError(ManagedBlockStorageDisk managedBlockDisk, ActionReturnValue actionReturnValue) { log.error("Can't remove managed block disk id '{}' for VM id '{}' from domain id '{}' due to: {}.", managedBlockDisk.getImageId(), getParameters().getVmId(), managedBlockDisk.getStorageIds().get(0), actionReturnValue != null ? actionReturnValue.getFault().getMessage() : ""); } private ActionReturnValue removeManagedBlockDisk(ManagedBlockStorageDisk managedBlockDisk) { Future<ActionReturnValue> future = commandCoordinatorUtil.executeAsyncCommand( ActionType.RemoveManagedBlockStorageDisk, buildChildCommandParameters(managedBlockDisk), cloneContextAndDetachFromParent()); try { return future.get(); } catch (InterruptedException | ExecutionException e) { log.error("Error removing Cinder disk", e); } return null; } private RemoveDiskParameters buildChildCommandParameters(ManagedBlockStorageDisk managedBlockDisk) { RemoveDiskParameters removeDiskParams = new RemoveDiskParameters(managedBlockDisk.getId()); removeDiskParams.setStorageDomainId(managedBlockDisk.getStorageIds().get(0)); removeDiskParams.setParentCommand(getActionType()); removeDiskParams.setParentParameters(getParameters()); removeDiskParams.setShouldBeLogged(false); removeDiskParams.setEndProcedure(EndProcedure.COMMAND_MANAGED); return removeDiskParams; } private List<ManagedBlockStorageDisk> getManagedBlockDisksToBeRemoved() { List<ManagedBlockStorageDisk> imageDisks = getParameters().getManagedBlockDisks(); final List<ManagedBlockStorageDisk> managedBlockDisks = new ArrayList<>(); if (imageDisks == null) { managedBlockDisks.addAll(DisksFilter.filterManagedBlockStorageDisks(diskDao.getAllForVm(getVmId()))); } else { imageDisks.forEach(diskImage -> managedBlockDisks.add((ManagedBlockStorageDisk) diskImage)); } return managedBlockDisks; } @Override protected void endWithFailure() { setSucceeded(true); } @Override protected void endSuccessfully() { setSucceeded(true); } @Override protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.emptyMap(); } @Override protected Map<String, Pair<String, String>> getSharedLocks() { return Collections.emptyMap(); } @Override public List<PermissionSubject> getPermissionCheckSubjects() { return null; } }
41.304688
133
0.727066
09ee17e812b2faa7cd0f821d0c5cdab1d473c541
4,298
package com.googlecode.flickrjandroid.groups.members; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import com.googlecode.flickrjandroid.FlickrException; import com.googlecode.flickrjandroid.Parameter; import com.googlecode.flickrjandroid.Response; import com.googlecode.flickrjandroid.Transport; import com.googlecode.flickrjandroid.oauth.OAuthInterface; import com.googlecode.flickrjandroid.oauth.OAuthUtils; import com.googlecode.flickrjandroid.util.StringUtilities; /** * Members Interface. * * @author mago * @version $Id: MembersInterface.java,v 1.1 2009/06/21 19:55:15 x-mago Exp $ */ public class MembersInterface { public static final String METHOD_GET_LIST = "flickr.groups.members.getList"; private String apiKey; private String sharedSecret; private Transport transportAPI; public MembersInterface( String apiKey, String sharedSecret, Transport transportAPI ) { this.apiKey = apiKey; this.sharedSecret = sharedSecret; this.transportAPI = transportAPI; } /** * Get a list of the members of a group. * The call must be signed on behalf of a Flickr member, * and the ability to see the group membership will be * determined by the Flickr member's group privileges. * * @param groupId Return a list of members for this group. The group must be viewable by the Flickr member on whose behalf the API call is made. * @param memberTypes A set of Membertypes as available as constants in {@link Member}. * @param perPage Number of records per page. * @param page Result-section. * @return A members-list * @throws FlickrException * @throws IOException * @throws JSONException * @see <a href="http://www.flickr.com/services/api/flickr.groups.members.getList.html">API Documentation</a> */ public MembersList getList(String groupId, Set<String> memberTypes, int perPage, int page) throws FlickrException, IOException, JSONException { MembersList members = new MembersList(); List<Parameter> parameters = new ArrayList<Parameter>(); parameters.add(new Parameter("method", METHOD_GET_LIST)); parameters.add(new Parameter(OAuthInterface.PARAM_OAUTH_CONSUMER_KEY, apiKey)); parameters.add(new Parameter("group_id", groupId)); if (perPage > 0) { parameters.add(new Parameter("per_page", "" + perPage)); } if (page > 0) { parameters.add(new Parameter("page", "" + page)); } if (memberTypes != null) { parameters.add( new Parameter( "membertypes", StringUtilities.join(memberTypes, ",") ) ); } OAuthUtils.addOAuthToken(parameters); Response response = transportAPI.postJSON(sharedSecret, parameters); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } JSONObject mElement = response.getData().getJSONObject("members"); members.setPage(mElement.getInt("page")); members.setPages(mElement.getInt("pages")); members.setPerPage(mElement.getInt("perpage")); members.setTotal(mElement.getInt("total")); JSONArray mNodes = mElement.optJSONArray("member"); for (int i = 0; mNodes != null && i < mNodes.length(); i++) { JSONObject element = mNodes.getJSONObject(i); members.add(parseMember(element)); } return members; } private Member parseMember(JSONObject mElement) throws JSONException { Member member = new Member(); member.setId(mElement.getString("nsid")); member.setUserName(mElement.getString("username")); member.setIconServer(mElement.getString("iconserver")); member.setIconFarm(mElement.getString("iconfarm")); member.setMemberType(mElement.getString("membertype")); return member; } }
38.720721
149
0.651466
08c9440d6ffdccbee034614ef957c19f4efa2f9e
2,226
package org.springrain.weixin.sdk.common.util.http; import java.io.File; import java.io.IOException; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.springrain.frame.util.HttpClientUtils; import org.springrain.weixin.sdk.common.bean.result.WxError; import org.springrain.weixin.sdk.common.bean.result.WxMediaUploadResult; import org.springrain.weixin.sdk.common.exception.WxErrorException; import org.springrain.weixin.sdk.common.service.IWxConfig; /** * 上传媒体文件请求执行器,请求的参数是File, 返回的结果是String * * @author springrain */ public class MediaUploadRequestExecutor implements RequestExecutor<WxMediaUploadResult, File> { @Override public WxMediaUploadResult execute(IWxConfig wxconfig, String uri, File file) throws WxErrorException, IOException { HttpPost httpPost = new HttpPost(uri); if (wxconfig.getHttpProxyHost()!=null) { RequestConfig config = RequestConfig.custom().setProxy(new HttpHost(wxconfig.getHttpProxyHost(), wxconfig.getHttpProxyPort())).build(); httpPost.setConfig(config); } if (file != null) { HttpEntity entity = MultipartEntityBuilder .create() .addBinaryBody("media", file) .setMode(HttpMultipartMode.RFC6532) .build(); httpPost.setEntity(entity); httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString()); } try (CloseableHttpResponse response = HttpClientUtils.getHttpClient().execute(httpPost)) { String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); WxError error = WxError.fromJson(responseContent); if (error.getErrorCode() != 0) { throw new WxErrorException(error); } return WxMediaUploadResult.fromJson(responseContent); } finally { httpPost.releaseConnection(); } } }
39.75
144
0.730009
5cc2258d2825db95ea6f5ea2c26833eabcd4c2ae
4,864
package com.transferwise.tasks.triggering; import static org.awaitility.Awaitility.await; import com.google.common.collect.ImmutableSet; import com.transferwise.tasks.BaseIntTest; import com.transferwise.tasks.TasksProperties; import java.time.Duration; import java.time.Instant; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import org.apache.kafka.clients.admin.AdminClient; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; public class SeekToDurationOnRebalanceIntTest extends BaseIntTest { private static final String TOPIC = "SeekToDurationOnRebalanceIntTest"; @Autowired private TasksProperties tasksProperties; private AdminClient adminClient; private KafkaConsumer<String, String> kafkaConsumer; private KafkaProducer<String, String> kafkaProducer; @BeforeEach void setup() throws Exception { Map<String, Object> configs = new HashMap<>(); configs.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, tasksProperties.getTriggering().getKafka().getBootstrapServers()); adminClient = AdminClient.create(configs); NewTopic topic = new NewTopic(TOPIC, 3, (short) 1); adminClient.createTopics(Collections.singletonList(topic)).all().get(5, TimeUnit.SECONDS); Map<String, Object> consumerProperties = new HashMap<>(configs); consumerProperties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none"); consumerProperties.put(ConsumerConfig.GROUP_ID_CONFIG, "SeekToDurationOnRebalanceConsumer"); consumerProperties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); consumerProperties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); kafkaConsumer = new KafkaConsumer<>(consumerProperties); Map<String, Object> producerProperties = new HashMap<>(configs); producerProperties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); producerProperties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class); kafkaProducer = new KafkaProducer<>(producerProperties); } @AfterEach void cleanup() { cleanWithoutException(() -> { kafkaConsumer.close(); }); cleanWithoutException(() -> { adminClient.deleteTopics(Collections.singletonList(TOPIC)); adminClient.close(); }); cleanWithoutException(() -> { kafkaProducer.close(); }); } @Test void resetsOffsetsToDurationOnRebalance() { Instant now = Instant.now(); sendKafkaMessage(TOPIC, 0, now.minus(Duration.ofDays(10)).toEpochMilli(), "key", "1"); // older, won't be consumed sendKafkaMessage(TOPIC, 0, now.minus(Duration.ofDays(3)).toEpochMilli(), "key", "2"); sendKafkaMessage(TOPIC, 0, now.minus(Duration.ofDays(2)).toEpochMilli(), "key", "3"); sendKafkaMessage(TOPIC, 1, now.minus(Duration.ofDays(7)).toEpochMilli(), "key", "4"); // older, won't be consumed sendKafkaMessage(TOPIC, 1, now.minus(Duration.ofDays(6)).toEpochMilli(), "key", "5"); // older, won't be consumed sendKafkaMessage(TOPIC, 1, now.minus(Duration.ofDays(2)).toEpochMilli(), "key", "6"); sendKafkaMessage(TOPIC, 1, now.minus(Duration.ofDays(1)).toEpochMilli(), "key", "7"); sendKafkaMessage(TOPIC, 2, now.minus(Duration.ofHours(1)).toEpochMilli(), "key", "8"); sendKafkaMessage(TOPIC, 2, now.minus(Duration.ofHours(1)).toEpochMilli(), "key", "9"); sendKafkaMessage(TOPIC, 2, now.minus(Duration.ofHours(1)).toEpochMilli(), "key", "10"); kafkaConsumer.subscribe(Collections.singletonList(TOPIC), new SeekToDurationOnRebalance(kafkaConsumer, Duration.ofDays(4).negated())); Set<String> values = new HashSet<>(); await().until( () -> { for (ConsumerRecord<String, String> record : kafkaConsumer.poll(Duration.ofSeconds(5))) { values.add(record.value()); } return values.equals(ImmutableSet.of("2", "3", "6", "7", "8", "9", "10")); } ); } private void sendKafkaMessage(String topic, int partition, long timestamp, String key, String value) { kafkaProducer.send(new ProducerRecord<>(topic, partition, timestamp, key, value)); } }
44.623853
138
0.748561
8cac08e29bac215e8dc63635eb7b6fdba01fa31b
3,895
/******************************************************************************* Copyright ArxanFintech Technology Ltd. 2018 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.arxanfintech.common.util; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import com.arxanfintech.common.crypto.Hash; import java.io.UnsupportedEncodingException; import java.math.BigInteger; /** * generic byte array utilities */ public class ByteUtils { private static final char[] b58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray(); private static final int[] r58 = new int[256]; static { for (int i = 0; i < 256; ++i) { r58[i] = -1; } for (int i = 0; i < b58.length; ++i) { r58[b58[i]] = i; } } /** * convert a byte array to a human readable base58 string. Base58 is a Bitcoin * specific encoding similar to widely used base64 but avoids using characters * of similar shape, such as 1 and l or O an 0 * * @param b * byte data * @return base58 data */ public static String toBase58(byte[] b) { if (b.length == 0) { return ""; } int lz = 0; while (lz < b.length && b[lz] == 0) { ++lz; } StringBuilder s = new StringBuilder(); BigInteger n = new BigInteger(1, b); while (n.compareTo(BigInteger.ZERO) > 0) { BigInteger[] r = n.divideAndRemainder(BigInteger.valueOf(58)); n = r[0]; char digit = b58[r[1].intValue()]; s.append(digit); } while (lz > 0) { --lz; s.append("1"); } return s.reverse().toString(); } /** * Encode in base58 with an added checksum of four bytes. * * @param b * byte[] data * @return toBase58WithChecksum */ public static String toBase58WithChecksum(byte[] b) { byte[] cs = Hash.hash(b); byte[] extended = new byte[b.length + 4]; System.arraycopy(b, 0, extended, 0, b.length); System.arraycopy(cs, 0, extended, b.length, 4); return toBase58(extended); } /** * reverse a byte array in place WARNING the parameter array is altered and * returned. * * @param data * ori data * @return reverse data */ public static byte[] reverse(byte[] data) { for (int i = 0, j = data.length - 1; i < data.length / 2; i++, j--) { data[i] ^= data[j]; data[j] ^= data[i]; data[i] ^= data[j]; } return data; } /** * convert a byte array to hexadecimal * * @param data * byte[] data * @return hex data */ public static String toHex(byte[] data) { return new String(Hex.encodeHex(data)); } /** * recreate a byte array from hexadecimal * * @param hex * string data * @return byte[] data */ public static byte[] fromHex(String hex) { try { return Hex.decodeHex(hex.toCharArray()); } catch (DecoderException e) { return null; } } }
28.851852
113
0.546341
7e35732f5added45ab2da9901795c5a498e557b0
2,738
package com.microsoft.example.obfuscate; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import org.mindrot.jbcrypt.BCrypt; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class ObfuscateMapper extends Mapper<LongWritable, Text, NullWritable, Text> { public static final String SECRET_WORDS_FILE_KEY = "obfuscate.secrets.path"; public static final String SALT_FILE_KEY = "obfuscate.salt.path"; private final Map<String, String> _secretsWithHashes = new HashMap<>(); private Text _outputValue = new Text(); private final ArrayList<String> _salts = new ArrayList<>(); @Override protected void setup(Context context) throws IOException, InterruptedException { Path secretsFilePath = new Path(context.getConfiguration().get(SECRET_WORDS_FILE_KEY)); Path saltFilePath = new Path(context.getConfiguration().get(SALT_FILE_KEY)); readSalt(saltFilePath, context.getConfiguration()); readSecrets(secretsFilePath, context.getConfiguration()); } private void readSalt(Path saltFilePath, Configuration configuration) throws IOException { FileSystem fileSystem = FileSystem.get(saltFilePath.toUri(), configuration); FSDataInputStream inputStream = fileSystem.open(saltFilePath); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); String currentLine; while ((currentLine = reader.readLine()) != null) { if (!currentLine.isEmpty()) { _salts.add(currentLine); } } reader.close(); } private void readSecrets(Path secretsFilePath, Configuration configuration) throws IOException { FileSystem fileSystem = FileSystem.get(secretsFilePath.toUri(), configuration); FSDataInputStream inputStream = fileSystem.open(secretsFilePath); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); String currentLine; int saltIndex = 0; while ((currentLine = reader.readLine()) != null) { if (!currentLine.isEmpty()) { _secretsWithHashes.put(currentLine, BCrypt.hashpw(currentLine, _salts.get(saltIndex++))); } } reader.close(); } @Override protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { _outputValue.set(value.toString()); for (Map.Entry<String, String> secret : _secretsWithHashes.entrySet()) { _outputValue.set(_outputValue.toString().replace(secret.getKey(), secret.getValue())); } context.write(NullWritable.get(), _outputValue); } }
40.865672
110
0.755661
e23ab73c3ca2d9e7654846355457e37f0c3f033f
3,185
package com.stripe.functional; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.gson.annotations.SerializedName; import com.stripe.BaseStripeTest; import com.stripe.Stripe; import com.stripe.exception.InvalidRequestException; import com.stripe.exception.StripeException; import com.stripe.model.HasId; import com.stripe.net.ApiResource; import com.stripe.net.RequestOptions; import com.stripe.util.StreamUtils; import java.io.IOException; import java.io.InputStream; import java.util.Map; import lombok.Cleanup; import lombok.Getter; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import org.junit.jupiter.api.Test; public class StripeResponseStreamTest extends BaseStripeTest { private static class TestResource extends ApiResource implements HasId { @Getter(onMethod_ = {@Override}) @SerializedName("id") String id; public static TestResource retrieve(String id) throws StripeException { return ApiResource.request( ApiResource.RequestMethod.GET, String.format("%s/v1/foos/%s", Stripe.getApiBase(), ApiResource.urlEncodeId(id)), (Map<String, Object>) null, TestResource.class, (RequestOptions) null); } public InputStream pdf() throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), String.format("/v1/foobars/%s/pdf", ApiResource.urlEncodeId(this.getId()))); return ApiResource.requestStream( ApiResource.RequestMethod.POST, url, (Map<String, Object>) null, (RequestOptions) null); } } @Test public void testStreamedResponseSuccess() throws StripeException, IOException, InterruptedException { @Cleanup MockWebServer server = new MockWebServer(); server.enqueue(new MockResponse().setBody("{\"id\": \"foo_123\"}")); server.enqueue(new MockResponse().setBody("}this is a pdf, not valid json{")); server.start(); Stripe.overrideApiBase(server.url("").toString()); TestResource t = TestResource.retrieve("foo_123"); server.takeRequest(); assertEquals("foo_123", t.id); InputStream stream = t.pdf(); final String body = StreamUtils.readToEnd(stream, ApiResource.CHARSET); stream.close(); assertEquals("}this is a pdf, not valid json{", body); server.shutdown(); } @Test public void testStreamedResponseFailure() throws StripeException, IOException, InterruptedException { @Cleanup MockWebServer server = new MockWebServer(); server.enqueue(new MockResponse().setBody("{\"id\": \"foo_123\"}")); server.enqueue( new MockResponse() .setResponseCode(400) .setBody("{\"error\": {\"message\": \"bad bad bad\"}}")); server.start(); Stripe.overrideApiBase(server.url("").toString()); TestResource r = TestResource.retrieve("foo_123"); server.takeRequest(); assertEquals("foo_123", r.id); assertThrows( InvalidRequestException.class, () -> { r.pdf(); }); server.shutdown(); } }
32.5
98
0.69168
4df0cf1631cb9f19c36c909b84056291a2f8c050
34,701
/* ************************************************************************** * * Copyright (C) 2005 Marc Boorshtein All Rights Reserved. * * THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND * TREATIES. USE, MODIFICATION, AND REDISTRIBUTION OF THIS WORK IS SUBJECT * TO VERSION 2.0.1 OF THE OPENLDAP PUBLIC LICENSE, A COPY OF WHICH IS * AVAILABLE AT HTTP://WWW.OPENLDAP.ORG/LICENSE.HTML OR IN THE FILE "LICENSE" * IN THE TOP-LEVEL DIRECTORY OF THE DISTRIBUTION. ANY USE OR EXPLOITATION * OF THIS WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP * PUBLIC LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY. ******************************************************************************/ package com.novell.ldap; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.openspml.client.LighthouseClient; import org.openspml.client.SpmlClient; import org.openspml.message.AddRequest; import org.openspml.message.AddResponse; import org.openspml.message.Attribute; import org.openspml.message.Filter; import org.openspml.message.FilterTerm; import org.openspml.message.Identifier; import org.openspml.message.Modification; import org.openspml.message.ModifyRequest; import org.openspml.message.ModifyResponse; import org.openspml.message.SearchRequest; import org.openspml.message.SearchResponse; import org.openspml.message.SearchResult; import org.openspml.message.SpmlResponse; import org.openspml.util.SpmlException; import java.io.*; import java.lang.reflect.Field; import java.net.MalformedURLException; import com.novell.ldap.Connection; import com.novell.ldap.LDAPAttribute; import com.novell.ldap.LDAPConnection; import com.novell.ldap.LDAPConstraints; import com.novell.ldap.LDAPControl; import com.novell.ldap.LDAPEntry; import com.novell.ldap.LDAPException; import com.novell.ldap.LDAPExtendedOperation; import com.novell.ldap.LDAPExtendedResponse; import com.novell.ldap.LDAPMessage; import com.novell.ldap.LDAPMessageQueue; import com.novell.ldap.LDAPModification; import com.novell.ldap.LDAPResponseQueue; import com.novell.ldap.LDAPSchema; import com.novell.ldap.LDAPSearchConstraints; import com.novell.ldap.LDAPSearchQueue; import com.novell.ldap.LDAPSearchResults; import com.novell.ldap.LDAPSocketFactory; import com.novell.ldap.LDAPUnsolicitedNotificationListener; import com.novell.ldap.rfc2251.RfcFilter; import com.novell.ldap.spml.SPMLImpl; import com.novell.ldap.util.*; /** * @author Marc Boorshtein * * This class is meant to be a drop-in replacement for an LDAPConnection * when working sith synchronous LDAP calls */ public class SPMLConnection extends LDAPConnection { /** Default spml implementation */ public static final String DEF_IMPL = "com.novell.ldap.spml.SunIdm"; /** The Connection To The DSMLv2 Server */ SpmlClient con; /** The vendor specific version of the SPML implementation */ SPMLImpl vendorImpl; /** The URL of the server */ String serverString; /** The User's Name */ String binddn; /** The User's Password */ String pass; /** Determine if the connection is bound */ boolean isBound; /** determine if we are "connected" */ boolean isConnected; /** The host extracted from the url */ private String host; /** Allow for the adjustment of the HTTP Post */ HttpRequestCallback callback; /** * Short hand for executing a modification operation (add/modify/delete/rename) * @param message The message * @return The response * @throws com.novell.ldap.LDAPException */ private LDAPMessage sendMessage(LDAPMessage message) throws LDAPException { return null;//return (LDAPMessage) sendMessage(message,false); } /** * Short hand for retrieving results from a query * @param message * @return The search results * @throws com.novell.ldap.LDAPException */ private DSMLSearchResults execQuery(LDAPMessage message) throws LDAPException { return null;//return (DSMLSearchResults) sendMessage(message,true); } /** * Default Contructor, initilizes the http client * */ public SPMLConnection(){ this.loadImpl(SPMLConnection.DEF_IMPL,null); } public SPMLConnection(String className){ this.loadImpl(className,null); } public SPMLConnection(String className,ClassLoader loader){ this.loadImpl(className,loader); } /** * Creates an instace of DsmlConnection ignoring the socket factory * @param factory */ public SPMLConnection(LDAPSocketFactory factory) { this(); } private void loadImpl(String className,ClassLoader loader) { SPMLImpl impl = null; if (loader == null) { try { impl = (SPMLImpl) Class.forName(className).newInstance(); } catch (Exception e) { return; } } else { try { impl = (SPMLImpl) loader.loadClass(className).newInstance(); } catch (Exception e) { return; } } this.vendorImpl = impl; this.con = impl.getSpmlClient(); } /** * Sets the host as the serverUrl, port is ignored * @param serverUrl The Server location and context * @param port The port (ignored) */ public void connect(String serverUrl, int port) throws LDAPException { this.serverString = serverUrl; host = serverUrl.substring(serverUrl.indexOf("//") + 2,serverUrl.indexOf("/",serverUrl.indexOf("//") + 2)); try { this.con.setUrl(serverUrl); } catch (MalformedURLException e) { throw new LDAPLocalException(e.toString(), 53, e); } this.isConnected = true; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, byte[], com.novell.ldap.LDAPConstraints) */ public void bind(int arg0, String binddn, byte[] pass, LDAPConstraints arg3) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, byte[], com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue bind( int arg0, String arg1, byte[] arg2, LDAPResponseQueue arg3, LDAPConstraints arg4) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, byte[], com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue bind( int arg0, String arg1, byte[] arg2, LDAPResponseQueue arg3) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, byte[]) */ public void bind(int arg0, String binddn, byte[] pass) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, java.lang.String, com.novell.ldap.LDAPConstraints) */ public void bind(int arg0, String binddn, String pass, LDAPConstraints arg3) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(int, java.lang.String, java.lang.String) */ public void bind(int arg0, String binddn, String pass) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String, com.novell.ldap.LDAPConstraints) */ public void bind(String binddn, String pass, LDAPConstraints arg2) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String, java.util.Map, java.lang.Object, com.novell.ldap.LDAPConstraints) */ public void bind( String binddn, String pass, Map arg2, Object arg3, LDAPConstraints arg4) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String, java.util.Map, java.lang.Object) */ public void bind(String binddn, String pass, Map arg2, Object arg3) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String, java.lang.String[], java.util.Map, java.lang.Object, com.novell.ldap.LDAPConstraints) */ public void bind( String binddn, String pass, String[] arg2, Map arg3, Object arg4, LDAPConstraints arg5) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String, java.lang.String[], java.util.Map, java.lang.Object) */ public void bind( String binddn, String arg1, String[] arg2, Map arg3, Object arg4) throws LDAPException { this.bind(binddn,new String(pass)); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#bind(java.lang.String, java.lang.String) */ public void bind(String binddn, String password) throws LDAPException { if (isBound) { this.vendorImpl.logout(); } //set the credentials globaly this.isBound = false; this.vendorImpl.login(binddn,password); this.isBound = true; } public void add(LDAPEntry entry, LDAPConstraints cont) throws LDAPException { AddRequest add = new AddRequest(); DN dn = new DN(entry.getDN()); RDN rdn = (RDN) dn.getRDNs().get(0); Identifier id = new Identifier(); try { id.setType(this.getIdentifierType(rdn.getType())); } catch (IllegalArgumentException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } catch (IllegalAccessException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } id.setId(rdn.getValue()); String objectClass = entry.getAttribute("objectClass").getStringValue(); add.setObjectClass(objectClass); Iterator it = entry.getAttributeSet().iterator(); HashMap map = new HashMap(); while (it.hasNext()) { LDAPAttribute attrib = (LDAPAttribute) it.next(); if (attrib.getName().toLowerCase().equals("objectclass")) { continue; } String[] vals = attrib.getStringValueArray(); ArrayList list = new ArrayList(); for (int i=0,m=vals.length;i<m;i++) { list.add(vals[i]); } map.put(attrib.getName(),list); } add.setAttributes(map); add.setIdentifier(id); try { SpmlResponse resp = con.request(add); if (resp.getResult().equals("urn:oasis:names:tc:SPML:1:0#pending")) { String res = ""; List attrs = resp.getOperationalAttributes(); it = attrs.iterator(); while (it.hasNext()) { Attribute attr = (Attribute) it.next(); res += "[" + attr.getName() + "=" + attr.getValue() + "] "; } throw new LDAPLocalException(res,0); } else if (! resp.getResult().equals("urn:oasis:names:tc:SPML:1:0#success")) { System.out.println("Response : " + resp.getResult()); throw new LDAPLocalException(resp.getErrorMessage(), 53); } } catch (SpmlException e) { throw new LDAPException(e.toString(),53,e.toString()); } } public LDAPResponseQueue add( LDAPEntry arg0, LDAPResponseQueue arg1, LDAPConstraints arg2) throws LDAPException { return null; } public LDAPResponseQueue add(LDAPEntry arg0, LDAPResponseQueue arg1) throws LDAPException { return null; } public void add(LDAPEntry entry) throws LDAPException { this.add(entry,(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification, com.novell.ldap.LDAPConstraints) */ public void modify( String dn, LDAPModification mod, LDAPConstraints consts) throws LDAPException { this.modify(dn,new LDAPModification[] {mod},consts); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification, com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue modify( String arg0, LDAPModification arg1, LDAPResponseQueue arg2, LDAPConstraints arg3) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification, com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue modify( String arg0, LDAPModification arg1, LDAPResponseQueue arg2) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification) */ public void modify(String dn, LDAPModification mod) throws LDAPException { this.modify(dn,new LDAPModification[] {mod},(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification[], com.novell.ldap.LDAPConstraints) */ public void modify( String dn, LDAPModification[] mods, LDAPConstraints consts) throws LDAPException { LDAPControl[] controls = consts != null ? consts.getControls() : null; ModifyRequest modreq = new ModifyRequest(); DN dnVal = new DN(dn); RDN rdn = (RDN) dnVal.getRDNs().get(0); Identifier id = new Identifier(); try { id.setType(this.getIdentifierType(rdn.getType())); } catch (IllegalArgumentException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } catch (IllegalAccessException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } modreq.setIdentifier(id); id.setId(rdn.getValue()); Modification mod = null; for (int i=0,m=mods.length;i<m;i++) { mod = new Modification(); mod.setName(mods[i].getAttribute().getName()); ArrayList list = new ArrayList(); Enumeration evals = mods[i].getAttribute().getStringValues(); while (evals.hasMoreElements()) { list.add(evals.nextElement()); } mod.setValue(list); int op = mods[i].getOp(); switch (op) { case LDAPModification.ADD : mod.setOperation("add"); break; case LDAPModification.REPLACE : mod.setOperation("replace"); break; case LDAPModification.DELETE : mod.setOperation("delete"); break; } modreq.addModification(mod); } try { ModifyResponse resp = (ModifyResponse) con.request(modreq); if (! resp.getResult().equals("urn:oasis:names:tc:SPML:1:0#success")) { throw new LDAPLocalException(resp.getErrorMessage(), 53); } } catch (SpmlException e) { throw new LDAPException(e.toString(),53,e.toString()); } } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification[], com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue modify( String arg0, LDAPModification[] arg1, LDAPResponseQueue arg2, LDAPConstraints arg3) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification[], com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue modify( String arg0, LDAPModification[] arg1, LDAPResponseQueue arg2) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#modify(java.lang.String, com.novell.ldap.LDAPModification[]) */ public void modify(String dn, LDAPModification[] mods) throws LDAPException { this.modify(dn,mods,(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPConstraints) */ public void rename( String dn, String newDn, boolean delOld, LDAPConstraints consts) throws LDAPException { this.rename(dn,newDn,"",delOld,(LDAPConstraints) consts); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue rename( String arg0, String arg1, boolean arg2, LDAPResponseQueue arg3, LDAPConstraints arg4) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue rename( String arg0, String arg1, boolean arg2, LDAPResponseQueue arg3) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, boolean) */ public void rename(String dn, String newDn, boolean delOld) throws LDAPException { this.rename(dn,newDn,"",delOld,(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPConstraints) */ public void rename( String dn, String newRdn, String newParentDN, boolean delOld, LDAPConstraints constr) throws LDAPException { LDAPControl[] controls = constr != null ? constr.getControls() : null; LDAPModifyDNRequest msg = new LDAPModifyDNRequest(dn,newRdn,newParentDN,delOld,controls); this.sendMessage(msg); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue rename( String arg0, String arg1, String arg2, boolean arg3, LDAPResponseQueue arg4, LDAPConstraints arg5) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, java.lang.String, boolean, com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue rename( String arg0, String arg1, String arg2, boolean arg3, LDAPResponseQueue arg4) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#rename(java.lang.String, java.lang.String, java.lang.String, boolean) */ public void rename(String dn, String newRdn, String newParentDN, boolean delOld) throws LDAPException { this.rename(dn,newRdn,newParentDN,delOld,(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#delete(java.lang.String, com.novell.ldap.LDAPConstraints) */ public void delete(String dn, LDAPConstraints consts) throws LDAPException { LDAPControl[] controls = consts != null ? consts.getControls() : null; LDAPDeleteRequest msg = new LDAPDeleteRequest(dn,controls); this.sendMessage(msg); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#delete(java.lang.String, com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints) */ public LDAPResponseQueue delete( String arg0, LDAPResponseQueue arg1, LDAPConstraints arg2) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#delete(java.lang.String, com.novell.ldap.LDAPResponseQueue) */ public LDAPResponseQueue delete(String arg0, LDAPResponseQueue arg1) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#delete(java.lang.String) */ public void delete(String dn) throws LDAPException { this.delete(dn,(LDAPConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, com.novell.ldap.LDAPSearchConstraints) */ public LDAPSearchResults search( String base, int scope, String filter, String[] attrs, boolean typesOnly, LDAPSearchConstraints cons) throws LDAPException { LDAPControl[] controls = cons != null ? cons.getControls() : null; LDAPSearchRequest msg = new LDAPSearchRequest(base,scope,filter,attrs,0,0,0,typesOnly,controls); SearchRequest req = new SearchRequest(); if (base != null && base.trim().length() != 0) { //req.setSearchBase(base); DN dn = new DN(base); if (! base.toLowerCase().startsWith("ou") && ! base.toLowerCase().startsWith("dc") && ! base.toLowerCase().startsWith("o")) { if (scope == 0) { Identifier id = new Identifier(); try { id.setType(this.getIdentifierType(((RDN)dn.getRDNs().get(0)).getType())); } catch (IllegalArgumentException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } catch (IllegalAccessException e1) { throw new LDAPException("Could not determine type",53, e1.toString(), e1); } id.setId(dn.explodeDN(true)[0]); req.setSearchBase(id); } else { req.setSearchBase(base); } } else if (scope == 0) { return new SPMLSearchResults(new ArrayList()); } } if (filter != null && ! filter.trim().equalsIgnoreCase("objectClass=*") && ! filter.trim().equalsIgnoreCase("(objectClass=*)")) { RfcFilter rfcFilter = new RfcFilter(filter.trim()); FilterTerm filterPart = new FilterTerm(); System.out.println("part : " + filterPart.getOperation()); this.stringFilter(rfcFilter.getFilterIterator(),filterPart); req.addFilterTerm(filterPart); } for (int i=0,m=attrs.length;i<m;i++) { req.addAttribute(attrs[i]); } SearchResponse res; try { res = con.searchRequest(req); } catch (SpmlException e) { throw new LDAPException("Could not search",53, e.toString()); } return new SPMLSearchResults(res.getResults() != null ? res.getResults() : new ArrayList()); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, com.novell.ldap.LDAPSearchQueue, com.novell.ldap.LDAPSearchConstraints) */ public LDAPSearchQueue search( String base, int scope, String filter, String[] attrs, boolean typesOnly, LDAPSearchQueue queue, LDAPSearchConstraints cons) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, com.novell.ldap.LDAPSearchQueue) */ public LDAPSearchQueue search( String base, int scope, String filter, String[] attrs, boolean typesOnly, LDAPSearchQueue queue) throws LDAPException { return null; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean) */ public LDAPSearchResults search( String base, int scope, String filter, String[] attrs, boolean typesOnly) throws LDAPException { return this.search(base,scope,filter,attrs,typesOnly,(LDAPSearchConstraints) null); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#isConnectionAlive() */ public boolean isConnectionAlive() { //GetMethod get = new GetMethod(this.serverString + "?wsdl"); /*try { //con.executeMethod(get); return true; } catch (HttpException e) { return true; } catch (IOException e) { return false; }*/ return true; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#isBound() */ public boolean isBound() { return this.isBound; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#isConnected() */ public boolean isConnected() { return this.isConnected; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#isTLS() */ public boolean isTLS() { return this.serverString.toLowerCase().startsWith("https"); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#disconnect() */ public void disconnect() throws LDAPException { this.serverString = null; this.isConnected = false; } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#disconnect(com.novell.ldap.LDAPConstraints) */ public void disconnect(LDAPConstraints cons) throws LDAPException { this.disconnect(); } /* (non-Javadoc) * @see com.novell.ldap.LDAPConnection#sendRequest(com.novell.ldap.LDAPMessage, com.novell.ldap.LDAPMessageQueue) */ public LDAPMessageQueue sendRequest(LDAPMessage request, LDAPMessageQueue queue) throws LDAPException { this.sendMessage(request); return null; } /** * @return Returns the call. */ public HttpRequestCallback getCallback() { return callback; } /** * @param call The call to set. */ public void setCallback(HttpRequestCallback call) { this.callback = call; } /** * @return Returns the binddn. */ public String getBinddn() { return binddn; } /** * @return Returns the con. */ public HttpClient getCon() { return null; } /** * @return Returns the host. */ public String getHost() { return host; } /** * @return Returns the pass. */ public String getPass() { return pass; } /** * @return Returns the serverString. */ public String getServerString() { return serverString; } private String getIdentifierType(String rdnAttrib) throws IllegalArgumentException, IllegalAccessException { Field[] fields = Identifier.class.getFields(); for (int i=0,m=fields.length;i<m;i++) { if (fields[i].getName().startsWith("TYPE") && fields[i].get(null).toString().endsWith(rdnAttrib)) { return fields[i].get(null).toString(); } } return ""; } private static String byteString(byte[] value) { String toReturn = null; if (Base64.isValidUTF8(value, true)) { try { toReturn = new String(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException( "Default JVM does not support UTF-8 encoding" + e); } } else { StringBuffer binary = new StringBuffer(); for (int i=0; i<value.length; i++){ //TODO repair binary output //Every octet needs to be escaped if (value[i] >=0) { //one character hex string binary.append("\\0"); binary.append(Integer.toHexString(value[i])); } else { //negative (eight character) hex string binary.append("\\"+ Integer.toHexString(value[i]).substring(6)); } } toReturn = binary.toString(); } return toReturn; } private void stringFilter(Iterator itr, FilterTerm filter) { int op=-1; //filter.append('('); String comp = null; byte[] value; boolean doAdd = false; boolean isFirst = true; FilterTerm part; while (itr.hasNext()){ Object filterpart = itr.next(); if (filterpart instanceof Integer){ op = ((Integer)filterpart).intValue(); switch (op){ case LDAPSearchRequest.AND: if (filter.getOperation() != null) { FilterTerm andFilter = new FilterTerm(); andFilter.setOperation(FilterTerm.OP_AND); filter.addOperand(andFilter); filter = andFilter; } else { filter.setOperation(FilterTerm.OP_AND); } break; case LDAPSearchRequest.OR: if (filter.getOperation() != null) { FilterTerm orFilter = new FilterTerm(); orFilter.setOperation(FilterTerm.OP_OR); filter.addOperand(orFilter); filter = orFilter; } else { if (filter.getOperation() == null) { filter.setOperation(FilterTerm.OP_OR); } } break; case LDAPSearchRequest.NOT: if (filter.getOperation() != null) { FilterTerm notFilter = new FilterTerm(); notFilter.setOperation(FilterTerm.OP_NOT); filter.addOperand(notFilter); filter = notFilter; } else { filter.setOperation(FilterTerm.OP_NOT); } break; case LDAPSearchRequest.EQUALITY_MATCH:{ if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_EQUAL); value = (byte[])itr.next(); part.setValue(byteString(value)); if (doAdd) { filter.addOperand(part); } break; } case LDAPSearchRequest.GREATER_OR_EQUAL:{ if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_GTE); value = (byte[])itr.next(); part.setValue(byteString(value)); if (doAdd) { filter.addOperand(part); } break; } case LDAPSearchRequest.LESS_OR_EQUAL:{ if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_LTE); value = (byte[])itr.next(); part.setValue(byteString(value)); if (doAdd) { filter.addOperand(part); } break; } case LDAPSearchRequest.PRESENT: if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_PRESENT); if (doAdd) { filter.addOperand(part); } break; case LDAPSearchRequest.APPROX_MATCH: if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_APPROX); value = (byte[])itr.next(); part.setValue(byteString(value)); if (doAdd) { filter.addOperand(part); } break; case LDAPSearchRequest.EXTENSIBLE_MATCH: String oid = (String)itr.next(); if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next() + ":" + oid); part.setOperation(FilterTerm.OP_EXTENSIBLE_MATCH); value = (byte[])itr.next(); part.setValue(byteString(value)); if (doAdd) { filter.addOperand(part); } break; case LDAPSearchRequest.SUBSTRINGS:{ if (filter.getOperation() == null) { part = filter; } else { part = new FilterTerm(); doAdd = true; } part.setName((String)itr.next()); part.setOperation(FilterTerm.OP_SUBSTRINGS); boolean noStarLast = false; while (itr.hasNext()){ op = ((Integer)itr.next()).intValue(); switch(op){ case LDAPSearchRequest.INITIAL: filter.addSubstring((String)itr.next()); noStarLast = false; break; case LDAPSearchRequest.ANY: filter.addSubstring((String)itr.next()); noStarLast = false; break; case LDAPSearchRequest.FINAL: filter.addSubstring((String)itr.next()); break; } } if (doAdd) { filter.addOperand(part); } break; } } } else if (filterpart instanceof Iterator){ stringFilter((Iterator)filterpart, filter); } } } }
29.837489
188
0.612634
0394366d1d5e374f13d931db106cb9b449623d89
1,189
package protocols.replication.crdts.datatypes; import io.netty.buffer.ByteBuf; import protocols.replication.crdts.serializers.MySerializer; public class ByteType extends SerializableType{ private final Byte value; public ByteType(Byte value) { this.value = value; } public static MySerializer<ByteType> serializer = new MySerializer<ByteType>() { @Override public void serialize(ByteType byteType, ByteBuf out) { out.writeByte(byteType.value); } @Override public ByteType deserialize(ByteBuf in) { return new ByteType(in.readByte()); } }; public Byte getValue() { return this.value; } @Override public String toString() { return this.value.toString(); } @Override public boolean equals(Object o) { if(!(o instanceof ByteType)) return false; return ((ByteType) o).getValue().equals(this.value); } @Override public int hashCode() { return this.value.hashCode(); } @Override public int compareTo(Object o) { return this.value.compareTo(((ByteType)o).value); } }
21.618182
84
0.622372
6026dfcc81e4fee85299cf6b4f8021d6af079688
532
package io.vilya.phthonus.resolver; import io.vilya.phthonus.resolver.constant.ResolverPriority; /** * @author zhukuanxin * @time 2017年8月31日 上午11:59:25 */ public abstract class BaseResolver implements IResolver { @Override public int compareTo(IResolver o) { ResolverPriority tp = getPriority() == null ? ResolverPriority.LOW : getPriority(); ResolverPriority op = o.getPriority() == null ? ResolverPriority.LOW : o.getPriority(); return op.getValue() - tp.getValue(); } }
28
103
0.678571
013742acb1cf28f05f046fc98bd2241210e4daaa
78
package com.company; public interface Sport { public String getName(); }
13
28
0.717949
adc55e9f9aaff686c7dd17dcdedf7a9ac553faad
2,338
/* * Copyright 2019-2021 The kafkaproxy developers (see 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 com.dajudge.kafkaproxy.roundtrip.util; import com.dajudge.kafkaproxy.config.Environment; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.function.Consumer; import static java.lang.Integer.parseInt; public class TestEnvironment implements Environment { private final Map<String, String> env = new HashMap<>(); public TestEnvironment withEnv(final String var, final String value) { env.put(var, value); return this; } @Override public String requiredString(final String variable, final String defaultValue) { return optionalString(variable).orElse(defaultValue); } @Override public String requiredString(final String variable) { final String value = requiredString(variable, null); return Optional.ofNullable(value) .orElseThrow(() -> new IllegalArgumentException("Environment variable not set: " + variable)); } @Override public Optional<String> optionalString(final String variable) { return Optional.ofNullable(env.get(variable)); } @Override public Optional<Integer> optionalInt(final String variable) { return optionalString(variable).map(Integer::parseInt); } @Override public boolean requiredBoolean(final String variable, final boolean defaultValue) { return optionalString(variable).map(Boolean::parseBoolean).orElse(defaultValue); } @Override public int requiredInt(final String variable) { return parseInt(requiredString(variable)); } public void dump(final Consumer<String> dumper) { env.forEach((k, v) -> dumper.accept(k + "=" + v)); } }
32.027397
110
0.711719
512ab6d686f34b885630bcdef8c4f67d55ec748b
3,913
package com.nenuphar.nenufar.Controllers; import com.nenuphar.nenufar.DTO.GetIDDTO; import com.nenuphar.nenufar.DTO.GettokenDTO; import com.nenuphar.nenufar.DTO.GradedSubSkillDTO; import com.nenuphar.nenufar.Models.GradedSubSkill; import com.nenuphar.nenufar.Models.SubSkill; import com.nenuphar.nenufar.Models.User; import com.nenuphar.nenufar.Services.GradedSubSkillService; import com.nenuphar.nenufar.Services.SubSkillService; import com.nenuphar.nenufar.Services.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.Calendar; import java.util.Date; import java.util.List; @RestController public class GradedSubSkillController { @Autowired private GradedSubSkillService gradedsubSkillService; @Autowired private UserService userService; @Autowired private SubSkillService subSkillService; @RequestMapping(value = "/get_gradedsubskill", method = RequestMethod.POST) private ResponseEntity getGradedSubSkillById(@RequestBody GetIDDTO dto) { Long id = dto.getID(); GradedSubSkill gradedsubskill = gradedsubSkillService.getGradedSubSkill(id); if(gradedsubskill==null) {return new ResponseEntity(HttpStatus.NOT_FOUND);} return new ResponseEntity<>(gradedsubskill, HttpStatus.OK); } @RequestMapping(value = "/get_lastweek_gradedsubskills", method = RequestMethod.POST) private ResponseEntity getLastWeekGradedSubSkillsFromUUID(@RequestBody GettokenDTO dto) { String uuid = dto.getToken(); List<GradedSubSkill> gradedsubskills = gradedsubSkillService.getLastWeekGradedSubSkillsFromUUID(uuid); if(gradedsubskills==null) {return new ResponseEntity(HttpStatus.NOT_FOUND);} return new ResponseEntity<>(gradedsubskills, HttpStatus.OK); } @RequestMapping(value = "/get_lastgradedsubskills", method = RequestMethod.POST) private ResponseEntity getLastGradedSubSkillsFromUUID(@RequestBody GettokenDTO dto) { String uuid = dto.getToken(); List<GradedSubSkill> gradedsubskills = gradedsubSkillService.getLastGradedSubSkillsFromUUID(uuid); if(gradedsubskills==null) {return new ResponseEntity(HttpStatus.NOT_FOUND);} return new ResponseEntity<>(gradedsubskills, HttpStatus.OK); } @RequestMapping(value = "/get_lastgradedsubskills_course", method = RequestMethod.POST) private ResponseEntity getLastGradedSubSkillsFromCourse(@RequestBody GettokenDTO dto) { String course_name = dto.getToken(); List<GradedSubSkill> gradedsubskills = gradedsubSkillService.getLastGradedSubSkillsFromCourse(course_name); if(gradedsubskills==null) {return new ResponseEntity(HttpStatus.NOT_FOUND);} return new ResponseEntity<>(gradedsubskills, HttpStatus.OK); } @RequestMapping(value = "/gradedsubskill", method = RequestMethod.POST) public ResponseEntity createGradedSubSkill(@RequestBody GradedSubSkillDTO dto) { String name = dto.getName(); String last_name = dto.getLast_name(); User user = userService.getFromCompleteName(name,last_name); String subskill_name = dto.getSubSkillName(); String course_name = dto.getCourseName(); SubSkill subskill = subSkillService.getSubSkillFromNameAndCourse(course_name, subskill_name); int level = dto.getLevel(); Calendar calendar = Calendar.getInstance(); java.sql.Date currentDate = new java.sql.Date(calendar.getTime().getTime()); GradedSubSkill gradedsubskill = gradedsubSkillService.createGradedSubSkill(level, subskill, user, currentDate); if(gradedsubskill==null) {return new ResponseEntity(HttpStatus.BAD_REQUEST);} return new ResponseEntity<>(gradedsubskill, HttpStatus.OK); } }
46.035294
119
0.762586
9d0b1e01018c11c1507752526482aa1159660112
370
package com.macro.mall.vasiros.stat.service.impl; import com.macro.mall.vasiros.stat.service.ResourceStatisticService; import org.springframework.stereotype.Service; /** * @version : * @ClassName: StatServiceImpl * @Description: TODO * @Auther: fyy * @Date: 2020/5/30 */ @Service public class ResourceStatisticServiceImpl implements ResourceStatisticService { }
23.125
79
0.778378
3e1a10de16b81307b2c86b5be0b5b86e8ee70a2c
1,076
package com.Sysclass; import java.util.*; public class XunliehuaTest { ArrayList a1; public XunliehuaTest(int num,int mod){ a1=new ArrayList(num); Random rand=new Random(); System.out.println("排序之前"); for(int i=0;i<num;i++){ a1.add(new Integer(Math.abs(rand.nextInt())%mod+1)); System.out.println("a1["+i+"]="+a1.get(i)); } } public void Sortit(){ Integer tempint; int MaxSize=1; for(int i=1;i<a1.size();i++){ tempint=(Integer)a1.remove(i); if(tempint.intValue()>=((Integer)a1.get(MaxSize-1)).intValue()){ a1.add(MaxSize, tempint); MaxSize++; System.out.println(a1.toString()); } else{ for(int j=0;j<MaxSize;j++){ if(((Integer)a1.get(j)).intValue()>=tempint.intValue()){ a1.add(j, tempint); MaxSize++; System.out.println(a1.toString()); break; } } } } System.out.println("排序之后:"); for(int i=0;i<a1.size();i++){ System.out.println("a1["+i+"]="+a1.get(i)); } } public static void main(String[] args) { XunliehuaTest XT=new XunliehuaTest(10,100); XT.Sortit(); } }
22.893617
67
0.605019
fb1d46563dee9eb225688bc0f2b8be62f4a27c23
4,300
/* Insets.java -- Information about a container border. Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt; /** * This class represents the "margin" or space around a container. * * @author Aaron M. Renn (arenn@urbanophile.com) */ public class Insets implements Cloneable, java.io.Serializable { /* * Instance Variable */ /** * @serial The top inset */ public int top; /** * @serial This bottom inset */ public int bottom; /** * @serial The left inset */ public int left; /** * @serial The right inset */ public int right; /*************************************************************************/ /** * Initializes a new instance of <code>Inset</code> with the specified * inset values. * * @param top The top inset * @param left The left inset * @param bottom The bottom inset * @param right The right inset */ public Insets(int top, int left, int bottom, int right) { this.top = top; this.left = left; this.bottom = bottom; this.right = right; } /*************************************************************************/ /* * Instance Methods */ /** * Tests whether this object is equal to the specified object. This will * be true if and only if the specified object: * <p> * <ul> * <li>Is not <code>null</code>. * <li>Is an instance of <code>Insets</code>. * <li>Has the same top, bottom, left, and right inset values as this object. * </ul> * * @param obj The object to test against. * * @return <code>true</code> if the specified object is equal to this * one, <code>false</code> otherwise. */ public boolean equals(Object obj) { if (!(obj instanceof Insets)) return(false); Insets i = (Insets)obj; if (i.top != top) return(false); if (i.bottom != bottom) return(false); if (i.left != left) return(false); if (i.right != right) return(false); return(true); } public int hashCode() { return top + bottom + left + right; } /*************************************************************************/ /** * Returns a string representation of this object. * * @return A string representation of this object. */ public String toString() { return(getClass().getName() + "(top=" + top + ",bottom=" + bottom + ",left=" + left + ",right=" + right + ")"); } /*************************************************************************/ /** * Returns a copy of this object. * * @return A copy of this object. */ public Object clone() { try { return(super.clone()); } catch(Exception e) { return(null); } } } // class Insets
24.571429
78
0.645116
76c3efee01cd8b06c2d6984b56ba7a0bdcfa1e85
1,892
/*** Copyright (c) 2008-2012 CommonsWare, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Covered in detail in the book _The Busy Coder's Guide to Android Development_ https://commonsware.com/Android */ package com.commonsware.android.abf.test; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import android.test.AndroidTestCase; import android.test.UiThreadTest; import android.view.LayoutInflater; import android.view.View; import com.commonsware.android.abf.R; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class DemoContextTest { private View field=null; private View root=null; @Before public void init() { InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { LayoutInflater inflater=LayoutInflater .from(InstrumentationRegistry.getTargetContext()); root=inflater.inflate(R.layout.add, null); } }); root.measure(800, 480); root.layout(0, 0, 800, 480); field=root.findViewById(R.id.title); } @Test public void exists() { Assert.assertNotNull(field); } @Test public void position() { Assert.assertEquals(0, field.getTop()); Assert.assertEquals(0, field.getLeft()); } }
30.516129
79
0.738372
d3afa5ef62cddfd4c2db7e2c5d88c5f4ef072107
583
package habuma.books; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import io.micrometer.core.instrument.MeterRegistry; import lombok.RequiredArgsConstructor; @RestController @RequiredArgsConstructor public class HelloController { private final GreetingProps props; private final MeterRegistry reg; @GetMapping("/hello") public String hello() { reg.counter("demo.hello", "one", "two").increment(); return props.getMessage(); } }
23.32
62
0.794168
dc45ed8e3686e0b67782290737b30a10ed5c8deb
1,191
/** * Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2015, * QOS.ch. All rights reserved. * * This program and the accompanying materials are dual-licensed under either the terms of the * Eclipse Public License v1.0 as published by the Eclipse Foundation * * or (per the licensee's choosing) * * under the terms of the GNU Lesser General Public License version 2.1 as published by the Free * Software Foundation. */ package chapters._03_configuration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class _1_MyApp1 { private static String CONFIGURATION_LOCATION = "logback-examples-by-logback/src/main/resources/chapters/_03_configuration/sample0.xml"; static { System.setProperty("logback.configurationFile", CONFIGURATION_LOCATION); } final static Logger logger = LoggerFactory.getLogger(_1_MyApp1.class); public static void main(String[] args) { // Print // LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // StatusPrinter.print(lc); logger.info("Entering application."); Foo foo = new Foo(); foo.doIt(); logger.info("Exiting application."); } }
30.538462
137
0.738875
647f64d5500d3a06898ed8f486efdd310017c4da
1,133
package sh.okx.sql.clause; import sh.okx.sql.api.StatementWhere; import sh.okx.sql.api.clause.ClauseWhere; public class ClauseWhereImpl<E extends StatementWhere> implements ClauseWhere<E> { private E statement; private StringBuilder where = new StringBuilder(); public ClauseWhereImpl(E statement) { this.statement = statement; } @Override public ClauseWhere<E> equals(Object a, Object b) { where.append(String.valueOf(a)).append("=").append(String.valueOf(b)); return this; } @Override public ClauseWhere<E> prepareEquals(Object a, Object b) { where.append(String.valueOf(a)).append("=").append("?"); statement.prepare(b); return this; } @Override public ClauseWhere<E> and() { where.append(" AND "); return this; } @Override public ClauseWhere<E> or() { where.append(" OR "); return this; } @Override public E then() { statement.where(define()); return statement; } @Override public String define() { return where.toString(); } }
22.66
82
0.612533
12c4dec7696d3d45d6bc62e026047f27e2e92b7b
2,955
package sql.access; import model.Ailment; import model.Patient; import model.Symptom; import sql.Database; import util.stream.Streams; import java.sql.Connection; import java.sql.ResultSet; import java.util.Set; import java.util.stream.Collectors; /** * Implementation of {@link AbstractSQLAccessor} that wraps the * {@link Patient} class, allowing for the creation of {@code Patient} objects * from SQL. * * @see Patient * @author Oliver Abdulrahim */ public class PatientAccessor extends AbstractSQLAccessor<Patient> { /** * Constructs a {@code PatientAccessor} using the given {@code Connection}. * * @param connection The database connection for the object. */ public PatientAccessor(Connection connection) { super(connection, Database.PATIENT_TABLE); } /** * Returns a {@code Set} containing all {@code Patient}s with the given * {@code Ailment}. * * @param ailment The {@code Ailment} to collect. * @return A {@code Set} containing all {@code Patient}s with the given * {@code Ailment}. */ public Set<Patient> findAll(Ailment ailment) { return all() // No method reference for you, friend! :( .filter(patient -> patient.hasAilment(ailment)) .collect(Collectors.toSet()); } /** * Returns a {@code Set} containing the union of ailments of all * {@code Patient}s in the given {@code Collection}, or in other words, all * ailments shared by the given patients. * * @return A {@code Set} containing the union of ailments of all * {@code Patient}s in the given {@code Collection}. */ public Set<Ailment> union() { return Streams.flatUnion( all(), patient -> patient.getAilments().stream() ); } /** * Returns a {@code Set} containing the intersection of the symptoms of the * given {@code Patient}s. * * @param first The patient whose symptoms to intersect with {@code second}. * @param second The patient whose symptoms to intersect with {@code first}. * @return A {@code Set} containing the intersection of the symptoms of the * given {@code Patient}s. */ public static Set<Symptom> intersection(Patient first, Patient second) { return Streams.intersection( first.getSymptoms().stream(), second.getSymptoms().stream() ); } /** * Constructs a new {@code Patient}, whose attributes are loaded from the * given {@code ResultSet}. * * @param result The result containing the data for the object to construct. * @return A new {@code Patient} containing the data stored in the given * {@code ResultSet}. */ @Override public Patient createFromSQL(ResultSet result) { return SQLAccessor.createFromSQL(Patient.class, result); } }
31.43617
80
0.632826
dfa4194b692acb73e155f82462352f4d949b1b56
4,319
/* * Copyright 2016 aliba. * * 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.oneandone.rest.test; import com.oneandone.rest.POJO.Requests.AssignLoadBalancerRequest; import com.oneandone.rest.POJO.Requests.CreateLoadBalancerRequest; import com.oneandone.rest.POJO.Requests.LoadBalancerRuleRequest; import com.oneandone.rest.POJO.Response.LoadBalancerResponse; import com.oneandone.rest.POJO.Response.ServerLoadBalancers; import com.oneandone.rest.POJO.Response.ServerResponse; import com.oneandone.rest.POJO.Response.Types; import com.oneandone.rest.client.RestClientException; import static com.oneandone.rest.test.TestHelper.CreateTestServer; import com.oneandone.sdk.OneAndOneApi; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.junit.AfterClass; import static org.junit.Assert.*; import org.junit.BeforeClass; import org.junit.Test; /** * * @author aliba */ public class ServerLoadBalancersTest { static OneAndOneApi oneandoneApi = new OneAndOneApi(); static Random rand = new Random(); static String serverId; static String ipId; static ServerResponse server; static LoadBalancerResponse lb; @BeforeClass public static void getLoadBalancers() throws RestClientException, IOException, InterruptedException { oneandoneApi.setToken(System.getenv("OAO_TOKEN")); serverId = CreateTestServer("servers loadbalancer test", true).getId(); server = oneandoneApi.getServerApi().getServer(serverId); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest(); request.setDescription("javaLBDesc"); request.setName("javaLBTest" + rand.nextInt(300)); request.setHealthCheckInterval(1); request.setPersistence(true); request.setPersistenceTime(30); request.setHealthCheckTest(Types.HealthCheckTestTypes.NONE); request.setMethod(Types.LoadBalancerMethod.ROUND_ROBIN); List<LoadBalancerRuleRequest> rules = new ArrayList<LoadBalancerRuleRequest>(); LoadBalancerRuleRequest ruleA = new LoadBalancerRuleRequest(); ruleA.setPortBalancer(80); ruleA.setProtocol(Types.LBRuleProtocol.TCP); ruleA.setSource("0.0.0.0"); ruleA.setPortServer(80); rules.add(ruleA); request.setRules(rules); lb = oneandoneApi.getLoadBalancerApi().createLoadBalancer(request); TestHelper.waitLoadBalancerReady(lb.getId()); AssignLoadBalancerRequest lbRequest = new AssignLoadBalancerRequest(); lbRequest.setLoadBalancerId(lb.getId()); ServerResponse lbresult = oneandoneApi.getServerIpsApi().createServerIPLoadBalancer(serverId, server.getIps().get(0).getId(), lbRequest); assertNotNull(lbresult); } @Test public void getLoadbalancerServer() throws RestClientException, IOException { List<ServerLoadBalancers> result = oneandoneApi.getServerIpsApi().getServerIPLoadBalancers(serverId, server.getIps().get(0).getId()); assertNotNull(result); } @AfterClass public static void cleanupTest() throws RestClientException, IOException, InterruptedException { if (lb != null) { TestHelper.waitLoadBalancerReady(lb.getId()); server = oneandoneApi.getServerApi().getServer(serverId); ServerResponse result = oneandoneApi.getServerIpsApi().deleteServerIPLoadBalancer(serverId, server.getIps().get(0).getId(), lb.getId()); TestHelper.waitLoadBalancerReady(lb.getId()); oneandoneApi.getLoadBalancerApi().deleteLoadBalancer(lb.getId()); } if (serverId != null) { TestHelper.waitServerReady(serverId); oneandoneApi.getServerApi().deleteServer(serverId, false); } } }
40.745283
148
0.733272
861b56b32712a67e69e35f2c6dfdbdc27c34dfbf
2,207
package com.stylint; import com.intellij.codeInsight.intention.HighPriorityAction; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.icons.AllIcons.General; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Iconable; import com.intellij.psi.PsiFile; import com.intellij.util.IncorrectOperationException; import com.stylint.settings.StylintSettingsPage; import org.jetbrains.annotations.NotNull; import javax.swing.*; class EditSettingsAction implements IntentionAction, Iconable, HighPriorityAction { private static boolean ourInvoked; private final boolean fileLevelAnnotation; private final Icon icon; private final StylintSettingsPage configurable; EditSettingsAction(@NotNull StylintSettingsPage configurable) { this(configurable, false, General.Settings); } private EditSettingsAction(@NotNull StylintSettingsPage configurable, boolean fileLevelAnnotation, @NotNull Icon icon) { this.configurable = configurable; this.fileLevelAnnotation = fileLevelAnnotation; this.icon = icon; } public Icon getIcon(@IconFlags int flags) { return this.icon; } @NotNull public String getText() { return this.fileLevelAnnotation ? "Settings..." : this.configurable.getDisplayName() + " settings..."; } @NotNull public String getFamilyName() { return this.getText(); } public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { return true; } public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { if (!ourInvoked) { ourInvoked = true; ApplicationManager.getApplication().invokeLater(() -> { EditSettingsAction.ourInvoked = false; EditSettingsAction.this.configurable.showSettings(); }, ModalityState.any()); } } public boolean startInWriteAction() { return false; } }
33.439394
124
0.724966
483f4942f959f49fe2221bf506e500d7e20f7555
2,709
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package library.dao; import java.sql.ResultSet; import java.util.Date; import library.model.Book; import library.model.TransactionHistory; /** * * @author meyor */ public class TransactionHistoryDao extends BaseDao { public TransactionHistoryDao() { super(); } public void writeHistory(Book book) throws Exception { StringBuilder query = new StringBuilder(); query = query.append("INSERT INTO TRANSACTION_HISTORY ") .append("(TITLE, AUTHOR, ISBN, STATUS, DATE_BORROWED, DATE_RETURNED, LIBRARIAN_ID) ") .append("VALUES(") .append("'" + book.getTitle() + "',") .append("'" + book.getAuthor() + "',") .append("'" + book.getIsbn() + "',") .append("'" + book.getStatus() + "',") .append("'" + new Date() + "',") .append("'PENDING',") .append("'" + book.getLibarianID()+ "'") .append(")"); insert(query.toString()); } public void rewriteHistory(long historyId, String bookStatus) throws Exception { StringBuilder query = new StringBuilder(); query = query.append( "UPDATE `transaction_history`" + "SET `STATUS` = '" + bookStatus + "' , `DATE_RETURNED` = '" + new Date() + "' WHERE " + "`TRANSACTION_ID` = '" + historyId + "'"); insert(query.toString()); } public TransactionHistory findlibrarianHistory(long librarianId, String bookStatus) throws Exception { StringBuilder query = new StringBuilder(); TransactionHistory history = null; query = query.append("SELECT * FROM TRANSACTION_HISTORY WHERE LIBRARIAN_ID = '" + librarianId + "'" + " AND " + "STATUS = '" + bookStatus + "'"); ResultSet rs = select(query.toString()); while (rs.next()) { history = new TransactionHistory(); history.setId(rs.getLong("TRANSACTION_ID")); history.setTitle(rs.getString("TITLE")); history.setAuthor(rs.getString("AUTHOR")); history.setIsbn(rs.getString("ISBN")); history.setStatus(rs.getString("STATUS")); history.setLibrarian(Long.parseLong(rs.getString("LIBRARIAN_ID"))); } return history; } }
35.181818
109
0.539313
f028ea4fb84875e1b1a93f801b0b0b495fde3f65
3,157
package campuslifecenter.notice.entry; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; public class AccountNotice extends AccountNoticeKey implements Serializable { @ApiModelProperty(value = "是否已读") private Boolean looked; @ApiModelProperty(value = "是否置顶") private Boolean top; @ApiModelProperty(value = "是否删除") private Boolean del; @ApiModelProperty(value = "相对重要程度") private Integer relativeImportance; @ApiModelProperty(value = "冗余字段,记录通知重要度,用于计算优先级") private Integer noticeImportance; @ApiModelProperty(value = "冗余字段,记录通知发布组织,用于计算优先级") private Integer organization; private static final long serialVersionUID = 1L; public Boolean getLooked() { return looked; } public AccountNotice withLooked(Boolean looked) { this.setLooked(looked); return this; } public void setLooked(Boolean looked) { this.looked = looked; } public Boolean getTop() { return top; } public AccountNotice withTop(Boolean top) { this.setTop(top); return this; } public void setTop(Boolean top) { this.top = top; } public Boolean getDel() { return del; } public AccountNotice withDel(Boolean del) { this.setDel(del); return this; } public void setDel(Boolean del) { this.del = del; } public Integer getRelativeImportance() { return relativeImportance; } public AccountNotice withRelativeImportance(Integer relativeImportance) { this.setRelativeImportance(relativeImportance); return this; } public void setRelativeImportance(Integer relativeImportance) { this.relativeImportance = relativeImportance; } public Integer getNoticeImportance() { return noticeImportance; } public AccountNotice withNoticeImportance(Integer noticeImportance) { this.setNoticeImportance(noticeImportance); return this; } public void setNoticeImportance(Integer noticeImportance) { this.noticeImportance = noticeImportance; } public Integer getOrganization() { return organization; } public AccountNotice withOrganization(Integer organization) { this.setOrganization(organization); return this; } public void setOrganization(Integer organization) { this.organization = organization; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", looked=").append(looked); sb.append(", top=").append(top); sb.append(", del=").append(del); sb.append(", relativeImportance=").append(relativeImportance); sb.append(", noticeImportance=").append(noticeImportance); sb.append(", organization=").append(organization); sb.append("]"); sb.append(", from super class "); sb.append(super.toString()); return sb.toString(); } }
25.877049
77
0.652201
50ef83dd4bcf88232f13e2f21a8a17c188320739
18,371
package org.riderzen.flume.sink; import com.mongodb.*; import org.apache.commons.collections.MapUtils; import org.apache.flume.*; import org.apache.flume.channel.MemoryChannel; import org.apache.flume.conf.Configurables; import org.apache.flume.event.EventBuilder; import org.json.simple.JSONObject; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.net.UnknownHostException; import java.text.ParseException; import java.util.*; import static org.testng.Assert.*; /** * User: guoqiang.li * Date: 12-9-12 * Time: 下午3:31 */ @Test(singleThreaded = true, threadPoolSize = 1) public class MongoSinkTest { private static Mongo mongo; public static final String DBNAME = "myDb"; private static Context ctx = new Context(); private static Channel channel; @BeforeMethod(groups = {"dev"}) public static void setup() throws UnknownHostException { mongo = new Mongo("localhost", 27017); Map<String, String> ctxMap = new HashMap<String, String>(); ctxMap.put(MongoSink.HOST, "localhost"); ctxMap.put(MongoSink.PORT, "27017"); ctxMap.put(MongoSink.DB_NAME, "test_events"); ctxMap.put(MongoSink.COLLECTION, "test_log"); ctxMap.put(MongoSink.BATCH_SIZE, "100"); ctx.putAll(ctxMap); Context channelCtx = new Context(); channelCtx.put("capacity", "1000000"); channelCtx.put("transactionCapacity", "1000000"); channel = new MemoryChannel(); Configurables.configure(channel, channelCtx); } @AfterMethod(groups = {"dev"}) public static void tearDown() { mongo.dropDatabase(DBNAME); mongo.dropDatabase("test_events"); mongo.dropDatabase("dynamic_db"); mongo.close(); } @Test(groups = "dev", invocationCount = 1) public void sinkDynamicTest() throws EventDeliveryException, InterruptedException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Transaction tx; for (int i = 0; i < 100; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("test_events"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); } } @Test(groups = "dev") public void sinkDynamicTest2() throws EventDeliveryException, InterruptedException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Transaction tx; for (int i = 0; i < 100; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events" + i % 10); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("test_events"); DBCollection collection = db.getCollection("my_events" + i % 10); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); } } @Test(groups = "dev") public void sinkSingleModelTest() throws EventDeliveryException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.SINGLE.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); Transaction tx = channel.getTransaction(); tx.begin(); JSONObject msg = new JSONObject(); msg.put("name", "test"); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Event e = EventBuilder.withBody(msg.toJSONString().getBytes()); channel.put(e); tx.commit(); tx.close(); sink.process(); sink.stop(); DB db = mongo.getDB("test_events"); DBCollection collection = db.getCollection("test_log"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); } @Test(groups = "dev") public void dbTest() { DB db = mongo.getDB(DBNAME); db.getCollectionNames(); List<String> names = mongo.getDatabaseNames(); assertNotNull(names); boolean hit = false; for (String name : names) { if (DBNAME.equals(name)) { hit = true; break; } } assertTrue(hit); } @Test(groups = "dev") public void collectionTest() { DB db = mongo.getDB(DBNAME); DBCollection myCollection = db.getCollection("myCollection"); myCollection.save(new BasicDBObject(MapUtils.putAll(new HashMap(), new Object[]{"name", "leon", "age", 33}))); myCollection.findOne(); Set<String> names = db.getCollectionNames(); assertNotNull(names); boolean hit = false; for (String name : names) { if ("myCollection".equals(name)) { hit = true; break; } } assertTrue(hit); } @Test(groups = "dev") public void autoWrapTest() throws EventDeliveryException { ctx.put(MongoSink.AUTO_WRAP, Boolean.toString(true)); ctx.put(MongoSink.DB_NAME, "test_wrap"); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); Transaction tx = channel.getTransaction(); tx.begin(); String msg = "2012/10/26 11:23:08 [error] 7289#0: *6430831 open() \"/usr/local/nginx/html/50x.html\" failed (2: No such file or directory), client: 10.160.105.161, server: sg15.redatoms.com, request: \"POST /mojo/ajax/embed HTTP/1.0\", upstream: \"fastcgi://unix:/tmp/php-fpm.sock:\", host: \"sg15.redatoms.com\", referrer: \"http://sg15.redatoms.com/mojo/mobile/package\""; Event e = EventBuilder.withBody(msg.getBytes()); channel.put(e); tx.commit(); tx.close(); sink.process(); sink.stop(); DB db = mongo.getDB("test_wrap"); DBCollection collection = db.getCollection("test_log"); DBCursor cursor = collection.find(new BasicDBObject(MongoSink.DEFAULT_WRAP_FIELD, msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get(MongoSink.DEFAULT_WRAP_FIELD), msg); mongo.dropDatabase("test_wrap"); } @Test(groups = "dev") public void sinkDynamicDbTest() throws EventDeliveryException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); } } @Test(groups = "dev") public void timestampNewFieldTest() throws EventDeliveryException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); String tsField = "createdOn"; ctx.put(MongoSink.TIMESTAMP_FIELD, tsField); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); assertTrue(dbObject.get(tsField) instanceof Date); } } @Test(groups = "dev") public void timestampExistingFieldTest() throws EventDeliveryException, ParseException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); String tsField = "createdOn"; ctx.put(MongoSink.TIMESTAMP_FIELD, tsField); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); String dateText = "2013-02-19T14:20:53+08:00"; msg.put(tsField, dateText); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); msg.put(tsField, MongoSink.dateTimeFormatter.parseDateTime(dateText).toDate()); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); assertTrue(dbObject.get(tsField) instanceof Date); System.out.println("ts = " + dbObject.get(tsField)); } } @Test(groups = "dev") public void upsertTest() throws EventDeliveryException, ParseException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); String tsField = "createdOn"; ctx.put(MongoSink.TIMESTAMP_FIELD, tsField); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); String dateText = "2013-02-19T14:20:53+08:00"; msg.put(tsField, dateText); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("_id", 1111 + i); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("_id", 1111 + i); msg.put("name", "test" + i * 10); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); header.put(MongoSink.OPERATION, MongoSink.OP_UPSERT); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); msg.put(tsField, MongoSink.dateTimeFormatter.parseDateTime(dateText).toDate()); for (int i = 0; i < 10; i++) { System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(BasicDBObjectBuilder.start().add("_id", 1111 + i).get()); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), "test" + i * 10); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); assertTrue(dbObject.get(tsField) instanceof Date); System.out.println("ts = " + dbObject.get(tsField)); System.out.println("_id = " + dbObject.get("_id")); } } @Test public static void sandbox() throws EventDeliveryException { JSONObject msg = new JSONObject(); JSONObject set = new JSONObject(); set.put("pid", "274"); set.put("fac", "missin-do"); msg.put("$set", set); JSONObject inc = new JSONObject(); inc.put("sum", 1); msg.put("$inc", inc); msg.put("_id", "111111111111111111111111111"); msg.put("pid", "111111111111111111111111111"); ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.DYNAMIC.name()); String tsField = "createdOn"; ctx.put(MongoSink.TIMESTAMP_FIELD, tsField); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); Transaction tx; tx = channel.getTransaction(); tx.begin(); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_eventsjj"); header.put(MongoSink.DB_NAME, "dynamic_dbjj"); header.put(MongoSink.OPERATION, MongoSink.OP_UPSERT); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); sink.process(); sink.stop(); } }
34.083488
382
0.573948
43e5f0fd88e000679456ca13b2e04f39c69371d3
204
package metube.repository; import java.util.List; import java.util.Optional; public interface GenericRepository<E, K> { E save(E entity); Optional<E> findById(K id); List<E> findAll(); }
14.571429
42
0.691176
b5066280e427fc069674dbf76d669df811316951
148
package co.waltsoft.exceptions4j.auth; import co.waltsoft.exceptions4j.Exception4j; public class InvalidPasswordException extends Exception4j { }
21.142857
59
0.844595
2a87e0b33bc22f7f8e704c03a836966d8c6d7e71
20,076
/* * Copyright 2011-Present Author or Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.cp.elements.dao.support; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doCallRealMethod; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.function.Predicate; import org.cp.elements.lang.Identifiable; import org.cp.elements.util.CollectionUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; /** * Unit Tests for {@link DaoSupport} * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito * @see org.mockito.junit.MockitoJUnitRunner * @see org.cp.elements.dao.support.DaoSupport * @since 1.0.0 */ @RunWith(MockitoJUnitRunner.class) public class DaoSupportUnitTests { @Mock private DaoSupport<User> mockDao; @Test @SuppressWarnings("unchecked") public void createWithFunctionCallsCreate() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); Function<User, User> mockFunction = mock(Function.class); doReturn(jonDoe).when(this.mockDao).create(); doCallRealMethod().when(this.mockDao).create(any(Function.class)); doReturn(jonDoe).when(mockFunction).apply(isA(User.class)); assertThat(this.mockDao.create(mockFunction)).isEqualTo(jonDoe); verify(this.mockDao).create(); verify(mockFunction, times(1)).apply(eq(jonDoe)); verifyNoMoreInteractions(mockFunction); } @Test(expected = IllegalArgumentException.class) public void createWithNullFunctionThrowsIllegalArgumentException() { doCallRealMethod().when(this.mockDao).create(any()); try { this.mockDao.create(null); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Callback Function is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).create(); } } @Test public void findAllReturnsEmptyListByDefault() { doCallRealMethod().when(this.mockDao).findAll(); List<User> users = this.mockDao.findAll(); assertThat(users).isNotNull(); assertThat(users).isEmpty(); verify(this.mockDao, times(1)).findAll(); verifyNoMoreInteractions(this.mockDao); } @Test @SuppressWarnings("unchecked") public void findAllWithComparatorCallsFindAllReturnsOrderedListOfBeans() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User bobDoe = User.of("Bob Doe").identifiedBy(3L); User cookieDoe = User.of("Cookie Doe").identifiedBy(4L); User dillDoe = User.of("Dill Doe").identifiedBy(5L); User froDoe = User.of("Fro Doe").identifiedBy(6L); User hoeDoe = User.of("Hoe Doe").identifiedBy(7L); User joeDoe = User.of("Joe Doe").identifiedBy(8L); User moeDoe = User.of("Moe Doe").identifiedBy(9L); User pieDoe = User.of("Pie Doe").identifiedBy(10L); User poeDoe = User.of("Pie Doe").identifiedBy(11L); User sourDoe = User.of("Sour Doe").identifiedBy(12L); List<User> users = new ArrayList<>(Arrays.asList( jonDoe, janeDoe, bobDoe, cookieDoe, dillDoe, froDoe, hoeDoe, joeDoe, moeDoe, pieDoe, poeDoe, sourDoe )); Comparator<User> orderBy = Comparator.naturalOrder(); doReturn(users).when(this.mockDao).findAll(); doCallRealMethod().when(this.mockDao).findAll(isA(Comparator.class)); List<User> usersFound = this.mockDao.findAll(orderBy); assertThat(usersFound).isNotNull(); assertThat(usersFound).hasSize(users.size()); assertThat(usersFound).containsExactly(bobDoe, cookieDoe, dillDoe, froDoe, hoeDoe, janeDoe, joeDoe, jonDoe, moeDoe, pieDoe, poeDoe, sourDoe); verify(this.mockDao, times(1)).findAll(eq(orderBy)); verify(this.mockDao, times(1)).findAll(); verifyNoMoreInteractions(this.mockDao); } @Test @SuppressWarnings("unchecked") public void findAllWithComparatorIsNullSafe() { Comparator<User> mockComparator = mock(Comparator.class); doReturn(null).when(this.mockDao).findAll(); doCallRealMethod().when(this.mockDao).findAll(isA(Comparator.class)); List<User> users = this.mockDao.findAll(mockComparator); assertThat(users).isNotNull(); assertThat(users).isEmpty(); verify(this.mockDao, times(1)).findAll(eq(mockComparator)); verify(this.mockDao, times(1)).findAll(); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockComparator); } @Test(expected = IllegalArgumentException.class) public void findAllWithNullComparatorThrowsIllegalArgumentException() { doCallRealMethod().when(this.mockDao).findAll(ArgumentMatchers.<Comparator<User>>any()); try { this.mockDao.findAll((Comparator<User>) null); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Comparator used to order (sort) the beans is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).findAll(); } } @Test @SuppressWarnings("unchecked") public void findAllWithPredicatedReturnsFilteredListOfBeans() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User cookieDoe = User.of("Cookie Doe").identifiedBy(3L); User pieDoe = User.of("Pie Doe").identifiedBy(4L); User sourDoe = User.of("Sour Doe").identifiedBy(5L); Predicate<User> mockPredicate = mock(Predicate.class); List<User> users = new ArrayList<>(Arrays.asList(jonDoe, janeDoe, cookieDoe, pieDoe, sourDoe)); doReturn(users).when(this.mockDao).findAll(); doCallRealMethod().when(this.mockDao).findAll(any(Predicate.class)); users.forEach(user -> doReturn(Arrays.asList(cookieDoe, pieDoe, sourDoe).contains(user)) .when(mockPredicate).test(eq(user))); List<User> foundUsers = this.mockDao.findAll(mockPredicate); assertThat(foundUsers).isNotNull(); assertThat(foundUsers).containsExactly(cookieDoe, pieDoe, sourDoe); users.forEach(user -> verify(mockPredicate, times(1)).test(eq(user))); verify(this.mockDao, times(1)).findAll(eq(mockPredicate)); verify(this.mockDao, times(1)).findAll(); verifyNoMoreInteractions(this.mockDao, mockPredicate); } @Test @SuppressWarnings("unchecked") public void findAllWithPredicateIsNullSafe() { Predicate<User> mockPredicate = mock(Predicate.class); doReturn(null).when(this.mockDao).findAll(); doCallRealMethod().when(this.mockDao).findAll(isA(Predicate.class)); List<User> users = this.mockDao.findAll(mockPredicate); assertThat(users).isNotNull(); assertThat(users).isEmpty(); verify(this.mockDao, times(1)).findAll(eq(mockPredicate)); verify(this.mockDao, times(1)).findAll(); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockPredicate); } @Test(expected = IllegalArgumentException.class) public void findAllWithNullPredicateThrowsIllegalArgumentException() { doCallRealMethod().when(this.mockDao).findAll(ArgumentMatchers.<Predicate<User>>any()); try { this.mockDao.findAll((Predicate<User>) null); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Query Predicate is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).findAll(); } } @Test @SuppressWarnings("unchecked") public void findAllWithPredicateAndComparatorCallsFindAllReturnsOrderedFilteredListOfBeans() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User cookieDoe = User.of("Cookie Doe").identifiedBy(3L); User pieDoe = User.of("Pie Doe").identifiedBy(4L); User sourDoe = User.of("Sour Doe").identifiedBy(5L); Predicate<User> mockPredicate = mock(Predicate.class); List<User> users = new ArrayList<>(Arrays.asList(jonDoe, janeDoe, cookieDoe, pieDoe, sourDoe)); Comparator<User> orderBy = Comparator.naturalOrder(); doReturn(users).when(this.mockDao).findAll(eq(mockPredicate)); doCallRealMethod().when(this.mockDao).findAll(isA(Predicate.class), isA(Comparator.class)); assertThat(this.mockDao.findAll(mockPredicate, orderBy)) .containsExactly(cookieDoe, janeDoe, jonDoe, pieDoe, sourDoe); verify(this.mockDao, times(1)).findAll(eq(mockPredicate), eq(orderBy)); verify(this.mockDao, times(1)).findAll(eq(mockPredicate)); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockPredicate); } @Test @SuppressWarnings("unchecked") public void findAllWithPredicateAndComparatorIsNullSafe() { Comparator<User> mockComparator = mock(Comparator.class); Predicate<User> mockPredicate = mock(Predicate.class); doReturn(null).when(this.mockDao).findAll(eq(mockPredicate)); doCallRealMethod().when(this.mockDao).findAll(isA(Predicate.class), isA(Comparator.class)); List<User> users = this.mockDao.findAll(mockPredicate, mockComparator); assertThat(users).isNotNull(); assertThat(users).isEmpty(); verify(this.mockDao, times(1)).findAll(eq(mockPredicate), eq(mockComparator)); verify(this.mockDao, times(1)).findAll(eq(mockPredicate)); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockPredicate, mockComparator); } @SuppressWarnings("unchecked") @Test(expected = IllegalArgumentException.class) public void findAllWithNullPredicateAndComparatorThrowsIllegalArgumentException() { Comparator<User> mockComparator = mock(Comparator.class); doCallRealMethod().when(this.mockDao).findAll(any(), isA(Comparator.class)); try { this.mockDao.findAll(null, mockComparator); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Query Predicate is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).findAll(isA(Predicate.class)); verifyNoInteractions(mockComparator); } } @SuppressWarnings("unchecked") @Test(expected = IllegalArgumentException.class) public void findAllWithPredicateAndNullComparatorThrowsIllegalArgumentException() { Predicate<User> mockPredicate = mock(Predicate.class); doCallRealMethod().when(this.mockDao).findAll(isA(Predicate.class), any()); try { this.mockDao.findAll(mockPredicate, null); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Comparator used to order (sort) the beans is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).findAll(eq(mockPredicate)); verifyNoInteractions(mockPredicate); } } @Test @SuppressWarnings("unchecked") public void findByReturnsOptionalEmptyByDefault() { Predicate<User> mockPredicate = mock(Predicate.class); doCallRealMethod().when(this.mockDao).findBy(isA(Predicate.class)); Optional<User> user = this.mockDao.findBy(mockPredicate); assertThat(user).isNotNull(); assertThat(user.isPresent()).isFalse(); verify(this.mockDao, times(1)).findBy(eq(mockPredicate)); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockPredicate); } @Test @SuppressWarnings("unchecked") public void removeAllWithPredicateCallsFindAllAndRemoveAll() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User cookieDoe = User.of("Cookie Doe").identifiedBy(3L); User pieDoe = User.of("Pie Doe").identifiedBy(4L); User sourDoe = User.of("Sour Doe").identifiedBy(5L); Predicate<User> mockPredicate = mock(Predicate.class); List<User> users = Arrays.asList(jonDoe, janeDoe, cookieDoe, pieDoe, sourDoe); doReturn(users).when(this.mockDao).findAll(eq(mockPredicate)); doReturn(true).when(this.mockDao).removeAll(CollectionUtils.asSet(users)); doCallRealMethod().when(this.mockDao).removeAll(isA(Predicate.class)); assertThat(this.mockDao.removeAll(mockPredicate)).isTrue(); verify(this.mockDao, times(1)).removeAll(eq(mockPredicate)); verify(this.mockDao, times(1)).findAll(eq(mockPredicate)); verify(this.mockDao, times(1)).removeAll(eq(CollectionUtils.asSet(users))); verifyNoMoreInteractions(this.mockDao); verifyNoInteractions(mockPredicate); } @SuppressWarnings("unchecked") @Test(expected = IllegalArgumentException.class) public void removeAllWithNullPredicateThrowsIllegalArgumentException() { doCallRealMethod().when(this.mockDao).removeAll(ArgumentMatchers.<Predicate<User>>any()); try { this.mockDao.removeAll((Predicate<User>) null); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Predicate identifying beans to remove is required"); assertThat(expected).hasNoCause(); throw expected; } finally { verify(this.mockDao, never()).findAll(any(Predicate.class)); verify(this.mockDao, never()).removeAll(any(Set.class)); } } @Test @SuppressWarnings("unchecked") public void removeAllWithSetCallsRemove() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User cookieDoe = User.of("Cookie Doe").identifiedBy(3L); User pieDoe = User.of("Pie Doe").identifiedBy(4L); User sourDoe = User.of("Sour Doe").identifiedBy(5L); Set<User> users = CollectionUtils.asSet(jonDoe, janeDoe, cookieDoe, pieDoe, sourDoe); users.forEach(user -> doReturn(true).when(this.mockDao).remove(eq(user))); doCallRealMethod().when(this.mockDao).removeAll(eq(users)); assertThat(this.mockDao.removeAll(users)).isTrue(); users.forEach(user -> verify(this.mockDao, times(1)).remove(eq(user))); } @Test @SuppressWarnings("unchecked") public void removeAllWithSetCallsRemoveWithOnlyNonNullBeans() { User cookieDoe = User.of("Cookie Doe").identifiedBy(1L); User pieDoe = User.of("Pie Doe").identifiedBy(2L); User sourDoe = User.of("Sour Doe").identifiedBy(3L); Set<User> users = CollectionUtils.asSet(cookieDoe, null, pieDoe, null, null, sourDoe, null); users.stream() .filter(Objects::nonNull) .forEach(user -> doReturn(true).when(this.mockDao).remove(eq(user))); doCallRealMethod().when(this.mockDao).removeAll(eq(users)); assertThat(this.mockDao.removeAll(users)).isTrue(); users.stream() .filter(Objects::nonNull) .forEach(user -> verify(this.mockDao, times(1)).remove(eq(user))); verify(this.mockDao, never()).remove(eq(null)); } @Test @SuppressWarnings("unchecked") public void removeAllWithSetIsNullSafe() { doCallRealMethod().when(this.mockDao).removeAll(ArgumentMatchers.<Set<User>>any()); assertThat(this.mockDao.removeAll((Set<User>) null)).isFalse(); verify(this.mockDao, never()).remove(any()); } @Test public void removeAllWithSetReturnsFalse() { User cookieDoe = User.of("Cookie Doe").identifiedBy(1L); User pieDoe = User.of("Pie Doe").identifiedBy(2L); User sourDoe = User.of("Sour Doe").identifiedBy(3L); Set<User> users = CollectionUtils.asSet(cookieDoe, pieDoe, sourDoe); doReturn(false).when(this.mockDao).remove(any()); doCallRealMethod().when(this.mockDao).removeAll(eq(users)); assertThat(this.mockDao.removeAll(users)).isFalse(); users.stream() .filter(Objects::nonNull) .forEach(user -> verify(this.mockDao, times(1)).remove(eq(user))); } @Test public void removeAllWithSetReturnsTrueIfJustOneBeansIsRemoved() { User cookieDoe = User.of("Cookie Doe").identifiedBy(1L); User pieDoe = User.of("Pie Doe").identifiedBy(2L); User sourDoe = User.of("Sour Doe").identifiedBy(3L); Set<User> users = CollectionUtils.asSet(cookieDoe, pieDoe, sourDoe); users.stream() .filter(Objects::nonNull) .forEach(user -> doReturn(Arrays.asList(cookieDoe, pieDoe).contains(user)).when(this.mockDao).remove(eq(user))); doCallRealMethod().when(this.mockDao).removeAll(eq(users)); assertThat(this.mockDao.removeAll(users)).isTrue(); users.stream() .filter(Objects::nonNull) .forEach(user -> verify(this.mockDao, times(1)).remove(eq(user))); } @Test public void saveAllCallsSave() { User jonDoe = User.of("Jon Doe").identifiedBy(1L); User janeDoe = User.of("Jane Doe").identifiedBy(2L); User cookieDoe = User.of("Cookie Doe").identifiedBy(3L); User pieDoe = User.of("Pie Doe").identifiedBy(4L); User sourDoe = User.of("Sour Doe").identifiedBy(5L); Set<User> users = CollectionUtils.asSet(jonDoe, janeDoe, cookieDoe, pieDoe, sourDoe); users.forEach(user -> doReturn(user).when(this.mockDao).save(eq(user))); doCallRealMethod().when(this.mockDao).saveAll(eq(users)); Set<User> savedUsers = this.mockDao.saveAll(users); assertThat(savedUsers).isNotNull(); assertThat(savedUsers).isEqualTo(users); assertThat(savedUsers).isNotSameAs(users); users.forEach(user -> verify(this.mockDao, times(1)).save(eq(user))); } @Test public void saveAllSavesOnlyNonNullBeans() { User cookieDoe = User.of("Cookie Doe").identifiedBy(1L); User pieDoe = User.of("Pie Doe").identifiedBy(2L); User sourDoe = User.of("Sour Doe").identifiedBy(3L); Set<User> users = CollectionUtils.asSet(cookieDoe, null, pieDoe, null, null, sourDoe, null); users.stream() .filter(Objects::nonNull) .forEach(user -> doReturn(user).when(this.mockDao).save(eq(user))); doCallRealMethod().when(this.mockDao).saveAll(eq(users)); assertThat(this.mockDao.saveAll(users)).containsExactlyInAnyOrder(cookieDoe, pieDoe, sourDoe); users.stream() .filter(Objects::nonNull) .forEach(user -> verify(this.mockDao, times(1)).save(eq(user))); verify(this.mockDao, never()).save(eq(null)); } @Test public void saveAllIsNullSafe() { doCallRealMethod().when(this.mockDao).saveAll(any()); Set<User> users = this.mockDao.saveAll(null); assertThat(users).isNotNull(); assertThat(users).isEmpty(); verify(this.mockDao, never()).save(eq(null)); } @Getter @ToString(of = "name") @EqualsAndHashCode(of = "name") @RequiredArgsConstructor(staticName = "of") static class User implements Comparable<User>, Identifiable<Long> { @Setter private Long id; @lombok.NonNull private final String name; @Override public int compareTo(User that) { return this.getName().compareTo(that.getName()); } } }
31.765823
119
0.713439
98aa78ef9ef4a133dc9108a6083c923950d37ce2
708
package com.hockey.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import com.hockey.model.entity.HistoryPoints; import com.hockey.model.entity.Seat; public interface HistoryPointsRepository extends JpaRepository<HistoryPoints, Long> { List<HistoryPoints> findBySeatOrderByHistoryDateAsc(Seat seat); @Modifying(clearAutomatically = true) @Query(value = "DELETE FROM history_points WHERE seat_id = (:seat_id);", nativeQuery = true) void deleteBy(@Param("seat_id") String idSeat); }
33.714286
93
0.814972
2fd0d3f54347f2153796c4dfb89ddfe735837220
340
package com.zw.lifecycle; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; @Configuration public class ConfigDemo { @Bean String str() { System.out.println("创建@Configuration @Bean对象..."); return "hello word..."; } }
22.666667
60
0.770588
d8b1a2a57634d97be947a63b3364805810602f8b
1,100
package com.semperhilaris.smoothcam; import aurelienribon.tweenengine.TweenAccessor; /** Exposing tweenable fields of {@link SmoothCamWorld} for Universal Tween Engine by Aurelien Ribon (see * http://www.aurelienribon.com/blog/projects/universal-tween-engine/) * @author David Froehlich <semperhilaris@gmail.com> */ public class SmoothCamAccessor implements TweenAccessor<SmoothCamWorld> { public static final int PAN = 1; public static final int ZOOM = 2; @Override public int getValues (SmoothCamWorld target, int tweenType, float[] returnValues) { switch (tweenType) { case PAN: returnValues[0] = target.getX(); returnValues[1] = target.getY(); return 2; case ZOOM: returnValues[0] = target.getZoom(); return 1; default: assert false; return -1; } } @Override public void setValues (SmoothCamWorld target, int tweenType, float[] newValues) { switch (tweenType) { case PAN: target.setX(newValues[0]); target.setY(newValues[1]); break; case ZOOM: target.setZoom(newValues[0]); break; default: assert false; break; } } }
23.404255
105
0.712727
d1d6eac0136a060350ed39877e7832d59461403c
17,104
package imagescience.random; import imagescience.image.Axes; import imagescience.image.ByteImage; import imagescience.image.Coordinates; import imagescience.image.Dimensions; import imagescience.image.Image; import imagescience.utility.ImageScience; import imagescience.utility.Messenger; import imagescience.utility.Progressor; import imagescience.utility.Timer; import java.lang.Math; /** Randomizes images. */ public class Randomizer { /** Additive insertion of random numbers. For each image element, a random number is generated from the selected distribution and is added to the original value. */ public final static int ADDITIVE = 0; /** Multiplicative insertion of random numbers. For each image element, a random number is generated from the selected distribution which multiplies the original value. */ public final static int MULTIPLICATIVE = 1; /** Modulatory insertion of random numbers. For each image element, a random number is generated from the selected distribution (currently this works only for Poisson) with the original value being a parameter value, which replaces the original value. */ public final static int MODULATORY = 2; /** Default constructor. */ public Randomizer() { } /** Randomizes images using a Gaussian random variable. @param image the input image to be randomized. @param mean the mean of the Gaussian distribution. @param stdev the standard deviation of the Gaussian distribution. Must be larger than or equal to {@code 0}. @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE} or {@link #MULTIPLICATIVE}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code stdev} is less than {@code 0}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image gaussian( final Image image, final double mean, final double stdev, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for Gaussian randomization"); if (stdev < 0) throw new IllegalArgumentException("Standard deviation less than 0"); messenger.log("Initializing Gaussian random number generator"); messenger.log("Mean = " + mean); messenger.log("Standard deviation = " + stdev); messenger.log(">> Variance = " + stdev*stdev); final RandomGenerator rng = new GaussianGenerator(mean,stdev); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" Gaussian noise"); insert(ran,rng,insertion); timer.stop(); return ran; } /** Randomizes images using a binomial random variable. @param image the input image to be randomized. @param trials the number of trials of the binomial distribution. Must be larger than or equal to {@code 0}. @param probability the probability for each trial of the binomial distribution. Must be in the range {@code [0,1]}. @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE} or {@link #MULTIPLICATIVE}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code trials} is less than {@code 0}, if {@code probability} is outside the range {@code [0,1]}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image binomial( final Image image, final int trials, final double probability, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for binomial randomization"); if (trials < 0) throw new IllegalArgumentException("Number of trials less than 0"); if (probability < 0 || probability > 1) throw new IllegalArgumentException("Probability outside range [0,1]"); messenger.log("Initializing binomial random number generator"); messenger.log("Trials = " + trials); messenger.log("Probability = " + probability); final double mean = trials*probability; final double variance = mean*(1 - probability); messenger.log(">> Mean = " + mean); messenger.log(">> Variance = " + variance); messenger.log(">> Standard deviation = " + Math.sqrt(variance)); final RandomGenerator rng = new BinomialGenerator(trials,probability); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" binomial noise"); insert(ran,rng,insertion); timer.stop(); return ran; } /** Randomizes images using a gamma random variable. @param image the input image to be randomized. @param order the integer order of the gamma distribution. Must be larger than {@code 0}. @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE} or {@link #MULTIPLICATIVE}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code order} is less than or equal to {@code 0}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image gamma( final Image image, final int order, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for gamma randomization"); if (order <= 0) throw new IllegalArgumentException("Order less than or equal to 0"); messenger.log("Initializing gamma random number generator"); messenger.log("Order = " + order); messenger.log(">> Mean = " + order); messenger.log(">> Variance = " + order); messenger.log(">> Standard deviation = " + Math.sqrt(order)); final RandomGenerator rng = new GammaGenerator(order); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" gamma noise"); insert(ran,rng,insertion); timer.stop(); return ran; } /** Randomizes images using a uniform random variable. @param image the input image to be randomized. @param min {@code max} - the interval parameters of the uniform distribution. Random numbers are generated in the open interval ({@code min},{@code max}). @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE} or {@link #MULTIPLICATIVE}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code min} is larger than or equal to {@code max}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image uniform( final Image image, final double min, final double max, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for uniform randomization"); if (min >= max) throw new IllegalArgumentException("Maximum must be larger than minimum"); messenger.log("Initializing uniform random number generator"); messenger.log("Minimum = " + min); messenger.log("Maximum = " + max); final double mean = 0.5*(min + max); final double stdev = (max - min)/Math.sqrt(12); messenger.log(">> Mean = " + mean); messenger.log(">> Variance = " + stdev*stdev); messenger.log(">> Standard deviation = " + stdev); final RandomGenerator rng = new UniformGenerator(min,max); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" uniform noise"); insert(ran,rng,insertion); timer.stop(); return ran; } /** Randomizes images using an exponential random variable. @param image the input image to be randomized. @param lambda the lambda parameter of the exponential distribution. Must be larger than {@code 0}. @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE} or {@link #MULTIPLICATIVE}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code lambda} is less than or equal to {@code 0}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image exponential( final Image image, final double lambda, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for exponential randomization"); if (lambda <= 0) throw new IllegalArgumentException("Lambda less than or equal to 0"); messenger.log("Initializing exponential random number generator"); messenger.log("Lambda = " + lambda); final double mean = 1/lambda; final double stdev = mean; messenger.log(">> Mean = " + mean); messenger.log(">> Variance = " + stdev*stdev); messenger.log(">> Standard deviation = " + stdev); final RandomGenerator rng = new ExponentialGenerator(lambda); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" exponential noise"); insert(ran,rng,insertion); timer.stop(); return ran; } /** Randomizes images using a Poisson random variable. @param image the input image to be randomized. @param mean the mean of the Poisson distribution. Must be larger than or equal to {@code 0}. @param insertion determines how the random numbers generated from the distribution are inserted into the image. Must be one of {@link #ADDITIVE}, {@link #MULTIPLICATIVE}, or {@link #MODULATORY}. @param newimage indicates whether the randomized image should be returned as a new image. If this parameter is {@code true}, the result is returned as a new {@code Image} object (of the same type as the input image) and the input image is left unaltered; if it is {@code false}, the input image itself is randomized and returned, thereby saving memory. @return a randomized version of the input image. Be aware of the value conversion and insertion rules for the different types of images: random numbers may have been clipped and rounded. @exception IllegalArgumentException if {@code mean} is less than {@code 0}, or if {@code insertion} is invalid. @exception NullPointerException if {@code image} is {@code null}. */ public Image poisson( final Image image, final double mean, final int insertion, final boolean newimage ) { messenger.log(ImageScience.prelude()+"Randomizer"); final Timer timer = new Timer(); timer.messenger.log(messenger.log()); timer.start(); messenger.log("Checking arguments for Poisson randomization"); if (mean < 0) throw new IllegalArgumentException("Mean less than 0"); messenger.log("Initializing Poisson random number generator"); if (insertion == ADDITIVE || insertion == MULTIPLICATIVE) { messenger.log("Mean = " + mean); messenger.log(">> Variance = " + mean); messenger.log(">> Standard deviation = " + Math.sqrt(mean)); } final RandomGenerator rng = new PoissonGenerator(mean); final Image ran = newimage ? image.duplicate() : image; ran.name(image.name()+" with "+insertion(insertion)+" Poisson noise"); insert(ran,rng,insertion); timer.stop(); return ran; } private void insert(final Image img, final RandomGenerator rng, final int insertion) { messenger.log("Randomizing "+img.type()); final Dimensions dims = img.dimensions(); final Coordinates coords = new Coordinates(); messenger.status("Randomizing..."); progressor.steps(dims.c*dims.t*dims.z*dims.y); final double[] array = new double[dims.x]; img.axes(Axes.X); progressor.start(); switch (insertion) { case ADDITIVE: { messenger.log("Inserting random numbers by addition"); for (coords.c=0; coords.c<dims.c; ++coords.c) for (coords.t=0; coords.t<dims.t; ++coords.t) for (coords.z=0; coords.z<dims.z; ++coords.z) for (coords.y=0; coords.y<dims.y; ++coords.y) { img.get(coords,array); for (int x=0; x<dims.x; ++x) array[x] += rng.next(); img.set(coords,array); progressor.step(); } break; } case MULTIPLICATIVE: { messenger.log("Inserting random numbers by multiplication"); for (coords.c=0; coords.c<dims.c; ++coords.c) for (coords.t=0; coords.t<dims.t; ++coords.t) for (coords.z=0; coords.z<dims.z; ++coords.z) for (coords.y=0; coords.y<dims.y; ++coords.y) { img.get(coords,array); for (int x=0; x<dims.x; ++x) array[x] *= rng.next(); img.set(coords,array); progressor.step(); } break; } case MODULATORY: { if (!(rng instanceof PoissonGenerator)) throw new IllegalArgumentException("Invalid type of insertion"); final PoissonGenerator prng = (PoissonGenerator)rng; messenger.log("Inserting random numbers by modulation"); for (coords.c=0; coords.c<dims.c; ++coords.c) for (coords.t=0; coords.t<dims.t; ++coords.t) for (coords.z=0; coords.z<dims.z; ++coords.z) for (coords.y=0; coords.y<dims.y; ++coords.y) { img.get(coords,array); for (int x=0; x<dims.x; ++x) array[x] = prng.next(array[x]); img.set(coords,array); progressor.step(); } break; } default: throw new IllegalArgumentException("Invalid type of insertion"); } progressor.stop(); messenger.status(""); } private String insertion(final int insertion) { switch (insertion) { case ADDITIVE: return "additive"; case MULTIPLICATIVE: return "multiplicative"; case MODULATORY: return "modulatory"; } return null; } /** The object used for message displaying. */ public final Messenger messenger = new Messenger(); /** The object used for progress displaying. */ public final Progressor progressor = new Progressor(); }
42.547264
354
0.714102
0d94a824a3df51e69084f4344feb1b6c750b2ad5
442
package com.github.bruce.thrift.connection.pool; import org.apache.commons.pool2.BasePooledObjectFactory; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; public interface Pool<T> { public boolean initPool(BasePooledObjectFactory<T> factory, GenericObjectPoolConfig config); public T getResource() throws Exception; public void returnResourceObject(final T resource, boolean broken); public void close(); }
27.625
96
0.794118
a53db018ccdf986c5607ff8601c6cb4b8626e7ed
10,955
package seedu.address.logic.parser; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.commons.core.Messages.MESSAGE_UNKNOWN_COMMAND; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.ExitCommand; import seedu.address.logic.commands.HelpCommand; import seedu.address.logic.commands.HistoryCommand; import seedu.address.logic.commands.ListCommand; import seedu.address.logic.commands.RedoCommand; import seedu.address.logic.commands.UndoCommand; import seedu.address.logic.commands.epiggy.AddBudgetCommand; import seedu.address.logic.commands.epiggy.EditBudgetCommand; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.epiggy.Budget; import seedu.address.testutil.epiggy.BudgetBuilder; import seedu.address.testutil.epiggy.BudgetUtil; import seedu.address.testutil.epiggy.EditBudgetDetailsBuilder; public class EPiggyParserTest { @Rule public ExpectedException thrown = ExpectedException.none(); private final EPiggyParser parser = new EPiggyParser(); // @Test // public void parseCommand_addAllowance() throws Exception { // Allowance allowance = new AllowanceBuilder().build(); // AddAllowanceCommand command = (AddAllowanceCommand) // parser.parseCommand(AllowanceUtil.getAddAllowanceCommand(allowance)); // assertEquals(new AddAllowanceCommand(allowance), command); // } @Test public void parseCommand_addBudget() throws Exception { Budget budget = new BudgetBuilder().build(); AddBudgetCommand command = (AddBudgetCommand) parser.parseCommand(BudgetUtil.getAddBudgetCommand(budget)); assertEquals(new AddBudgetCommand(budget), command); } @Test public void parseCommand_addBudgetAlias() throws Exception { Budget budget = new BudgetBuilder().build(); AddBudgetCommand command = (AddBudgetCommand) parser.parseCommand(BudgetUtil.getAddBudgetCommand(budget)); assertEquals(new AddBudgetCommand(budget), command); } //@Test //public void parseCommand_addExpense() throws Exception { // // TODO: Issues with date toString method in ExpenseUtil // Expense expense = new ExpensesBuilder().build(); // AddExpenseCommand command = (AddExpenseCommand) // parser.parseCommand(ExpenseUtil.getAddExpenseCommand(expense)); // assertEquals(new AddExpenseCommand(expense), command); //} @Test public void parseCommand_clear() throws Exception { assertTrue(parser.parseCommand(ClearCommand.COMMAND_WORD) instanceof ClearCommand); assertTrue(parser.parseCommand(ClearCommand.COMMAND_WORD + " 3") instanceof ClearCommand); } @Test public void parseCommand_clearAlias() throws Exception { assertTrue(parser.parseCommand(ClearCommand.COMMAND_ALIAS) instanceof ClearCommand); assertTrue(parser.parseCommand(ClearCommand.COMMAND_ALIAS + " 3") instanceof ClearCommand); } // @Test // public void parseCommand_deleteBudget() throws Exception { // DeleteBudgetCommand command = (DeleteBudgetCommand) parser.parseCommand( // DeleteBudgetCommand.COMMAND_WORD + " " + INDEX_FIRST_BUDGET.getOneBased()); // assertEquals(new DeleteExpenseCommand(INDEX_FIRST_BUDGET), command); // } // @Test // public void parseCommand_deleteExpense() throws Exception { // DeleteExpenseCommand command = (DeleteExpenseCommand) parser.parseCommand( // DeleteExpenseCommand.COMMAND_WORD + " " + INDEX_FIRST_EXPENSE.getOneBased()); // assertEquals(new DeleteExpenseCommand(INDEX_FIRST_EXPENSE), command); // } // @Test // public void parseCommand_deleteAlias() throws Exception { // DeleteCommand command = (DeleteCommand) parser.parseCommand( // DeleteCommand.COMMAND_ALIAS + " " + INDEX_FIRST_PERSON.getOneBased()); // assertEquals(new DeleteCommand(INDEX_FIRST_PERSON), command); // } @Test public void parseCommand_editBudget() throws Exception { Budget budget = new BudgetBuilder().build(); EditBudgetCommand.EditBudgetDetails details = new EditBudgetDetailsBuilder(budget).build(); EditBudgetCommand command = (EditBudgetCommand) parser.parseCommand(EditBudgetCommand.COMMAND_WORD + " " + BudgetUtil.getEditBudgetDetailsDetails(details)); assertEquals(new EditBudgetCommand(details), command); } // @Test // public void parseCommand_editExpense() throws Exception { // Expense expense = new ExpensesBuilder().build(); // EditExpenseCommand.EditExpenseDescriptor descriptor = new EditExpenseDescriptorBuilder(expense).build(); // EditExpenseCommand command = (EditExpenseCommand) parser.parseCommand(EditExpenseCommand.COMMAND_WORD // + " " + INDEX_FIRST_EXPENSE.getOneBased() + " " // + ExpenseUtil.getEditExpenseDescriptorDetails(descriptor)); // assertEquals(new EditExpenseCommand(INDEX_FIRST_EXPENSE, descriptor), command); // } // @Test // public void parseCommand_editAlias() throws Exception { // Person person = new PersonBuilder().build(); // EditPersonDescriptor descriptor = new EditPersonDescriptorBuilder(person).build(); // EditCommand command = (EditCommand) parser.parseCommand(EditCommand.COMMAND_ALIAS + " " // + INDEX_FIRST_PERSON.getOneBased() + " " + PersonUtil.getEditPersonDescriptorDetails(descriptor)); // assertEquals(new EditCommand(INDEX_FIRST_PERSON, descriptor), command); //} @Test public void parseCommand_exit() throws Exception { assertTrue(parser.parseCommand(ExitCommand.COMMAND_WORD) instanceof ExitCommand); assertTrue(parser.parseCommand(ExitCommand.COMMAND_WORD + " 3") instanceof ExitCommand); } @Test public void parseCommand_exitAlias() throws Exception { assertTrue(parser.parseCommand(ExitCommand.COMMAND_ALIAS) instanceof ExitCommand); assertTrue(parser.parseCommand(ExitCommand.COMMAND_ALIAS + " 3") instanceof ExitCommand); } // @Test // public void parseCommand_find() throws Exception { // List<String> keywords = Arrays.asList("foo", "bar", "baz"); // FindCommand command = (FindCommand) parser.parseCommand( // FindCommand.COMMAND_WORD + " " + keywords.stream().collect(Collectors.joining(" "))); // assertEquals(new FindCommand(new NameContainsKeywordsPredicate(keywords)), command); // } // @Test // public void parseCommand_findAlias() throws Exception { // List<String> keywords = Arrays.asList("foo", "bar", "baz"); // FindCommand command = (FindCommand) parser.parseCommand( // FindCommand.COMMAND_ALIAS + " " + keywords.stream().collect(Collectors.joining(" "))); // assertEquals(new FindCommand(new NameContainsKeywordsPredicate(keywords)), command); // } @Test public void parseCommand_help() throws Exception { assertTrue(parser.parseCommand(HelpCommand.COMMAND_WORD) instanceof HelpCommand); assertTrue(parser.parseCommand(HelpCommand.COMMAND_WORD + " 3") instanceof HelpCommand); } @Test public void parseCommand_helpAlias() throws Exception { assertTrue(parser.parseCommand(HelpCommand.COMMAND_ALIAS) instanceof HelpCommand); assertTrue(parser.parseCommand(HelpCommand.COMMAND_ALIAS + " 3") instanceof HelpCommand); } @Test public void parseCommand_history() throws Exception { assertTrue(parser.parseCommand(HistoryCommand.COMMAND_WORD) instanceof HistoryCommand); assertTrue(parser.parseCommand(HistoryCommand.COMMAND_WORD + " 3") instanceof HistoryCommand); try { parser.parseCommand("histories"); throw new AssertionError("The expected ParseException was not thrown."); } catch (ParseException pe) { assertEquals(MESSAGE_UNKNOWN_COMMAND, pe.getMessage()); } } @Test public void parseCommand_historyAlias() throws Exception { assertTrue(parser.parseCommand(HistoryCommand.COMMAND_ALIAS) instanceof HistoryCommand); assertTrue(parser.parseCommand(HistoryCommand.COMMAND_ALIAS + " 3") instanceof HistoryCommand); try { parser.parseCommand("histories"); throw new AssertionError("The expected ParseException was not thrown."); } catch (ParseException pe) { assertEquals(MESSAGE_UNKNOWN_COMMAND, pe.getMessage()); } } @Test public void parseCommand_list() throws Exception { assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD) instanceof ListCommand); assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD + " 3") instanceof ListCommand); } @Test public void parseCommand_listAlias() throws Exception { assertTrue(parser.parseCommand(ListCommand.COMMAND_ALIAS) instanceof ListCommand); assertTrue(parser.parseCommand(ListCommand.COMMAND_ALIAS + " 3") instanceof ListCommand); } @Test public void parseCommand_redoCommandWord_returnsRedoCommand() throws Exception { assertTrue(parser.parseCommand(RedoCommand.COMMAND_WORD) instanceof RedoCommand); assertTrue(parser.parseCommand("redo 1") instanceof RedoCommand); } @Test public void parseCommand_redoCommandAlias_returnsRedoCommand() throws Exception { assertTrue(parser.parseCommand(RedoCommand.COMMAND_ALIAS) instanceof RedoCommand); assertTrue(parser.parseCommand("redo 1") instanceof RedoCommand); } @Test public void parseCommand_undoCommandWord_returnsUndoCommand() throws Exception { assertTrue(parser.parseCommand(UndoCommand.COMMAND_WORD) instanceof UndoCommand); assertTrue(parser.parseCommand("undo 3") instanceof UndoCommand); } @Test public void parseCommand_undoCommandAlias_returnsUndoCommand() throws Exception { assertTrue(parser.parseCommand(UndoCommand.COMMAND_ALIAS) instanceof UndoCommand); assertTrue(parser.parseCommand("undo 3") instanceof UndoCommand); } @Test public void parseCommand_unrecognisedInput_throwsParseException() throws Exception { thrown.expect(ParseException.class); thrown.expectMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE)); parser.parseCommand(""); } @Test public void parseCommand_unknownCommand_throwsParseException() throws Exception { thrown.expect(ParseException.class); thrown.expectMessage(MESSAGE_UNKNOWN_COMMAND); parser.parseCommand("unknownCommand"); } }
45.456432
116
0.723049
b270d8352e7152080b614e33a27e8fa0119adc29
632
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Graphics; /** *last Edited: 2/25/2013 * @author james small */ public abstract class SingletonUserActionKeyboard extends UserActionKeyboard { private int key = -1; public void setKey(int key){ this.key = key; } public int getKey(){ return this.key; } @Override protected void action(int key){ if((this.key == key||this.isIgnoreInput())&&this.isActive()){ this.Reaction(); } } protected abstract void Reaction(); }
23.407407
79
0.596519
e4270ccc56a09e1320d3a278fbf46c33b04c2c3a
4,384
package be.unamur.transitionsystem.test.mutation; /* * #%L * vibes-mutation * %% * Copyright (C) 2014 PReCISE, University of Namur * %% * 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. * #L% */ import static org.junit.Assert.*; import java.io.InputStream; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runner.Description; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import be.unamur.transitionsystem.State; import be.unamur.transitionsystem.LabelledTransitionSystem; import be.unamur.transitionsystem.TransitionSystem; import be.unamur.transitionsystem.fts.FeaturedTransitionSystem; import be.unamur.transitionsystem.transformation.xml.LtsHandler; import be.unamur.transitionsystem.transformation.xml.XmlReader; public class WrongInitialStateTest { private static final Logger LOG = LoggerFactory.getLogger(WrongInitialStateTest.class); @Rule public TestRule watcher = new TestWatcher() { @Override protected void starting(Description description) { LOG.info(String.format("Starting test: %s()...", description.getMethodName())); } ; }; @Test public void testResult() throws Exception { InputStream input = this.getClass().getClassLoader() .getResourceAsStream("ts-sodaVendingMachine.xml"); LtsHandler handler = new LtsHandler(); XmlReader reader = new XmlReader(handler, input); reader.readDocument(); LabelledTransitionSystem system = (LabelledTransitionSystem) handler.geTransitionSystem(); assertNotNull(system); LOG.debug("Transition System {}", system); final State state = system.getState("state2"); WrongInitialState op = new WrongInitialState(system, new StateSelectionStrategy() { @Override public State selectState(MutationOperator op, TransitionSystem ts) { return state; } }); op.apply(); assertEquals("Wrong initial state!", state, op.getNewInitialState()); LabelledTransitionSystem mutant = (LabelledTransitionSystem) op.result(); LOG.debug("Mutant = {}", mutant); assertEquals("Wrong initial state!", state, mutant.getInitialState()); } @Test public void testTranspose() throws Exception { InputStream input = this.getClass().getClassLoader() .getResourceAsStream("ts-sodaVendingMachine.xml"); LtsHandler handler = new LtsHandler(); XmlReader reader = new XmlReader(handler, input); reader.readDocument(); LabelledTransitionSystem system = (LabelledTransitionSystem) handler.geTransitionSystem(); assertNotNull(system); LOG.debug("Transition System {}", system); final State state = system.getState("state2"); WrongInitialState op = new WrongInitialState(system, new StateSelectionStrategy() { @Override public State selectState(MutationOperator op, TransitionSystem ts) { return state; } }); op.apply(); FeaturedTransitionSystem mutant = op.transpose(new FeaturedTransitionSystem(system)); LOG.debug("Mutant = {}", mutant); assertNotNull(mutant); } }
39.495495
98
0.698221
7e3944382ee88197ee16c7f4a704a1dc4c9f7d56
4,811
/* * 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.misers.certutil; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URISyntaxException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.Provider; import java.security.Security; import java.security.cert.Certificate; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.codec.binary.Base64; /** * @author covener */ public class GetHPKPFingerprint { static boolean debug = false; private String db, label; public GetHPKPFingerprint(String db, String label) { this.db = db; this.label = label; try { @SuppressWarnings("unchecked") Class<java.security.Provider> cmsclass = (Class<Provider>) Class.forName("com.ibm.security.cmskeystore.CMSProvider"); Security.addProvider(cmsclass.newInstance()); } catch (Exception e) { e.printStackTrace(); } } public static String getThumbPrint(Certificate cert) throws NoSuchAlgorithmException, CertificateEncodingException, javax.security.cert.CertificateEncodingException { MessageDigest md = MessageDigest.getInstance("SHA-256"); byte[] der = cert.getPublicKey().getEncoded(); md.update(der); byte[] digest = md.digest(); return Base64.encodeBase64String(digest); } private static Certificate getCertificate(String db, String pw, String label) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore ks = KeyStore.getInstance("IBMCMSKS"); FileInputStream in = new FileInputStream(db); ks.load(in, pw.toCharArray()); return ks.getCertificate(label); } private String getPIN() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, javax.security.cert.CertificateEncodingException { System.out.println("Please enter the password for keystore " + this.db + "\n"); String pw = new String(System.console().readPassword()); return getThumbPrint(getCertificate(this.db, pw, this.label)); } public static void main(String[] args) throws Exception { CommandLineParser parser = new DefaultParser(); CommandLine line = null; Options options = new Options(); options.addOption("db", true, "path to CMS KDB B"); options.addOption("label", true, "label of cert in KDB"); options.addOption("debug", false, "debug"); options.addOption("h", false, "help"); HelpFormatter formatter = new HelpFormatter(); try { line = parser.parse(options, args); } catch (ParseException exp) { System.out.println(exp); formatter.printHelp("GetHPKPFingerprint", options); return; } if (line.hasOption("debug")) debug = true; if (!line.hasOption("db") || !line.hasOption("label")) { usage(); } GetHPKPFingerprint retriever = new GetHPKPFingerprint(line.getOptionValue("db"), line.getOptionValue("label")); System.out.println(retriever.getPIN()); } private static void usage() throws URISyntaxException { File myjar = new File(GetHPKPFingerprint.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); System.err.println("java -jar " + myjar + " -db /path/to/cms.kdb -label label-name"); System.exit(1); } }
38.488
170
0.687175
bfdbcd852e2d23b363c622fda7b1708f488f7474
886
package com.petkit.android.model; import java.io.Serializable; public class Brand implements Serializable{ private static final long serialVersionUID = 3126226868756859708L; private String index; private String name; private String icon; private int id; private int privated; public String getIndex() { return index; } public void setIndex(String index) { this.index = index; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getPrivated() { // 0 表示公有的宠粮种类, 1 表示用户自己添加的宠粮, 2表示添加项 return privated; } public void setPrivated(int privated) { this.privated = privated; } }
18.458333
70
0.681716
2431c5695d9301d6aee6edbc0116bf1d683f1327
1,972
package osmedile.intellij.stringmanip.filter; import com.intellij.openapi.editor.VisualPosition; import com.intellij.util.xmlb.annotations.Transient; import java.util.Objects; public class GrepSettings { private boolean inverted; private boolean groupMatching; private boolean regex; private String pattern; private boolean caseSensitive; private boolean fullWords; @Transient public transient boolean quick; @Transient public transient VisualPosition visualPosition; /** * UPDATE EQUALS */ public boolean isInverted() { return inverted; } public void setInverted(boolean inverted) { this.inverted = inverted; } public boolean isGroupMatching() { return groupMatching; } public void setGroupMatching(boolean groupMatching) { this.groupMatching = groupMatching; } public String getPattern() { return pattern; } public void setPattern(final String pattern) { this.pattern = pattern; } public boolean isRegex() { return regex; } public void setRegex(final boolean regex) { this.regex = regex; } public boolean isCaseSensitive() { return caseSensitive; } public void setCaseSensitive(final boolean caseSensitive) { this.caseSensitive = caseSensitive; } public boolean isFullWords() { return fullWords; } public void setFullWords(final boolean fullWords) { this.fullWords = fullWords; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GrepSettings that = (GrepSettings) o; return inverted == that.inverted && groupMatching == that.groupMatching && regex == that.regex && caseSensitive == that.caseSensitive && fullWords == that.fullWords && Objects.equals(pattern, that.pattern); } @Override public int hashCode() { return Objects.hash(inverted, groupMatching, regex, pattern, caseSensitive, fullWords); } @Override public String toString() { return pattern + (regex ? " (regex)" : ""); } }
21.911111
208
0.733266
e1ebeed43ac09828b9c4cf2dea8a55df3bc899ef
2,232
package mage.cards.s; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.filter.StaticFilters; import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; import java.util.UUID; /** * @author TheElk801 */ public final class SilvanussInvoker extends CardImpl { public SilvanussInvoker(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.DRAGON); this.subtype.add(SubType.DRUID); this.power = new MageInt(3); this.toughness = new MageInt(2); // Conjure Elemental — {8}: Untap target land you control. It becomes an 8/8 Elemental creature with trample and haste until end of turn. It's still a land. Ability ability = new SimpleActivatedAbility(new UntapTargetEffect(), new GenericManaCost(8)); ability.addEffect(new BecomesCreatureTargetEffect( new CreatureToken(8, 8, "8/8 Elemental creature with trample and haste") .withSubType(SubType.ELEMENTAL) .withAbility(TrampleAbility.getInstance()) .withAbility(HasteAbility.getInstance()), false, true, Duration.EndOfTurn ).setText("It becomes an 8/8 Elemental creature with trample and haste until end of turn. It's still a land")); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND)); this.addAbility(ability.withFlavorWord("Conjure Elemental")); } private SilvanussInvoker(final SilvanussInvoker card) { super(card); } @Override public SilvanussInvoker copy() { return new SilvanussInvoker(this); } }
39.157895
164
0.722222
4b7673a4bc630694345545ef5f9fb2743fe27d66
1,406
package org.epodia.metier; import java.util.Collection; import java.util.List; import org.epodia.dao.GeneratedExerciceRepository; import org.epodia.entities.Generated_exercice; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class GeneratedExerciceMetierImpl implements GeneratedExerciceMetier { @Autowired private GeneratedExerciceRepository generatedExerciceRepository ; @Override public Generated_exercice saveGeneratedExercice(Generated_exercice GE) { // TODO Auto-generated method stub return generatedExerciceRepository.save(GE); } @Override public List<Generated_exercice> ListGExerciceList() { // TODO Auto-generated method stub return generatedExerciceRepository.findAll(); } @Override public Generated_exercice updateGExercice(Generated_exercice GE, Long id) { // TODO Auto-generated method stub return generatedExerciceRepository.saveAndFlush(GE); } @Override public Generated_exercice getGExerciceById(Long id) { // TODO Auto-generated method stub return generatedExerciceRepository.getOne(id); } @Override public Collection<Generated_exercice> ExpertGenExercice(Long id) { // TODO Auto-generated method stub return generatedExerciceRepository.ExpertGenExercice(id) ; } @Override public void deleteGExercice(Long id) { // TODO Auto-generated method stub } }
26.037037
77
0.805121
a6d16e8d3dcec9c158cbef044dfb0f700d2fd17e
223
/* * Here comes the text of your license * Each line should be prefixed with * */ package rubiksrace; /** * * @author kjhuggins */ public interface IGameTileListener { public void tileClicked(GameTile tile); }
15.928571
43
0.690583
5bdb8ae0fd8bab4803cff2878aaf3dd7736c6cb1
44,981
package OpenRate.process; import OpenRate.cache.ICacheManager; import OpenRate.cache.RateCache; import OpenRate.exception.InitializationException; import OpenRate.exception.ProcessingException; import OpenRate.record.IRecord; import OpenRate.record.RateMapEntry; import OpenRate.record.RatingBreakdown; import OpenRate.record.RatingResult; import OpenRate.resource.CacheFactory; import OpenRate.utils.PropertyUtils; import java.util.ArrayList; /** * Please * <a target='new' href='http://www.open-rate.com/wiki/index.php?title=Rate_Calculation'>click * here</a> to go to wiki page. * <br> * <p> * This class provides the abstract base for a rating plug in. A raw rate object * is retrieved from the RateCache object, and this class provides the * primitives required for performing rating. */ public abstract class AbstractRateCalc extends AbstractPlugIn { // This is the object will be using the find the cache manager private ICacheManager CMR = null; // The zone model object private RateCache RC; // ----------------------------------------------------------------------------- // ------------------ Start of inherited Plug In functions --------------------- // ----------------------------------------------------------------------------- /** * Initialise the module. Called during pipeline creation to initialise: - * Configuration properties that are defined in the properties file. - The * references to any cache objects that are used in the processing - The * symbolic name of the module * * @param PipelineName The name of the pipeline this module is in * @param ModuleName The name of this module in the pipeline * @throws OpenRate.exception.InitializationException */ @Override public void init(String PipelineName, String ModuleName) throws InitializationException { String CacheObjectName; // Do the inherited work, e.g. setting the symbolic name etc super.init(PipelineName, ModuleName); // Get the cache object reference CacheObjectName = PropertyUtils.getPropertyUtils().getPluginPropertyValue(PipelineName, ModuleName, "DataCache"); CMR = CacheFactory.getGlobalManager(CacheObjectName); if (CMR == null) { message = "Could not find cache entry for <" + CacheObjectName + ">"; throw new InitializationException(message, getSymbolicName()); } // Load up the mapping arrays, but only if we are the right type. This // allows us to build up ever more complex rating models, matching the // right model to the right cache if (CMR.get(CacheObjectName) instanceof RateCache) { RC = (RateCache) CMR.get(CacheObjectName); if (RC == null) { message = "Could not find cache entry for <" + CacheObjectName + ">"; throw new InitializationException(message, getSymbolicName()); } } } // ----------------------------------------------------------------------------- // ------------------ Start of inherited Plug In functions --------------------- // ----------------------------------------------------------------------------- /** * This is called when the synthetic Header record is encountered, and has the * meaning that the stream is starting. * * @return */ @Override public IRecord procHeader(IRecord r) { return r; } /** * This is called when the synthetic trailer record is encountered, and has * the meaning that the stream is now finished. * * @return */ @Override public IRecord procTrailer(IRecord r) { return r; } // ----------------------------------------------------------------------------- // ------------------------ Start of utiity functions -------------------------- // ----------------------------------------------------------------------------- /** * This function does the rating based on the chosen price model and the RUM * (Rateable Usage Metric) value. The model processes all of the tiers up to * the value of the RUM, calculating the cost for each tier and summing the * tier costs. This is different to the "threshold" mode where all of the RUM * is used from the tier that is reached. * * @param priceModel The price model to use * @param valueToRate The value to rate * @param valueOffset The offset for the start of the tier, if there is one * @param cdrDate The date to use for price model version selection * @return the price for the rated record * @throws OpenRate.exception.ProcessingException */ public double rateCalculateTiered(String priceModel, double valueToRate, double valueOffset, long cdrDate) throws ProcessingException { ArrayList<RateMapEntry> tmpRateModel; RatingResult tmpRatingResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the rating using the selected rate model tmpRatingResult = performRateEvaluationTiered(priceModel, tmpRateModel, valueToRate, valueOffset, cdrDate, false); // return the rated value return tmpRatingResult.RatedValue; } /** * This function does the rating based on the chosen price model and the RUM * (Rateable Usage Metric) value. The model locates the correct tier to use * and then rates all of the RUM according to that tier. This is different to * the "tiered" mode, where the individual contributing tier costs are * calculated and then summed. * * @param priceModel The price model to use * @param valueToRate The value to rate * @param valueOffset The offset for the start of the tier, if there is one * @param CDRDate The date to use for price model version selection * @return the price for the rated record * @throws OpenRate.exception.ProcessingException */ public double rateCalculateThreshold(String priceModel, double valueToRate, double valueOffset, long CDRDate) throws ProcessingException { ArrayList<RateMapEntry> tmpRateModel; RatingResult tmpRatingResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the rating using the selected rate model tmpRatingResult = performRateEvaluationThreshold(priceModel, tmpRateModel, valueToRate, valueOffset, CDRDate, false); // return the rated value return tmpRatingResult.RatedValue; } /** * This function does the rating based on the chosen price model and the RUM * (Rateable Usage Metric) value. It is a simplified version of the "tiered" * model that just does a multiplication of valueToRate*Rate, without having * to calculate tiers. This of course does not support singularity rating. * * @param priceModel The price model to use * @param valueToRate the duration that should be rated in seconds * @param CDRDate The date to use for price model version selection * @return the price for the rated record * @throws OpenRate.exception.ProcessingException */ public double rateCalculateFlat(String priceModel, double valueToRate, long CDRDate) throws ProcessingException { ArrayList<RateMapEntry> tmpRateModel; RatingResult tmpRatingResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the rating using the selected rate model tmpRatingResult = performRateEvaluationFlat(priceModel, tmpRateModel, valueToRate, CDRDate, false); // return the rated value return tmpRatingResult.RatedValue; } /** * This function does the rating based on the chosen price model and the RUM * (Rateable Usage Metric) value. It is a simplified version of the "tiered" * model that just does returns the event price. * * @param priceModel The price model to use * @param CDRDate The date to use for price model version selection * @param valueToRate The value to rate for * @return the price for the rated record * @throws OpenRate.exception.ProcessingException */ public double rateCalculateEvent(String priceModel, long valueToRate, long CDRDate) throws ProcessingException { ArrayList<RateMapEntry> tmpRateModel; RatingResult tmpRatingResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the rating using the selected rate model tmpRatingResult = performRateEvaluationEvent(priceModel, tmpRateModel, valueToRate, CDRDate, false); // return the rated value return tmpRatingResult.RatedValue; } /** * This method is used to calculate the number of RUM units (e.g. seconds) * which can be purchased for the available credit. The credit is calculated * from the difference between the current balance and the credit limit. In * pre-paid scenarios, the current balance will tend to be > 0 and the credit * limit will tend to be 0. In post paid scenarios, both values will tend to * be negative. * * The clever thing about this method is the fact that it uses the standard * rating price model in order to arrive at the value, simplifying greatly the * management of pre-paid balances. * * This method uses the TIERED rating model. * * @param priceModel The price model to use * @param availableBalance The current balance the user has available to them, * positive * @param CDRDate The date to rate at * @return The number of RUM units that can be purchased for the available * balance * @throws ProcessingException */ public double authCalculateTiered(String priceModel, double availableBalance, long CDRDate) throws ProcessingException { if (availableBalance <= 0) { return 0; } ArrayList<RateMapEntry> tmpRateModel; double tmpcalculationResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the calculation using the selected rate model tmpcalculationResult = performAuthEvaluationTiered(priceModel, tmpRateModel, availableBalance, CDRDate); return tmpcalculationResult; } /** * This method is used to calculate the number of RUM units (e.g. seconds) * which can be purchased for the available credit. The credit is calculated * from the difference between the current balance and the credit limit. In * pre-paid scenarios, the current balance will tend to be > 0 and the credit * limit will tend to be 0. In post paid scenarios, both values will tend to * be negative. * * The clever thing about this method is the fact that it uses the standard * rating price model in order to arrive at the value, simplifying greatly the * management of pre-paid balances. * * This method uses the THRESHOLD rating model. * * @param priceModel The price model to use * @param availableBalance The current balance the user has available to them, * positive * @param CDRDate The date to rate at * @return The number of RUM units that can be purchased for the available * balance * @throws ProcessingException */ public double authCalculateThreshold(String priceModel, double availableBalance, long CDRDate) throws ProcessingException { if (availableBalance <= 0) { return 0; } ArrayList<RateMapEntry> tmpRateModel; double tmpcalculationResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the calculation using the selected rate model tmpcalculationResult = performAuthEvaluationThreshold(priceModel, tmpRateModel, availableBalance, CDRDate); return tmpcalculationResult; } /** * This method is used to calculate the number of RUM units (e.g. seconds) * which can be purchased for the available credit. The credit is calculated * from the difference between the current balance and the credit limit. In * pre-paid scenarios, the current balance will tend to be > 0 and the credit * limit will tend to be 0. In post paid scenarios, both values will tend to * be negative. * * The clever thing about this method is the fact that it uses the standard * rating price model in order to arrive at the value, simplifying greatly the * management of pre-paid balances. * * This method uses the FLAT rating model. * * @param priceModel The price model to use * @param availableBalance The current balance the user has available to them, * positive * @param CDRDate The date to rate at * @return The number of RUM units that can be purchased for the available * balance * @throws ProcessingException */ public double authCalculateFlat(String priceModel, double availableBalance, long CDRDate) throws ProcessingException { if (availableBalance <= 0) { return 0; } ArrayList<RateMapEntry> tmpRateModel; double tmpcalculationResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the calculation using the selected rate model tmpcalculationResult = performAuthEvaluationFlat(priceModel, tmpRateModel, availableBalance, CDRDate); return tmpcalculationResult; } /** * This method is used to calculate the number of RUM units (e.g. seconds) * which can be purchased for the available credit. The credit is calculated * from the difference between the current balance and the credit limit. In * pre-paid scenarios, the current balance will tend to be > 0 and the credit * limit will tend to be 0. In post paid scenarios, both values will tend to * be negative. * * The clever thing about this method is the fact that it uses the standard * rating price model in order to arrive at the value, simplifying greatly the * management of pre-paid balances. * * This method uses the EVENT rating model. * * @param priceModel The price model to use * @param availableBalance The current balance the user has available to them, * positive * @param CDRDate The date to rate at * @return The number of RUM units that can be purchased for the available * balance * @throws ProcessingException */ public double authCalculateEvent(String priceModel, double availableBalance, long CDRDate) throws ProcessingException { if (availableBalance <= 0) { return 0; } ArrayList<RateMapEntry> tmpRateModel; double tmpRatingResult; // Look up the rate model to use tmpRateModel = RC.getPriceModel(priceModel); // perform the calculation using the selected rate model tmpRatingResult = performAuthEvaluationEvent(priceModel, tmpRateModel, availableBalance, CDRDate); return tmpRatingResult; } /** * Performs the rating calculation of the value given at the CDR date using * the given rating model. Tiered splits the value to be rated up into * segments according to the steps defined and rates each step individually, * summing up the charges from all steps. * * TIERED Calculation SINGULARITY Yes BEAT BASED Yes CHARGE BASE Yes STEP * FROM-TO Yes RATING beatCount * factor * beat / chargeBase; * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param valueToRate The value to rate * @param valueOffset The offset for the start of the tier, if there is one * @param CDRDate The date to rate at * @param BreakDown Produce a charge breakdown or not * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected RatingResult performRateEvaluationTiered(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double valueToRate, double valueOffset, long CDRDate, boolean BreakDown) throws ProcessingException { RatingResult tmpRatingResult = new RatingResult(); int index = 0; double AllTiersValue = 0; RatingBreakdown tmpBreakdown; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // For multi-packet rating, we have to apply the offset double effectiveValueToRate = valueToRate + valueOffset; // set the default value double rumValueUsed = 0; double rumValueUsedOffset = 0; double roundedRUMUsed = 0; tmpRatingResult.RatedValue = 0; tmpRatingResult.RUMUsed = 0; // We need to loop through all the tiers until we have finshed // consuming all the rateable input while (index < tmpRateModel.size()) { // Get the root price model RateMapEntry tmpEntry = tmpRateModel.get(index); // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); // Validate that we have something we can work with if (tmpEntry == null) { message = "CDR with <" + CDRDate + "> date not rated by model <" + PriceModel + "> because of missing validity coverage"; throw new ProcessingException(message, getSymbolicName()); } // For positive rating cases double thisTierValue; double thisTierRUMUsed = 0; long thisTierBeatCount = 0; double thisTierRoundedRUM; // For offset rating cases double thisTierOffsetRUMUsed = 0; long thisTierOffsetBeatCount = 0; // ********************* Deal with the rating value ********************** // See if this event crosses the lower tier threshold if (effectiveValueToRate > tmpEntry.getFrom()) { // see if we use all of the tier if (effectiveValueToRate >= tmpEntry.getTo()) { // Calculate the amount in this tier thisTierRUMUsed = (tmpEntry.getTo() - tmpEntry.getFrom()); rumValueUsed += thisTierRUMUsed; // Get the number of beats in this tier thisTierBeatCount = Math.round(thisTierRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((thisTierRUMUsed - thisTierBeatCount * tmpEntry.getBeat()) > 0) { thisTierBeatCount++; } // Deal with the empty beat if (thisTierBeatCount == 0) { thisTierBeatCount += 1; } } else { // Partial tier to do, and then we have finished thisTierRUMUsed = (effectiveValueToRate - tmpEntry.getFrom()); rumValueUsed += thisTierRUMUsed; thisTierBeatCount = Math.round(thisTierRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((thisTierRUMUsed - thisTierBeatCount * tmpEntry.getBeat()) > 0) { thisTierBeatCount++; } // Deal with the empty beat if (thisTierBeatCount == 0) { thisTierBeatCount = 1; } } } // *********************** Deal with the offset ************************ if (valueOffset != 0) { // See if this event crosses the lower tier threshold if (valueOffset > tmpEntry.getFrom()) { // see if we use all of the tier if (valueOffset >= tmpEntry.getTo()) { // Calculate the amount in this tier thisTierOffsetRUMUsed = (tmpEntry.getTo() - tmpEntry.getFrom()); rumValueUsedOffset += thisTierOffsetRUMUsed; // Get the number of beats in this tier thisTierOffsetBeatCount = Math.round(thisTierOffsetRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((thisTierOffsetRUMUsed - thisTierOffsetBeatCount * tmpEntry.getBeat()) > 0) { thisTierOffsetBeatCount++; } // Deal with the empty beat if (thisTierOffsetBeatCount == 0) { thisTierOffsetBeatCount = 1; } } else { // Partial tier to do, and then we have finished thisTierOffsetRUMUsed = (valueOffset - tmpEntry.getFrom()); rumValueUsedOffset += thisTierOffsetRUMUsed; thisTierOffsetBeatCount = Math.round(thisTierOffsetRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((thisTierOffsetRUMUsed - thisTierOffsetBeatCount * tmpEntry.getBeat()) > 0) { thisTierOffsetBeatCount++; } // Deal with the empty beat if (thisTierOffsetBeatCount == 0) { thisTierOffsetBeatCount = 1; } } } } // Now roll up the rating values thisTierRoundedRUM = (thisTierBeatCount - thisTierOffsetBeatCount) * tmpEntry.getBeat(); thisTierValue = (thisTierRoundedRUM * tmpEntry.getFactor()) / tmpEntry.getChargeBase(); // Only count rounded RUM used for non-singularity steps, otherwise we count more than once if (tmpEntry.getFrom() != tmpEntry.getTo()) { roundedRUMUsed += thisTierRoundedRUM; } // provide the rating breakdown if it is required if (BreakDown) { // initialise the breakdown if necessary if (tmpRatingResult.breakdown == null) { tmpRatingResult.breakdown = new ArrayList<>(); } // provide the charging breakdown tmpBreakdown = new RatingBreakdown(); tmpBreakdown.beat = tmpEntry.getBeat(); tmpBreakdown.beatCount = thisTierBeatCount - thisTierOffsetBeatCount; tmpBreakdown.factor = tmpEntry.getFactor(); tmpBreakdown.chargeBase = tmpEntry.getChargeBase(); tmpBreakdown.ratedAmount = thisTierValue; tmpBreakdown.RUMRated = thisTierRUMUsed - thisTierOffsetRUMUsed; tmpBreakdown.stepUsed = index; tmpBreakdown.tierFrom = tmpEntry.getFrom(); tmpBreakdown.tierTo = tmpEntry.getTo(); tmpBreakdown.validFrom = tmpEntry.getStartTime(); // Store the breakdown tmpRatingResult.breakdown.add(tmpBreakdown); } // Increment the tier counter index++; // Accumulate the tier value AllTiersValue += thisTierValue; } // Roll up the final values tmpRatingResult.RatedValue = AllTiersValue; tmpRatingResult.RUMUsed = rumValueUsed - rumValueUsedOffset; tmpRatingResult.RUMUsedRounded = roundedRUMUsed; // return OK return tmpRatingResult; } /** * Performs the rating calculation of the value given at the CDR date using * the given rating model. Threshold calculation locates the step that covers * the maximum value to be rated and calculates the whole value to be rated * using that step. * * THRESHOLD Calculation SINGULARITY Yes BEAT BASED Yes CHARGE BASE Yes STEP * FROM-TO Yes RATING beatCount * factor * beat / chargeBase; * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param valueToRate The value to rate * @param valueOffset The offset for the start of the tier, if there is one * @param CDRDate The date to rate at * @param BreakDown Produce a charge breakdown or not * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected RatingResult performRateEvaluationThreshold(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double valueToRate, double valueOffset, long CDRDate, boolean BreakDown) throws ProcessingException { int index = 0; double AllTiersValue = 0; RatingResult tmpRatingResult = new RatingResult(); RatingBreakdown tmpBreakdown; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // For multi-packet rating, we have to apply the offset double effectiveValueToRate = valueToRate + valueOffset; // set the default value double rumValueUsed = 0; double rumValueUsedOffset = 0; // We need to loop through all the tiers until we have finshed // consuming all the rateable input while (index < tmpRateModel.size()) { // Get the root price model RateMapEntry tmpEntry = tmpRateModel.get(index); // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); // Validate that we have something we can work with if (tmpEntry == null) { message = "CDR with <" + CDRDate + "> date not rated by model <" + PriceModel + "> because of missing validity coverage"; throw new ProcessingException(message, getSymbolicName()); } // For positive rating cases double thisTierValue; double thisTierRUMUsed = 0; long thisTierBeatCount = 0; // ********************* Deal with the rating value ********************** // See if this event crosses the lower tier threshold if (effectiveValueToRate > tmpEntry.getFrom()) { // see if we are in this tier if (effectiveValueToRate <= tmpEntry.getTo()) { // Calculate the amount in this tier - we use the offset to locate the // tier to use, but rate the original amount thisTierRUMUsed = valueToRate; rumValueUsed += thisTierRUMUsed; // Get the number of beats in this tier thisTierBeatCount = Math.round(thisTierRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((thisTierRUMUsed - thisTierBeatCount * tmpEntry.getBeat()) > 0) { thisTierBeatCount++; } // Deal with the empty beat if (thisTierBeatCount == 0) { thisTierBeatCount = 1; } } else if (tmpEntry.getFrom() == tmpEntry.getTo()) { // Singularity rate // Get the number of beats in this tier thisTierBeatCount = 1; } } // Calculate the value of the tier thisTierValue = (thisTierBeatCount * tmpEntry.getFactor()) * tmpEntry.getBeat() / tmpEntry.getChargeBase(); // provide the rating breakdown if it is required if (BreakDown) { // initialise the breakdown if necessary if (tmpRatingResult.breakdown == null) { tmpRatingResult.breakdown = new ArrayList<>(); } // provide the charging breakdown tmpBreakdown = new RatingBreakdown(); tmpBreakdown.beat = tmpEntry.getBeat(); tmpBreakdown.beatCount = thisTierBeatCount; tmpBreakdown.factor = tmpEntry.getFactor(); tmpBreakdown.chargeBase = tmpEntry.getChargeBase(); tmpBreakdown.ratedAmount = thisTierValue; tmpBreakdown.RUMRated = thisTierRUMUsed; tmpBreakdown.stepUsed = index; tmpBreakdown.tierFrom = tmpEntry.getFrom(); tmpBreakdown.tierTo = tmpEntry.getTo(); tmpBreakdown.validFrom = tmpEntry.getStartTime(); // Store the breakdown tmpRatingResult.breakdown.add(tmpBreakdown); } // Increment the tier counter index++; // Accumulate the tier value AllTiersValue += thisTierValue; } // Roll up the final values tmpRatingResult.RatedValue = AllTiersValue; tmpRatingResult.RUMUsed = rumValueUsed - rumValueUsedOffset; // return OK return tmpRatingResult; } /** * Performs the rating calculation of the value given at the CDR date using * the given rating model. Does *NOT* take into account the step FROM and TO * values. * * FLAT Calculation SINGULARITY No BEAT BASED No CHARGE BASE Yes STEP FROM-TO * No RATING valueToRate * factor / chargeBase * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param valueToRate The value to rate * @param CDRDate The date to rate at * @param BreakDown Produce a charge breakdown or not * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected RatingResult performRateEvaluationFlat(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double valueToRate, long CDRDate, boolean BreakDown) throws ProcessingException { double AllTiersValue; RateMapEntry tmpEntry; double RUMValueUsed; RatingResult tmpRatingResult = new RatingResult(); RatingBreakdown tmpBreakdown; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // Get just the first tier tmpEntry = tmpRateModel.get(0); // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); if (tmpEntry == null) { message = "CDR with <" + CDRDate + "> date not rated by model <" + PriceModel + "> because of missing validity coverage"; throw new ProcessingException(message, getSymbolicName()); } // Calculate the value of the entry - there should be no others AllTiersValue = (valueToRate * tmpEntry.getFactor()) / tmpEntry.getChargeBase(); RUMValueUsed = valueToRate; // provide the rating breakdown if it is required if (BreakDown) { // initialise the breakdown if necessary if (tmpRatingResult.breakdown == null) { tmpRatingResult.breakdown = new ArrayList<>(); } // provide the charging breakdown tmpBreakdown = new RatingBreakdown(); tmpBreakdown.beat = 1; tmpBreakdown.beatCount = (long) valueToRate; tmpBreakdown.factor = tmpEntry.getFactor(); tmpBreakdown.chargeBase = tmpEntry.getChargeBase(); tmpBreakdown.ratedAmount = AllTiersValue; tmpBreakdown.RUMRated = RUMValueUsed; tmpBreakdown.stepUsed = 1; tmpBreakdown.tierFrom = tmpEntry.getFrom(); tmpBreakdown.tierTo = tmpEntry.getTo(); tmpBreakdown.validFrom = tmpEntry.getStartTime(); // Store the breakdown tmpRatingResult.breakdown.add(tmpBreakdown); } // return OK tmpRatingResult.RatedValue = AllTiersValue; tmpRatingResult.RUMUsed = RUMValueUsed; return tmpRatingResult; } /** * Performs the rating calculation of the value given at the CDR date using * the given rating model. It does take into account the step FROM and TO * values. Step from and step to values are integers in this case. * * EVENT Calculation SINGULARITY No BEAT BASED No CHARGE BASE No STEP FROM-TO * Yes RATING valueToRate * factor * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param valueToRate The value to rate for * @param CDRDate The date to rate at * @param BreakDown Produce a charge breakdown or not * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected RatingResult performRateEvaluationEvent(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, long valueToRate, long CDRDate, boolean BreakDown) throws ProcessingException { RatingResult tmpRatingResult = new RatingResult(); int Index = 0; double ThisTierValue; double ThisTierRUMUsed; double AllTiersValue = 0; RateMapEntry tmpEntry; double RUMValueUsed = 0; RatingBreakdown tmpBreakdown; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // set the default value tmpRatingResult.RatedValue = 0; tmpRatingResult.RUMUsed = 0; // We need to loop through all the tiers until we have finshed // consuming all the rateable input while (Index < tmpRateModel.size()) { tmpEntry = tmpRateModel.get(Index); ThisTierValue = 0; // See if this event crosses the lower tier threshold if (valueToRate > tmpEntry.getFrom()) { // see if we use all of the tier if (valueToRate >= tmpEntry.getTo()) { // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); if (tmpEntry == null) { message = "CDR with <" + CDRDate + "> date not rated by model <" + PriceModel + "> because of missing validity coverage"; throw new ProcessingException(message, getSymbolicName()); } // Calculate the amount in this tier ThisTierRUMUsed = (tmpEntry.getTo() - tmpEntry.getFrom()); // Deal with the case that we have the empty beat if (ThisTierRUMUsed == 0) { ThisTierRUMUsed++; } RUMValueUsed += ThisTierRUMUsed; // Calculate the value of the tier ThisTierValue = ThisTierRUMUsed * tmpEntry.getFactor(); // provide the rating breakdown if it is required if (BreakDown) { // initialise the breakdown if necessary if (tmpRatingResult.breakdown == null) { tmpRatingResult.breakdown = new ArrayList<>(); } // provide the charging breakdown tmpBreakdown = new RatingBreakdown(); tmpBreakdown.beat = tmpEntry.getBeat(); tmpBreakdown.beatCount = (long) ThisTierRUMUsed; tmpBreakdown.factor = tmpEntry.getFactor(); tmpBreakdown.chargeBase = tmpEntry.getChargeBase(); tmpBreakdown.ratedAmount = ThisTierValue; tmpBreakdown.RUMRated = ThisTierRUMUsed; tmpBreakdown.stepUsed = Index; tmpBreakdown.tierFrom = tmpEntry.getFrom(); tmpBreakdown.tierTo = tmpEntry.getTo(); tmpBreakdown.validFrom = tmpEntry.getStartTime(); // Store the breakdown tmpRatingResult.breakdown.add(tmpBreakdown); } } else { // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); if (tmpEntry == null) { message = "CDR with <" + CDRDate + "> date not rated by model <" + PriceModel + "> because of missing validity coverage"; throw new ProcessingException(message, getSymbolicName()); } // Partial tier to do, and then we have finished ThisTierRUMUsed = (valueToRate - tmpEntry.getFrom()); // Deal with the case that we have the empty beat if (ThisTierRUMUsed == 0) { ThisTierRUMUsed++; } RUMValueUsed += ThisTierRUMUsed; ThisTierValue = ThisTierRUMUsed * tmpEntry.getFactor(); // provide the rating breakdown if it is required if (BreakDown) { // initialise the breakdown if necessary if (tmpRatingResult.breakdown == null) { tmpRatingResult.breakdown = new ArrayList<>(); } // provide the charging breakdown tmpBreakdown = new RatingBreakdown(); tmpBreakdown.beat = tmpEntry.getBeat(); tmpBreakdown.beatCount = (long) ThisTierRUMUsed; tmpBreakdown.factor = tmpEntry.getFactor(); tmpBreakdown.chargeBase = tmpEntry.getChargeBase(); tmpBreakdown.ratedAmount = ThisTierValue; tmpBreakdown.RUMRated = ThisTierRUMUsed; tmpBreakdown.stepUsed = Index; tmpBreakdown.tierFrom = tmpEntry.getFrom(); tmpBreakdown.tierTo = tmpEntry.getTo(); tmpBreakdown.validFrom = tmpEntry.getStartTime(); // Store the breakdown tmpRatingResult.breakdown.add(tmpBreakdown); } } } // Increment the tier counter Index++; // Accumulate the tier value AllTiersValue += ThisTierValue; } // return OK tmpRatingResult.RatedValue = AllTiersValue; tmpRatingResult.RUMUsed = RUMValueUsed; return tmpRatingResult; } /** * Performs the authorisation calculation of the value given at the CDR date. * Evaluates all the tiers in the model one at a time, and accumulates the * contribution from the tier into the final result. * * Matches the rating in performRateEvaluationTiered * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param availableBalance The balance available * @param CDRDate The date to rate at * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected double performAuthEvaluationTiered(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double availableBalance, long CDRDate) throws ProcessingException { int Index = 0; double ThisTierValue; double ThisTierRUMUsed; long ThisTierBeatCount; double AllTiersValue = 0; RateMapEntry tmpEntry; double RUMValueUsed = 0; boolean breakFlag = false; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // We need to loop through all the tiers until we have finished // consuming all the rateable input while (Index < tmpRateModel.size()) { tmpEntry = tmpRateModel.get(Index); tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); if (tmpEntry == null) { message = "Rate Model entry not valid for CDR with <" + CDRDate + "> date, model <" + PriceModel + ">"; throw new ProcessingException(message, getSymbolicName()); } // Deal with the case that we have a tier without cost if (tmpEntry.getFactor() == 0) { // we just skip over - nothing we can do with 0 priced tiers continue; } // Calculate the amount in this tier ThisTierRUMUsed = (tmpEntry.getTo() - tmpEntry.getFrom()); // Get the number of beats in this tier ThisTierBeatCount = Math.round(ThisTierRUMUsed / tmpEntry.getBeat()); // Deal with unfinished beats if ((ThisTierRUMUsed - ThisTierBeatCount * tmpEntry.getBeat()) > 0) { ThisTierBeatCount++; } // Deal with the empty beat if (ThisTierBeatCount == 0) { ThisTierBeatCount = 1; } // Calculate the value of the tier ThisTierValue = (ThisTierBeatCount * tmpEntry.getFactor()) * tmpEntry.getBeat() / tmpEntry.getChargeBase(); if (AllTiersValue + ThisTierValue > availableBalance) { ThisTierValue = availableBalance - AllTiersValue; ThisTierBeatCount = Math.round((ThisTierValue * tmpEntry.getChargeBase()) / (tmpEntry.getFactor() * tmpEntry.getBeat())); ThisTierRUMUsed = tmpEntry.getBeat() * ThisTierBeatCount; breakFlag = true; } // Accumulate the tier value AllTiersValue += ThisTierValue; RUMValueUsed += ThisTierRUMUsed; if (breakFlag == true) { break; } // Increment the tier counter Index++; } // Set the value to maximum if available balance is a lot higher than all tiered??? // if(availableBalance > AllTiersValue){ // RUMValueUsed = Double.MAX_VALUE; // } return RUMValueUsed; } /** * Performs the authorisation calculation of the value given at the CDR date. * We have to perform an evaluation for each of the threshold steps in the * model and find the lowest non-zero result. When the authorisation runs out, * the same process can happen again with less available balance. Not very * beautiful, but functional given the non-linear nature of the model. * * Matches the rating in performRateEvaluationThreshold * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param availableBalance The balance available * @param CDRDate The date to rate at * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected double performAuthEvaluationThreshold(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double availableBalance, long CDRDate) throws ProcessingException { int Index = 0; double ThisTierRUMUsed; long ThisTierBeatCount; RateMapEntry tmpEntry; double RUMValueUsed = 0; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // We need to loop through all the tiers and evaluate them, then return the // shortest. while (Index < tmpRateModel.size()) { tmpEntry = tmpRateModel.get(Index); Index++; tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); ThisTierBeatCount = Math.round((availableBalance * tmpEntry.getChargeBase()) / (tmpEntry.getFactor() * tmpEntry.getBeat())); ThisTierRUMUsed = tmpEntry.getBeat() * ThisTierBeatCount; // is this a better non-zero result if (RUMValueUsed == 0) { RUMValueUsed = ThisTierRUMUsed; } else if (RUMValueUsed > 0 && ThisTierRUMUsed > 0 && RUMValueUsed > ThisTierRUMUsed && ThisTierRUMUsed < tmpEntry.getTo()) { RUMValueUsed = ThisTierRUMUsed; } } return RUMValueUsed; } /** * Performs the authorisation calculation of the value given at the CDR date. * * Matches the rating in performRateEvaluationFlat * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param availableBalance The balance available * @param CDRDate The date to rate at * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected double performAuthEvaluationFlat(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double availableBalance, long CDRDate) throws ProcessingException { RateMapEntry tmpEntry; double tmpcalculationResult; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // Get the validty for this cdr tmpEntry = getRateModelEntryForTime(tmpRateModel.get(0), CDRDate); if (tmpEntry == null) { message = "Rate Model entry not found for CDR with <" + CDRDate + "> date, model <" + PriceModel + ">"; throw new ProcessingException(message, getSymbolicName()); } else if (tmpEntry.getFactor() == 0 || tmpEntry.getChargeBase() == 0) { message = "Rate Model entry not valid for CDR with <" + CDRDate + "> date, model <" + PriceModel + ">, factor <" + tmpEntry.getFactor() + "and charge base <" + tmpEntry.getChargeBase() + ">"; throw new ProcessingException(message, getSymbolicName()); } // Calculate the value of the entry - there should be no others tmpcalculationResult = (availableBalance / tmpEntry.getFactor()) * tmpEntry.getChargeBase(); return tmpcalculationResult; } /** * Performs the authorisation calculation of the value given at the CDR date. * * Matches the rating in performRateEvaluationEvent * * @param PriceModel The price model name we are using * @param tmpRateModel The price model definition * @param availableBalance The balance available * @param CDRDate The date to rate at * @return The rating result * @throws OpenRate.exception.ProcessingException */ protected double performAuthEvaluationEvent(String PriceModel, ArrayList<RateMapEntry> tmpRateModel, double availableBalance, long CDRDate) throws ProcessingException { double tmpcalculationResult; RateMapEntry tmpEntry; // check that we have something to work on if (tmpRateModel == null) { throw new ProcessingException("Price Model <" + PriceModel + "> not defined", getSymbolicName()); } // Get just the first tier tmpEntry = tmpRateModel.get(0); // Get the validity for this cdr tmpEntry = getRateModelEntryForTime(tmpEntry, CDRDate); if (tmpEntry == null) { message = "Rate Model entry not valid for CDR with <" + CDRDate + "> date, model <" + PriceModel + ">"; throw new ProcessingException(message, getSymbolicName()); } tmpcalculationResult = availableBalance / tmpEntry.getFactor(); return tmpcalculationResult; } /** * Runs through the validity periods in a rate map, and returns the one valid * for a given date, or null if no match * * @param tmpEntry The rate map object to search * @param CDRDate The long UTC date to search for * @return The relevant rate map entry, or null if there was no match at the * time */ protected RateMapEntry getRateModelEntryForTime(RateMapEntry tmpEntry, long CDRDate) { RateMapEntry result = tmpEntry; while (tmpEntry.getStartTime() > CDRDate) { // try to move down the list if (tmpEntry.getChild() == null) { // no more children, so we can't rate this return null; } else { // move down the list result = result.getChild(); } return result; } // return the right bit return tmpEntry; } }
38.24915
214
0.667771
c91359b6d0e9768bf1d45b34f5b3b2d9d7327884
1,248
package net.sourceforge.jwbf.mediawiki.actions.queries; import static org.junit.Assert.assertTrue; import java.util.Iterator; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.runners.MockitoJUnitRunner; import com.google.common.collect.ImmutableList; import net.sourceforge.jwbf.core.actions.util.HttpAction; import net.sourceforge.jwbf.mediawiki.MediaWiki; import net.sourceforge.jwbf.mediawiki.bots.MediaWikiBot; import net.sourceforge.jwbf.mediawiki.contentRep.CategoryItem; @RunWith(MockitoJUnitRunner.class) public class CategoryMembersTest { private ImmutableList<Integer> ns = ImmutableList.of(MediaWiki.NS_MAIN); @Spy private CategoryMembers testee = new CategoryMembers(Mockito.mock(MediaWikiBot.class), "A", ns) { @Override protected Iterator<CategoryItem> copy() { return null; } @Override protected HttpAction prepareNextRequest() { return null; } }; @Test public void testParseArticleTitles() { // GIVEN / WHEN ImmutableList<CategoryItem> result = testee.parseElements(BaseQueryTest.emptyXml()); // THEN assertTrue(result.isEmpty()); } }
26
88
0.736378
48bfc1c2f6dcbacfc840d03f64bf30045d2b29eb
1,661
/* * Copyright 2016 David Xu. 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.crcrch.chromatictuner; import android.os.Parcel; import com.github.mikephil.charting.data.Entry; /** * Compatibility for MPAndroidChart. */ public class FloatArrayEntry extends Entry { private final float[] array; protected final int index; public FloatArrayEntry(float[] array, int index) { this.array = array; this.index = index; } @Override public float getX() { return index; } @Override public void setX(float x) { throw new UnsupportedOperationException(); } @Override public Entry copy() { throw new UnsupportedOperationException(); } @Override public int describeContents() { throw new UnsupportedOperationException(); } @Override public void writeToParcel(Parcel dest, int flags) { throw new UnsupportedOperationException(); } @Override public float getY() { return array[index]; } @Override public void setY(float y) { array[index] = y; } }
24.426471
82
0.671884
78a3e3ebf3336fd66709d30986de713261d9b5b2
561
package no.nav.testnav.libs.dto.syntperson.v1; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.NoArgsConstructor; import lombok.Value; @Value @Builder @AllArgsConstructor @NoArgsConstructor(force = true) public class SyntPersonDTO { @JsonProperty String slektsnavn; @JsonProperty String fornavn; @JsonProperty String adressenavn; @JsonProperty String postnummer; @JsonProperty String kommunenummer; @JsonProperty String fodselsdato; }
21.576923
53
0.766488
7d534b96e4e18a2eb9ad2236f9851364dedcd4be
282
package org.kakara.engine.exceptions.render; /** * When an exception occurs when a shader was not found. * * @since 1.0-Pre4 */ public class ShaderNotFoundException extends RuntimeException { public ShaderNotFoundException(String message) { super(message); } }
21.692308
63
0.719858
f71dc80b856a9c94dea65de983f27777a1d67870
2,639
package app.controllers.ajax; import java.io.IOException; import java.time.OffsetDateTime; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import app.controllers.AbstractController; import app.daos.CardDao; import app.model.PersistenceManager; import app.model.entities.CardInstance; import app.model.entities.CardPlan; import app.model.entities.CardReview; import app.model.planner.Planner; import app.model.planner.PlannerResult; import app.model.planner.ReviewValues; @WebServlet("/AjaxSaveReview.go") public class ControllerAjaxSaveReview extends AbstractController { private static final long serialVersionUID = 1L; @Override protected void executePost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { saveReview(request); returnJson(response, "{}"); } catch (Throwable t) { Log log = LogFactory.getLog(this.getClass()); log.debug(t.getMessage()); returnJsonError(response, ""); } } private void saveReview(HttpServletRequest request) { EntityManager em = PersistenceManager.INSTANCE.getEM(); EntityTransaction transaction = em.getTransaction(); transaction.begin(); try { CardDao cardDao = new CardDao(em); int cardInstanceId = getUnsignedIntParameter(request, "cardInstanceId"); CardInstance cardInstance = cardDao.getCardInstance(cardInstanceId); if (cardInstance == null) { return; } OffsetDateTime now = OffsetDateTime.now(); CardPlan plan = cardInstance.getPlan(); if (plan.getNextDate() != null && now.isBefore(plan.getNextDate())) { return; } int value = getUnsignedIntParameter(request, "value"); ReviewValues reviewValue = ReviewValues.getFromOrdinal(value); if (reviewValue == null) { return; } PlannerResult plannerResult = Planner.planNext( reviewValue, now, plan.getLastDate()); plan.setLastDate(now); plan.setLastDays(plannerResult.getPassedDays()); plan.setNextDate(plannerResult.getNextDate()); plan.setNextDays(plannerResult.getDaysNext()); CardReview review = cardInstance.addReview(); review.setDateTime(now); review.setValue(reviewValue); transaction.commit(); } finally { if (transaction != null && transaction.isActive()) { transaction.rollback(); } } } }
24.211009
75
0.742327
61642942938143ea8e7c0a6baa1b860de66271bf
4,153
/* Copyright (c) 2013 bergerkiller 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 tk.martijn_heil.nincore.api.util; import org.jetbrains.annotations.NotNull; /** * A nanosecond stop watch used to measure code execution times * * @author bergerkiller */ public class StopWatch { /** * A global testing StopWatch that can be used when debugging */ public static final StopWatch instance = new StopWatch(); private long prevtime; private long prevdur; /** * Starts this Stop Watch * * @return This Stop Watch */ @NotNull public StopWatch start() { this.prevtime = System.nanoTime(); return this; } /** * Clears the times of this Stop Watch * * @return This Stop Watch */ @NotNull public StopWatch reset() { this.prevtime = 0; this.prevdur = 0; return this; } /** * Gets the current total duration of this Stop Watch in milliseconds * * @return Total time in milliseconds */ public double get() { return (double) prevdur / 1E6D; } /** * Gets the current total duration of this Stop Watch in milliseconds * * @param scale to use * @return Total time in milliseconds divided by the scale */ public double get(int scale) { return (double) prevdur / 1E6D / (double) scale; } /** * Sets a new elapsed time using a Strength to average the value * * @param elapsednanotime to set to * @param strength to use [0 - 1] * @return This Stop Watch */ @NotNull public StopWatch set(long elapsednanotime, double strength) { elapsednanotime += (1.0 - strength) * (this.prevdur - elapsednanotime); this.prevdur = elapsednanotime; return this; } /** * Sets a new elapsed time * * @param elapsednanotime to set to * @return This Stop Watch */ public StopWatch set(long elapsednanotime) { return this.set(elapsednanotime, 1.0); } /** * Performs the next measurement * * @return This Stop Watch */ public StopWatch next() { return this.next(1.0); } /** * Stops the measurement * * @return This Stop Watch */ public StopWatch stop() { return this.stop(1.0); } /** * Performs the next measurement * * @return This Stop Watch */ public StopWatch next(double strength) { return this.set(this.prevdur - prevtime + System.nanoTime(), strength).start(); } /** * Stops the measurement * * @return This Stop Watch */ public StopWatch stop(double strength) { return this.set(System.nanoTime() - this.prevtime, strength).start(); } /** * Logs the current duration to the server console * * @param name to log for * @return This Stop Watch */ @NotNull public StopWatch log(final String name) { System.out.println(name + ": " + this.get() + " ms"); return this; } }
23.331461
87
0.629184
b911ef06bc6429de3736520e1b4bca28da74bcb1
2,085
package x0961h.aoc16.day13; import x0961h.aoc16.utils.Point; import java.io.IOException; import java.util.HashSet; import java.util.Set; import java.util.TreeSet; /** * Created by 0x0961h on 14.12.16. */ public class DaySolver { private static final double TIE_BREAKER = 1.0 / 100.0; private static TreeSet<AStarPoint> queue; private static Set<AStarPoint> visited; public static void main(String[] args) throws IOException { System.out.println("Result = " + solve(1358, 31, 39)); } public static long solve(int favNum, int xt, int yt) { AStarPoint p0 = new AStarPoint(1, 1); AStarPoint pt = new AStarPoint(xt, yt); queue = new TreeSet<>( (o1, o2) -> (o1.manhattan(pt) * (1.0 + TIE_BREAKER)) < (o2.manhattan(pt) * (1.0 + TIE_BREAKER)) ? -1 : +1 ); visited = new HashSet<>(); visited.add(p0); pushToQueue(favNum, p0.next().right()); pushToQueue(favNum, p0.next().left()); pushToQueue(favNum, p0.next().up()); pushToQueue(favNum, p0.next().down()); while (!queue.isEmpty() && !queue.first().equals(pt)) { AStarPoint q = queue.pollFirst(); pushToQueue(favNum, q.next().right()); pushToQueue(favNum, q.next().left()); pushToQueue(favNum, q.next().up()); pushToQueue(favNum, q.next().down()); visited.add(q); } int steps = -1; AStarPoint p = queue.pollFirst(); while (p != null) { steps++; p = p.previous; } return steps; } private static void pushToQueue(int favNum, AStarPoint p) { if (p.x < 0 || p.y < 0) return; if (isWall(favNum, p)) return; if (visited.contains(p)) return; queue.add(p); } public static Boolean isWall(int favNum, Point p) { return Long. toBinaryString(p.x * p.x + 3 * p.x + 2 * p.x * p.y + p.y + p.y * p.y + favNum). replaceAll("0", ""). length() % 2 == 1; } }
28.561644
121
0.546283
833fadeb00f2818ef29a56de85e5ad1ea3dabbb2
3,580
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. package org.cef.handler; import org.cef.CefApp.CefAppState; import org.cef.callback.CefCommandLine; import org.cef.callback.CefSchemeRegistrar; /** * Implement this interface to provide handler implementations. Methods will be * called by the process and/or thread indicated. */ public interface CefAppHandler { /** * Provides an opportunity to view and/or modify command-line arguments before * processing by CEF and Chromium. The |process_type| value will be empty for * the browser process. Be cautious when using this method to modify * command-line arguments for non-browser processes as this may result in * undefined behavior including crashes. * * @param process_type type of process (empty for browser process). * @param command_line values of the command line. */ public void onBeforeCommandLineProcessing(String process_type, CefCommandLine command_line); /** * Provides an opportunity to hook into the native shutdown process. This * method is invoked if the user tries to terminate the app by sending the * corresponding key code (e.g. on Mac: CMD+Q) or something similar. If you * want to proceed with the default behavior of the native system, return * false. If you want to abort the terminate or if you want to implement your * own shutdown sequence return true and do the cleanup on your own. * * @return false to proceed with the default behavior, true to abort * terminate. */ public boolean onBeforeTerminate(); /** * Implement this method to get state changes of the CefApp. * See {@link CefAppState} for a complete list of possible states. * <p> * For example, this method can be used e.g. to get informed if CefApp has * completed its initialization or its shutdown process. * * @param state The current state of CefApp. */ public void stateHasChanged(CefAppState state); /** * Provides an opportunity to register custom schemes. Do not keep a reference * to the |registrar| object. This method is called on the main thread for * each process and the registered schemes should be the same across all * processes. */ public void onRegisterCustomSchemes(CefSchemeRegistrar registrar); // Inherited of CefBrowserProcessHandler /** * Called on the browser process UI thread immediately after the CEF context * has been initialized. */ public void onContextInitialized(); /** * Return the handler for printing on Linux. If a print handler is not * provided then printing will not be supported on the Linux platform. * * @return a reference to a print handler implementation */ public CefPrintHandler getPrintHandler(); /** * Called from any thread when work has been scheduled for the browser process * main (UI) thread. This callback should schedule a * CefApp.DoMessageLoopWork() call to happen on the main (UI) thread. * |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0 * then the call should happen reasonably soon. If |delay_ms| is > 0 then the * call should be scheduled to happen after the specified delay and any * currently pending scheduled call should be cancelled. */ public void onScheduleMessagePumpWork(long delay_ms); }
41.149425
96
0.710335
6c28805bc11b0550b7d13c38a9c23f7c26cd5e24
943
package com.books.suanfa4.d1._1; /** * page 3 * 欧几里得算法,算两个非负整数p/q的最大公约数 * * Created by Administrator on 2017/6/12 0012. */ public class P3Test { public static void main(String[] args) { int gcd = gcd(6, 2); System.out.println(gcd); double c = 256; double sqrt = sqrt(c); System.out.println(sqrt); } /** * 若q为0,则最大公约数为p,否则将p除以q得到余数r, * p和q的最大公约数即为q和r的最大公约数 * * @param p * @param q * @return */ public static int gcd(int p, int q) { if (q == 0) return p; int r = p % q; return gcd(q, r); } /** * Page13 计算平方根(牛顿迭代法) * * @param c * @return */ public static double sqrt(double c) { if (c < 0) return Double.NaN; double err = 1e-15; double t = c; while (Math.abs(t - c/t) > err * t) { t = (c/t + t) / 2.0; } return t; } }
18.86
46
0.481442
7aaec7f547903f3ea8098381501a7bbd8f95a5bd
4,992
package utils; import java.io.BufferedReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; public class CallFHIR { public HashMap<String,ArrayList<String>> getSpecialists() throws ClientProtocolException, IOException { String patientUrl = "https://taurus.i3l.gatech.edu:8443/HealthPort/fhir/Patient?_count=100&_format=json"; int count = 0; int patientRecords = 100; HashMap<String, ArrayList<String>> conditionDoctorMap = new HashMap(); ArrayList<String> patientIds = new ArrayList<>(); while(count < patientRecords) { try { HttpGet request = new HttpGet(patientUrl); CloseableHttpClient client = HttpClientBuilder.create().build(); HttpResponse response = client.execute(request); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = rd.readLine(); Map jsonData = PlayUtilities.getMapFromJson(line); if(count == 0) { patientUrl = (String) ((Map)((ArrayList)jsonData.get("link")).get(1)).get("href"); //patientRecords = Integer.parseInt((String)jsonData.get("totalResults")); } else patientUrl = (String) ((Map)((ArrayList)jsonData.get("link")).get(2)).get("href"); ArrayList entry=(ArrayList) jsonData.get("entry"); for (int i =0; i<entry.size();i++) { count += 1; Map identifier =(Map) ((ArrayList) ((Map) ((Map)entry.get(i)).get("content")).get("identifier")).get(0); String patientId = (String)identifier.get("value"); patientIds.add(patientId); } } catch(Exception ex) { ex.printStackTrace(); } } HashMap<String,String> patientConditions = new HashMap<>(); for(String pid:patientIds) { String conditionSearchUrl = "https://taurus.i3l.gatech.edu:8443/HealthPort/fhir/Condition?subject:Patient=" + pid + "&_format=json"; HttpGet request = new HttpGet(conditionSearchUrl); CloseableHttpClient client = HttpClientBuilder.create().build(); HttpResponse response = client.execute(request); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = rd.readLine(); Map jsonData = PlayUtilities.getMapFromJson(line); if(jsonData != null) { ArrayList entry=(ArrayList) jsonData.get("entry"); Map code =(Map)((Map) ((Map)entry.get(0)).get("content")).get("code"); String condition = (String) ((Map)((ArrayList)code.get("coding")).get(0)).get("display"); //System.out.println(pid + ": "+condition); patientConditions.put(pid, condition); } } for(String pid:patientIds) { String doctorSearchUrl = "https://taurus.i3l.gatech.edu:8443/HealthPort/fhir/MedicationPrescription?subject:Patient=" + pid + "&_format=json"; HttpGet request = new HttpGet(doctorSearchUrl); CloseableHttpClient client = HttpClientBuilder.create().build(); HttpResponse response = client.execute(request); BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent())); String line = rd.readLine(); Map jsonData = PlayUtilities.getMapFromJson(line); if(jsonData != null) { ArrayList entry=(ArrayList) jsonData.get("entry"); Map prescriber =(Map)((Map) ((Map)entry.get(0)).get("content")).get("prescriber"); String dr = (String) prescriber.get("display"); ArrayList<String> docs = null; docs = conditionDoctorMap.get(patientConditions.get(pid)); if(docs != null && docs.size() < 6) { if(!docs.contains(dr)) { docs.add(dr); } } else if(docs == null){ docs = new ArrayList<>(); docs.add(dr); } conditionDoctorMap.put(patientConditions.get(pid), docs); // System.out.println(patientConditions.get(pid)+" doctors are: "); // for(String d: docs) // { // System.out.println(d); // } } } return conditionDoctorMap; } public void writeToFile(HashMap<String,ArrayList<String>> conditionDoctorMap) throws IOException { String fname = "conditionDoctorMap.csv"; FileWriter writer = new FileWriter(fname); for (Entry<String, ArrayList<String>> e : conditionDoctorMap.entrySet()) { String vals = ""; for(String s: e.getValue()) { vals += s+" "; } writer.append(e.getKey()); writer.append(','); writer.append(vals); writer.append('\n'); } writer.flush(); writer.close(); } public static void main(String[] args) throws ClientProtocolException, IOException{ CallFHIR fhirApi = new CallFHIR(); HashMap<String,ArrayList<String>> conditionDoctorMap = fhirApi.getSpecialists(); fhirApi.writeToFile(conditionDoctorMap); } }
35.404255
145
0.692508
615ff840fa8cd3f5f3300f7e7162cadbcb7bb009
144
package org.modelcatalogue.core.policy; public enum VerificationPhase { PROPERTY_CHECK, EXTENSIONS_CHECK, FINALIZATION_CHECK; }
14.4
39
0.756944
46ed12d905613c1708f7cb8978a383f6daf61409
15,513
package org.openstreetmap.atlas.utilities.configuration; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; import org.openstreetmap.atlas.exception.CoreException; import org.openstreetmap.atlas.geography.MultiPolygon; import org.openstreetmap.atlas.geography.atlas.items.AtlasEntity; import org.openstreetmap.atlas.geography.converters.WkbMultiPolygonConverter; import org.openstreetmap.atlas.geography.converters.WktMultiPolygonConverter; import org.openstreetmap.atlas.streaming.resource.StringResource; import org.openstreetmap.atlas.tags.Taggable; import org.openstreetmap.atlas.tags.filters.RegexTaggableFilter; import org.openstreetmap.atlas.tags.filters.TaggableFilter; import org.openstreetmap.atlas.tags.filters.matcher.TaggableMatcher; import org.openstreetmap.atlas.utilities.conversion.HexStringByteArrayConverter; import org.openstreetmap.atlas.utilities.conversion.StringToPredicateConverter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.Lists; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; /** * This class reads in a configuration file with a specific schema and creates filters based on the * predicates and taggable filter specified in the file. Take a look at water-handlers.json for * reference * * @author matthieun */ public final class ConfiguredFilter implements Predicate<AtlasEntity>, Serializable { public static final String CONFIGURATION_GLOBAL = "global"; public static final String DEFAULT = "default"; public static final ConfiguredFilter NO_FILTER = new ConfiguredFilter(); public static final String CONFIGURATION_ROOT = CONFIGURATION_GLOBAL + ".filters"; /* * JSON constants for the toJson method. We should probably handle this better so that we do not * duplicate String literals. */ public static final String TYPE_JSON_PROPERTY_VALUE = "_filter"; public static final String NAME_JSON_PROPERTY = "name"; public static final String PREDICATE_JSON_PROPERTY = "predicate"; public static final String UNSAFE_PREDICATE_JSON_PROPERTY = "unsafePredicate"; public static final String IMPORTS_JSON_PROPERTY = "imports"; public static final String TAGGABLE_FILTER_JSON_PROPERTY = "taggableFilter"; public static final String REGEX_TAGGABLE_FILTER_JSON_PROPERTY = "regexTaggableFilter"; public static final String TAGGABLE_MATCHER_JSON_PROPERTY = "taggableMatcher"; public static final String NO_EXPANSION_JSON_PROPERTY = "noExpansion"; private static final long serialVersionUID = 7503301238426719144L; private static final Logger logger = LoggerFactory.getLogger(ConfiguredFilter.class); private static final String CONFIGURATION_PREDICATE_COMMAND = "predicate.command"; private static final String CONFIGURATION_PREDICATE_UNSAFE_COMMAND = "predicate.unsafeCommand"; private static final String CONFIGURATION_PREDICATE_IMPORTS = "predicate.imports"; private static final String CONFIGURATION_TAGGABLE_FILTER = "taggableFilter"; private static final String CONFIGURATION_REGEX_TAGGABLE_FILTER = "regexTaggableFilter"; private static final String CONFIGURATION_TAGGABLE_MATCHER = "taggableMatcher"; private static final String CONFIGURATION_WKT_FILTER = "geometry.wkt"; private static final String CONFIGURATION_WKB_FILTER = "geometry.wkb"; private static final String CONFIGURATION_HINT_NO_EXPANSION = "hint.noExpansion"; private static final WktMultiPolygonConverter WKT_MULTI_POLYGON_CONVERTER = new WktMultiPolygonConverter(); private static final WkbMultiPolygonConverter WKB_MULTI_POLYGON_CONVERTER = new WkbMultiPolygonConverter(); private static final HexStringByteArrayConverter HEX_STRING_BYTE_ARRAY_CONVERTER = new HexStringByteArrayConverter(); private final String name; private final String predicate; private final String unsafePredicate; private transient Predicate<AtlasEntity> filter; private final List<String> imports; private final String taggableFilter; private final String regexTaggableFilter; private final String taggableMatcher; private final boolean noExpansion; private final List<MultiPolygon> geometryBasedFilters; public static ConfiguredFilter from(final String name, final Configuration configuration) { return from(CONFIGURATION_ROOT, name, configuration); } /** * Create a new {@link ConfiguredFilter}. * <p> * For example, in the following json configuration: * * <pre> * {@code * { * "my": * { * "conf": * { * "filter": * { * "predicate": "....", * "geometry.wkb": * [ * "...", "..." * ], * "taggableFilter": "...", * "regexTaggableFilter": "...", * "taggableMatcher": "..." * } * } * } * } * } * </pre> * * the filter can be accessed using "my.conf" as root, and "filter" as name. * * @param root * The root of the configuration hierarchy, where to search for the name of the * filter. * @param name * The name of the filter, which is right under the root in the configuration * @param configuration * The {@link Configuration} containing the configured filter * @return The constructed {@link ConfiguredFilter} */ public static ConfiguredFilter from(final String root, final String name, final Configuration configuration) { if (DEFAULT.equals(name)) { return getDefaultFilter(root, configuration); } if (!isPresent(root, name, configuration)) { logger.warn( "Attempted to create ConfiguredFilter called \"{}\" but it was not found. It will be swapped with default passthrough filter.", name); return getDefaultFilter(root, configuration); } return new ConfiguredFilter(root, name, configuration); } public static ConfiguredFilter getDefaultFilter(final Configuration configuration) { return getDefaultFilter(CONFIGURATION_ROOT, configuration); } public static ConfiguredFilter getDefaultFilter(final String root, final Configuration configuration) { if (ConfiguredFilter.isPresent(root, DEFAULT, configuration)) { return new ConfiguredFilter(root, DEFAULT, configuration); } return NO_FILTER; } public static boolean isPresent(final String name, final Configuration configuration) { return isPresent(CONFIGURATION_ROOT, name, configuration); } public static boolean isPresent(final String root, final String name, final Configuration configuration) { return new ConfigurationReader(root).isPresent(configuration, name); } private ConfiguredFilter() { this(CONFIGURATION_ROOT, "NO_FILTER", new StandardConfiguration(new StringResource("{}"))); } private ConfiguredFilter(final String root, final String name, final Configuration configuration) { this.name = name; String readerRoot = ""; if (root != null && !root.isEmpty()) { readerRoot = root + "."; } final ConfigurationReader reader = new ConfigurationReader(readerRoot + name); this.predicate = reader.configurationValue(configuration, CONFIGURATION_PREDICATE_COMMAND, ""); this.unsafePredicate = reader.configurationValue(configuration, CONFIGURATION_PREDICATE_UNSAFE_COMMAND, ""); this.imports = reader.configurationValue(configuration, CONFIGURATION_PREDICATE_IMPORTS, Lists.newArrayList()); this.taggableFilter = reader.configurationValue(configuration, CONFIGURATION_TAGGABLE_FILTER, ""); this.regexTaggableFilter = reader.configurationValue(configuration, CONFIGURATION_REGEX_TAGGABLE_FILTER, ""); this.taggableMatcher = reader.configurationValue(configuration, CONFIGURATION_TAGGABLE_MATCHER, ""); this.noExpansion = readBoolean(configuration, reader, CONFIGURATION_HINT_NO_EXPANSION, false); this.geometryBasedFilters = readGeometries(configuration, reader); } public List<MultiPolygon> getGeometryBasedFilters() { return new ArrayList<>(this.geometryBasedFilters); } public String getName() { return this.name; } public boolean isNoExpansion() { return this.noExpansion; } @Override public boolean test(final AtlasEntity atlasEntity) { return getFilter().test(atlasEntity); } public boolean test(final Taggable taggable) { return TaggableFilter.forDefinition(this.taggableFilter).test(taggable); } public JsonObject toJson() { final JsonObject filterObject = new JsonObject(); filterObject.addProperty("type", TYPE_JSON_PROPERTY_VALUE); filterObject.addProperty(NAME_JSON_PROPERTY, this.name); if (!this.predicate.isEmpty()) { filterObject.addProperty(PREDICATE_JSON_PROPERTY, this.predicate); } if (!this.unsafePredicate.isEmpty()) { filterObject.addProperty(UNSAFE_PREDICATE_JSON_PROPERTY, this.unsafePredicate); } final JsonArray importsArray = new JsonArray(); if (!this.imports.isEmpty()) { for (final String importString : this.imports) { importsArray.add(new JsonPrimitive(importString)); } filterObject.add(IMPORTS_JSON_PROPERTY, importsArray); } if (!this.taggableFilter.isEmpty()) { filterObject.addProperty(TAGGABLE_FILTER_JSON_PROPERTY, this.taggableFilter); // NOSONAR } if (!this.regexTaggableFilter.isEmpty()) { filterObject.addProperty(REGEX_TAGGABLE_FILTER_JSON_PROPERTY, this.regexTaggableFilter); // NOSONAR } if (!this.taggableMatcher.isEmpty()) { filterObject.addProperty(TAGGABLE_MATCHER_JSON_PROPERTY, this.taggableMatcher); // NOSONAR } filterObject.addProperty(NO_EXPANSION_JSON_PROPERTY, this.noExpansion); return filterObject; } @Override public String toString() { return this.name; } private Predicate<AtlasEntity> geometryPredicate() { if (this.geometryBasedFilters.isEmpty()) { return atlasEntity -> true; } else { return atlasEntity -> { for (final MultiPolygon multiPolygon : this.geometryBasedFilters) { if (atlasEntity.intersects(multiPolygon)) { return true; } } return false; }; } } private Predicate<AtlasEntity> getFilter() { if (this.filter == null) { Predicate<AtlasEntity> localTemporaryPredicate = atlasEntity -> true; final StringToPredicateConverter<AtlasEntity> predicateReader = new StringToPredicateConverter<>(); predicateReader.withAddedStarImportPackages(this.imports); if (!this.predicate.isEmpty() && !this.unsafePredicate.isEmpty()) { throw new CoreException("Cannot specify both 'command' and 'unsafeCommand'"); } if (!this.predicate.isEmpty()) { localTemporaryPredicate = predicateReader.convert(this.predicate); } if (!this.unsafePredicate.isEmpty()) { localTemporaryPredicate = predicateReader.convertUnsafe(this.unsafePredicate); } final Predicate<AtlasEntity> localPredicate = localTemporaryPredicate; final TaggableFilter localTaggablefilter = TaggableFilter .forDefinition(this.taggableFilter); final RegexTaggableFilter localRegexTaggableFilter = new RegexTaggableFilter( this.regexTaggableFilter); final TaggableMatcher localTaggableMatcher = TaggableMatcher.from(this.taggableMatcher); final Predicate<AtlasEntity> geometryPredicate = geometryPredicate(); this.filter = atlasEntity -> localPredicate.test(atlasEntity) && localTaggablefilter.test(atlasEntity) && geometryPredicate.test(atlasEntity) && localRegexTaggableFilter.test(atlasEntity) && localTaggableMatcher.test(atlasEntity); } return this.filter; } private boolean readBoolean(final Configuration configuration, final ConfigurationReader reader, final String booleanName, final boolean defaultValue) { try { return reader.configurationValue(configuration, booleanName, defaultValue); } catch (final Exception e) { throw new CoreException("Unable to read \"{}\"", booleanName, e); } } private List<MultiPolygon> readGeometries(final Configuration configuration, final ConfigurationReader reader) { final List<MultiPolygon> result = new ArrayList<>(); final String defaultValue = "N/A"; try { final List<String> values = reader.configurationValues(configuration, CONFIGURATION_WKT_FILTER, new ArrayList<>()); if (!values.isEmpty()) { result.addAll(values.stream().map(WKT_MULTI_POLYGON_CONVERTER::backwardConvert) .collect(Collectors.toList())); } } catch (final Exception e) { final String wktString = reader.configurationValue(configuration, CONFIGURATION_WKT_FILTER, defaultValue); if (!defaultValue.equals(wktString)) { result.add(WKT_MULTI_POLYGON_CONVERTER.backwardConvert(wktString)); } } try { final List<String> values = reader.configurationValues(configuration, CONFIGURATION_WKB_FILTER, new ArrayList<>()); if (!values.isEmpty()) { result.addAll(values.stream().map(HEX_STRING_BYTE_ARRAY_CONVERTER::convert) .map(WKB_MULTI_POLYGON_CONVERTER::backwardConvert) .collect(Collectors.toList())); } } catch (final Exception e) { final String wkbString = reader.configurationValue(configuration, CONFIGURATION_WKB_FILTER, defaultValue); if (!defaultValue.equals(wkbString)) { result.add(WKB_MULTI_POLYGON_CONVERTER .backwardConvert(HEX_STRING_BYTE_ARRAY_CONVERTER.convert(wkbString))); } } return result; } }
39.675192
147
0.652678
ed390283c3988c6e4233381b65d76f8bc0c77194
1,757
package rbmwsimulator.protocol.rasim.grdsrt; /** * <p>Title: Role-based Middleware Simulator (RBMW Simulator)</p> * * <p>Description: A simulator to test several role functionalities such as * role-assignment, role-monitoring, role-repair, role-execution scheduling, * role state machine, and role load-balancing algorithms. Also, we want to * experiment with two domain-specific models such as the Role-Energy (RE) model * and Role/Resource Allocation Marginal Utility (RAMU) model.</p> * * <p>Copyright: Copyright (c) 2006</p> * * <p>Company: Networking Wireless Sensors (NeWS) Lab, Wayne State University * <http://newslab.cs.wayne.edu/></p> * * @author Manish M. Kochhal <manishk@wayne.edu> * @version 2.0 */ public class MarkerInfo { private int myId; private int markers[]; private int hierarchy_level; private int nLevels; public MarkerInfo(int id) { this.myId = id; this.hierarchy_level = 0; this.nLevels = 150; this.markers = new int[this.nLevels]; for (int i = 0; i < this.nLevels; i++) this.markers[i] = -1; } public int getMarkValueAt(int level) { return this.markers[level]; } public boolean isMarked(int level) { if (this.markers[level] > 0) return true; return false; } public void markme(int level) { this.markers[level] = 1; this.nLevels = level; } public void unmarkme(int level) { this.markers[level] = -1; } public int getCurrentLevel() { return this.nLevels; } public int whoAmI() { return this.myId; } }
27.030769
80
0.593625
afdbfe30a8449845053391957f44db505950b154
338
package ru.job4j.design.isp.exx; public class MultiTool implements Tool { @Override public void toSaw() { System.out.println("Do nag!"); } @Override public void tighten() { System.out.println("Do tighten!"); } @Override public void cut() { System.out.println("Do cut!"); } }
17.789474
42
0.579882
9dce7b393cd78a6eb771bf6a9166f9bd86ebd2b1
309
package operatorExamples; public class ConditionalOperators { int x = 8; int y = 9; public void printExample5() { if(x != 1 && x != 2){ System.out.println("x != 1 && x != 2 - true"); } if(x == 8 || x != 2){ System.out.println("x == 8 || x != 2 - true"); } } }
12.36
49
0.475728
6139ca3bd6535782de67e0f2c88617a79b816787
196
package p; class A { void m() { Cell<String> c = new Cell<String>(); c.put("X"); Cell<Cell<String>> nested = new Cell<Cell<String>>(); nested.put(c); } }
16.333333
61
0.484694
45b577cabf4aedac88a09582eda7563a7f33573e
2,720
// ------------------------------------------------------------------------------ // Copyright (c) 2017 Microsoft Corporation // // 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, sub-license, 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.microsoft.graph.http; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.Objects; import javax.annotation.Nonnull; import com.microsoft.graph.serializer.AdditionalDataManager; import com.microsoft.graph.serializer.IJsonBackedObject; import com.microsoft.graph.serializer.ISerializer; /** Represents the body to use with an OData method */ public class ReferenceRequestBody implements IJsonBackedObject { private AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); /** the odata id */ @SerializedName("@odata.id") @Expose @Nonnull public String odataId; /** * Instanciates a new reference request body from the serialized payload * @param payload payload to instanciate the body from */ public ReferenceRequestBody(@Nonnull final String payload) { odataId = Objects.requireNonNull(payload, "parameter payload cannot be null"); } /** * Sets the raw JSON object * * @param serializer the serializer * @param json the JSON object to set this object to */ public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { } @Override @Nonnull public final AdditionalDataManager additionalDataManager() { return additionalDataManager; } }
38.309859
101
0.702574
62876a4b74f9962276228a04197a3a3f22ab409c
1,082
package com.appdirect.sdk.appmarket.events; import static java.util.Objects.isNull; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; @Getter @EqualsAndHashCode(callSuper = true) @NoArgsConstructor public class EventWithContextWithConfiguration extends EventWithContext { private Map<String, String> configuration = new HashMap<>(); public EventWithContextWithConfiguration( String consumerKeyUsedByTheRequest, Map<String, String []> queryParameters, EventFlag flag, String eventToken, String marketplaceUrl, Map<String, String> configuration) { super(consumerKeyUsedByTheRequest, queryParameters, flag, eventToken, marketplaceUrl); this.configuration = configuration; } /** * Returns the configuration that was passed to the endpoint when this event was received. * * @return an unmodifiable view of the configuration map. */ public Map<String, String> getConfiguration() { return new HashMap<>(isNull(configuration) ? new HashMap<>() : configuration); } }
28.473684
91
0.781885
2b97e8b0aacd1271d5d31b4a258f9a2877d402cd
1,860
package com.bitdubai.fermat_api.layer.actor_connection.common.structure_common_classes; import com.bitdubai.fermat_api.layer.all_definition.enums.Actors; import org.apache.commons.lang.Validate; /** * The class <code>ActiveActorIdentityInformation</code> * represents an actor identity with all the basic information. * * An Actor Identity Information contains all the basic information of an actor identity. * * <p/> * Created by Leon Acosta - (laion.cj91@gmail.com) on 14/12/2015. * * @author lnacosta * @version 1.0 * @since Java JDK 1.7 */ public class ActorIdentityInformation { private final String publicKey; private final Actors actorType; private final String alias ; private final byte[] image ; public ActorIdentityInformation(final String publicKey, final Actors actorType, final String alias , final byte[] image ) { Validate.notNull(publicKey, "The Public Key can't be null."); Validate.notNull(actorType, "The Actor Type can't be null."); Validate.notNull(alias , "The alias can't be null." ); Validate.notNull(image , "The image can't be null." ); this.publicKey = publicKey; this.actorType = actorType; this.alias = alias ; this.image = image ; } /** * @return a string representing the public key. */ public final String getPublicKey() { return publicKey; } /** * @return an element of Actors enum representing the type of the actor identity. */ public final Actors getActorType() { return actorType; } public String getAlias() { return alias; } public byte[] getImage() { return image; } }
28.615385
89
0.616129