code
stringlengths
3
1.04M
repo_name
stringlengths
5
109
path
stringlengths
6
306
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.04M
/** * Copyright (C) 2000 - 2011 Silverpeas * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * As a special exception to the terms and conditions of version 3.0 of * the GPL, you may redistribute this Program in connection with Free/Libre * Open Source Software ("FLOSS") applications as described in Silverpeas's * FLOSS exception. You should have received a copy of the text describing * the FLOSS exception, and it is also available here: * "http://repository.silverpeas.com/legal/licensing" * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.stratelia.webactiv.beans.admin; import java.util.ArrayList; import java.util.List; import com.silverpeas.scheduler.Scheduler; import com.silverpeas.scheduler.SchedulerEvent; import com.silverpeas.scheduler.SchedulerEventListener; import com.silverpeas.scheduler.SchedulerFactory; import com.silverpeas.scheduler.trigger.JobTrigger; import com.stratelia.silverpeas.silvertrace.SilverTrace; public class SynchroDomainScheduler implements SchedulerEventListener { public static final String ADMINSYNCHRODOMAIN_JOB_NAME = "AdminSynchroDomainJob"; private List<String> domainIds = null; public void initialize(String cron, List<String> domainIds) { try { this.domainIds = domainIds; SchedulerFactory schedulerFactory = SchedulerFactory.getFactory(); Scheduler scheduler = schedulerFactory.getScheduler(); scheduler.unscheduleJob(ADMINSYNCHRODOMAIN_JOB_NAME); JobTrigger trigger = JobTrigger.triggerAt(cron); scheduler.scheduleJob(ADMINSYNCHRODOMAIN_JOB_NAME, trigger, this); } catch (Exception e) { SilverTrace.error("admin", "SynchroDomainScheduler.initialize()", "admin.CANT_INIT_DOMAINS_SYNCHRO", e); } } public void addDomain(String id) { if (domainIds == null) { domainIds = new ArrayList<String>(); } domainIds.add(id); } public void removeDomain(String id) { if (domainIds != null) { domainIds.remove(id); } } public void doSynchro() { SilverTrace.info("admin", "SynchroDomainScheduler.doSynchro()", "root.MSG_GEN_ENTER_METHOD"); if (domainIds != null) { for (String domainId : domainIds) { try { AdminReference.getAdminService().synchronizeSilverpeasWithDomain(domainId, true); } catch (Exception e) { SilverTrace.error("admin", "SynchroDomainScheduler.doSynchro()", "admin.MSG_ERR_SYNCHRONIZE_DOMAIN", e); } } } SilverTrace.info("admin", "SynchroDomainScheduler.doSynchro()", "root.MSG_GEN_EXIT_METHOD"); } @Override public void triggerFired(SchedulerEvent anEvent) { String jobName = anEvent.getJobExecutionContext().getJobName(); SilverTrace.debug("admin", "SynchroDomainScheduler.triggerFired()", "The job '" + jobName + "' is executed"); doSynchro(); } @Override public void jobSucceeded(SchedulerEvent anEvent) { String jobName = anEvent.getJobExecutionContext().getJobName(); SilverTrace.debug("admin", "SynchroDomainScheduler.jobSucceeded()", "The job '" + jobName + "' was successfull"); } @Override public void jobFailed(SchedulerEvent anEvent) { String jobName = anEvent.getJobExecutionContext().getJobName(); SilverTrace.error("admin", "SynchroDomainScheduler.jobFailed", "The job '" + jobName + "' was not successfull"); } }
stephaneperry/Silverpeas-Core
lib-core/src/main/java/com/stratelia/webactiv/beans/admin/SynchroDomainScheduler.java
Java
agpl-3.0
3,969
package cz.plichtanet.honza; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 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 javax.sql.DataSource; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/", "/robots.txt", "/index.jsp", "/.well-known/**", "/static/**").permitAll() .antMatchers("/downloadPdf/**").hasRole("PDF_USER") .antMatchers("/dir/**", "/setPassword", "/addUser").hasRole("ADMIN") .antMatchers("/helloagain").hasRole("ADMIN") .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .and() .logout() .permitAll() .and() .exceptionHandling() .accessDeniedPage("/403") .and() .csrf(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { /* // pro lokalni testovani bez databaze auth .inMemoryAuthentication() .withUser("jenda").password("604321192").roles("USER","PDF_USER","ADMIN"); */ PasswordEncoder encoder = passwordEncoder(); auth.jdbcAuthentication().dataSource(dataSource).passwordEncoder(encoder) /* .withUser("petra").password(encoder.encode("737438719")).roles("USER") .and() .withUser("kuba").password(encoder.encode("737438719")).roles("USER") .and() .withUser("jenda").password(encoder.encode("604321192")).roles("USER","ADMIN") */ ; } @Bean public PasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } }
plichjan/pdfDriveWebApp
src/main/java/cz/plichtanet/honza/WebSecurityConfig.java
Java
agpl-3.0
2,624
package mezz.texturedump.dumpers; import com.google.gson.stream.JsonWriter; import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.StartupMessageManager; import net.minecraftforge.forgespi.language.IModFileInfo; import net.minecraftforge.forgespi.language.IModInfo; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import javax.annotation.Nullable; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class ModStatsDumper { private static final Logger LOGGER = LogManager.getLogger(); public Path saveModStats(String name, TextureAtlas map, Path modStatsDir) throws IOException { Map<String, Long> modPixelCounts = map.texturesByName.values().stream() .collect(Collectors.groupingBy( sprite -> sprite.getName().getNamespace(), Collectors.summingLong(sprite -> (long) sprite.getWidth() * sprite.getHeight())) ); final long totalPixels = modPixelCounts.values().stream().mapToLong(longValue -> longValue).sum(); final String filename = name + "_mod_statistics"; Path output = modStatsDir.resolve(filename + ".js"); List<Map.Entry<String, Long>> sortedEntries = modPixelCounts.entrySet().stream() .sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) .collect(Collectors.toList()); StartupMessageManager.addModMessage("Dumping Mod TextureMap Statistics"); FileWriter fileWriter = new FileWriter(output.toFile()); fileWriter.write("var modStatistics = \n//Start of Data\n"); JsonWriter jsonWriter = new JsonWriter(fileWriter); jsonWriter.setIndent(" "); jsonWriter.beginArray(); { for (Map.Entry<String, Long> modPixels : sortedEntries) { String resourceDomain = modPixels.getKey(); long pixelCount = modPixels.getValue(); writeModStatisticsObject(jsonWriter, resourceDomain, pixelCount, totalPixels); } } jsonWriter.endArray(); jsonWriter.close(); fileWriter.close(); LOGGER.info("Saved mod statistics to {}.", output.toString()); return output; } private static void writeModStatisticsObject(JsonWriter jsonWriter, String resourceDomain, long pixelCount, long totalPixels) throws IOException { IModInfo modInfo = getModMetadata(resourceDomain); String modName = modInfo != null ? modInfo.getDisplayName() : ""; jsonWriter.beginObject() .name("resourceDomain").value(resourceDomain) .name("pixelCount").value(pixelCount) .name("percentOfTextureMap").value(pixelCount * 100f / totalPixels) .name("modName").value(modName) .name("url").value(getModConfigValue(modInfo, "displayURL")) .name("issueTrackerUrl").value(getModConfigValue(modInfo, "issueTrackerURL")); jsonWriter.name("authors").beginArray(); { String authors = getModConfigValue(modInfo, "authors"); if (!authors.isEmpty()) { String[] authorList = authors.split(","); for (String author : authorList) { jsonWriter.value(author.trim()); } } } jsonWriter.endArray(); jsonWriter.endObject(); } private static String getModConfigValue(@Nullable IModInfo modInfo, String key) { if (modInfo == null) { return ""; } Map<String, Object> modConfig = modInfo.getModProperties(); Object value = modConfig.getOrDefault(key, ""); if (value instanceof String) { return (String) value; } return ""; } @Nullable private static IModInfo getModMetadata(String resourceDomain) { ModList modList = ModList.get(); IModFileInfo modFileInfo = modList.getModFileById(resourceDomain); if (modFileInfo == null) { return null; } return modFileInfo.getMods() .stream() .findFirst() .orElse(null); } }
mezz/TextureDump
src/main/java/mezz/texturedump/dumpers/ModStatsDumper.java
Java
lgpl-2.1
3,817
/* * Copyright 2005-2006 UniVis Explorer development team. * * This file is part of UniVis Explorer * (http://phobos22.inf.uni-konstanz.de/univis). * * UniVis Explorer is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * Please see COPYING for the complete licence. */ package unikn.dbis.univis.message; /** * TODO: document me!!! * <p/> * <code>Internationalizable+</code>. * <p/> * User: raedler, weiler * Date: 18.05.2006 * Time: 01:39:22 * * @author Roman R&auml;dle * @author Andreas Weiler * @version $Id: Internationalizable.java 338 2006-10-08 23:11:30Z raedler $ * @since UniVis Explorer 0.1 */ public interface Internationalizable { public void internationalize(); }
raedle/univis
src/java/unikn/dbis/univis/message/Internationalizable.java
Java
lgpl-2.1
899
package soot.jimple.toolkits.callgraph; /*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 2003 Ondrej Lhotak * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; import soot.AnySubType; import soot.ArrayType; import soot.FastHierarchy; import soot.G; import soot.NullType; import soot.PhaseOptions; import soot.RefType; import soot.Scene; import soot.Singletons; import soot.SootClass; import soot.SootMethod; import soot.Type; import soot.jimple.SpecialInvokeExpr; import soot.options.CGOptions; import soot.toolkits.scalar.Pair; import soot.util.Chain; import soot.util.HashMultiMap; import soot.util.LargeNumberedMap; import soot.util.MultiMap; import soot.util.NumberedString; import soot.util.SmallNumberedMap; import soot.util.queue.ChunkedQueue; /** * Resolves virtual calls. * * @author Ondrej Lhotak */ public class VirtualCalls { private CGOptions options = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")); public VirtualCalls(Singletons.Global g) { } public static VirtualCalls v() { return G.v().soot_jimple_toolkits_callgraph_VirtualCalls(); } private final LargeNumberedMap<Type, SmallNumberedMap<SootMethod>> typeToVtbl = new LargeNumberedMap<Type, SmallNumberedMap<SootMethod>>(Scene.v().getTypeNumberer()); public SootMethod resolveSpecial(SpecialInvokeExpr iie, NumberedString subSig, SootMethod container) { return resolveSpecial(iie, subSig, container, false); } public SootMethod resolveSpecial(SpecialInvokeExpr iie, NumberedString subSig, SootMethod container, boolean appOnly) { SootMethod target = iie.getMethod(); /* cf. JVM spec, invokespecial instruction */ if (Scene.v().getOrMakeFastHierarchy().canStoreType(container.getDeclaringClass().getType(), target.getDeclaringClass().getType()) && container.getDeclaringClass().getType() != target.getDeclaringClass().getType() && !target.getName().equals("<init>") && subSig != sigClinit) { return resolveNonSpecial(container.getDeclaringClass().getSuperclass().getType(), subSig, appOnly); } else { return target; } } public SootMethod resolveNonSpecial(RefType t, NumberedString subSig) { return resolveNonSpecial(t, subSig, false); } public SootMethod resolveNonSpecial(RefType t, NumberedString subSig, boolean appOnly) { SmallNumberedMap<SootMethod> vtbl = typeToVtbl.get(t); if (vtbl == null) { typeToVtbl.put(t, vtbl = new SmallNumberedMap<SootMethod>()); } SootMethod ret = vtbl.get(subSig); if (ret != null) { return ret; } SootClass cls = t.getSootClass(); if (appOnly && cls.isLibraryClass()) { return null; } SootMethod m = cls.getMethodUnsafe(subSig); if (m != null) { if (!m.isAbstract()) { ret = m; } } else { SootClass c = cls.getSuperclassUnsafe(); if (c != null) { ret = resolveNonSpecial(c.getType(), subSig); } } vtbl.put(subSig, ret); return ret; } protected MultiMap<Type, Type> baseToSubTypes = new HashMultiMap<Type, Type>(); protected MultiMap<Pair<Type, NumberedString>, Pair<Type, NumberedString>> baseToPossibleSubTypes = new HashMultiMap<Pair<Type, NumberedString>, Pair<Type, NumberedString>>(); public void resolve(Type t, Type declaredType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets) { resolve(t, declaredType, null, subSig, container, targets); } public void resolve(Type t, Type declaredType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly) { resolve(t, declaredType, null, subSig, container, targets, appOnly); } public void resolve(Type t, Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets) { resolve(t, declaredType, sigType, subSig, container, targets, false); } public void resolve(Type t, Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly) { if (declaredType instanceof ArrayType) { declaredType = RefType.v("java.lang.Object"); } if (sigType instanceof ArrayType) { sigType = RefType.v("java.lang.Object"); } if (t instanceof ArrayType) { t = RefType.v("java.lang.Object"); } FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); if (declaredType != null && !fastHierachy.canStoreType(t, declaredType)) { return; } if (sigType != null && !fastHierachy.canStoreType(t, sigType)) { return; } if (t instanceof RefType) { SootMethod target = resolveNonSpecial((RefType) t, subSig, appOnly); if (target != null) { targets.add(target); } } else if (t instanceof AnySubType) { RefType base = ((AnySubType) t).getBase(); /* * Whenever any sub type of a specific type is considered as receiver for a method to call and the base type is an * interface, calls to existing methods with matching signature (possible implementation of method to call) are also * added. As Javas' subtyping allows contra-variance for return types and co-variance for parameters when overriding a * method, these cases are also considered here. * * Example: Classes A, B (B sub type of A), interface I with method public A foo(B b); and a class C with method public * B foo(A a) { ... }. The extended class hierarchy will contain C as possible implementation of I. * * Since Java has no multiple inheritance call by signature resolution is only activated if the base is an interface. */ if (options.library() == CGOptions.library_signature_resolution && base.getSootClass().isInterface()) { resolveLibrarySignature(declaredType, sigType, subSig, container, targets, appOnly, base); } else { resolveAnySubType(declaredType, sigType, subSig, container, targets, appOnly, base); } } else if (t instanceof NullType) { } else { throw new RuntimeException("oops " + t); } } public void resolveSuperType(Type t, Type declaredType, NumberedString subSig, ChunkedQueue<SootMethod> targets, boolean appOnly) { if (declaredType == null) { return; } if (t == null) { return; } if (declaredType instanceof ArrayType) { declaredType = RefType.v("java.lang.Object"); } if (t instanceof ArrayType) { t = RefType.v("java.lang.Object"); } if (declaredType instanceof RefType) { RefType parent = (RefType)declaredType; SootClass parentClass = parent.getSootClass(); RefType child; SootClass childClass; if (t instanceof AnySubType) { child = ((AnySubType) t).getBase(); } else if (t instanceof RefType) { child = (RefType)t; } else { return; } childClass = child.getSootClass(); FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); if (fastHierachy.canStoreClass(childClass,parentClass)) { SootMethod target = resolveNonSpecial(child, subSig, appOnly); if (target != null) { targets.add(target); } } } } protected void resolveAnySubType(Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly, RefType base) { FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); { Set<Type> subTypes = baseToSubTypes.get(base); if (subTypes != null && !subTypes.isEmpty()) { for (final Type st : subTypes) { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); } return; } } Set<Type> newSubTypes = new HashSet<>(); newSubTypes.add(base); LinkedList<SootClass> worklist = new LinkedList<SootClass>(); HashSet<SootClass> workset = new HashSet<SootClass>(); FastHierarchy fh = fastHierachy; SootClass cl = base.getSootClass(); if (workset.add(cl)) { worklist.add(cl); } while (!worklist.isEmpty()) { cl = worklist.removeFirst(); if (cl.isInterface()) { for (Iterator<SootClass> cIt = fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext();) { final SootClass c = cIt.next(); if (workset.add(c)) { worklist.add(c); } } } else { if (cl.isConcrete()) { resolve(cl.getType(), declaredType, sigType, subSig, container, targets, appOnly); newSubTypes.add(cl.getType()); } for (Iterator<SootClass> cIt = fh.getSubclassesOf(cl).iterator(); cIt.hasNext();) { final SootClass c = cIt.next(); if (workset.add(c)) { worklist.add(c); } } } } baseToSubTypes.putAll(base, newSubTypes); } protected void resolveLibrarySignature(Type declaredType, Type sigType, NumberedString subSig, SootMethod container, ChunkedQueue<SootMethod> targets, boolean appOnly, RefType base) { FastHierarchy fastHierachy = Scene.v().getOrMakeFastHierarchy(); assert (declaredType instanceof RefType); Pair<Type, NumberedString> pair = new Pair<Type, NumberedString>(base, subSig); { Set<Pair<Type, NumberedString>> types = baseToPossibleSubTypes.get(pair); // if this type and method has been resolved earlier we can // just retrieve the previous result. if (types != null) { for (Pair<Type, NumberedString> tuple : types) { Type st = tuple.getO1(); if (!fastHierachy.canStoreType(st, declaredType)) { resolve(st, st, sigType, subSig, container, targets, appOnly); } else { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); } } return; } } Set<Pair<Type, NumberedString>> types = new HashSet<Pair<Type, NumberedString>>(); // get return type; method name; parameter types String[] split = subSig.getString().replaceAll("(.*) (.*)\\((.*)\\)", "$1;$2;$3").split(";"); Type declaredReturnType = Scene.v().getType(split[0]); String declaredName = split[1]; List<Type> declaredParamTypes = new ArrayList<Type>(); // separate the parameter types if (split.length == 3) { for (String type : split[2].split(",")) { declaredParamTypes.add(Scene.v().getType(type)); } } Chain<SootClass> classes = Scene.v().getClasses(); for (SootClass sc : classes) { for (SootMethod sm : sc.getMethods()) { if (!sm.isAbstract()) { // method name has to match if (!sm.getName().equals(declaredName)) { continue; } // the return type has to be a the declared return // type or a sub type of it if (!fastHierachy.canStoreType(sm.getReturnType(), declaredReturnType)) { continue; } List<Type> paramTypes = sm.getParameterTypes(); // method parameters have to match to the declared // ones (same type or super type). if (declaredParamTypes.size() != paramTypes.size()) { continue; } boolean check = true; for (int i = 0; i < paramTypes.size(); i++) { if (!fastHierachy.canStoreType(declaredParamTypes.get(i), paramTypes.get(i))) { check = false; break; } } if (check) { Type st = sc.getType(); if (!fastHierachy.canStoreType(st, declaredType)) { // final classes can not be extended and // therefore not used in library client if (!sc.isFinal()) { NumberedString newSubSig = sm.getNumberedSubSignature(); resolve(st, st, sigType, newSubSig, container, targets, appOnly); types.add(new Pair<Type, NumberedString>(st, newSubSig)); } } else { resolve(st, declaredType, sigType, subSig, container, targets, appOnly); types.add(new Pair<Type, NumberedString>(st, subSig)); } } } } } baseToPossibleSubTypes.putAll(pair, types); } public final NumberedString sigClinit = Scene.v().getSubSigNumberer().findOrAdd("void <clinit>()"); public final NumberedString sigStart = Scene.v().getSubSigNumberer().findOrAdd("void start()"); public final NumberedString sigRun = Scene.v().getSubSigNumberer().findOrAdd("void run()"); }
plast-lab/soot
src/main/java/soot/jimple/toolkits/callgraph/VirtualCalls.java
Java
lgpl-2.1
13,477
/* * JBoss, Home of Professional Open Source. * Copyright 2021, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.wildfly.clustering.infinispan.spi.persistence.sifs; import static org.infinispan.configuration.cache.AbstractStoreConfiguration.SEGMENTED; import static org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.COMPACTION_THRESHOLD; import static org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.OPEN_FILES_LIMIT; import org.infinispan.commons.configuration.attributes.Attribute; import org.infinispan.configuration.cache.AbstractStoreConfigurationBuilder; import org.infinispan.configuration.cache.AsyncStoreConfiguration; import org.infinispan.configuration.cache.PersistenceConfigurationBuilder; import org.infinispan.configuration.global.GlobalConfiguration; import org.infinispan.configuration.global.GlobalStateConfiguration; import org.infinispan.persistence.PersistenceUtil; import org.infinispan.persistence.sifs.Log; import org.infinispan.persistence.sifs.NonBlockingSoftIndexFileStore; import org.infinispan.persistence.sifs.configuration.DataConfiguration; import org.infinispan.persistence.sifs.configuration.DataConfigurationBuilder; import org.infinispan.persistence.sifs.configuration.IndexConfiguration; import org.infinispan.persistence.sifs.configuration.IndexConfigurationBuilder; import org.infinispan.util.logging.LogFactory; /** * Workaround for ISPN-13605. * @author Paul Ferraro */ public class SoftIndexFileStoreConfigurationBuilder extends AbstractStoreConfigurationBuilder<SoftIndexFileStoreConfiguration, SoftIndexFileStoreConfigurationBuilder> { private static final Log LOG = LogFactory.getLog(SoftIndexFileStoreConfigurationBuilder.class, Log.class); protected final IndexConfigurationBuilder index = new IndexConfigurationBuilder(); protected final DataConfigurationBuilder data = new DataConfigurationBuilder(); public SoftIndexFileStoreConfigurationBuilder(PersistenceConfigurationBuilder builder) { super(builder, org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration.attributeDefinitionSet(), AsyncStoreConfiguration.attributeDefinitionSet()); } /** * The path where the Soft-Index store will keep its data files. Under this location the store will create * a directory named after the cache name, under which a <code>data</code> directory will be created. * * The default behaviour is to use the {@link GlobalStateConfiguration#persistentLocation()}. */ public SoftIndexFileStoreConfigurationBuilder dataLocation(String dataLocation) { this.data.dataLocation(dataLocation); return this; } /** * The path where the Soft-Index store will keep its index files. Under this location the store will create * a directory named after the cache name, under which a <code>index</code> directory will be created. * * The default behaviour is to use the {@link GlobalStateConfiguration#persistentLocation()}. */ public SoftIndexFileStoreConfigurationBuilder indexLocation(String indexLocation) { this.index.indexLocation(indexLocation); return this; } /** * Number of index segment files. Increasing this value improves throughput but requires more threads to be spawned. * <p> * Defaults to <code>16</code>. */ public SoftIndexFileStoreConfigurationBuilder indexSegments(int indexSegments) { this.index.indexSegments(indexSegments); return this; } /** * Sets the maximum size of single data file with entries, in bytes. * * Defaults to <code>16777216</code> (16MB). */ public SoftIndexFileStoreConfigurationBuilder maxFileSize(int maxFileSize) { this.data.maxFileSize(maxFileSize); return this; } /** * If the size of the node (continuous block on filesystem used in index implementation) drops below this threshold, * the node will try to balance its size with some neighbour node, possibly causing join of multiple nodes. * * Defaults to <code>0</code>. */ public SoftIndexFileStoreConfigurationBuilder minNodeSize(int minNodeSize) { this.index.minNodeSize(minNodeSize); return this; } /** * Max size of node (continuous block on filesystem used in index implementation), in bytes. * * Defaults to <code>4096</code>. */ public SoftIndexFileStoreConfigurationBuilder maxNodeSize(int maxNodeSize) { this.index.maxNodeSize(maxNodeSize); return this; } /** * Sets the maximum number of entry writes that are waiting to be written to the index, per index segment. * * Defaults to <code>1000</code>. */ public SoftIndexFileStoreConfigurationBuilder indexQueueLength(int indexQueueLength) { this.index.indexQueueLength(indexQueueLength); return this; } /** * Sets whether writes shoud wait to be fsynced to disk. * * Defaults to <code>false</code>. */ public SoftIndexFileStoreConfigurationBuilder syncWrites(boolean syncWrites) { this.data.syncWrites(syncWrites); return this; } /** * Sets the maximum number of open files. * * Defaults to <code>1000</code>. */ public SoftIndexFileStoreConfigurationBuilder openFilesLimit(int openFilesLimit) { this.attributes.attribute(OPEN_FILES_LIMIT).set(openFilesLimit); return this; } /** * If the amount of unused space in some data file gets above this threshold, the file is compacted - entries from that file are copied to a new file and the old file is deleted. * * Defaults to <code>0.5</code> (50%). */ public SoftIndexFileStoreConfigurationBuilder compactionThreshold(double compactionThreshold) { this.attributes.attribute(COMPACTION_THRESHOLD).set(compactionThreshold); return this; } @Override public SoftIndexFileStoreConfiguration create() { return new SoftIndexFileStoreConfiguration(this.attributes.protect(), this.async.create(), this.index.create(), this.data.create()); } @Override public SoftIndexFileStoreConfigurationBuilder read(SoftIndexFileStoreConfiguration template) { super.read(template); this.index.read(template.index()); this.data.read(template.data()); return this; } @Override public SoftIndexFileStoreConfigurationBuilder self() { return this; } @Override protected void validate (boolean skipClassChecks) { Attribute<Boolean> segmentedAttribute = this.attributes.attribute(SEGMENTED); if (segmentedAttribute.isModified() && !segmentedAttribute.get()) { throw org.infinispan.util.logging.Log.CONFIG.storeRequiresBeingSegmented(NonBlockingSoftIndexFileStore.class.getSimpleName()); } super.validate(skipClassChecks); this.index.validate(); double compactionThreshold = this.attributes.attribute(COMPACTION_THRESHOLD).get(); if (compactionThreshold <= 0 || compactionThreshold > 1) { throw LOG.invalidCompactionThreshold(compactionThreshold); } } @Override public void validate(GlobalConfiguration globalConfig) { PersistenceUtil.validateGlobalStateStoreLocation(globalConfig, NonBlockingSoftIndexFileStore.class.getSimpleName(), this.data.attributes().attribute(DataConfiguration.DATA_LOCATION), this.index.attributes().attribute(IndexConfiguration.INDEX_LOCATION)); super.validate(globalConfig); } @Override public String toString () { return String.format("SoftIndexFileStoreConfigurationBuilder{index=%s, data=%s, attributes=%s, async=%s}", this.index, this.data, this.attributes, this.async); } }
jstourac/wildfly
clustering/infinispan/spi/src/main/java/org/wildfly/clustering/infinispan/spi/persistence/sifs/SoftIndexFileStoreConfigurationBuilder.java
Java
lgpl-2.1
8,817
/* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.controller.interfaces; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.jboss.as.controller.logging.ControllerLogger; import org.wildfly.security.manager.WildFlySecurityManager; /** * Overall interface criteria. Encapsulates a set of individual criteria and selects interfaces and addresses * that meet them all. */ public final class OverallInterfaceCriteria implements InterfaceCriteria { // java.net properties static final String PREFER_IPV4_STACK = "java.net.preferIPv4Stack"; static final String PREFER_IPV6_ADDRESSES = "java.net.preferIPv6Addresses"; private static final long serialVersionUID = -5417786897309925997L; private final String interfaceName; private final Set<InterfaceCriteria> interfaceCriteria; public OverallInterfaceCriteria(final String interfaceName, Set<InterfaceCriteria> criteria) { this.interfaceName = interfaceName; this.interfaceCriteria = criteria; } @Override public Map<NetworkInterface, Set<InetAddress>> getAcceptableAddresses(Map<NetworkInterface, Set<InetAddress>> candidates) throws SocketException { Map<NetworkInterface, Set<InetAddress>> result = AbstractInterfaceCriteria.cloneCandidates(candidates); Set<InterfaceCriteria> sorted = new TreeSet<>(interfaceCriteria); for (InterfaceCriteria criteria : sorted) { result = criteria.getAcceptableAddresses(result); if (result.size() == 0) { break; } } if (result.size() > 0) { if (hasMultipleMatches(result)) { // Multiple options matched the criteria. Eliminate the same address showing up in both // a subinterface (an alias) and in the parent result = pruneAliasDuplicates(result); } if (hasMultipleMatches(result)) { // Multiple options matched the criteria. Try and narrow the selection based on // preferences indirectly expressed via -Djava.net.preferIPv4Stack and -Djava.net.preferIPv6Addresses result = pruneIPTypes(result); } if (hasMultipleMatches(result)) { // Multiple options matched the criteria; Pick one Map<NetworkInterface, Set<InetAddress>> selected = selectInterfaceAndAddress(result); // Warn user their criteria was insufficiently exact if (interfaceName != null) { // will be null if the resolution is being performed for the "resolved-address" // user query operation in which case we don't want to log a WARN Map.Entry<NetworkInterface, Set<InetAddress>> entry = selected.entrySet().iterator().next(); warnMultipleValidInterfaces(interfaceName, result, entry.getKey(), entry.getValue().iterator().next()); } result = selected; } } return result; } public String toString() { StringBuilder sb = new StringBuilder("OverallInterfaceCriteria("); for (InterfaceCriteria criteria : interfaceCriteria) { sb.append(criteria.toString()); sb.append(","); } sb.setLength(sb.length() - 1); sb.append(")"); return sb.toString(); } @Override public int compareTo(InterfaceCriteria o) { if (this.equals(o)) { return 0; } return 1; } private Map<NetworkInterface, Set<InetAddress>> pruneIPTypes(Map<NetworkInterface, Set<InetAddress>> candidates) { Boolean preferIPv4Stack = getBoolean(PREFER_IPV4_STACK); Boolean preferIPv6Stack = (preferIPv4Stack != null && !preferIPv4Stack) ? Boolean.TRUE : getBoolean(PREFER_IPV6_ADDRESSES); if (preferIPv4Stack == null && preferIPv6Stack == null) { // No meaningful user input return candidates; } final Map<NetworkInterface, Set<InetAddress>> result = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : candidates.entrySet()) { Set<InetAddress> good = null; for (InetAddress address : entry.getValue()) { if ((preferIPv4Stack != null && preferIPv4Stack && address instanceof Inet4Address) || (preferIPv6Stack != null && preferIPv6Stack && address instanceof Inet6Address)) { if (good == null) { good = new HashSet<InetAddress>(); result.put(entry.getKey(), good); } good.add(address); } } } return result.size() == 0 ? candidates : result; } static Map<NetworkInterface, Set<InetAddress>> pruneAliasDuplicates(Map<NetworkInterface, Set<InetAddress>> result) { final Map<NetworkInterface, Set<InetAddress>> pruned = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : result.entrySet()) { NetworkInterface ni = entry.getKey(); if (ni.getParent() != null) { pruned.put(ni, entry.getValue()); } else { Set<InetAddress> retained = new HashSet<InetAddress>(entry.getValue()); Enumeration<NetworkInterface> subInterfaces = ni.getSubInterfaces(); while (subInterfaces.hasMoreElements()) { NetworkInterface sub = subInterfaces.nextElement(); Set<InetAddress> subAddresses = result.get(sub); if (subAddresses != null) { retained.removeAll(subAddresses); } } if (retained.size() > 0) { pruned.put(ni, retained); } } } return pruned; } private static Boolean getBoolean(final String property) { final String value = WildFlySecurityManager.getPropertyPrivileged(property, null); return value == null ? null : value.equalsIgnoreCase("true"); } private static Map<NetworkInterface, Set<InetAddress>> selectInterfaceAndAddress(Map<NetworkInterface, Set<InetAddress>> acceptable) throws SocketException { // Give preference to NetworkInterfaces that are 1) up, 2) not loopback 3) not point-to-point. // If any of these criteria eliminate all interfaces, discard it. if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (ni.isUp()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (!ni.isLoopback()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (acceptable.size() > 1) { Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (NetworkInterface ni : acceptable.keySet()) { if (!ni.isPointToPoint()) { preferred.put(ni, acceptable.get(ni)); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } if (hasMultipleMatches(acceptable)) { // Give preference to non-link-local addresses Map<NetworkInterface, Set<InetAddress>> preferred = new HashMap<NetworkInterface, Set<InetAddress>>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : acceptable.entrySet()) { Set<InetAddress> acceptableAddresses = entry.getValue(); if (acceptableAddresses.size() > 1) { Set<InetAddress> preferredAddresses = null; for (InetAddress addr : acceptableAddresses) { if (!addr.isLinkLocalAddress()) { if (preferredAddresses == null) { preferredAddresses = new HashSet<InetAddress>(); preferred.put(entry.getKey(), preferredAddresses); } preferredAddresses.add(addr); } } } else { acceptable.put(entry.getKey(), acceptableAddresses); } } if (preferred.size() > 0) { acceptable = preferred; } // else this preference eliminates all interfaces, so ignore it } Map.Entry<NetworkInterface, Set<InetAddress>> entry = acceptable.entrySet().iterator().next(); return Collections.singletonMap(entry.getKey(), Collections.singleton(entry.getValue().iterator().next())); } private static boolean hasMultipleMatches(Map<NetworkInterface, Set<InetAddress>> map) { return map.size() > 1 || (map.size() == 1 && map.values().iterator().next().size() > 1); } private static void warnMultipleValidInterfaces(String interfaceName, Map<NetworkInterface, Set<InetAddress>> acceptable, NetworkInterface selectedInterface, InetAddress selectedAddress) { Set<String> nis = new HashSet<String>(); Set<InetAddress> addresses = new HashSet<InetAddress>(); for (Map.Entry<NetworkInterface, Set<InetAddress>> entry : acceptable.entrySet()) { nis.add(entry.getKey().getName()); addresses.addAll(entry.getValue()); } ControllerLogger.ROOT_LOGGER.multipleMatchingAddresses(interfaceName, addresses, nis, selectedAddress, selectedInterface.getName()); } }
JiriOndrusek/wildfly-core
controller/src/main/java/org/jboss/as/controller/interfaces/OverallInterfaceCriteria.java
Java
lgpl-2.1
11,851
/* * CLiC, Framework for Command Line Interpretation in Eclipse * * Copyright (C) 2013 Worldline or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package com.worldline.clic.internal.assist; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; /** * This class allows to deal with autocompletion for all commands. * * @author mvanbesien * @since 1.0 * @version 1.0 */ public class ContentAssistProvider { private final StyledText text; private final IProcessor[] processors; private final Map<String, Object> properties = new HashMap<String, Object>(); private IStructuredContentProvider assistContentProvider; private Listener textKeyListener; private Listener assistTablePopulationListener; private Listener onSelectionListener; private Listener onEscapeListener; private IDoubleClickListener tableDoubleClickListener; private Listener focusOutListener; private Listener vanishListener; private Table table; private TableViewer viewer; private Shell popupShell; public ContentAssistProvider(final StyledText text, final IProcessor... processors) { this.text = text; this.processors = processors; build(); } public void setProperty(final String key, final Object value) { properties.put(key, value); } private void build() { // Creation of graphical elements final Display display = text.getDisplay(); popupShell = new Shell(display, SWT.ON_TOP); popupShell.setLayout(new FillLayout()); table = new Table(popupShell, SWT.SINGLE); viewer = new TableViewer(table); assistContentProvider = newAssistContentProvider(); textKeyListener = newTextKeyListener(); assistTablePopulationListener = newAssistTablePopulationListener(); onSelectionListener = newOnSelectionListener(); onEscapeListener = newOnEscapeListener(); tableDoubleClickListener = newDoubleClickListener(); focusOutListener = newFocusOutListener(); vanishListener = newVanishListener(); viewer.setContentProvider(assistContentProvider); text.addListener(SWT.KeyDown, textKeyListener); text.addListener(SWT.Modify, assistTablePopulationListener); table.addListener(SWT.DefaultSelection, onSelectionListener); table.addListener(SWT.KeyDown, onEscapeListener); viewer.addDoubleClickListener(tableDoubleClickListener); table.addListener(SWT.FocusOut, focusOutListener); text.addListener(SWT.FocusOut, focusOutListener); text.getShell().addListener(SWT.Move, vanishListener); text.addDisposeListener(newDisposeListener()); } private DisposeListener newDisposeListener() { return new DisposeListener() { @Override public void widgetDisposed(final DisposeEvent e) { text.removeListener(SWT.KeyDown, textKeyListener); text.removeListener(SWT.Modify, assistTablePopulationListener); table.removeListener(SWT.DefaultSelection, onSelectionListener); table.removeListener(SWT.KeyDown, onEscapeListener); viewer.removeDoubleClickListener(tableDoubleClickListener); table.removeListener(SWT.FocusOut, focusOutListener); text.removeListener(SWT.FocusOut, focusOutListener); text.getShell().removeListener(SWT.Move, vanishListener); table.dispose(); popupShell.dispose(); } }; } private IStructuredContentProvider newAssistContentProvider() { return new IStructuredContentProvider() { @Override public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) { } @Override public void dispose() { } @Override public Object[] getElements(final Object inputElement) { final Collection<String> results = new ArrayList<String>(); if (inputElement instanceof String) { final String input = (String) inputElement; final ProcessorContext pc = new ProcessorContext(input, text.getCaretOffset(), properties); for (final IProcessor processor : processors) results.addAll(processor.getProposals(pc)); } return results.toArray(); } }; } private Listener newAssistTablePopulationListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.widget instanceof Text) { final Text text = (Text) event.widget; final String string = text.getText(); if (string.length() == 0) // if (popupShell.isVisible()) popupShell.setVisible(false); else { viewer.setInput(string); final Rectangle textBounds = text.getDisplay().map( text.getParent(), null, text.getBounds()); popupShell.setBounds(textBounds.x, textBounds.y + textBounds.height, textBounds.width, 80); // if (!popupShell.isVisible()) popupShell.setVisible(true); } } } }; } private Listener newVanishListener() { return new Listener() { @Override public void handleEvent(final Event event) { popupShell.setVisible(false); } }; } private Listener newTextKeyListener() { return new Listener() { @Override public void handleEvent(final Event event) { switch (event.keyCode) { case SWT.ARROW_DOWN: int index = (table.getSelectionIndex() + 1) % table.getItemCount(); table.setSelection(index); event.doit = false; break; case SWT.ARROW_UP: index = table.getSelectionIndex() - 1; if (index < 0) index = table.getItemCount() - 1; table.setSelection(index); event.doit = false; break; case SWT.ARROW_RIGHT: if (popupShell.isVisible() && table.getSelectionIndex() != -1) { text.setText(table.getSelection()[0].getText()); text.setSelection(text.getText().length()); popupShell.setVisible(false); } break; case SWT.ESC: popupShell.setVisible(false); break; } } }; } private IDoubleClickListener newDoubleClickListener() { return new IDoubleClickListener() { @Override public void doubleClick(final DoubleClickEvent event) { if (popupShell.isVisible() && table.getSelectionIndex() != -1) { text.setText(table.getSelection()[0].getText()); text.setSelection(text.getText().length()); popupShell.setVisible(false); } } }; } private Listener newOnSelectionListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.widget instanceof Text) { final Text text = (Text) event.widget; final ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { text.setText(((IStructuredSelection) selection) .getFirstElement().toString()); text.setSelection(text.getText().length() - 1); } popupShell.setVisible(false); } } }; } private Listener newOnEscapeListener() { return new Listener() { @Override public void handleEvent(final Event event) { if (event.keyCode == SWT.ESC) popupShell.setVisible(false); } }; } private Listener newFocusOutListener() { return new Listener() { @Override public void handleEvent(final Event event) { popupShell.setVisible(false); } }; } }
awltech/clic
com.worldline.clic/src/main/java/com/worldline/clic/internal/assist/ContentAssistProvider.java
Java
lgpl-2.1
8,789
package com.stek101.projectzulu.common.core; /** * For usage see: {@link Pair} */ public class PairDirectoryFile<K, V> { private final K directory; private final V file; public static <K, V> PairDirectoryFile<K, V> createPair(K directory, V file) { return new PairDirectoryFile<K, V>(directory, file); } public PairDirectoryFile(K directory, V file) { this.file = file; this.directory = directory; } public K getDirectory() { return directory; } public V getFile() { return file; } @Override public boolean equals(Object object){ if (! (object instanceof PairDirectoryFile)) { return false; } PairDirectoryFile pair = (PairDirectoryFile)object; return directory.equals(pair.directory) && file.equals(pair.file); } @Override public int hashCode(){ return 7 * directory.hashCode() + 13 * file.hashCode(); } }
soultek101/projectzulu1.7.10
src/main/java/com/stek101/projectzulu/common/core/PairDirectoryFile.java
Java
lgpl-2.1
1,073
package fastSim.data; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.*; //import fanweizhu.fastSim.util.Config; //import fanweizhu.fastSim.util.IndexManager; //import fanweizhu.fastSim.util.KeyValuePair; //import fanweizhu.fastSim.util.MapCapacity; import fastSim.util.*; import fastSim.util.io.DataReader; import fastSim.util.io.DataWriter; public class PrimeSim implements Serializable{ /** * */ private static final long serialVersionUID = -7028575305146090045L; private List<Integer> hubs; protected Map<Integer, Map<Integer,Double>> map; protected boolean outG; protected List<Integer> meetingNodes; /*public PrimeSim(int capacity) { super(capacity); hubs = new ArrayList<Integer>(); }*/ public PrimeSim() { map = new HashMap<Integer, Map<Integer,Double>>(); hubs = new ArrayList<Integer>(); meetingNodes = new ArrayList<Integer>(); } public PrimeSim(int numNodes) { //need to change MapCapacity when double->Map? map = new HashMap<Integer, Map<Integer,Double>>(MapCapacity.compute(numNodes)); hubs = new ArrayList<Integer>(); } public Set<Integer> getLengths(){ return map.keySet(); } public int numHubs() { return hubs.size(); } public int numLength(){ return map.size(); } public Map<Integer,Map<Integer,Double>> getMap(){ return map; } public int getHubId(int index) { return hubs.get(index); } public List<Integer> getMeetingNodes(){ return meetingNodes; } public void addNewNode(Node h, String simType){ h.isVisited = true; if(h.isHub) hubs.add(h.id); if(simType=="in" && h.out.size()>1) //store meeting nodes for ingraphs //meetingnodes refer to >1 nodes (descendants) meetingNodes.add(h.id); } public void set(int l, Node n, double value) { // if (n.isVisited == false){ // if (n.isHub) // hubs.add(n.id); // if (graphType=="in" && n.in.size()>1) // meetingNodes.add(n.id); // } // Map<Integer, Double> nodesVal; if (map.get(l)!= null) { nodesVal = map.get(l); nodesVal.put(n.id, value); map.put(l, nodesVal); } else { nodesVal = new HashMap<Integer,Double>(); nodesVal.put(n.id, value); map.put(l, nodesVal); } } public void set(int l, Map<Integer,Double> nodeValuePairs){ //System.out.println(l); Map<Integer, Double> nodesVal = map.get(l); // for(Integer i:nodeValuePairs.keySet()) { // System.out.println("PS node: "+ i + " rea: " +nodeValuePairs.get(i)); // } if(nodesVal == null) { map.put(l, nodeValuePairs); } else{ System.out.println("####PrimeSim line108: should not go to here."); nodesVal.putAll(nodeValuePairs); map.put(l, nodesVal); } //System.out.println("length_Test:" + l + " Map_Size:" + map.get(l).size()); // for(Integer i: map.get(l).keySet()) // System.out.println(map.get(l).get(i)); } public long computeStorageInBytes() { long nodeIdSize = (1 + hubs.size()) * 4; long mapSize = (1 + map.size()) * 4 + map.size() * 8; return nodeIdSize + mapSize; } public String getCountInfo() { //int graphSize = map.size(); int hubSize = hubs.size(); int meetingNodesSize = meetingNodes.size(); return "hub size: " + hubSize + " meetingNodesSize: " + meetingNodesSize ; } public void trim(double clip) { Map<Integer, Map<Integer,Double>> newMap = new HashMap<Integer, Map<Integer,Double>>(); List<Integer> newHublist = new ArrayList<Integer>(); List<Integer> newXlist = new ArrayList<Integer>(); for (int l: map.keySet()){ Map<Integer, Double> pairMap =map.get(l); Map<Integer, Double> newPairs = new HashMap<Integer, Double>(); for (int nid: pairMap.keySet()){ double score = pairMap.get(nid); if (score > clip){ newPairs.put(nid, score); if(hubs.contains(nid) && !newHublist.contains(nid)) newHublist.add(nid); if(meetingNodes.contains(nid) && !newXlist.contains(nid)) newXlist.add(nid); } } newMap.put(l, newPairs); } this.map = newMap; this.hubs = newHublist; this.meetingNodes = newXlist; } public void saveToDisk(int id,String type,boolean doTrim) throws Exception { String path = ""; if(type == "out") //path = "./outSim/" + Integer.toString(id); path = IndexManager.getIndexDeepDir() + "out/" +Integer.toString(id); else if(type == "in") //path = "./inSim/" + Integer.toString(id); path = IndexManager.getIndexDeepDir() + "in/" +Integer.toString(id); else{ System.out.println("Type of prime graph should be either out or in."); System.exit(0); } // System.out.println(path+"/"+id); DataWriter out = new DataWriter(path); if (doTrim) trim(Config.clip); out.writeInteger(hubs.size()); for (int i : hubs) { out.writeInteger(i); } out.writeInteger(meetingNodes.size()); for(int i: meetingNodes){ out.writeInteger(i); } out.writeInteger(map.size()); for(int i=0; i<map.size();i++){ int pairNum = map.get(i).size(); Map<Integer,Double> pairMap = map.get(i); out.writeInteger(pairNum); for(int j: pairMap.keySet()){ out.writeInteger(j); out.writeDouble(pairMap.get(j)); } } out.close(); /*//test: read all the content DataReader in = new DataReader(path); while(true){ double oneNum =in.readDouble(); if (oneNum == -1.11) break; System.out.print(oneNum+"\t"); } System.out.println(); in.close();*/ } public void loadFromDisk(int id,String type) throws Exception { String path = ""; if(type == "out") path = IndexManager.getIndexDeepDir() + "out/" + Integer.toString(id); else if(type == "in") path = IndexManager.getIndexDeepDir() + "in/" + Integer.toString(id); else { System.out.println("Type of prime graph should be either out or in."); System.exit(0); } //============== DataReader in = new DataReader(path); int n = in.readInteger(); this.hubs = new ArrayList<Integer>(n); for (int i = 0; i < n; i++) this.hubs.add(in.readInteger()); int numM = in.readInteger(); this.meetingNodes=new ArrayList<Integer>(numM); for(int i =0; i<numM; i++) this.meetingNodes.add(in.readInteger()); int numL = in.readInteger(); for(int i=0; i<numL; i++){ int numPair = in.readInteger(); Map<Integer,Double> pairMap = new HashMap<Integer, Double>(); for(int j=0; j<numPair; j++){ int nodeId = in.readInteger(); double nodeScore = in.readDouble(); pairMap.put(nodeId, nodeScore); } this.map.put(i, pairMap); } in.close(); } public PrimeSim duplicate() { // TODO Auto-generated method stub PrimeSim sim = new PrimeSim(); sim.map.putAll(this.map); return sim; } public void addFrom(PrimeSim nextOut, Map<Integer, Double> oneHubValue) { // TODO Auto-generated method stub for (int lenToHub : oneHubValue.keySet()){ double hubScoreoflen = oneHubValue.get(lenToHub); for (int lenFromHub : nextOut.getMap().keySet()){ if(lenFromHub == 0){ // the new score of hub (over length==0) is just the score on prime graph continue; } int newLen = lenToHub + lenFromHub; if (!this.getMap().containsKey(newLen)) this.getMap().put(newLen, new HashMap<Integer,Double>()); for(int toNode: nextOut.getMap().get(lenFromHub).keySet()){ double oldValue = this.getMap().get(newLen).keySet() .contains(toNode) ? this.getMap().get(newLen).get(toNode): 0.0; //System.out.println(oldValue); double newValue = hubScoreoflen *nextOut.getMap().get(lenFromHub).get(toNode); // //added aug-29 // if (newValue<Config.epsilon) // continue; this.getMap().get(newLen).put(toNode, oldValue + newValue) ; // PrintInfor.printDoubleMap(this.getMap(), "assemble simout of the hub at length: " + lenFromHub +" node: "+ toNode ); // System.out.println(this.getMap()); } } } } public void addMeetingNodes(List<Integer> nodes){ for (int nid: nodes){ if (!this.meetingNodes.contains(nid)) this.meetingNodes.add(nid); } //System.out.println("====PrimeSim: line 195: meetingnodes Size " + this.meetingNodes.size()); } }
fastsim2016/FastSim
fastSim_SS_pre/src/fastSim/data/PrimeSim.java
Java
lgpl-2.1
8,347
/* Copyright (c) 2013-2014 Boundless and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/edl-v10.html * * Contributors: * Gabriel Roldan (Boundless) - initial implementation */ package org.locationtech.geogig.geotools.data; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.NoSuchElementException; import org.eclipse.jdt.annotation.Nullable; import org.geotools.data.DataStore; import org.geotools.data.Transaction; import org.geotools.data.simple.SimpleFeatureSource; import org.geotools.data.store.ContentDataStore; import org.geotools.data.store.ContentEntry; import org.geotools.data.store.ContentState; import org.geotools.feature.NameImpl; import org.locationtech.geogig.data.FindFeatureTypeTrees; import org.locationtech.geogig.model.ObjectId; import org.locationtech.geogig.model.Ref; import org.locationtech.geogig.model.RevObject.TYPE; import org.locationtech.geogig.model.RevTree; import org.locationtech.geogig.model.SymRef; import org.locationtech.geogig.plumbing.ForEachRef; import org.locationtech.geogig.plumbing.RefParse; import org.locationtech.geogig.plumbing.RevParse; import org.locationtech.geogig.plumbing.TransactionBegin; import org.locationtech.geogig.porcelain.AddOp; import org.locationtech.geogig.porcelain.CheckoutOp; import org.locationtech.geogig.porcelain.CommitOp; import org.locationtech.geogig.repository.Context; import org.locationtech.geogig.repository.GeogigTransaction; import org.locationtech.geogig.repository.NodeRef; import org.locationtech.geogig.repository.Repository; import org.locationtech.geogig.repository.WorkingTree; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.feature.type.Name; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Throwables; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; /** * A GeoTools {@link DataStore} that serves and edits {@link SimpleFeature}s in a geogig repository. * <p> * Multiple instances of this kind of data store may be created against the same repository, * possibly working against different {@link #setHead(String) heads}. * <p> * A head is any commit in GeoGig. If a head has a branch pointing at it then the store allows * transactions, otherwise no data modifications may be made. * * A branch in Geogig is a separate line of history that may or may not share a common ancestor with * another branch. In the later case the branch is called "orphan" and by convention the default * branch is called "master", which is created when the geogig repo is first initialized, but does * not necessarily exist. * <p> * Every read operation (like in {@link #getFeatureSource(Name)}) reads committed features out of * the configured "head" branch. Write operations are only supported if a {@link Transaction} is * set, in which case a {@link GeogigTransaction} is tied to the geotools transaction by means of a * {@link GeogigTransactionState}. During the transaction, read operations will read from the * transaction's {@link WorkingTree} in order to "see" features that haven't been committed yet. * <p> * When the transaction is committed, the changes made inside that transaction are merged onto the * actual repository. If any other change was made to the repository meanwhile, a rebase will be * attempted, and the transaction commit will fail if the rebase operation finds any conflict. This * provides for optimistic locking and reduces thread contention. * */ public class GeoGigDataStore extends ContentDataStore implements DataStore { private final Repository geogig; /** @see #setHead(String) */ private String refspec; /** When the configured head is not a branch, we disallow transactions */ private boolean allowTransactions = true; public GeoGigDataStore(Repository geogig) { super(); Preconditions.checkNotNull(geogig); this.geogig = geogig; } @Override public void dispose() { super.dispose(); geogig.close(); } /** * Instructs the datastore to operate against the specified refspec, or against the checked out * branch, whatever it is, if the argument is {@code null}. * * Editing capabilities are disabled if the refspec is not a local branch. * * @param refspec the name of the branch to work against, or {@code null} to default to the * currently checked out branch * @see #getConfiguredBranch() * @see #getOrFigureOutHead() * @throws IllegalArgumentException if {@code refspec} is not null and no such commit exists in * the repository */ public void setHead(@Nullable final String refspec) throws IllegalArgumentException { if (refspec == null) { allowTransactions = true; // when no branch name is set we assume we should make // transactions against the current HEAD } else { final Context context = getCommandLocator(null); Optional<ObjectId> rev = context.command(RevParse.class).setRefSpec(refspec).call(); if (!rev.isPresent()) { throw new IllegalArgumentException("Bad ref spec: " + refspec); } Optional<Ref> branchRef = context.command(RefParse.class).setName(refspec).call(); if (branchRef.isPresent()) { Ref ref = branchRef.get(); if (ref instanceof SymRef) { ref = context.command(RefParse.class).setName(((SymRef) ref).getTarget()).call() .orNull(); } Preconditions.checkArgument(ref != null, "refSpec is a dead symref: " + refspec); if (ref.getName().startsWith(Ref.HEADS_PREFIX)) { allowTransactions = true; } else { allowTransactions = false; } } else { allowTransactions = false; } } this.refspec = refspec; } public String getOrFigureOutHead() { String branch = getConfiguredHead(); if (branch != null) { return branch; } return getCheckedOutBranch(); } public Repository getGeogig() { return geogig; } /** * @return the configured refspec of the commit this datastore works against, or {@code null} if * no head in particular has been set, meaning the data store works against whatever the * currently checked out branch is. */ @Nullable public String getConfiguredHead() { return this.refspec; } /** * @return whether or not we can support transactions against the configured head */ public boolean isAllowTransactions() { return this.allowTransactions; } /** * @return the name of the currently checked out branch in the repository, not necessarily equal * to {@link #getConfiguredBranch()}, or {@code null} in the (improbable) case HEAD is * on a dettached state (i.e. no local branch is currently checked out) */ @Nullable public String getCheckedOutBranch() { Optional<Ref> head = getCommandLocator(null).command(RefParse.class).setName(Ref.HEAD) .call(); if (!head.isPresent()) { return null; } Ref headRef = head.get(); if (!(headRef instanceof SymRef)) { return null; } String refName = ((SymRef) headRef).getTarget(); Preconditions.checkState(refName.startsWith(Ref.HEADS_PREFIX)); String branchName = refName.substring(Ref.HEADS_PREFIX.length()); return branchName; } public ImmutableList<String> getAvailableBranches() { ImmutableSet<Ref> heads = getCommandLocator(null).command(ForEachRef.class) .setPrefixFilter(Ref.HEADS_PREFIX).call(); List<String> list = Lists.newArrayList(Collections2.transform(heads, (ref) -> { String branchName = ref.getName().substring(Ref.HEADS_PREFIX.length()); return branchName; })); Collections.sort(list); return ImmutableList.copyOf(list); } public Context getCommandLocator(@Nullable Transaction transaction) { Context commandLocator = null; if (transaction != null && !Transaction.AUTO_COMMIT.equals(transaction)) { GeogigTransactionState state; state = (GeogigTransactionState) transaction.getState(GeogigTransactionState.class); Optional<GeogigTransaction> geogigTransaction = state.getGeogigTransaction(); if (geogigTransaction.isPresent()) { commandLocator = geogigTransaction.get(); } } if (commandLocator == null) { commandLocator = geogig.context(); } return commandLocator; } public Name getDescriptorName(NodeRef treeRef) { Preconditions.checkNotNull(treeRef); Preconditions.checkArgument(TYPE.TREE.equals(treeRef.getType())); Preconditions.checkArgument(!treeRef.getMetadataId().isNull(), "NodeRef '%s' is not a feature type reference", treeRef.path()); return new NameImpl(getNamespaceURI(), NodeRef.nodeFromPath(treeRef.path())); } public NodeRef findTypeRef(Name typeName, @Nullable Transaction tx) { Preconditions.checkNotNull(typeName); final String localName = typeName.getLocalPart(); final List<NodeRef> typeRefs = findTypeRefs(tx); Collection<NodeRef> matches = Collections2.filter(typeRefs, new Predicate<NodeRef>() { @Override public boolean apply(NodeRef input) { return NodeRef.nodeFromPath(input.path()).equals(localName); } }); switch (matches.size()) { case 0: throw new NoSuchElementException( String.format("No tree ref matched the name: %s", localName)); case 1: return matches.iterator().next(); default: throw new IllegalArgumentException(String .format("More than one tree ref matches the name %s: %s", localName, matches)); } } @Override protected ContentState createContentState(ContentEntry entry) { return new ContentState(entry); } @Override protected ImmutableList<Name> createTypeNames() throws IOException { List<NodeRef> typeTrees = findTypeRefs(Transaction.AUTO_COMMIT); return ImmutableList .copyOf(Collections2.transform(typeTrees, (ref) -> getDescriptorName(ref))); } private List<NodeRef> findTypeRefs(@Nullable Transaction tx) { final String rootRef = getRootRef(tx); Context commandLocator = getCommandLocator(tx); List<NodeRef> typeTrees = commandLocator.command(FindFeatureTypeTrees.class) .setRootTreeRef(rootRef).call(); return typeTrees; } String getRootRef(@Nullable Transaction tx) { final String rootRef; if (null == tx || Transaction.AUTO_COMMIT.equals(tx)) { rootRef = getOrFigureOutHead(); } else { rootRef = Ref.WORK_HEAD; } return rootRef; } @Override protected GeogigFeatureStore createFeatureSource(ContentEntry entry) throws IOException { return new GeogigFeatureStore(entry); } /** * Creates a new feature type tree on the {@link #getOrFigureOutHead() current branch}. * <p> * Implementation detail: the operation is the homologous to starting a transaction, checking * out the current/configured branch, creating the type tree inside the transaction, issueing a * geogig commit, and committing the transaction for the created tree to be merged onto the * configured branch. */ @Override public void createSchema(SimpleFeatureType featureType) throws IOException { if (!allowTransactions) { throw new IllegalStateException("Configured head " + refspec + " is not a branch; transactions are not supported."); } GeogigTransaction tx = getCommandLocator(null).command(TransactionBegin.class).call(); boolean abort = false; try { String treePath = featureType.getName().getLocalPart(); // check out the datastore branch on the transaction space final String branch = getOrFigureOutHead(); tx.command(CheckoutOp.class).setForce(true).setSource(branch).call(); // now we can use the transaction working tree with the correct branch checked out WorkingTree workingTree = tx.workingTree(); workingTree.createTypeTree(treePath, featureType); tx.command(AddOp.class).addPattern(treePath).call(); tx.command(CommitOp.class).setMessage("Created feature type tree " + treePath).call(); tx.commit(); } catch (IllegalArgumentException alreadyExists) { abort = true; throw new IOException(alreadyExists.getMessage(), alreadyExists); } catch (Exception e) { abort = true; throw Throwables.propagate(e); } finally { if (abort) { tx.abort(); } } } // Deliberately leaving the @Override annotation commented out so that the class builds // both against GeoTools 10.x and 11.x (as the method was added to DataStore in 11.x) // @Override public void removeSchema(Name name) throws IOException { throw new UnsupportedOperationException( "removeSchema not yet supported by geogig DataStore"); } // Deliberately leaving the @Override annotation commented out so that the class builds // both against GeoTools 10.x and 11.x (as the method was added to DataStore in 11.x) // @Override public void removeSchema(String name) throws IOException { throw new UnsupportedOperationException( "removeSchema not yet supported by geogig DataStore"); } public static enum ChangeType { ADDED, REMOVED, CHANGED_NEW, CHANGED_OLD; } /** * Builds a FeatureSource (read-only) that fetches features out of the differences between two * root trees: a provided tree-ish as the left side of the comparison, and the datastore's * configured HEAD as the right side of the comparison. * <p> * E.g., to get all features of a given feature type that were removed between a given commit * and its parent: * * <pre> * <code> * String commitId = ... * GeoGigDataStore store = new GeoGigDataStore(geogig); * store.setHead(commitId); * FeatureSource removed = store.getDiffFeatureSource("roads", commitId + "~1", ChangeType.REMOVED); * </code> * </pre> * * @param typeName the feature type name to look up a type tree for in the datastore's current * {@link #getOrFigureOutHead() HEAD} * @param oldRoot a tree-ish string that resolves to the ROOT tree to be used as the left side * of the diff * @param changeType the type of change between {@code oldRoot} and {@link #getOrFigureOutHead() * head} to pick as the features to return. * @return a feature source whose features are computed out of the diff between the feature type * diffs between the given {@code oldRoot} and the datastore's * {@link #getOrFigureOutHead() HEAD}. */ public SimpleFeatureSource getDiffFeatureSource(final String typeName, final String oldRoot, final ChangeType changeType) throws IOException { Preconditions.checkNotNull(typeName, "typeName"); Preconditions.checkNotNull(oldRoot, "oldRoot"); Preconditions.checkNotNull(changeType, "changeType"); final Name name = name(typeName); final ContentEntry entry = ensureEntry(name); GeogigFeatureSource featureSource = new GeogigFeatureSource(entry); featureSource.setTransaction(Transaction.AUTO_COMMIT); featureSource.setChangeType(changeType); if (ObjectId.NULL.toString().equals(oldRoot) || RevTree.EMPTY_TREE_ID.toString().equals(oldRoot)) { featureSource.setOldRoot(null); } else { featureSource.setOldRoot(oldRoot); } return featureSource; } }
jodygarnett/GeoGig
src/datastore/src/main/java/org/locationtech/geogig/geotools/data/GeoGigDataStore.java
Java
lgpl-2.1
17,024
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2003-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.data.vpf.exc; /** * Class VPFHeaderFormatException.java is responsible for * * <p>Created: Tue Jan 21 15:12:10 2003 * * @author <a href="mailto:kobit@users.sourceforge.net">Artur Hefczyc</a> * @source $URL$ * @version 1.0.0 */ public class VPFHeaderFormatException extends VPFDataException { /** serialVersionUID */ private static final long serialVersionUID = 4680952037855445222L; /** Creates a new VPFHeaderFormatException object. */ public VPFHeaderFormatException() { super(); } /** * Creates a new VPFHeaderFormatException object. * * @param message DOCUMENT ME! */ public VPFHeaderFormatException(String message) { super(message); } } // VPFHeaderFormatException
geotools/geotools
modules/unsupported/vpf/src/main/java/org/geotools/data/vpf/exc/VPFHeaderFormatException.java
Java
lgpl-2.1
1,418
package compiler.ASTNodes.Operators; import compiler.ASTNodes.GeneralNodes.Node; import compiler.ASTNodes.GeneralNodes.UnaryNode; import compiler.ASTNodes.SyntaxNodes.ExprNode; import compiler.Visitors.AbstractVisitor; public class UnaryMinusNode extends ExprNode { public UnaryMinusNode(Node child) { super(child, null); } @Override public Object Accept(AbstractVisitor v) { return v.visit(this); } }
TobiasMorell/P4
Minecraft/src/main/java/compiler/ASTNodes/Operators/UnaryMinusNode.java
Java
lgpl-2.1
415
/** * NativeFmod Project * * Want to use FMOD API (www.fmod.org) in the Java language ? NativeFmod is made for you. * Copyright © 2004-2007 Jérôme JOUVIE (Jouvieje) * * Created on 28 avr. 2004 * @version NativeFmod v3.4 (for FMOD v3.75) * @author Jérôme JOUVIE (Jouvieje) * * * WANT TO CONTACT ME ? * E-mail : * jerome.jouvie@gmail.com * My web sites : * http://jerome.jouvie.free.fr/ * * * INTRODUCTION * Fmod is an API (Application Programming Interface) that allow you to use music * and creating sound effects with a lot of sort of musics. * Fmod is at : * http://www.fmod.org/ * The reason of this project is that Fmod can't be used in Java direcly, so I've created * NativeFmod project. * * * GNU LESSER GENERAL PUBLIC LICENSE * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of the License, * or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA */ package org.jouvieje.Fmod.Structures; import org.jouvieje.Fmod.Misc.Pointer; /** * Structure defining the properties for a reverb source, related to a FSOUND channel. * For more indepth descriptions of the reverb properties under win32, please see the EAX3 * documentation at http://developer.creative.com/ under the 'downloads' section. * If they do not have the EAX3 documentation, then most information can be attained from * the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of * EAX2. * Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset. * Note that integer values that typically range from -10,000 to 1000 are represented in * decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear. * PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox). * Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then * the reverb should product a similar effect on either platform. * Linux and FMODCE do not support the reverb api. * The numerical values listed below are the maximum, minimum and default values for each variable respectively. */ public class FSOUND_REVERB_CHANNELPROPERTIES extends Pointer { /** * Create a view of the <code>Pointer</code> object as a <code>FSOUND_REVERB_CHANNELPROPERTIES</code> object.<br> * This view is valid only if the memory holded by the <code>Pointer</code> holds a FSOUND_REVERB_CHANNELPROPERTIES object. */ public static FSOUND_REVERB_CHANNELPROPERTIES createView(Pointer pointer) { return new FSOUND_REVERB_CHANNELPROPERTIES(Pointer.getPointer(pointer)); } /** * Create a new <code>FSOUND_REVERB_CHANNELPROPERTIES</code>.<br> * The call <code>isNull()</code> on the object created will return false.<br> * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = FSOUND_REVERB_CHANNELPROPERTIES.create(); * (obj == null) <=> obj.isNull() <=> false * </code></pre> */ public static FSOUND_REVERB_CHANNELPROPERTIES create() { return new FSOUND_REVERB_CHANNELPROPERTIES(StructureJNI.new_FSOUND_REVERB_CHANNELPROPERTIES()); } protected FSOUND_REVERB_CHANNELPROPERTIES(long pointer) { super(pointer); } /** * Create an object that holds a null <code>FSOUND_REVERB_CHANNELPROPERTIES</code>.<br> * The call <code>isNull()</code> on the object created will returns true.<br> * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = new FSOUND_REVERB_CHANNELPROPERTIES(); * (obj == null) <=> false * obj.isNull() <=> true * </code></pre> * To creates a new <code>FSOUND_REVERB_CHANNELPROPERTIES</code>, use the static "constructor" : * <pre><code> FSOUND_REVERB_CHANNELPROPERTIES obj = FSOUND_REVERB_CHANNELPROPERTIES.create();</code></pre> * @see FSOUND_REVERB_CHANNELPROPERTIES#create() */ public FSOUND_REVERB_CHANNELPROPERTIES() { super(); } public void release() { if(pointer != 0) { StructureJNI.delete_FSOUND_REVERB_CHANNELPROPERTIES(pointer); } pointer = 0; } /** * -10000, 1000, 0, direct path level (at low and mid frequencies) (WIN32/XBOX) */ public void setDirect(int Direct) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Direct(pointer, Direct); } /** * @return value of Direct */ public int getDirect() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Direct(pointer); } /** * -10000, 0, 0, relative direct path level at high frequencies (WIN32/XBOX) */ public void setDirectHF(int DirectHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_DirectHF(pointer, DirectHF); } /** * @return value of DirectHF */ public int getDirectHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_DirectHF(pointer); } /** * -10000, 1000, 0, room effect level (at low and mid frequencies) (WIN32/XBOX/PS2) */ public void setRoom(int Room) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Room(pointer, Room); } /** * @return value of Room */ public int getRoom() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Room(pointer); } /** * -10000, 0, 0, relative room effect level at high frequencies (WIN32/XBOX) */ public void setRoomHF(int RoomHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RoomHF(pointer, RoomHF); } /** * @return value of RoomHF */ public int getRoomHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RoomHF(pointer); } /** * -10000, 0, 0, main obstruction control (attenuation at high frequencies) (WIN32/XBOX) */ public void setObstruction(int Obstruction) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Obstruction(pointer, Obstruction); } /** * @return value of Obstruction */ public int getObstruction() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Obstruction(pointer); } /** * 0.0, 1.0, 0.0, obstruction low-frequency level re. main control (WIN32/XBOX) */ public void setObstructionLFRatio(float ObstructionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_ObstructionLFRatio(pointer, ObstructionLFRatio); } /** * @return value of ObstructionLFRatio */ public float getObstructionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_ObstructionLFRatio(pointer); } /** * -10000, 0, 0, main occlusion control (attenuation at high frequencies) (WIN32/XBOX) */ public void setOcclusion(int Occlusion) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Occlusion(pointer, Occlusion); } /** * @return value of Occlusion */ public int getOcclusion() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Occlusion(pointer); } /** * 0.0, 1.0, 0.25, occlusion low-frequency level re. main control (WIN32/XBOX) */ public void setOcclusionLFRatio(float OcclusionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionLFRatio(pointer, OcclusionLFRatio); } /** * @return value of OcclusionLFRatio */ public float getOcclusionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionLFRatio(pointer); } /** * 0.0, 10.0, 1.5, relative occlusion control for room effect (WIN32) */ public void setOcclusionRoomRatio(float OcclusionRoomRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionRoomRatio(pointer, OcclusionRoomRatio); } /** * @return value of OcclusionRoomRatio */ public float getOcclusionRoomRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionRoomRatio(pointer); } /** * 0.0, 10.0, 1.0, relative occlusion control for direct path (WIN32) */ public void setOcclusionDirectRatio(float OcclusionDirectRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionDirectRatio(pointer, OcclusionDirectRatio); } /** * @return value of OcclusionDirectRatio */ public float getOcclusionDirectRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OcclusionDirectRatio(pointer); } /** * -10000, 0, 0, main exlusion control (attenuation at high frequencies) (WIN32) */ public void setExclusion(int Exclusion) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Exclusion(pointer, Exclusion); } /** * @return value of Exclusion */ public int getExclusion() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Exclusion(pointer); } /** * 0.0, 1.0, 1.0, exclusion low-frequency level re. main control (WIN32) */ public void setExclusionLFRatio(float ExclusionLFRatio) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_ExclusionLFRatio(pointer, ExclusionLFRatio); } /** * @return value of ExclusionLFRatio */ public float getExclusionLFRatio() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_ExclusionLFRatio(pointer); } /** * -10000, 0, 0, outside sound cone level at high frequencies (WIN32) */ public void setOutsideVolumeHF(int OutsideVolumeHF) { if(pointer == 0) throw new NullPointerException(); StructureJNI .set_FSOUND_REVERB_CHANNELPROPERTIES_OutsideVolumeHF(pointer, OutsideVolumeHF); } /** * @return value of OutsideVolumeHF */ public int getOutsideVolumeHF() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_OutsideVolumeHF(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flDopplerFactor but per source (WIN32) */ public void setDopplerFactor(float DopplerFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_DopplerFactor(pointer, DopplerFactor); } /** * @return value of DopplerFactor */ public float getDopplerFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_DopplerFactor(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flRolloffFactor but per source (WIN32) */ public void setRolloffFactor(float RolloffFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RolloffFactor(pointer, RolloffFactor); } /** * @return value of RolloffFactor */ public float getRolloffFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RolloffFactor(pointer); } /** * 0.0, 10.0, 0.0, like DS3D flRolloffFactor but for room effect (WIN32/XBOX) */ public void setRoomRolloffFactor(float RoomRolloffFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_RoomRolloffFactor(pointer, RoomRolloffFactor); } /** * @return value of RoomRolloverFactor */ public float getRoomRolloffFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_RoomRolloffFactor(pointer); } /** * 0.0, 10.0, 1.0, multiplies AirAbsorptionHF member of FSOUND_REVERB_PROPERTIES (WIN32) * */ public void setAirAbsorptionFactor(float AirAbsorptionFactor) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_AirAbsorptionFactor(pointer, AirAbsorptionFactor); } /** * @return value of AirAbsorptionFactor */ public float getAirAbsorptionFactor() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_AirAbsorptionFactor(pointer); } /** * FSOUND_REVERB_CHANNELFLAGS - modifies the behavior of properties (WIN32) */ public void setFlags(int Flags) { if(pointer == 0) throw new NullPointerException(); StructureJNI.set_FSOUND_REVERB_CHANNELPROPERTIES_Flags(pointer, Flags); } /** * @return value of EchoTime */ public int getFlags() { if(pointer == 0) throw new NullPointerException(); return StructureJNI.get_FSOUND_REVERB_CHANNELPROPERTIES_Flags(pointer); } }
jerome-jouvie/NativeFmod
src-java/org/jouvieje/Fmod/Structures/FSOUND_REVERB_CHANNELPROPERTIES.java
Java
lgpl-2.1
13,664
/* * 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 org.kore.runtime.jsf.converter; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.FacesConverter; import org.kore.runtime.person.Titel; /** * * @author Konrad Renner */ @FacesConverter(value = "CurrencyConverter") public class TitelConverter implements Converter { @Override public Titel getAsObject(FacesContext fc, UIComponent uic, String string) { if (string == null || string.trim().length() == 0) { return null; } return new Titel(string.trim()); } @Override public String getAsString(FacesContext fc, UIComponent uic, Object o) { if (o == null) { return null; } if (o instanceof Titel) { return ((Titel) o).getValue(); } throw new IllegalArgumentException("Given object is not a org.kore.runtime.person.Titel"); } }
konradrenner/KoreRuntime-jsf
src/main/java/org/kore/runtime/jsf/converter/TitelConverter.java
Java
lgpl-2.1
1,145
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2012, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.referencing.factory.gridshift; import java.net.URL; import org.geotools.metadata.iso.citation.Citations; import org.geotools.util.factory.AbstractFactory; import org.opengis.metadata.citation.Citation; /** * Default grid shift file locator, looks up grids in the classpath * * @author Andrea Aime - GeoSolutions */ public class ClasspathGridShiftLocator extends AbstractFactory implements GridShiftLocator { public ClasspathGridShiftLocator() { super(NORMAL_PRIORITY); } @Override public Citation getVendor() { return Citations.GEOTOOLS; } @Override public URL locateGrid(String grid) { return getClass().getResource(grid); } }
geotools/geotools
modules/library/referencing/src/main/java/org/geotools/referencing/factory/gridshift/ClasspathGridShiftLocator.java
Java
lgpl-2.1
1,361
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.dialect.identity; import java.sql.PreparedStatement; import java.sql.SQLException; import org.hibernate.HibernateException; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.identity.GetGeneratedKeysDelegate; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.id.PostInsertIdentityPersister; /** * @author Andrea Boriero */ public class Oracle12cGetGeneratedKeysDelegate extends GetGeneratedKeysDelegate { private String[] keyColumns; public Oracle12cGetGeneratedKeysDelegate(PostInsertIdentityPersister persister, Dialect dialect) { super( persister, dialect ); this.keyColumns = getPersister().getRootTableKeyColumnNames(); if ( keyColumns.length > 1 ) { throw new HibernateException( "Identity generator cannot be used with multi-column keys" ); } } @Override protected PreparedStatement prepare(String insertSQL, SessionImplementor session) throws SQLException { return session .getJdbcCoordinator() .getStatementPreparer() .prepareStatement( insertSQL, keyColumns ); } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/main/java/org/hibernate/dialect/identity/Oracle12cGetGeneratedKeysDelegate.java
Java
lgpl-2.1
1,313
/******************************************************************************* * Copyright (c) 2012 Scott Ross. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * * Contributors: * Scott Ross - initial API and implementation ******************************************************************************/ package org.alms.messages; import org.alms.beans.*; import javax.ws.rs.core.HttpHeaders; public interface IMsg { public void setHeader(HttpHeaders msgHeaders); public void setIncomingMessage(String incomingMessage); public Boolean checkMessageVocubulary(); public RelatedParty getMsgDestination(); public RelatedParty getMsgSending(); public String getMsgId(); public String getUserName(); public String getPassword(); public String getXSDLocation(); public String getIncomingMessage(); public String receiverTransmissionType(); }
sross07/alms
src/main/java/org/alms/messages/IMsg.java
Java
lgpl-2.1
1,077
package jastadd.soot.JastAddJ; import java.util.HashSet;import java.util.LinkedHashSet;import java.io.File;import java.util.*;import jastadd.beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;import java.io.FileNotFoundException;import java.util.Collection;import soot.*;import soot.util.*;import soot.jimple.*;import soot.coffi.ClassFile;import soot.coffi.method_info;import soot.coffi.CONSTANT_Utf8_info;import soot.tagkit.SourceFileTag;import soot.coffi.CoffiMethodSource; public class ParClassInstanceExpr extends ClassInstanceExpr implements Cloneable { public void flushCache() { super.flushCache(); } public void flushCollectionCache() { super.flushCollectionCache(); } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr clone() throws CloneNotSupportedException { ParClassInstanceExpr node = (ParClassInstanceExpr)super.clone(); node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr copy() { try { ParClassInstanceExpr node = clone(); if(children != null) node.children = children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public ParClassInstanceExpr fullCopy() { ParClassInstanceExpr res = copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in GenericMethods.jrag at line 160 public void toString(StringBuffer s) { s.append("<"); for(int i = 0; i < getNumTypeArgument(); i++) { if(i != 0) s.append(", "); getTypeArgument(i).toString(s); } s.append(">"); super.toString(s); } // Declared in GenericMethods.ast at line 3 // Declared in GenericMethods.ast line 15 public ParClassInstanceExpr() { super(); setChild(new List(), 1); setChild(new Opt(), 2); setChild(new List(), 3); } // Declared in GenericMethods.ast at line 13 // Declared in GenericMethods.ast line 15 public ParClassInstanceExpr(Access p0, List<Expr> p1, Opt<TypeDecl> p2, List<Access> p3) { setChild(p0, 0); setChild(p1, 1); setChild(p2, 2); setChild(p3, 3); } // Declared in GenericMethods.ast at line 20 protected int numChildren() { return 4; } // Declared in GenericMethods.ast at line 23 public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setAccess(Access node) { setChild(node, 0); } // Declared in java.ast at line 5 public Access getAccess() { return (Access)getChild(0); } // Declared in java.ast at line 9 public Access getAccessNoTransform() { return (Access)getChildNoTransform(0); } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setArgList(List<Expr> list) { setChild(list, 1); } // Declared in java.ast at line 6 public int getNumArg() { return getArgList().getNumChild(); } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Expr getArg(int i) { return getArgList().getChild(i); } // Declared in java.ast at line 14 public void addArg(Expr node) { List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList(); list.addChild(node); } // Declared in java.ast at line 19 public void addArgNoTransform(Expr node) { List<Expr> list = getArgListNoTransform(); list.addChild(node); } // Declared in java.ast at line 24 public void setArg(Expr node, int i) { List<Expr> list = getArgList(); list.setChild(node, i); } // Declared in java.ast at line 28 public List<Expr> getArgs() { return getArgList(); } // Declared in java.ast at line 31 public List<Expr> getArgsNoTransform() { return getArgListNoTransform(); } // Declared in java.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getArgList() { List<Expr> list = (List<Expr>)getChild(1); list.getNumChild(); return list; } // Declared in java.ast at line 41 @SuppressWarnings({"unchecked", "cast"}) public List<Expr> getArgListNoTransform() { return (List<Expr>)getChildNoTransform(1); } // Declared in java.ast at line 2 // Declared in java.ast line 34 public void setTypeDeclOpt(Opt<TypeDecl> opt) { setChild(opt, 2); } // Declared in java.ast at line 6 public boolean hasTypeDecl() { return getTypeDeclOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl getTypeDecl() { return getTypeDeclOpt().getChild(0); } // Declared in java.ast at line 14 public void setTypeDecl(TypeDecl node) { getTypeDeclOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<TypeDecl> getTypeDeclOpt() { return (Opt<TypeDecl>)getChild(2); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<TypeDecl> getTypeDeclOptNoTransform() { return (Opt<TypeDecl>)getChildNoTransform(2); } // Declared in GenericMethods.ast at line 2 // Declared in GenericMethods.ast line 15 public void setTypeArgumentList(List<Access> list) { setChild(list, 3); } // Declared in GenericMethods.ast at line 6 public int getNumTypeArgument() { return getTypeArgumentList().getNumChild(); } // Declared in GenericMethods.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Access getTypeArgument(int i) { return getTypeArgumentList().getChild(i); } // Declared in GenericMethods.ast at line 14 public void addTypeArgument(Access node) { List<Access> list = (parent == null || state == null) ? getTypeArgumentListNoTransform() : getTypeArgumentList(); list.addChild(node); } // Declared in GenericMethods.ast at line 19 public void addTypeArgumentNoTransform(Access node) { List<Access> list = getTypeArgumentListNoTransform(); list.addChild(node); } // Declared in GenericMethods.ast at line 24 public void setTypeArgument(Access node, int i) { List<Access> list = getTypeArgumentList(); list.setChild(node, i); } // Declared in GenericMethods.ast at line 28 public List<Access> getTypeArguments() { return getTypeArgumentList(); } // Declared in GenericMethods.ast at line 31 public List<Access> getTypeArgumentsNoTransform() { return getTypeArgumentListNoTransform(); } // Declared in GenericMethods.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<Access> getTypeArgumentList() { List<Access> list = (List<Access>)getChild(3); list.getNumChild(); return list; } // Declared in GenericMethods.ast at line 41 @SuppressWarnings({"unchecked", "cast"}) public List<Access> getTypeArgumentListNoTransform() { return (List<Access>)getChildNoTransform(3); } // Declared in GenericMethods.jrag at line 126 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getTypeArgumentListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return NameType.TYPE_NAME; } return super.Define_NameType_nameType(caller, child); } // Declared in GenericMethods.jrag at line 127 public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { if(caller == getTypeArgumentListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return unqualifiedScope().lookupType(name); } return super.Define_SimpleSet_lookupType(caller, child, name); } public ASTNode rewriteTo() { return super.rewriteTo(); } }
plast-lab/soot
src/jastadd/soot/JastAddJ/ParClassInstanceExpr.java
Java
lgpl-2.1
8,648
package org.wingx; import java.awt.Color; import org.wings.*; import org.wings.style.CSSAttributeSet; import org.wings.style.CSSProperty; import org.wings.style.CSSStyle; import org.wings.style.CSSStyleSheet; import org.wings.style.Selector; import org.wings.style.Style; public class XDivision extends SContainer implements LowLevelEventListener { String title; SIcon icon; /** * Is the XDivision shaded? */ boolean shaded; /** * Is the title clickable? Default is false. */ protected boolean isTitleClickable = false; public static final Selector SELECTOR_TITLE = new Selector("xdiv.title"); /** * Creates a XDivision instance with the specified LayoutManager * @param l the LayoutManager */ public XDivision(SLayoutManager l) { super(l); } /** * Creates a XDivision instance */ public XDivision() { } public XDivision(String title) { this.title = title; } /** * Returns the title of the XDivision. * @return String the title */ public String getTitle() { return title; } /** * Sets the title of the XDivision. * @param title the title */ public void setTitle(String title) { String oldVal = this.title; reloadIfChange(this.title, title); this.title = title; propertyChangeSupport.firePropertyChange("title", oldVal, this.title); } /** * Sets the title-font of the XDivision. * @param titleFont the font for the title */ public void setTitleFont( org.wings.SFont titleFont) { SFont oldVal = this.getTitleFont(); CSSAttributeSet attributes = CSSStyleSheet.getAttributes(titleFont); Style style = getDynamicStyle(SELECTOR_TITLE); if (style == null) { addDynamicStyle(new CSSStyle(SELECTOR_TITLE, attributes)); } else { style.remove(CSSProperty.FONT); style.remove(CSSProperty.FONT_FAMILY); style.remove(CSSProperty.FONT_SIZE); style.remove(CSSProperty.FONT_STYLE); style.remove(CSSProperty.FONT_WEIGHT); style.putAll(attributes); } propertyChangeSupport.firePropertyChange("titleFont", oldVal, this.getTitleFont()); } /** * Returns the title-font of the XDivision. * @return SFont the font for the title */ public SFont getTitleFont() { return dynamicStyles == null || dynamicStyles.get(SELECTOR_TITLE) == null ? null : CSSStyleSheet.getFont((CSSAttributeSet) dynamicStyles.get(SELECTOR_TITLE)); } /** * Sets the title-color of the XDivision. * @param titleColor the color for the title */ public void setTitleColor( Color titleColor ) { Color oldVal = this.getTitleColor(); setAttribute( SELECTOR_TITLE, CSSProperty.COLOR, CSSStyleSheet.getAttribute( titleColor ) ); propertyChangeSupport.firePropertyChange("titleColor", oldVal, this.getTitleColor()); } /** * Returns the title-color of the XDivision. * @return titleColor the color for the title */ public Color getTitleColor() { return dynamicStyles == null || dynamicStyles.get(SELECTOR_TITLE) == null ? null : CSSStyleSheet.getForeground((CSSAttributeSet) dynamicStyles.get(SELECTOR_TITLE)); } /** * Determines whether or not the title is clickable. * @param clickable true if the title is clickable */ public void setTitleClickable( boolean clickable ) { boolean oldVal = this.isTitleClickable; this.isTitleClickable = clickable; propertyChangeSupport.firePropertyChange("titleClickable", oldVal, this.isTitleClickable); } /** * Returns true if the title is clickable. * @return boolean true if the title is clickable */ public boolean isTitleClickable() { return this.isTitleClickable; } public SIcon getIcon() { return icon; } public void setIcon(SIcon icon) { SIcon oldVal = this.icon; reloadIfChange(this.icon, icon); this.icon = icon; propertyChangeSupport.firePropertyChange("icon", oldVal, this.icon); } /** * Returns true if the XDivision is shaded. * @return boolean true if the XDivision is shaded */ public boolean isShaded() { return shaded; } /** * Determines whether or not the XDivision is shaded. * @param shaded true if the XDivision is shaded */ public void setShaded(boolean shaded) { if (this.shaded != shaded) { reload(); this.shaded = shaded; propertyChangeSupport.firePropertyChange("shaded", !this.shaded, this.shaded); setRecursivelyVisible(isRecursivelyVisible()); } } @Override public void processLowLevelEvent(String name, String... values) { if (values.length == 1 && "t".equals(values[0])) { setShaded(!shaded); } /* TODO: first focusable component if (!shaded && getComponentCount() > 0) getComponent(0).requestFocus(); else requestFocus(); */ } @Override public void fireIntermediateEvents() { } @Override public boolean isEpochCheckEnabled() { return false; } @Override protected boolean isShowingChildren() { return !shaded; } }
dheid/wings3
wingx/src/main/java/org/wingx/XDivision.java
Java
lgpl-2.1
5,529
/* * $Id: IpWatch.java 3905 2008-07-28 13:55:03Z uckelman $ * * Copyright (c) 2007-2008 by Rodney Kinney * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License (LGPL) as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, copies are available * at http://www.opensource.org. */ package VASSAL.chat.peer2peer; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.net.InetAddress; import java.net.UnknownHostException; public class IpWatch implements Runnable { private PropertyChangeSupport propSupport = new PropertyChangeSupport(this); private String currentIp; private long wait = 1000; public IpWatch(long waitInterval) { wait = waitInterval; currentIp = findIp(); } public IpWatch() { this(1000); } public void addPropertyChangeListener(PropertyChangeListener l) { propSupport.addPropertyChangeListener(l); } public void run() { while (true) { String newIp = findIp(); propSupport.firePropertyChange("address", currentIp, newIp); //$NON-NLS-1$ currentIp = newIp; try { Thread.sleep(wait); } catch (InterruptedException ex) { } } } public String getCurrentIp() { return currentIp; } private String findIp() { try { InetAddress a[] = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); final StringBuilder buff = new StringBuilder(); for (int i = 0; i < a.length; ++i) { buff.append(a[i].getHostAddress()); if (i < a.length - 1) { buff.append(","); //$NON-NLS-1$ } } return buff.toString(); } // FIXME: review error message catch (UnknownHostException e) { return null; } } public static void main(String[] args) { IpWatch w = new IpWatch(); w.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { System.out.println("Address = " + evt.getNewValue()); //$NON-NLS-1$ } }); System.out.println("Address = " + w.getCurrentIp()); //$NON-NLS-1$ new Thread(w).start(); } }
caiusb/vassal
src/VASSAL/chat/peer2peer/IpWatch.java
Java
lgpl-2.1
2,630
/** * Copyright (C) 2013 Rohan Padhye * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package vasco.soot.examples; import java.util.Map; import org.junit.Test; import soot.Local; import soot.PackManager; import soot.SceneTransformer; import soot.SootMethod; import soot.Transform; import soot.Unit; import vasco.DataFlowSolution; import vasco.soot.examples.SignAnalysis.Sign; /** * A Soot {@link SceneTransformer} for performing {@link SignAnalysis}. * * @author Rohan Padhye */ public class SignTest extends SceneTransformer { private SignAnalysis analysis; @Override protected void internalTransform(String arg0, @SuppressWarnings("rawtypes") Map arg1) { analysis = new SignAnalysis(); analysis.doAnalysis(); DataFlowSolution<Unit,Map<Local,Sign>> solution = analysis.getMeetOverValidPathsSolution(); System.out.println("----------------------------------------------------------------"); for (SootMethod sootMethod : analysis.getMethods()) { System.out.println(sootMethod); for (Unit unit : sootMethod.getActiveBody().getUnits()) { System.out.println("----------------------------------------------------------------"); System.out.println(unit); System.out.println("IN: " + formatConstants(solution.getValueBefore(unit))); System.out.println("OUT: " + formatConstants(solution.getValueAfter(unit))); } System.out.println("----------------------------------------------------------------"); } } public static String formatConstants(Map<Local, Sign> value) { if (value == null) { return ""; } StringBuffer sb = new StringBuffer(); for (Map.Entry<Local,Sign> entry : value.entrySet()) { Local local = entry.getKey(); Sign sign = entry.getValue(); if (sign != null) { sb.append("(").append(local).append(": ").append(sign.toString()).append(") "); } } return sb.toString(); } public SignAnalysis getAnalysis() { return analysis; } public static void main(String args[]) { String classPath = System.getProperty("java.class.path"); String mainClass = null; /* ------------------- OPTIONS ---------------------- */ try { int i=0; while(true){ if (args[i].equals("-cp")) { classPath = args[i+1]; i += 2; } else { mainClass = args[i]; i++; break; } } if (i != args.length || mainClass == null) throw new Exception(); } catch (Exception e) { System.err.println("Usage: java SignTest [-cp CLASSPATH] MAIN_CLASS"); System.exit(1); } String[] sootArgs = { "-cp", classPath, "-pp", "-w", "-app", "-keep-line-number", "-keep-bytecode-offset", "-p", "jb", "use-original-names", "-p", "cg", "implicit-entry:false", "-p", "cg.spark", "enabled", "-p", "cg.spark", "simulate-natives", "-p", "cg", "safe-forname", "-p", "cg", "safe-newinstance", "-main-class", mainClass, "-f", "none", mainClass }; SignTest sgn = new SignTest(); PackManager.v().getPack("wjtp").add(new Transform("wjtp.sgn", sgn)); soot.Main.main(sootArgs); } @Test public void testSignAnalysis() { // TODO: Compare output with an ideal (expected) output SignTest.main(new String[]{"vasco.tests.SignTestCase"}); } }
rohanpadhye/vasco
src/test/java/vasco/soot/examples/SignTest.java
Java
lgpl-2.1
3,854
/***************************************************************** JADE - Java Agent DEvelopment Framework is a framework to develop multi-agent systems in compliance with the FIPA specifications. Copyright (C) 2000 CSELT S.p.A. GNU Lesser General Public License This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *****************************************************************/ package examples.O2AInterface; import jade.core.Runtime; import jade.core.Profile; import jade.core.ProfileImpl; import jade.wrapper.*; /** * This class shows an example of how to run JADE as a library from an external program * and in particular how to start an agent and interact with it by means of the * Object-to-Agent (O2A) interface. * * @author Giovanni Iavarone - Michele Izzo */ public class O2AInterfaceExample { public static void main(String[] args) throws StaleProxyException, InterruptedException { // Get a hold to the JADE runtime Runtime rt = Runtime.instance(); // Launch the Main Container (with the administration GUI on top) listening on port 8888 System.out.println(">>>>>>>>>>>>>>> Launching the platform Main Container..."); Profile pMain = new ProfileImpl(null, 8888, null); pMain.setParameter(Profile.GUI, "true"); ContainerController mainCtrl = rt.createMainContainer(pMain); // Create and start an agent of class CounterAgent System.out.println(">>>>>>>>>>>>>>> Starting up a CounterAgent..."); AgentController agentCtrl = mainCtrl.createNewAgent("CounterAgent", CounterAgent.class.getName(), new Object[0]); agentCtrl.start(); // Wait a bit System.out.println(">>>>>>>>>>>>>>> Wait a bit..."); Thread.sleep(10000); try { // Retrieve O2A interface CounterManager1 exposed by the agent to make it activate the counter System.out.println(">>>>>>>>>>>>>>> Activate counter"); CounterManager1 o2a1 = agentCtrl.getO2AInterface(CounterManager1.class); o2a1.activateCounter(); // Wait a bit System.out.println(">>>>>>>>>>>>>>> Wait a bit..."); Thread.sleep(30000); // Retrieve O2A interface CounterManager2 exposed by the agent to make it de-activate the counter System.out.println(">>>>>>>>>>>>>>> Deactivate counter"); CounterManager2 o2a2 = agentCtrl.getO2AInterface(CounterManager2.class); o2a2.deactivateCounter(); } catch (StaleProxyException e) { e.printStackTrace(); } } }
ekiwi/jade-mirror
src/examples/O2AInterface/O2AInterfaceExample.java
Java
lgpl-2.1
3,081
package codechicken.lib.math; import net.minecraft.util.math.BlockPos; //TODO cleanup. public class MathHelper { public static final double phi = 1.618033988749894; public static final double pi = Math.PI; public static final double todeg = 57.29577951308232; public static final double torad = 0.017453292519943; public static final double sqrt2 = 1.414213562373095; public static double[] SIN_TABLE = new double[65536]; static { for (int i = 0; i < 65536; ++i) { SIN_TABLE[i] = Math.sin(i / 65536D * 2 * Math.PI); } SIN_TABLE[0] = 0; SIN_TABLE[16384] = 1; SIN_TABLE[32768] = 0; SIN_TABLE[49152] = 1; } public static double sin(double d) { return SIN_TABLE[(int) ((float) d * 10430.378F) & 65535]; } public static double cos(double d) { return SIN_TABLE[(int) ((float) d * 10430.378F + 16384.0F) & 65535]; } /** * @param a The value * @param b The value to approach * @param max The maximum step * @return the closed value to b no less than max from a */ public static float approachLinear(float a, float b, float max) { return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); } /** * @param a The value * @param b The value to approach * @param max The maximum step * @return the closed value to b no less than max from a */ public static double approachLinear(double a, double b, double max) { return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); } /** * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static float interpolate(float a, float b, float d) { return a + (b - a) * d; } /** * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static double interpolate(double a, double b, double d) { return a + (b - a) * d; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @return a+(b-a)*ratio */ public static double approachExp(double a, double b, double ratio) { return a + (b - a) * ratio; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @param cap The maximum amount to advance by * @return a+(b-a)*ratio */ public static double approachExp(double a, double b, double ratio, double cap) { double d = (b - a) * ratio; if (Math.abs(d) > cap) { d = Math.signum(d) * cap; } return a + d; } /** * @param a The value * @param b The value to approach * @param ratio The ratio to reduce the difference by * @param c The value to retreat from * @param kick The difference when a == c * @return */ public static double retreatExp(double a, double b, double c, double ratio, double kick) { double d = (Math.abs(c - a) + kick) * ratio; if (d > Math.abs(b - a)) { return b; } return a + Math.signum(b - a) * d; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static double clip(double value, double min, double max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static float clip(float value, float min, float max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static int clip(int value, int min, int max) { if (value > max) { value = max; } if (value < min) { value = min; } return value; } /** * Maps a value range to another value range. * * @param valueIn The value to map. * @param inMin The minimum of the input value range. * @param inMax The maximum of the input value range * @param outMin The minimum of the output value range. * @param outMax The maximum of the output value range. * @return The mapped value. */ public static double map(double valueIn, double inMin, double inMax, double outMin, double outMax) { return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } /** * Maps a value range to another value range. * * @param valueIn The value to map. * @param inMin The minimum of the input value range. * @param inMax The maximum of the input value range * @param outMin The minimum of the output value range. * @param outMax The maximum of the output value range. * @return The mapped value. */ public static float map(float valueIn, float inMin, float inMax, float outMin, float outMax) { return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } /** * Rounds the number of decimal places based on the given multiplier.<br> * e.g.<br> * Input: 17.5245743<br> * multiplier: 1000<br> * Output: 17.534<br> * multiplier: 10<br> * Output 17.5<br><br> * * @param number The input value. * @param multiplier The multiplier. * @return The input rounded to a number of decimal places based on the multiplier. */ public static double round(double number, double multiplier) { return Math.round(number * multiplier) / multiplier; } /** * Rounds the number of decimal places based on the given multiplier.<br> * e.g.<br> * Input: 17.5245743<br> * multiplier: 1000<br> * Output: 17.534<br> * multiplier: 10<br> * Output 17.5<br><br> * * @param number The input value. * @param multiplier The multiplier. * @return The input rounded to a number of decimal places based on the multiplier. */ public static float round(float number, float multiplier) { return Math.round(number * multiplier) / multiplier; } /** * @return min <= value <= max */ public static boolean between(double min, double value, double max) { return min <= value && value <= max; } public static int approachExpI(int a, int b, double ratio) { int r = (int) Math.round(approachExp(a, b, ratio)); return r == a ? b : r; } public static int retreatExpI(int a, int b, int c, double ratio, int kick) { int r = (int) Math.round(retreatExp(a, b, c, ratio, kick)); return r == a ? b : r; } public static int floor(double d) { return net.minecraft.util.math.MathHelper.floor_double(d); } public static int floor(float d) { return net.minecraft.util.math.MathHelper.floor_float(d); } public static int ceil(double d) { return net.minecraft.util.math.MathHelper.ceiling_double_int(d); } public static int ceil(float d) { return net.minecraft.util.math.MathHelper.ceiling_float_int(d); } public static float sqrt(float f) { return net.minecraft.util.math.MathHelper.sqrt_float(f); } public static float sqrt(double f) { return net.minecraft.util.math.MathHelper.sqrt_double(f); } public static int roundAway(double d) { return (int) (d < 0 ? Math.floor(d) : Math.ceil(d)); } public static int compare(int a, int b) { return a == b ? 0 : a < b ? -1 : 1; } public static int compare(double a, double b) { return a == b ? 0 : a < b ? -1 : 1; } public static int absSum(BlockPos pos) { return (pos.getX() < 0 ? -pos.getX() : pos.getX()) + (pos.getY() < 0 ? -pos.getY() : pos.getY()) + (pos.getZ() < 0 ? -pos.getZ() : pos.getZ()); } public static boolean isAxial(BlockPos pos) { return pos.getX() == 0 ? (pos.getY() == 0 || pos.getZ() == 0) : (pos.getY() == 0 && pos.getZ() == 0); } public static int toSide(BlockPos pos) { if (!isAxial(pos)) { return -1; } if (pos.getY() < 0) { return 0; } if (pos.getY() > 0) { return 1; } if (pos.getZ() < 0) { return 2; } if (pos.getZ() > 0) { return 3; } if (pos.getX() < 0) { return 4; } if (pos.getX() > 0) { return 5; } return -1; } }
darkeports/tc5-port
src/main/java/thaumcraft/codechicken/lib/math/MathHelper.java
Java
lgpl-2.1
9,265
/******************************************************************************* * Copyright 2002 National Student Clearinghouse * * This code is part of the Meteor system as defined and specified * by the National Student Clearinghouse and the Meteor Sponsors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ package org.meteornetwork.meteor.common.abstraction.index; import org.meteornetwork.meteor.common.xml.indexresponse.DataProvider; import org.meteornetwork.meteor.common.xml.indexresponse.DataProviders; import org.meteornetwork.meteor.common.xml.indexresponse.IndexProviderData; import org.meteornetwork.meteor.common.xml.indexresponse.IndexProviderMessages; import org.meteornetwork.meteor.common.xml.indexresponse.Message; import org.meteornetwork.meteor.common.xml.indexresponse.MeteorIndexResponse; import org.meteornetwork.meteor.common.xml.indexresponse.types.RsMsgLevelEnum; public class MeteorIndexResponseWrapper { private final MeteorIndexResponse response; public MeteorIndexResponseWrapper() { response = new MeteorIndexResponse(); response.setDataProviders(new DataProviders()); } /** * Add index provider information to the response. * * @param id * the ID of this index provider * @param name * the name of this index provider * @param url * the contact URL of this index provider */ public void setIndexProviderData(String id, String name, String url) { IndexProviderData data = new IndexProviderData(); data.setEntityID(id); data.setEntityName(name); data.setEntityURL(url); response.setIndexProviderData(data); } /** * Add a message to this response * * @param messageText * the text of the message * @param level * the severity level of the message */ public void addMessage(String messageText, RsMsgLevelEnum level) { Message message = new Message(); message.setRsMsg(messageText); message.setRsMsgLevel(level.name()); if (response.getIndexProviderMessages() == null) { response.setIndexProviderMessages(new IndexProviderMessages()); } response.getIndexProviderMessages().addMessage(message); } /** * Add one or more Data Provider objects to the response * * @param dataProviders * the data providers to add to the response */ public void addDataProviders(DataProvider... dataProviders) { for (DataProvider dataProvider : dataProviders) { response.getDataProviders().addDataProvider(dataProvider); } } /** * Add Data Provider objects to the response * * @param dataProviders * an iterable collection of Data Providers to add to the * response */ public void addDataProviders(Iterable<DataProvider> dataProviders) { for (DataProvider dataProvider : dataProviders) { response.getDataProviders().addDataProvider(dataProvider); } } /** * Access a mutable version of the response. * * @return A mutable version of the internal MeteorIndexResponse object */ public MeteorIndexResponse getResponse() { return response; } }
NationalStudentClearinghouse/Meteor4
meteorlib/src/main/java/org/meteornetwork/meteor/common/abstraction/index/MeteorIndexResponseWrapper.java
Java
lgpl-2.1
3,856
/*************************************************************************** * Copyright (C) 2011-2015 by Fabrizio Montesi <famontesi@gmail.com> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * * For details about the authors of this software, see the AUTHORS file. * ***************************************************************************/ package jolie.runtime.typing; import jolie.lang.Constants; /** * * @author Fabrizio Montesi */ public class TypeCastingException extends Exception { public final static long serialVersionUID = Constants.serialVersionUID(); public TypeCastingException() { super(); } public TypeCastingException( String message ) { super( message ); } /* * @Override public Throwable fillInStackTrace() { return this; } */ }
jolie/jolie
jolie/src/main/java/jolie/runtime/typing/TypeCastingException.java
Java
lgpl-2.1
1,972
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ //$Id: $ package org.hibernate.test.join; /** * @author Chris Jones */ public class Thing { private Employee salesperson; private String comments; /** * @return Returns the salesperson. */ public Employee getSalesperson() { return salesperson; } /** * @param salesperson The salesperson to set. */ public void setSalesperson(Employee salesperson) { this.salesperson = salesperson; } /** * @return Returns the comments. */ public String getComments() { return comments; } /** * @param comments The comments to set. */ public void setComments(String comments) { this.comments = comments; } Long id; String name; /** * @return Returns the ID. */ public Long getId() { return id; } /** * @param id The ID to set. */ public void setId(Long id) { this.id = id; } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/test/java/org/hibernate/test/join/Thing.java
Java
lgpl-2.1
1,249
/* * Copyright (C) 2008 Trustin Heuiseung Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA */ package net.gleamynode.netty.channel; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import net.gleamynode.netty.logging.Logger; public class DefaultChannelFuture implements ChannelFuture { private static final Logger logger = Logger.getLogger(DefaultChannelFuture.class); private static final int DEAD_LOCK_CHECK_INTERVAL = 5000; private static final Throwable CANCELLED = new Throwable(); private final Channel channel; private final boolean cancellable; private ChannelFutureListener firstListener; private List<ChannelFutureListener> otherListeners; private boolean done; private Throwable cause; private int waiters; public DefaultChannelFuture(Channel channel, boolean cancellable) { this.channel = channel; this.cancellable = cancellable; } public Channel getChannel() { return channel; } public synchronized boolean isDone() { return done; } public synchronized boolean isSuccess() { return cause == null; } public synchronized Throwable getCause() { if (cause != CANCELLED) { return cause; } else { return null; } } public synchronized boolean isCancelled() { return cause == CANCELLED; } public void addListener(ChannelFutureListener listener) { if (listener == null) { throw new NullPointerException("listener"); } boolean notifyNow = false; synchronized (this) { if (done) { notifyNow = true; } else { if (firstListener == null) { firstListener = listener; } else { if (otherListeners == null) { otherListeners = new ArrayList<ChannelFutureListener>(1); } otherListeners.add(listener); } } } if (notifyNow) { notifyListener(listener); } } public void removeListener(ChannelFutureListener listener) { if (listener == null) { throw new NullPointerException("listener"); } synchronized (this) { if (!done) { if (listener == firstListener) { if (otherListeners != null && !otherListeners.isEmpty()) { firstListener = otherListeners.remove(0); } else { firstListener = null; } } else if (otherListeners != null) { otherListeners.remove(listener); } } } } public ChannelFuture await() throws InterruptedException { synchronized (this) { while (!done) { waiters++; try { this.wait(DEAD_LOCK_CHECK_INTERVAL); checkDeadLock(); } finally { waiters--; } } } return this; } public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return await(unit.toMillis(timeout)); } public boolean await(long timeoutMillis) throws InterruptedException { return await0(timeoutMillis, true); } public ChannelFuture awaitUninterruptibly() { synchronized (this) { while (!done) { waiters++; try { this.wait(DEAD_LOCK_CHECK_INTERVAL); } catch (InterruptedException e) { // Ignore. } finally { waiters--; if (!done) { checkDeadLock(); } } } } return this; } public boolean awaitUninterruptibly(long timeout, TimeUnit unit) { return awaitUninterruptibly(unit.toMillis(timeout)); } public boolean awaitUninterruptibly(long timeoutMillis) { try { return await0(timeoutMillis, false); } catch (InterruptedException e) { throw new InternalError(); } } private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException { long startTime = timeoutMillis <= 0 ? 0 : System.currentTimeMillis(); long waitTime = timeoutMillis; synchronized (this) { if (done) { return done; } else if (waitTime <= 0) { return done; } waiters++; try { for (;;) { try { this.wait(Math.min(waitTime, DEAD_LOCK_CHECK_INTERVAL)); } catch (InterruptedException e) { if (interruptable) { throw e; } } if (done) { return true; } else { waitTime = timeoutMillis - (System.currentTimeMillis() - startTime); if (waitTime <= 0) { return done; } } } } finally { waiters--; if (!done) { checkDeadLock(); } } } } private void checkDeadLock() { // IllegalStateException e = new IllegalStateException( // "DEAD LOCK: " + ChannelFuture.class.getSimpleName() + // ".await() was invoked from an I/O processor thread. " + // "Please use " + ChannelFutureListener.class.getSimpleName() + // " or configure a proper thread model alternatively."); // // StackTraceElement[] stackTrace = e.getStackTrace(); // // // Simple and quick check. // for (StackTraceElement s: stackTrace) { // if (AbstractPollingIoProcessor.class.getName().equals(s.getClassName())) { // throw e; // } // } // // // And then more precisely. // for (StackTraceElement s: stackTrace) { // try { // Class<?> cls = DefaultChannelFuture.class.getClassLoader().loadClass(s.getClassName()); // if (IoProcessor.class.isAssignableFrom(cls)) { // throw e; // } // } catch (Exception cnfe) { // // Ignore // } // } } public void setSuccess() { synchronized (this) { // Allow only once. if (done) { return; } done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); } public void setFailure(Throwable cause) { synchronized (this) { // Allow only once. if (done) { return; } this.cause = cause; done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); } public boolean cancel() { if (!cancellable) { return false; } synchronized (this) { // Allow only once. if (done) { return false; } cause = CANCELLED; done = true; if (waiters > 0) { this.notifyAll(); } } notifyListeners(); return true; } private void notifyListeners() { // There won't be any visibility problem or concurrent modification // because 'ready' flag will be checked against both addListener and // removeListener calls. if (firstListener != null) { notifyListener(firstListener); firstListener = null; if (otherListeners != null) { for (ChannelFutureListener l: otherListeners) { notifyListener(l); } otherListeners = null; } } } private void notifyListener(ChannelFutureListener l) { try { l.operationComplete(this); } catch (Throwable t) { logger.warn( "An exception was thrown by " + ChannelFutureListener.class.getSimpleName() + ".", t); } } }
jiangbo212/netty-init
src/main/java/net/gleamynode/netty/channel/DefaultChannelFuture.java
Java
lgpl-2.1
9,495
/** * Contains the service and the class filter required for this bundle. */ package org.awb.env.networkModel.classFilter;
EnFlexIT/AgentWorkbench
eclipseProjects/org.agentgui/bundles/org.awb.env.networkModel/src/org/awb/env/networkModel/classFilter/package-info.java
Java
lgpl-2.1
127
/* LanguageTool, a natural language style checker * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ package org.languagetool.tokenizers.uk; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.StringTokenizer; import org.languagetool.tokenizers.Tokenizer; /** * Tokenizes a sentence into words. * Punctuation and whitespace gets its own token. * Specific to Ukrainian: apostrophes (0x27 and U+2019) not in the list as they are part of the word * * @author Andriy Rysin */ public class UkrainianWordTokenizer implements Tokenizer { private static final String SPLIT_CHARS = "\u0020\u00A0" + "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007" + "\u2008\u2009\u200A\u200B\u200c\u200d\u200e\u200f" + "\u2028\u2029\u202a\u202b\u202c\u202d\u202e\u202f" + "\u205F\u2060\u2061\u2062\u2063\u206A\u206b\u206c\u206d" + "\u206E\u206F\u3000\u3164\ufeff\uffa0\ufff9\ufffa\ufffb" + ",.;()[]{}<>!?:/|\\\"«»„”“…¿¡\t\n\r\uE100\uE101\uE102\uE110"; // for handling exceptions private static final char DECIMAL_COMMA_SUBST = '\uE001'; // some unused character to hide comma in decimal number temporary for tokenizer run private static final char NON_BREAKING_SPACE_SUBST = '\uE002'; private static final char NON_BREAKING_DOT_SUBST = '\uE003'; // some unused character to hide dot in date temporary for tokenizer run private static final char NON_BREAKING_COLON_SUBST = '\uE004'; // decimal comma between digits private static final Pattern DECIMAL_COMMA_PATTERN = Pattern.compile("([\\d]),([\\d])", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); private static final String DECIMAL_COMMA_REPL = "$1" + DECIMAL_COMMA_SUBST + "$2"; // space between digits private static final Pattern DECIMAL_SPACE_PATTERN = Pattern.compile("(?<=^|[\\s(])\\d{1,3}( [\\d]{3})+(?=[\\s(]|$)", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); // dots in numbers private static final Pattern DOTTED_NUMBERS_PATTERN = Pattern.compile("([\\d])\\.([\\d])", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); private static final String DOTTED_NUMBERS_REPL = "$1" + NON_BREAKING_DOT_SUBST + "$2"; // colon in numbers private static final Pattern COLON_NUMBERS_PATTERN = Pattern.compile("([\\d]):([\\d])", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); private static final String COLON_NUMBERS_REPL = "$1" + NON_BREAKING_COLON_SUBST + "$2"; // dates private static final Pattern DATE_PATTERN = Pattern.compile("([\\d]{2})\\.([\\d]{2})\\.([\\d]{4})|([\\d]{4})\\.([\\d]{2})\\.([\\d]{2})|([\\d]{4})-([\\d]{2})-([\\d]{2})", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); private static final String DATE_PATTERN_REPL = "$1" + NON_BREAKING_DOT_SUBST + "$2" + NON_BREAKING_DOT_SUBST + "$3"; // braces in words private static final Pattern BRACE_IN_WORD_PATTERN = Pattern.compile("([а-яіїєґ'])\\(([а-яіїєґ']+)\\)", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE); private static final char LEFT_BRACE_SUBST = '\uE005'; private static final char RIGHT_BRACE_SUBST = '\uE006'; private static final String BREAKING_PLACEHOLDER = "\uE110"; // abbreviation dot //TODO: л.с., ч.л./ч. л., ст. л., р. х. private static final Pattern ABBR_DOT_TYS_PATTERN = Pattern.compile("(тис)\\.([ \u00A0]+[а-яіїєґ])"); private static final Pattern ABBR_DOT_LAT_PATTERN = Pattern.compile("([^а-яіїєґА-ЯІЇЄҐ'-]лат)\\.([ \u00A0]+[a-zA-Z])"); private static final Pattern ABBR_DOT_PROF_PATTERN = Pattern.compile("([Аа]кад|[Пп]роф|[Дд]оц|[Аа]сист|вул|о|р|ім)\\.([\\s\u00A0]+[А-ЯІЇЄҐ])"); // tokenize initials with dot, e.g. "А.", "Ковальчук" private static final Pattern INITIALS_DOT_PATTERN_SP_2 = Pattern.compile("([А-ЯІЇЄҐ])\\.([\\s\u00A0][А-ЯІЇЄҐ])\\.([\\s\u00A0][А-ЯІЇЄҐ][а-яіїєґ']+)"); private static final String INITIALS_DOT_REPL_SP_2 = "$1" + NON_BREAKING_DOT_SUBST + "$2" + NON_BREAKING_DOT_SUBST + "$3"; private static final Pattern INITIALS_DOT_PATTERN_SP_1 = Pattern.compile("([А-ЯІЇЄҐ])\\.([\\s\u00A0][А-ЯІЇЄҐ][а-яіїєґ']+)"); private static final String INITIALS_DOT_REPL_SP_1 = "$1" + NON_BREAKING_DOT_SUBST + "$2"; private static final Pattern INITIALS_DOT_PATTERN_NSP_2 = Pattern.compile("([А-ЯІЇЄҐ])\\.([А-ЯІЇЄҐ])\\.([А-ЯІЇЄҐ][а-яіїєґ']+)"); private static final String INITIALS_DOT_REPL_NSP_2 = "$1" + NON_BREAKING_DOT_SUBST + BREAKING_PLACEHOLDER + "$2" + NON_BREAKING_DOT_SUBST + BREAKING_PLACEHOLDER + "$3"; private static final Pattern INITIALS_DOT_PATTERN_NSP_1 = Pattern.compile("([А-ЯІЇЄҐ])\\.([А-ЯІЇЄҐ][а-яіїєґ']+)"); private static final String INITIALS_DOT_REPL_NSP_1 = "$1" + NON_BREAKING_DOT_SUBST + BREAKING_PLACEHOLDER + "$2"; // село, місто, річка (якщо з цифрою: секунди, метри, роки) - з роками складно private static final Pattern ABBR_DOT_KUB_SM_PATTERN = Pattern.compile("((?:[0-9]|кв\\.?|куб\\.?)[\\s\u00A0]+[см])\\."); private static final Pattern ABBR_DOT_S_G_PATTERN = Pattern.compile("(с)\\.(-г)\\."); private static final Pattern ABBR_DOT_2_SMALL_LETTERS_PATTERN = Pattern.compile("([^а-яіїєґ'-][векнпрстцч]{1,2})\\.([екмнпрстч]{1,2})\\."); private static final String ABBR_DOT_2_SMALL_LETTERS_REPL = "$1" + NON_BREAKING_DOT_SUBST + BREAKING_PLACEHOLDER + "$2" + NON_BREAKING_DOT_SUBST; // скорочення що не можуть бути в кінці речення private static final Pattern ABBR_DOT_NON_ENDING_PATTERN = Pattern.compile("([^а-яіїєґА-ЯІЇЄҐ'-](?:амер|англ|бл(?:изьк)?|буд|вірм|грец(?:ьк)|див|дол|досл|доц|ел|жін|заст|зв|ім|івр|ісп|італ|к|кв|[1-9]-кімн|кімн|кл|м|н|напр|п|пен|перекл|пл|пор|поч|прибл|пров|просп|[Рр]ед|[Рр]еж|рт|с|[Сс]в|соц|співавт|стор|табл|тел|укр|філол|фр|франц|ч|чайн|ц))\\.(?!$)"); // скорочення що можуть бути в кінці речення private static final Pattern ABBR_DOT_ENDING_PATTERN = Pattern.compile("([^а-яіїєґА-ЯІЇЄҐ'-]((та|й) ін|е|коп|обл|р|рр|руб|ст|стол|стор|чол|шт))\\."); private static final Pattern ABBR_DOT_I_T_P_PATTERN = Pattern.compile("([ій][ \u00A0]+т)\\.([ \u00A0]*(д|п|ін))\\."); // Сьогодні (у четвер. - Ред.), вранці. // private static final Pattern ABBR_DOT_PATTERN8 = Pattern.compile("([\\s\u00A0]+[–—-][\\s\u00A0]+(?:[Рр]ед|[Аа]вт))\\.([\\)\\]])"); private static final Pattern ABBR_DOT_RED_AVT_PATTERN = Pattern.compile("([\\s\u00A0]+(?:[Рр]ед|[Аа]вт))\\.([\\)\\]])"); // ellipsis private static final String ELLIPSIS = "..."; private static final String ELLIPSIS_SUBST = "\uE100"; private static final String ELLIPSIS2 = "!.."; private static final String ELLIPSIS2_SUBST = "\uE101"; private static final String ELLIPSIS3 = "?.."; private static final String ELLIPSIS3_SUBST = "\uE102"; private static final String SOFT_HYPHEN_WRAP = "\u00AD\n"; private static final String SOFT_HYPHEN_WRAP_SUBST = "\uE103"; // url private static final Pattern URL_PATTERN = Pattern.compile("^(https?|ftp)://[^\\s/$.?#].[^\\s]*$", Pattern.CASE_INSENSITIVE); private static final int URL_START_REPLACE_CHAR = 0xE300; public UkrainianWordTokenizer() { } @Override public List<String> tokenize(String text) { HashMap<String, String> urls = new HashMap<>(); text = cleanup(text); if( text.contains(",") ) { text = DECIMAL_COMMA_PATTERN.matcher(text).replaceAll(DECIMAL_COMMA_REPL); } // check for urls if( text.contains("tp") ) { // https?|ftp Matcher matcher = URL_PATTERN.matcher(text); int urlReplaceChar = URL_START_REPLACE_CHAR; while( matcher.find() ) { String urlGroup = matcher.group(); String replaceChar = String.valueOf((char)urlReplaceChar); urls.put(replaceChar, urlGroup); text = matcher.replaceAll(replaceChar); urlReplaceChar++; } } // if period is not the last character in the sentence int dotIndex = text.indexOf("."); boolean dotInsideSentence = dotIndex >= 0 && dotIndex < text.length()-1; if( dotInsideSentence ){ if( text.contains(ELLIPSIS) ) { text = text.replace(ELLIPSIS, ELLIPSIS_SUBST); } if( text.contains(ELLIPSIS2) ) { text = text.replace(ELLIPSIS2, ELLIPSIS2_SUBST); } if( text.contains(ELLIPSIS3) ) { text = text.replace(ELLIPSIS3, ELLIPSIS3_SUBST); } text = DATE_PATTERN.matcher(text).replaceAll(DATE_PATTERN_REPL); text = DOTTED_NUMBERS_PATTERN.matcher(text).replaceAll(DOTTED_NUMBERS_REPL); text = ABBR_DOT_2_SMALL_LETTERS_PATTERN.matcher(text).replaceAll(ABBR_DOT_2_SMALL_LETTERS_REPL); text = ABBR_DOT_TYS_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2"); text = ABBR_DOT_LAT_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2"); text = ABBR_DOT_PROF_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2"); text = INITIALS_DOT_PATTERN_SP_2.matcher(text).replaceAll(INITIALS_DOT_REPL_SP_2); text = INITIALS_DOT_PATTERN_SP_1.matcher(text).replaceAll(INITIALS_DOT_REPL_SP_1); text = INITIALS_DOT_PATTERN_NSP_2.matcher(text).replaceAll(INITIALS_DOT_REPL_NSP_2); text = INITIALS_DOT_PATTERN_NSP_1.matcher(text).replaceAll(INITIALS_DOT_REPL_NSP_1); text = ABBR_DOT_KUB_SM_PATTERN.matcher(text).replaceAll("$1" + BREAKING_PLACEHOLDER + NON_BREAKING_DOT_SUBST); text = ABBR_DOT_S_G_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2" + NON_BREAKING_DOT_SUBST); text = ABBR_DOT_I_T_P_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2" + NON_BREAKING_DOT_SUBST); text = ABBR_DOT_RED_AVT_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST + "$2"); text = ABBR_DOT_NON_ENDING_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST); } text = ABBR_DOT_ENDING_PATTERN.matcher(text).replaceAll("$1" + NON_BREAKING_DOT_SUBST); // 2 000 000 Matcher spacedDecimalMatcher = DECIMAL_SPACE_PATTERN.matcher(text); if( spacedDecimalMatcher.find() ) { StringBuffer sb = new StringBuffer(); do { String splitNumber = spacedDecimalMatcher.group(0); String splitNumberAdjusted = splitNumber.replace(' ', NON_BREAKING_SPACE_SUBST); splitNumberAdjusted = splitNumberAdjusted.replace('\u00A0', NON_BREAKING_SPACE_SUBST); spacedDecimalMatcher.appendReplacement(sb, splitNumberAdjusted); } while( spacedDecimalMatcher.find() ); spacedDecimalMatcher.appendTail(sb); text = sb.toString(); } // 12:25 if( text.contains(":") ) { text = COLON_NUMBERS_PATTERN.matcher(text).replaceAll(COLON_NUMBERS_REPL); } // ВКПБ(о) if( text.contains("(") ) { text = BRACE_IN_WORD_PATTERN.matcher(text).replaceAll("$1" + LEFT_BRACE_SUBST + "$2" + RIGHT_BRACE_SUBST); } if( text.contains(SOFT_HYPHEN_WRAP) ) { text = text.replace(SOFT_HYPHEN_WRAP, SOFT_HYPHEN_WRAP_SUBST); } List<String> tokenList = new ArrayList<>(); StringTokenizer st = new StringTokenizer(text, SPLIT_CHARS, true); while (st.hasMoreElements()) { String token = st.nextToken(); if( token.equals(BREAKING_PLACEHOLDER) ) continue; token = token.replace(DECIMAL_COMMA_SUBST, ','); token = token.replace(NON_BREAKING_COLON_SUBST, ':'); token = token.replace(NON_BREAKING_SPACE_SUBST, ' '); token = token.replace(LEFT_BRACE_SUBST, '('); token = token.replace(RIGHT_BRACE_SUBST, ')'); // outside of if as we also replace back sentence-ending abbreviations token = token.replace(NON_BREAKING_DOT_SUBST, '.'); if( dotInsideSentence ){ token = token.replace(ELLIPSIS_SUBST, ELLIPSIS); token = token.replace(ELLIPSIS2_SUBST, ELLIPSIS2); token = token.replace(ELLIPSIS3_SUBST, ELLIPSIS3); } token = token.replace(SOFT_HYPHEN_WRAP_SUBST, SOFT_HYPHEN_WRAP); if( ! urls.isEmpty() ) { for(Entry<String, String> entry : urls.entrySet()) { token = token.replace(entry.getKey(), entry.getValue()); } } tokenList.add( token ); } return tokenList; } private static String cleanup(String text) { text = text .replace('\u2019', '\'') .replace('\u02BC', '\'') .replace('\u2018', '\'') .replace('`', '\'') .replace('´', '\'') .replace('\u2011', '-'); // we handle \u2013 in tagger so we can base our rule on it return text; } }
meg0man/languagetool
languagetool-language-modules/uk/src/main/java/org/languagetool/tokenizers/uk/UkrainianWordTokenizer.java
Java
lgpl-2.1
13,891
/** * Copyright (C) 2012 Orbeon, Inc. * * This program is free software; you can redistribute it and/or modify it under the terms of the * GNU Lesser General Public License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * The full text of the license is available at http://www.gnu.org/copyleft/lesser.html */ package org.orbeon.oxf.processor.serializer; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.log4j.Logger; import org.dom4j.Document; import org.orbeon.oxf.common.OXFException; import org.orbeon.oxf.pipeline.api.PipelineContext; import org.orbeon.oxf.pipeline.api.XMLReceiver; import org.orbeon.oxf.processor.*; import org.orbeon.oxf.processor.serializer.store.ResultStore; import org.orbeon.oxf.processor.serializer.store.ResultStoreOutputStream; import org.orbeon.oxf.util.LoggerFactory; import org.orbeon.oxf.util.NetUtils; import org.orbeon.oxf.xforms.processor.XFormsResourceServer; import org.orbeon.oxf.xml.XMLUtils; import org.orbeon.oxf.xml.XPathUtils; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; /** * The File Serializer serializes text and binary documents to files on disk. */ public class FileSerializer extends ProcessorImpl { private static Logger logger = LoggerFactory.createLogger(FileSerializer.class); public static final String FILE_SERIALIZER_CONFIG_NAMESPACE_URI = "http://orbeon.org/oxf/xml/file-serializer-config"; public static final String DIRECTORY_PROPERTY = "directory"; // NOTE: Those are also in HttpSerializerBase private static final boolean DEFAULT_FORCE_CONTENT_TYPE = false; private static final boolean DEFAULT_IGNORE_DOCUMENT_CONTENT_TYPE = false; private static final boolean DEFAULT_FORCE_ENCODING = false; private static final boolean DEFAULT_IGNORE_DOCUMENT_ENCODING = false; private static final boolean DEFAULT_APPEND = false; private static final boolean DEFAULT_MAKE_DIRECTORIES = false; static { try { // Create factory DocumentBuilderFactory documentBuilderFactory = (DocumentBuilderFactory) Class.forName("orbeon.apache.xerces.jaxp.DocumentBuilderFactoryImpl").newInstance(); // Configure factory documentBuilderFactory.setNamespaceAware(true); } catch (Exception e) { throw new OXFException(e); } } public FileSerializer() { addInputInfo(new ProcessorInputOutputInfo(INPUT_CONFIG, FILE_SERIALIZER_CONFIG_NAMESPACE_URI)); addInputInfo(new ProcessorInputOutputInfo(INPUT_DATA)); // We don't declare the "data" output here, as this is an optional output. // If we declare it, we'll the XPL engine won't be happy when don't connect anything to that output. } private static class Config { private String directory; private String file; private String scope; private boolean proxyResult; private String url; private boolean append; private boolean makeDirectories; private boolean cacheUseLocalCache; private boolean forceContentType; private String requestedContentType; private boolean ignoreDocumentContentType; private boolean forceEncoding; private String requestedEncoding; private boolean ignoreDocumentEncoding; public Config(Document document) { // Directory and file directory = XPathUtils.selectStringValueNormalize(document, "/config/directory"); file = XPathUtils.selectStringValueNormalize(document, "/config/file"); // Scope scope = XPathUtils.selectStringValueNormalize(document, "/config/scope"); // Proxy result proxyResult = ProcessorUtils.selectBooleanValue(document, "/config/proxy-result", false); // URL url = XPathUtils.selectStringValueNormalize(document, "/config/url"); // Cache control cacheUseLocalCache = ProcessorUtils.selectBooleanValue(document, "/config/cache-control/use-local-cache", CachedSerializer.DEFAULT_CACHE_USE_LOCAL_CACHE); // Whether to append or not append = ProcessorUtils.selectBooleanValue(document, "/config/append", DEFAULT_APPEND); // Whether to append or not makeDirectories = ProcessorUtils.selectBooleanValue(document, "/config/make-directories", DEFAULT_MAKE_DIRECTORIES); // Content-type and Encoding requestedContentType = XPathUtils.selectStringValueNormalize(document, "/config/content-type"); forceContentType = ProcessorUtils.selectBooleanValue(document, "/config/force-content-type", DEFAULT_FORCE_CONTENT_TYPE); // TODO: We don't seem to be using the content type in the file serializer. // Maybe this is something that was left over from the days when the file serializer was also serializing XML. if (forceContentType) throw new OXFException("The force-content-type element requires a content-type element."); ignoreDocumentContentType = ProcessorUtils.selectBooleanValue(document, "/config/ignore-document-content-type", DEFAULT_IGNORE_DOCUMENT_CONTENT_TYPE); requestedEncoding = XPathUtils.selectStringValueNormalize(document, "/config/encoding"); forceEncoding = ProcessorUtils.selectBooleanValue(document, "/config/force-encoding", DEFAULT_FORCE_ENCODING); if (forceEncoding && (requestedEncoding == null || requestedEncoding.equals(""))) throw new OXFException("The force-encoding element requires an encoding element."); ignoreDocumentEncoding = ProcessorUtils.selectBooleanValue(document, "/config/ignore-document-encoding", DEFAULT_IGNORE_DOCUMENT_ENCODING); } public String getDirectory() { return directory; } public String getFile() { return file; } public String getScope() { return scope; } public boolean isProxyResult() { return proxyResult; } public String getUrl() { return url; } public boolean isAppend() { return append; } public boolean isMakeDirectories() { return makeDirectories; } public boolean isCacheUseLocalCache() { return cacheUseLocalCache; } public boolean isForceContentType() { return forceContentType; } public boolean isForceEncoding() { return forceEncoding; } public boolean isIgnoreDocumentContentType() { return ignoreDocumentContentType; } public boolean isIgnoreDocumentEncoding() { return ignoreDocumentEncoding; } public String getRequestedContentType() { return requestedContentType; } public String getRequestedEncoding() { return requestedEncoding; } } @Override public void start(PipelineContext context) { try { // Read config final Config config = readCacheInputAsObject(context, getInputByName(INPUT_CONFIG), new CacheableInputReader<Config>() { public Config read(PipelineContext context, ProcessorInput input) { return new Config(readInputAsDOM4J(context, input)); } }); final ProcessorInput dataInput = getInputByName(INPUT_DATA); // Get file object final String directory = config.getDirectory() != null ? config.getDirectory() : getPropertySet().getString(DIRECTORY_PROPERTY); final File file = NetUtils.getFile(directory, config.getFile(), config.getUrl(), getLocationData(), config.isMakeDirectories()); // NOTE: Caching here is broken, so we never cache. This is what we should do in case // we want caching: // o for a given file, store a hash of the content stored (or the input key?) // o then when we check whether we need to modify the file, check against the key // AND the validity // Delete file if it exists, unless we append if (!config.isAppend() && file.exists()) { final boolean deleted = file.delete(); // We test on file.exists() here again so we don't complain that the file can't be deleted if it got // deleted just between our last test and the delete operation. if (!deleted && file.exists()) throw new OXFException("Can't delete file: " + file); } // Create file if needed file.createNewFile(); FileOutputStream fileOutputStream = new FileOutputStream(file, config.isAppend()); writeToFile(context, config, dataInput, fileOutputStream); } catch (Exception e) { throw new OXFException(e); } } private void writeToFile(PipelineContext context, final Config config, ProcessorInput dataInput, final OutputStream fileOutputStream) throws IOException { try { if (config.cacheUseLocalCache) { // If caching of the data is enabled, use the caching API // We return a ResultStore final boolean[] read = new boolean[1]; ResultStore filter = (ResultStore) readCacheInputAsObject(context, dataInput, new CacheableInputReader() { public Object read(PipelineContext context, ProcessorInput input) { read[0] = true; if (logger.isDebugEnabled()) logger.debug("Output not cached"); try { ResultStoreOutputStream resultStoreOutputStream = new ResultStoreOutputStream(fileOutputStream); readInputAsSAX(context, input, new BinaryTextXMLReceiver(null, resultStoreOutputStream, true, config.forceContentType, config.requestedContentType, config.ignoreDocumentContentType, config.forceEncoding, config.requestedEncoding, config.ignoreDocumentEncoding)); resultStoreOutputStream.close(); return resultStoreOutputStream; } catch (IOException e) { throw new OXFException(e); } } }); // If the output was obtained from the cache, just write it if (!read[0]) { if (logger.isDebugEnabled()) logger.debug("Serializer output cached"); filter.replay(fileOutputStream); } } else { // Caching is not enabled readInputAsSAX(context, dataInput, new BinaryTextXMLReceiver(null, fileOutputStream, true, config.forceContentType, config.requestedContentType, config.ignoreDocumentContentType, config.forceEncoding, config.requestedEncoding, config.ignoreDocumentEncoding)); fileOutputStream.close(); } } finally { if (fileOutputStream != null) fileOutputStream.close(); } } /** * Case where a response must be generated. */ @Override public ProcessorOutput createOutput(String name) { final ProcessorOutput output = new ProcessorOutputImpl(FileSerializer.this, name) { public void readImpl(PipelineContext pipelineContext, XMLReceiver xmlReceiver) { OutputStream fileOutputStream = null; try { //Get the input and config final Config config = getConfig(pipelineContext); final ProcessorInput dataInput = getInputByName(INPUT_DATA); // Determine scope final int scope; if ("request".equals(config.getScope())) { scope = NetUtils.REQUEST_SCOPE; } else if ("session".equals(config.getScope())) { scope = NetUtils.SESSION_SCOPE; } else if ("application".equals(config.getScope())) { scope = NetUtils.APPLICATION_SCOPE; } else { throw new OXFException("Invalid context requested: " + config.getScope()); } // We use the commons fileupload utilities to write to file final FileItem fileItem = NetUtils.prepareFileItem(scope); fileOutputStream = fileItem.getOutputStream(); writeToFile(pipelineContext, config, dataInput, fileOutputStream); // Create file if it doesn't exist final File storeLocation = ((DiskFileItem) fileItem).getStoreLocation(); storeLocation.createNewFile(); // Get the url of the file final String resultURL; { final String localURL = ((DiskFileItem) fileItem).getStoreLocation().toURI().toString(); if ("session".equals(config.getScope()) && config.isProxyResult()) resultURL = XFormsResourceServer.jProxyURI(localURL, config.getRequestedContentType()); else resultURL = localURL; } xmlReceiver.startDocument(); xmlReceiver.startElement("", "url", "url", XMLUtils.EMPTY_ATTRIBUTES); xmlReceiver.characters(resultURL.toCharArray(), 0, resultURL.length()); xmlReceiver.endElement("", "url", "url"); xmlReceiver.endDocument(); } catch (SAXException e) { throw new OXFException(e); } catch (IOException e) { throw new OXFException(e); } finally { if (fileOutputStream != null) { try { fileOutputStream.close(); } catch (IOException e) { throw new OXFException(e); } } } } }; addOutput(name, output); return output; } protected Config getConfig(PipelineContext pipelineContext) { // Read config return readCacheInputAsObject(pipelineContext, getInputByName(INPUT_CONFIG), new CacheableInputReader<Config>() { public Config read(PipelineContext context, ProcessorInput input) { return new Config(readInputAsDOM4J(context, input)); } }); } }
evlist/orbeon-forms
src/main/java/org/orbeon/oxf/processor/serializer/FileSerializer.java
Java
lgpl-2.1
15,660
/*** Copyright (c) 2011, 2014 Hércules S. S. José Este arquivo é parte do programa Imobiliária Web. Imobiliária Web é um software livre; você pode redistribui-lo e/ou modificá-lo dentro dos termos da Licença Pública Geral Menor GNU como publicada pela Fundação do Software Livre (FSF); na versão 2.1 da Licença. Este programa é distribuído na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral Menor GNU em português para maiores detalhes. Você deve ter recebido uma cópia da Licença Pública Geral Menor GNU sob o nome de "LICENSE.TXT" junto com este programa, se não, acesse o site HSlife no endereco www.hslife.com.br ou escreva para a Fundação do Software Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Para mais informações sobre o programa Imobiliária Web e seus autores acesso o endereço www.hslife.com.br, pelo e-mail contato@hslife.com.br ou escreva para Hércules S. S. José, Av. Ministro Lafaeyte de Andrade, 1683 - Bl. 3 Apt 404, Marco II - Nova Iguaçu, RJ, Brasil. ***/ package br.com.hslife.imobiliaria.logic; import java.util.List; import br.com.hslife.imobiliaria.exception.BusinessException; import br.com.hslife.imobiliaria.model.Usuario; public interface IUsuario { public void cadastrar(Usuario usuario) throws BusinessException; public void editar(Usuario usuario) throws BusinessException; public void habilitar(Long id) throws BusinessException; public Usuario buscar(Long id) throws BusinessException; public List<Usuario> buscar(Usuario usuario) throws BusinessException; public List<Usuario> buscarTodos() throws BusinessException; public Usuario buscarPorLogin(String login) throws BusinessException; public List<Usuario> buscarTodosPorLogin(String login) throws BusinessException; }
herculeshssj/imobiliariaweb
src/br/com/hslife/imobiliaria/logic/IUsuario.java
Java
lgpl-2.1
2,132
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.pades.timestamp; import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.io.InputStream; import java.util.List; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature; import org.junit.jupiter.api.Test; import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.model.InMemoryDocument; import eu.europa.esig.dss.pades.PAdESTimestampParameters; import eu.europa.esig.dss.pades.signature.PAdESService; import eu.europa.esig.dss.test.signature.PKIFactoryAccess; public class PDFTimestampServiceTest extends PKIFactoryAccess { @Test public void timestampAlone() throws IOException { PAdESService service = new PAdESService(getCompleteCertificateVerifier()); service.setTspSource(getGoodTsa()); PAdESTimestampParameters parameters = new PAdESTimestampParameters(); DSSDocument document = new InMemoryDocument(getClass().getResourceAsStream("/sample.pdf")); DSSDocument timestamped = service.timestamp(document, parameters); try (InputStream is = timestamped.openStream(); PDDocument doc = PDDocument.load(is)) { List<PDSignature> signatureDictionaries = doc.getSignatureDictionaries(); assertEquals(1, signatureDictionaries.size()); PDSignature pdSignature = signatureDictionaries.get(0); assertNotNull(pdSignature); assertEquals("Adobe.PPKLite", pdSignature.getFilter()); assertEquals("ETSI.RFC3161", pdSignature.getSubFilter()); } } @Override protected String getSigningAlias() { return null; } }
openlimit-signcubes/dss
dss-pades-pdfbox/src/test/java/eu/europa/esig/dss/pades/timestamp/PDFTimestampServiceTest.java
Java
lgpl-2.1
2,583
/** */ package net.opengis.gml311; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Abstract Parametric Curve Surface Type</b></em>'. * <!-- end-user-doc --> * * <!-- begin-model-doc --> * * * <!-- end-model-doc --> * * * @see net.opengis.gml311.Gml311Package#getAbstractParametricCurveSurfaceType() * @model extendedMetaData="name='AbstractParametricCurveSurfaceType' kind='empty'" * @generated */ public interface AbstractParametricCurveSurfaceType extends AbstractSurfacePatchType { } // AbstractParametricCurveSurfaceType
geotools/geotools
modules/ogc/net.opengis.wmts/src/net/opengis/gml311/AbstractParametricCurveSurfaceType.java
Java
lgpl-2.1
576
/* Simple DirectMedia Layer Java source code (C) 2009-2011 Sergii Pylypenko This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ package net.sourceforge.clonekeenplus; import java.lang.String; import java.util.ArrayList; import java.util.Arrays; import java.lang.reflect.Field; // Autogenerated by hand with a command: // grep 'SDLK_' SDL_keysym.h | sed 's/SDLK_\([a-zA-Z0-9_]\+\).*[=] \([0-9]\+\).*/public static final int SDLK_\1 = \2;/' >> Keycodes.java class SDL_1_2_Keycodes { public static final int SDLK_UNKNOWN = 0; public static final int SDLK_BACKSPACE = 8; public static final int SDLK_TAB = 9; public static final int SDLK_CLEAR = 12; public static final int SDLK_RETURN = 13; public static final int SDLK_PAUSE = 19; public static final int SDLK_ESCAPE = 27; public static final int SDLK_SPACE = 32; public static final int SDLK_EXCLAIM = 33; public static final int SDLK_QUOTEDBL = 34; public static final int SDLK_HASH = 35; public static final int SDLK_DOLLAR = 36; public static final int SDLK_AMPERSAND = 38; public static final int SDLK_QUOTE = 39; public static final int SDLK_LEFTPAREN = 40; public static final int SDLK_RIGHTPAREN = 41; public static final int SDLK_ASTERISK = 42; public static final int SDLK_PLUS = 43; public static final int SDLK_COMMA = 44; public static final int SDLK_MINUS = 45; public static final int SDLK_PERIOD = 46; public static final int SDLK_SLASH = 47; public static final int SDLK_0 = 48; public static final int SDLK_1 = 49; public static final int SDLK_2 = 50; public static final int SDLK_3 = 51; public static final int SDLK_4 = 52; public static final int SDLK_5 = 53; public static final int SDLK_6 = 54; public static final int SDLK_7 = 55; public static final int SDLK_8 = 56; public static final int SDLK_9 = 57; public static final int SDLK_COLON = 58; public static final int SDLK_SEMICOLON = 59; public static final int SDLK_LESS = 60; public static final int SDLK_EQUALS = 61; public static final int SDLK_GREATER = 62; public static final int SDLK_QUESTION = 63; public static final int SDLK_AT = 64; public static final int SDLK_LEFTBRACKET = 91; public static final int SDLK_BACKSLASH = 92; public static final int SDLK_RIGHTBRACKET = 93; public static final int SDLK_CARET = 94; public static final int SDLK_UNDERSCORE = 95; public static final int SDLK_BACKQUOTE = 96; public static final int SDLK_a = 97; public static final int SDLK_b = 98; public static final int SDLK_c = 99; public static final int SDLK_d = 100; public static final int SDLK_e = 101; public static final int SDLK_f = 102; public static final int SDLK_g = 103; public static final int SDLK_h = 104; public static final int SDLK_i = 105; public static final int SDLK_j = 106; public static final int SDLK_k = 107; public static final int SDLK_l = 108; public static final int SDLK_m = 109; public static final int SDLK_n = 110; public static final int SDLK_o = 111; public static final int SDLK_p = 112; public static final int SDLK_q = 113; public static final int SDLK_r = 114; public static final int SDLK_s = 115; public static final int SDLK_t = 116; public static final int SDLK_u = 117; public static final int SDLK_v = 118; public static final int SDLK_w = 119; public static final int SDLK_x = 120; public static final int SDLK_y = 121; public static final int SDLK_z = 122; public static final int SDLK_DELETE = 127; public static final int SDLK_WORLD_0 = 160; public static final int SDLK_WORLD_1 = 161; public static final int SDLK_WORLD_2 = 162; public static final int SDLK_WORLD_3 = 163; public static final int SDLK_WORLD_4 = 164; public static final int SDLK_WORLD_5 = 165; public static final int SDLK_WORLD_6 = 166; public static final int SDLK_WORLD_7 = 167; public static final int SDLK_WORLD_8 = 168; public static final int SDLK_WORLD_9 = 169; public static final int SDLK_WORLD_10 = 170; public static final int SDLK_WORLD_11 = 171; public static final int SDLK_WORLD_12 = 172; public static final int SDLK_WORLD_13 = 173; public static final int SDLK_WORLD_14 = 174; public static final int SDLK_WORLD_15 = 175; public static final int SDLK_WORLD_16 = 176; public static final int SDLK_WORLD_17 = 177; public static final int SDLK_WORLD_18 = 178; public static final int SDLK_WORLD_19 = 179; public static final int SDLK_WORLD_20 = 180; public static final int SDLK_WORLD_21 = 181; public static final int SDLK_WORLD_22 = 182; public static final int SDLK_WORLD_23 = 183; public static final int SDLK_WORLD_24 = 184; public static final int SDLK_WORLD_25 = 185; public static final int SDLK_WORLD_26 = 186; public static final int SDLK_WORLD_27 = 187; public static final int SDLK_WORLD_28 = 188; public static final int SDLK_WORLD_29 = 189; public static final int SDLK_WORLD_30 = 190; public static final int SDLK_WORLD_31 = 191; public static final int SDLK_WORLD_32 = 192; public static final int SDLK_WORLD_33 = 193; public static final int SDLK_WORLD_34 = 194; public static final int SDLK_WORLD_35 = 195; public static final int SDLK_WORLD_36 = 196; public static final int SDLK_WORLD_37 = 197; public static final int SDLK_WORLD_38 = 198; public static final int SDLK_WORLD_39 = 199; public static final int SDLK_WORLD_40 = 200; public static final int SDLK_WORLD_41 = 201; public static final int SDLK_WORLD_42 = 202; public static final int SDLK_WORLD_43 = 203; public static final int SDLK_WORLD_44 = 204; public static final int SDLK_WORLD_45 = 205; public static final int SDLK_WORLD_46 = 206; public static final int SDLK_WORLD_47 = 207; public static final int SDLK_WORLD_48 = 208; public static final int SDLK_WORLD_49 = 209; public static final int SDLK_WORLD_50 = 210; public static final int SDLK_WORLD_51 = 211; public static final int SDLK_WORLD_52 = 212; public static final int SDLK_WORLD_53 = 213; public static final int SDLK_WORLD_54 = 214; public static final int SDLK_WORLD_55 = 215; public static final int SDLK_WORLD_56 = 216; public static final int SDLK_WORLD_57 = 217; public static final int SDLK_WORLD_58 = 218; public static final int SDLK_WORLD_59 = 219; public static final int SDLK_WORLD_60 = 220; public static final int SDLK_WORLD_61 = 221; public static final int SDLK_WORLD_62 = 222; public static final int SDLK_WORLD_63 = 223; public static final int SDLK_WORLD_64 = 224; public static final int SDLK_WORLD_65 = 225; public static final int SDLK_WORLD_66 = 226; public static final int SDLK_WORLD_67 = 227; public static final int SDLK_WORLD_68 = 228; public static final int SDLK_WORLD_69 = 229; public static final int SDLK_WORLD_70 = 230; public static final int SDLK_WORLD_71 = 231; public static final int SDLK_WORLD_72 = 232; public static final int SDLK_WORLD_73 = 233; public static final int SDLK_WORLD_74 = 234; public static final int SDLK_WORLD_75 = 235; public static final int SDLK_WORLD_76 = 236; public static final int SDLK_WORLD_77 = 237; public static final int SDLK_WORLD_78 = 238; public static final int SDLK_WORLD_79 = 239; public static final int SDLK_WORLD_80 = 240; public static final int SDLK_WORLD_81 = 241; public static final int SDLK_WORLD_82 = 242; public static final int SDLK_WORLD_83 = 243; public static final int SDLK_WORLD_84 = 244; public static final int SDLK_WORLD_85 = 245; public static final int SDLK_WORLD_86 = 246; public static final int SDLK_WORLD_87 = 247; public static final int SDLK_WORLD_88 = 248; public static final int SDLK_WORLD_89 = 249; public static final int SDLK_WORLD_90 = 250; public static final int SDLK_WORLD_91 = 251; public static final int SDLK_WORLD_92 = 252; public static final int SDLK_WORLD_93 = 253; public static final int SDLK_WORLD_94 = 254; public static final int SDLK_WORLD_95 = 255; public static final int SDLK_KP0 = 256; public static final int SDLK_KP1 = 257; public static final int SDLK_KP2 = 258; public static final int SDLK_KP3 = 259; public static final int SDLK_KP4 = 260; public static final int SDLK_KP5 = 261; public static final int SDLK_KP6 = 262; public static final int SDLK_KP7 = 263; public static final int SDLK_KP8 = 264; public static final int SDLK_KP9 = 265; public static final int SDLK_KP_PERIOD = 266; public static final int SDLK_KP_DIVIDE = 267; public static final int SDLK_KP_MULTIPLY = 268; public static final int SDLK_KP_MINUS = 269; public static final int SDLK_KP_PLUS = 270; public static final int SDLK_KP_ENTER = 271; public static final int SDLK_KP_EQUALS = 272; public static final int SDLK_UP = 273; public static final int SDLK_DOWN = 274; public static final int SDLK_RIGHT = 275; public static final int SDLK_LEFT = 276; public static final int SDLK_INSERT = 277; public static final int SDLK_HOME = 278; public static final int SDLK_END = 279; public static final int SDLK_PAGEUP = 280; public static final int SDLK_PAGEDOWN = 281; public static final int SDLK_F1 = 282; public static final int SDLK_F2 = 283; public static final int SDLK_F3 = 284; public static final int SDLK_F4 = 285; public static final int SDLK_F5 = 286; public static final int SDLK_F6 = 287; public static final int SDLK_F7 = 288; public static final int SDLK_F8 = 289; public static final int SDLK_F9 = 290; public static final int SDLK_F10 = 291; public static final int SDLK_F11 = 292; public static final int SDLK_F12 = 293; public static final int SDLK_F13 = 294; public static final int SDLK_F14 = 295; public static final int SDLK_F15 = 296; public static final int SDLK_NUMLOCK = 300; public static final int SDLK_CAPSLOCK = 301; public static final int SDLK_SCROLLOCK = 302; public static final int SDLK_RSHIFT = 303; public static final int SDLK_LSHIFT = 304; public static final int SDLK_RCTRL = 305; public static final int SDLK_LCTRL = 306; public static final int SDLK_RALT = 307; public static final int SDLK_LALT = 308; public static final int SDLK_RMETA = 309; public static final int SDLK_LMETA = 310; public static final int SDLK_LSUPER = 311; public static final int SDLK_RSUPER = 312; public static final int SDLK_MODE = 313; public static final int SDLK_COMPOSE = 314; public static final int SDLK_HELP = 315; public static final int SDLK_PRINT = 316; public static final int SDLK_SYSREQ = 317; public static final int SDLK_BREAK = 318; public static final int SDLK_MENU = 319; public static final int SDLK_POWER = 320; public static final int SDLK_EURO = 321; public static final int SDLK_UNDO = 322; public static final int SDLK_NO_REMAP = 512; } // Autogenerated by hand with a command: // grep 'SDL_SCANCODE_' SDL_scancode.h | sed 's/SDL_SCANCODE_\([a-zA-Z0-9_]\+\).*[=] \([0-9]\+\).*/public static final int SDLK_\1 = \2;/' >> Keycodes.java class SDL_1_3_Keycodes { public static final int SDLK_UNKNOWN = 0; public static final int SDLK_A = 4; public static final int SDLK_B = 5; public static final int SDLK_C = 6; public static final int SDLK_D = 7; public static final int SDLK_E = 8; public static final int SDLK_F = 9; public static final int SDLK_G = 10; public static final int SDLK_H = 11; public static final int SDLK_I = 12; public static final int SDLK_J = 13; public static final int SDLK_K = 14; public static final int SDLK_L = 15; public static final int SDLK_M = 16; public static final int SDLK_N = 17; public static final int SDLK_O = 18; public static final int SDLK_P = 19; public static final int SDLK_Q = 20; public static final int SDLK_R = 21; public static final int SDLK_S = 22; public static final int SDLK_T = 23; public static final int SDLK_U = 24; public static final int SDLK_V = 25; public static final int SDLK_W = 26; public static final int SDLK_X = 27; public static final int SDLK_Y = 28; public static final int SDLK_Z = 29; public static final int SDLK_1 = 30; public static final int SDLK_2 = 31; public static final int SDLK_3 = 32; public static final int SDLK_4 = 33; public static final int SDLK_5 = 34; public static final int SDLK_6 = 35; public static final int SDLK_7 = 36; public static final int SDLK_8 = 37; public static final int SDLK_9 = 38; public static final int SDLK_0 = 39; public static final int SDLK_RETURN = 40; public static final int SDLK_ESCAPE = 41; public static final int SDLK_BACKSPACE = 42; public static final int SDLK_TAB = 43; public static final int SDLK_SPACE = 44; public static final int SDLK_MINUS = 45; public static final int SDLK_EQUALS = 46; public static final int SDLK_LEFTBRACKET = 47; public static final int SDLK_RIGHTBRACKET = 48; public static final int SDLK_BACKSLASH = 49; public static final int SDLK_NONUSHASH = 50; public static final int SDLK_SEMICOLON = 51; public static final int SDLK_APOSTROPHE = 52; public static final int SDLK_GRAVE = 53; public static final int SDLK_COMMA = 54; public static final int SDLK_PERIOD = 55; public static final int SDLK_SLASH = 56; public static final int SDLK_CAPSLOCK = 57; public static final int SDLK_F1 = 58; public static final int SDLK_F2 = 59; public static final int SDLK_F3 = 60; public static final int SDLK_F4 = 61; public static final int SDLK_F5 = 62; public static final int SDLK_F6 = 63; public static final int SDLK_F7 = 64; public static final int SDLK_F8 = 65; public static final int SDLK_F9 = 66; public static final int SDLK_F10 = 67; public static final int SDLK_F11 = 68; public static final int SDLK_F12 = 69; public static final int SDLK_PRINTSCREEN = 70; public static final int SDLK_SCROLLLOCK = 71; public static final int SDLK_PAUSE = 72; public static final int SDLK_INSERT = 73; public static final int SDLK_HOME = 74; public static final int SDLK_PAGEUP = 75; public static final int SDLK_DELETE = 76; public static final int SDLK_END = 77; public static final int SDLK_PAGEDOWN = 78; public static final int SDLK_RIGHT = 79; public static final int SDLK_LEFT = 80; public static final int SDLK_DOWN = 81; public static final int SDLK_UP = 82; public static final int SDLK_NUMLOCKCLEAR = 83; public static final int SDLK_KP_DIVIDE = 84; public static final int SDLK_KP_MULTIPLY = 85; public static final int SDLK_KP_MINUS = 86; public static final int SDLK_KP_PLUS = 87; public static final int SDLK_KP_ENTER = 88; public static final int SDLK_KP_1 = 89; public static final int SDLK_KP_2 = 90; public static final int SDLK_KP_3 = 91; public static final int SDLK_KP_4 = 92; public static final int SDLK_KP_5 = 93; public static final int SDLK_KP_6 = 94; public static final int SDLK_KP_7 = 95; public static final int SDLK_KP_8 = 96; public static final int SDLK_KP_9 = 97; public static final int SDLK_KP_0 = 98; public static final int SDLK_KP_PERIOD = 99; public static final int SDLK_NONUSBACKSLASH = 100; public static final int SDLK_APPLICATION = 101; public static final int SDLK_POWER = 102; public static final int SDLK_KP_EQUALS = 103; public static final int SDLK_F13 = 104; public static final int SDLK_F14 = 105; public static final int SDLK_F15 = 106; public static final int SDLK_F16 = 107; public static final int SDLK_F17 = 108; public static final int SDLK_F18 = 109; public static final int SDLK_F19 = 110; public static final int SDLK_F20 = 111; public static final int SDLK_F21 = 112; public static final int SDLK_F22 = 113; public static final int SDLK_F23 = 114; public static final int SDLK_F24 = 115; public static final int SDLK_EXECUTE = 116; public static final int SDLK_HELP = 117; public static final int SDLK_MENU = 118; public static final int SDLK_SELECT = 119; public static final int SDLK_STOP = 120; public static final int SDLK_AGAIN = 121; public static final int SDLK_UNDO = 122; public static final int SDLK_CUT = 123; public static final int SDLK_COPY = 124; public static final int SDLK_PASTE = 125; public static final int SDLK_FIND = 126; public static final int SDLK_MUTE = 127; public static final int SDLK_VOLUMEUP = 128; public static final int SDLK_VOLUMEDOWN = 129; public static final int SDLK_KP_COMMA = 133; public static final int SDLK_KP_EQUALSAS400 = 134; public static final int SDLK_INTERNATIONAL1 = 135; public static final int SDLK_INTERNATIONAL2 = 136; public static final int SDLK_INTERNATIONAL3 = 137; public static final int SDLK_INTERNATIONAL4 = 138; public static final int SDLK_INTERNATIONAL5 = 139; public static final int SDLK_INTERNATIONAL6 = 140; public static final int SDLK_INTERNATIONAL7 = 141; public static final int SDLK_INTERNATIONAL8 = 142; public static final int SDLK_INTERNATIONAL9 = 143; public static final int SDLK_LANG1 = 144; public static final int SDLK_LANG2 = 145; public static final int SDLK_LANG3 = 146; public static final int SDLK_LANG4 = 147; public static final int SDLK_LANG5 = 148; public static final int SDLK_LANG6 = 149; public static final int SDLK_LANG7 = 150; public static final int SDLK_LANG8 = 151; public static final int SDLK_LANG9 = 152; public static final int SDLK_ALTERASE = 153; public static final int SDLK_SYSREQ = 154; public static final int SDLK_CANCEL = 155; public static final int SDLK_CLEAR = 156; public static final int SDLK_PRIOR = 157; public static final int SDLK_RETURN2 = 158; public static final int SDLK_SEPARATOR = 159; public static final int SDLK_OUT = 160; public static final int SDLK_OPER = 161; public static final int SDLK_CLEARAGAIN = 162; public static final int SDLK_CRSEL = 163; public static final int SDLK_EXSEL = 164; public static final int SDLK_KP_00 = 176; public static final int SDLK_KP_000 = 177; public static final int SDLK_THOUSANDSSEPARATOR = 178; public static final int SDLK_DECIMALSEPARATOR = 179; public static final int SDLK_CURRENCYUNIT = 180; public static final int SDLK_CURRENCYSUBUNIT = 181; public static final int SDLK_KP_LEFTPAREN = 182; public static final int SDLK_KP_RIGHTPAREN = 183; public static final int SDLK_KP_LEFTBRACE = 184; public static final int SDLK_KP_RIGHTBRACE = 185; public static final int SDLK_KP_TAB = 186; public static final int SDLK_KP_BACKSPACE = 187; public static final int SDLK_KP_A = 188; public static final int SDLK_KP_B = 189; public static final int SDLK_KP_C = 190; public static final int SDLK_KP_D = 191; public static final int SDLK_KP_E = 192; public static final int SDLK_KP_F = 193; public static final int SDLK_KP_XOR = 194; public static final int SDLK_KP_POWER = 195; public static final int SDLK_KP_PERCENT = 196; public static final int SDLK_KP_LESS = 197; public static final int SDLK_KP_GREATER = 198; public static final int SDLK_KP_AMPERSAND = 199; public static final int SDLK_KP_DBLAMPERSAND = 200; public static final int SDLK_KP_VERTICALBAR = 201; public static final int SDLK_KP_DBLVERTICALBAR = 202; public static final int SDLK_KP_COLON = 203; public static final int SDLK_KP_HASH = 204; public static final int SDLK_KP_SPACE = 205; public static final int SDLK_KP_AT = 206; public static final int SDLK_KP_EXCLAM = 207; public static final int SDLK_KP_MEMSTORE = 208; public static final int SDLK_KP_MEMRECALL = 209; public static final int SDLK_KP_MEMCLEAR = 210; public static final int SDLK_KP_MEMADD = 211; public static final int SDLK_KP_MEMSUBTRACT = 212; public static final int SDLK_KP_MEMMULTIPLY = 213; public static final int SDLK_KP_MEMDIVIDE = 214; public static final int SDLK_KP_PLUSMINUS = 215; public static final int SDLK_KP_CLEAR = 216; public static final int SDLK_KP_CLEARENTRY = 217; public static final int SDLK_KP_BINARY = 218; public static final int SDLK_KP_OCTAL = 219; public static final int SDLK_KP_DECIMAL = 220; public static final int SDLK_KP_HEXADECIMAL = 221; public static final int SDLK_LCTRL = 224; public static final int SDLK_LSHIFT = 225; public static final int SDLK_LALT = 226; public static final int SDLK_LGUI = 227; public static final int SDLK_RCTRL = 228; public static final int SDLK_RSHIFT = 229; public static final int SDLK_RALT = 230; public static final int SDLK_RGUI = 231; public static final int SDLK_MODE = 257; public static final int SDLK_AUDIONEXT = 258; public static final int SDLK_AUDIOPREV = 259; public static final int SDLK_AUDIOSTOP = 260; public static final int SDLK_AUDIOPLAY = 261; public static final int SDLK_AUDIOMUTE = 262; public static final int SDLK_MEDIASELECT = 263; public static final int SDLK_WWW = 264; public static final int SDLK_MAIL = 265; public static final int SDLK_CALCULATOR = 266; public static final int SDLK_COMPUTER = 267; public static final int SDLK_AC_SEARCH = 268; public static final int SDLK_AC_HOME = 269; public static final int SDLK_AC_BACK = 270; public static final int SDLK_AC_FORWARD = 271; public static final int SDLK_AC_STOP = 272; public static final int SDLK_AC_REFRESH = 273; public static final int SDLK_AC_BOOKMARKS = 274; public static final int SDLK_BRIGHTNESSDOWN = 275; public static final int SDLK_BRIGHTNESSUP = 276; public static final int SDLK_DISPLAYSWITCH = 277; public static final int SDLK_KBDILLUMTOGGLE = 278; public static final int SDLK_KBDILLUMDOWN = 279; public static final int SDLK_KBDILLUMUP = 280; public static final int SDLK_EJECT = 281; public static final int SDLK_SLEEP = 282; public static final int SDLK_NO_REMAP = 512; } class SDL_Keys { public static String [] names = null; public static Integer [] values = null; public static String [] namesSorted = null; public static Integer [] namesSortedIdx = null; public static Integer [] namesSortedBackIdx = null; static final int JAVA_KEYCODE_LAST = 255; // Android 2.3 added several new gaming keys, Android 3.1 added even more - keep in sync with javakeycodes.h static { ArrayList<String> Names = new ArrayList<String> (); ArrayList<Integer> Values = new ArrayList<Integer> (); Field [] fields = SDL_1_2_Keycodes.class.getDeclaredFields(); if( Globals.Using_SDL_1_3 ) { fields = SDL_1_3_Keycodes.class.getDeclaredFields(); } try { for(Field f: fields) { Values.add(f.getInt(null)); Names.add(f.getName().substring(5).toUpperCase()); } } catch(IllegalAccessException e) {}; // Sort by value for( int i = 0; i < Values.size(); i++ ) { for( int j = i; j < Values.size(); j++ ) { if( Values.get(i) > Values.get(j) ) { int x = Values.get(i); Values.set(i, Values.get(j)); Values.set(j, x); String s = Names.get(i); Names.set(i, Names.get(j)); Names.set(j, s); } } } names = Names.toArray(new String[0]); values = Values.toArray(new Integer[0]); namesSorted = Names.toArray(new String[0]); namesSortedIdx = new Integer[values.length]; namesSortedBackIdx = new Integer[values.length]; Arrays.sort(namesSorted); for( int i = 0; i < namesSorted.length; i++ ) { for( int j = 0; j < namesSorted.length; j++ ) { if( namesSorted[i].equals( names[j] ) ) { namesSortedIdx[i] = j; namesSortedBackIdx[j] = i; break; } } } } }
dennis-sheil/commandergenius
project/java/Keycodes.java
Java
lgpl-2.1
24,603
/*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | An executable that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being dynamically linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | The following has been added to the RXTX License to remove | any confusion about linking to RXTX. We want to allow in part what | section 5, paragraph 2 of the LGPL does not permit in the special | case of linking over a controlled interface. The intent is to add a | Java Specification Request or standards body defined interface in the | future as another exception but one is not currently available. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | All trademarks belong to their respective owners. --------------------------------------------------------------------------*/ package gnu.io; import java.io.*; import java.util.*; import java.lang.Math; /** * @author Trent Jarvi * @version %I%, %G% * @since JDK1.0 */ final class RS485 extends RS485Port { static { //System.loadLibrary( "rxtxRS485" ); Initialize(); } /** Initialize the native library */ private native static void Initialize(); /** Actual RS485Port wrapper class */ /** Open the named port */ public RS485( String name ) throws PortInUseException { fd = open( name ); } private native int open( String name ) throws PortInUseException; /** File descriptor */ private int fd; /** DSR flag **/ static boolean dsrFlag = false; /** Output stream */ private final RS485OutputStream out = new RS485OutputStream(); public OutputStream getOutputStream() { return out; } /** Input stream */ private final RS485InputStream in = new RS485InputStream(); public InputStream getInputStream() { return in; } /** Set the RS485Port parameters */ public void setRS485PortParams( int b, int d, int s, int p ) throws UnsupportedCommOperationException { nativeSetRS485PortParams( b, d, s, p ); speed = b; dataBits = d; stopBits = s; parity = p; } /** Set the native RS485 port parameters */ private native void nativeSetRS485PortParams( int speed, int dataBits, int stopBits, int parity ) throws UnsupportedCommOperationException; /** Line speed in bits-per-second */ private int speed=9600; public int getBaudRate() { return speed; } /** Data bits port parameter */ private int dataBits=DATABITS_8; public int getDataBits() { return dataBits; } /** Stop bits port parameter */ private int stopBits=RS485Port.STOPBITS_1; public int getStopBits() { return stopBits; } /** Parity port parameter */ private int parity= RS485Port.PARITY_NONE; public int getParity() { return parity; } /** Flow control */ private int flowmode = RS485Port.FLOWCONTROL_NONE; public void setFlowControlMode( int flowcontrol ) { try { setflowcontrol( flowcontrol ); } catch( IOException e ) { e.printStackTrace(); return; } flowmode=flowcontrol; } public int getFlowControlMode() { return flowmode; } native void setflowcontrol( int flowcontrol ) throws IOException; /* linux/drivers/char/n_hdlc.c? FIXME taj@www.linux.org.uk */ /** Receive framing control */ public void enableReceiveFraming( int f ) throws UnsupportedCommOperationException { throw new UnsupportedCommOperationException( "Not supported" ); } public void disableReceiveFraming() {} public boolean isReceiveFramingEnabled() { return false; } public int getReceiveFramingByte() { return 0; } /** Receive timeout control */ private int timeout = 0; public native int NativegetReceiveTimeout(); public native boolean NativeisReceiveTimeoutEnabled(); public native void NativeEnableReceiveTimeoutThreshold(int time, int threshold,int InputBuffer); public void disableReceiveTimeout(){ enableReceiveTimeout(0); } public void enableReceiveTimeout( int time ){ if( time >= 0 ) { timeout = time; NativeEnableReceiveTimeoutThreshold( time , threshold, InputBuffer ); } else { System.out.println("Invalid timeout"); } } public boolean isReceiveTimeoutEnabled(){ return(NativeisReceiveTimeoutEnabled()); } public int getReceiveTimeout(){ return(NativegetReceiveTimeout( )); } /** Receive threshold control */ private int threshold = 0; public void enableReceiveThreshold( int thresh ){ if(thresh >=0) { threshold=thresh; NativeEnableReceiveTimeoutThreshold(timeout, threshold, InputBuffer); } else /* invalid thresh */ { System.out.println("Invalid Threshold"); } } public void disableReceiveThreshold() { enableReceiveThreshold(0); } public int getReceiveThreshold(){ return threshold; } public boolean isReceiveThresholdEnabled(){ return(threshold>0); } /** Input/output buffers */ /** FIXME I think this refers to FOPEN(3)/SETBUF(3)/FREAD(3)/FCLOSE(3) taj@www.linux.org.uk These are native stubs... */ private int InputBuffer=0; private int OutputBuffer=0; public void setInputBufferSize( int size ) { InputBuffer=size; } public int getInputBufferSize() { return(InputBuffer); } public void setOutputBufferSize( int size ) { OutputBuffer=size; } public int getOutputBufferSize() { return(OutputBuffer); } /** Line status methods */ public native boolean isDTR(); public native void setDTR( boolean state ); public native void setRTS( boolean state ); private native void setDSR( boolean state ); public native boolean isCTS(); public native boolean isDSR(); public native boolean isCD(); public native boolean isRI(); public native boolean isRTS(); /** Write to the port */ public native void sendBreak( int duration ); private native void writeByte( int b ) throws IOException; private native void writeArray( byte b[], int off, int len ) throws IOException; private native void drain() throws IOException; /** RS485 read methods */ private native int nativeavailable() throws IOException; private native int readByte() throws IOException; private native int readArray( byte b[], int off, int len ) throws IOException; /** RS485 Port Event listener */ private RS485PortEventListener SPEventListener; /** Thread to monitor data */ private MonitorThread monThread; /** Process RS485PortEvents */ native void eventLoop(); private int dataAvailable=0; public void sendEvent( int event, boolean state ) { switch( event ) { case RS485PortEvent.DATA_AVAILABLE: dataAvailable=1; if( monThread.Data ) break; return; case RS485PortEvent.OUTPUT_BUFFER_EMPTY: if( monThread.Output ) break; return; /* if( monThread.DSR ) break; return; if (isDSR()) { if (!dsrFlag) { dsrFlag = true; RS485PortEvent e = new RS485PortEvent(this, RS485PortEvent.DSR, !dsrFlag, dsrFlag ); } } else if (dsrFlag) { dsrFlag = false; RS485PortEvent e = new RS485PortEvent(this, RS485PortEvent.DSR, !dsrFlag, dsrFlag ); } */ case RS485PortEvent.CTS: if( monThread.CTS ) break; return; case RS485PortEvent.DSR: if( monThread.DSR ) break; return; case RS485PortEvent.RI: if( monThread.RI ) break; return; case RS485PortEvent.CD: if( monThread.CD ) break; return; case RS485PortEvent.OE: if( monThread.OE ) break; return; case RS485PortEvent.PE: if( monThread.PE ) break; return; case RS485PortEvent.FE: if( monThread.FE ) break; return; case RS485PortEvent.BI: if( monThread.BI ) break; return; default: System.err.println("unknown event:"+event); return; } RS485PortEvent e = new RS485PortEvent(this, event, !state, state ); if( SPEventListener != null ) SPEventListener.RS485Event( e ); } /** Add an event listener */ public void addEventListener( RS485PortEventListener lsnr ) throws TooManyListenersException { if( SPEventListener != null ) throw new TooManyListenersException(); SPEventListener = lsnr; monThread = new MonitorThread(); monThread.start(); } /** Remove the RS485 port event listener */ public void removeEventListener() { SPEventListener = null; if( monThread != null ) { monThread.interrupt(); monThread = null; } } public void notifyOnDataAvailable( boolean enable ) { monThread.Data = enable; } public void notifyOnOutputEmpty( boolean enable ) { monThread.Output = enable; } public void notifyOnCTS( boolean enable ) { monThread.CTS = enable; } public void notifyOnDSR( boolean enable ) { monThread.DSR = enable; } public void notifyOnRingIndicator( boolean enable ) { monThread.RI = enable; } public void notifyOnCarrierDetect( boolean enable ) { monThread.CD = enable; } public void notifyOnOverrunError( boolean enable ) { monThread.OE = enable; } public void notifyOnParityError( boolean enable ) { monThread.PE = enable; } public void notifyOnFramingError( boolean enable ) { monThread.FE = enable; } public void notifyOnBreakInterrupt( boolean enable ) { monThread.BI = enable; } /** Close the port */ private native void nativeClose(); public void close() { setDTR(false); setDSR(false); nativeClose(); super.close(); fd = 0; } /** Finalize the port */ protected void finalize() { if( fd > 0 ) close(); } /** Inner class for RS485OutputStream */ class RS485OutputStream extends OutputStream { public void write( int b ) throws IOException { writeByte( b ); } public void write( byte b[] ) throws IOException { writeArray( b, 0, b.length ); } public void write( byte b[], int off, int len ) throws IOException { writeArray( b, off, len ); } public void flush() throws IOException { drain(); } } /** Inner class for RS485InputStream */ class RS485InputStream extends InputStream { public int read() throws IOException { dataAvailable=0; return readByte(); } public int read( byte b[] ) throws IOException { return read ( b, 0, b.length); } public int read( byte b[], int off, int len ) throws IOException { dataAvailable=0; int i=0, Minimum=0; int intArray[] = { b.length, InputBuffer, len }; /* find the lowest nonzero value timeout and threshold are handled on the native side see NativeEnableReceiveTimeoutThreshold in RS485Imp.c */ while(intArray[i]==0 && i < intArray.length) i++; Minimum=intArray[i]; while( i < intArray.length ) { if(intArray[i] > 0 ) { Minimum=Math.min(Minimum,intArray[i]); } i++; } Minimum=Math.min(Minimum,threshold); if(Minimum == 0) Minimum=1; int Available=available(); int Ret = readArray( b, off, Minimum); return Ret; } public int available() throws IOException { return nativeavailable(); } } class MonitorThread extends Thread { /** Note: these have to be separate boolean flags because the RS485PortEvent constants are NOT bit-flags, they are just defined as integers from 1 to 10 -DPL */ private boolean CTS=false; private boolean DSR=false; private boolean RI=false; private boolean CD=false; private boolean OE=false; private boolean PE=false; private boolean FE=false; private boolean BI=false; private boolean Data=false; private boolean Output=false; MonitorThread() { } public void run() { eventLoop(); } } }
timmattison/rxtx
src/gnu/io/RS485.java
Java
lgpl-2.1
13,919
/* * cron4j - A pure Java cron-like scheduler * * Copyright (C) 2007-2010 Carlo Pelliccia (www.sauronsoftware.it) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version * 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License 2.1 for more details. * * You should have received a copy of the GNU Lesser General Public * License version 2.1 along with this program. * If not, see <http://www.gnu.org/licenses/>. */ package example; import it.sauronsoftware.cron4j.Scheduler; import it.sauronsoftware.cron4j.TaskExecutor; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * This servlet enables the user to view and control any ongoing task execution. * The HTML layout is generated calling the /WEB-INF/ongoing.jsp page. */ public class ExecutionServlet extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // Retrieves the servlet context. ServletContext context = getServletContext(); // Retrieves the scheduler. Scheduler scheduler = (Scheduler) context .getAttribute(Constants.SCHEDULER); // Retrieves the executors. TaskExecutor[] executors = scheduler.getExecutingTasks(); // Registers the executors in the request. req.setAttribute("executors", executors); // Action requested? String action = req.getParameter("action"); if ("pause".equals(action)) { String id = req.getParameter("id"); TaskExecutor executor = find(executors, id); if (executor != null && executor.isAlive() && !executor.isStopped() && executor.canBePaused() && !executor.isPaused()) { executor.pause(); } } else if ("resume".equals(action)) { String id = req.getParameter("id"); TaskExecutor executor = find(executors, id); if (executor != null && executor.isAlive() && !executor.isStopped() && executor.canBePaused() && executor.isPaused()) { executor.resume(); } } else if ("stop".equals(action)) { String id = req.getParameter("id"); TaskExecutor executor = find(executors, id); if (executor != null && executor.isAlive() && executor.canBeStopped() && !executor.isStopped()) { executor.stop(); } } // Layout. String page = "/WEB-INF/ongoing.jsp"; RequestDispatcher dispatcher = req.getRequestDispatcher(page); dispatcher.include(req, resp); } private TaskExecutor find(TaskExecutor[] executors, String id) { if (id == null) { return null; } for (int i = 0; i < executors.length; i++) { String aux = executors[i].getGuid(); if (aux.equals(id)) { return executors[i]; } } return null; } }
lazizgueye/TAGL
cron4j-original/examples/6-web-app-integration/src/example/ExecutionServlet.java
Java
lgpl-2.1
3,206
package org.reprap.comms; import java.io.IOException; import org.reprap.Device; import org.reprap.ReprapException; /** * */ public abstract class IncomingMessage { /** * The actual content portion of a packet, not the frilly bits */ private byte [] payload; /** * */ IncomingContext incomingContext; /** * */ public class InvalidPayloadException extends ReprapException { private static final long serialVersionUID = -5403970405132990115L; public InvalidPayloadException() { super(); } public InvalidPayloadException(String arg) { super(arg); } } /** * Receive a message matching context criteria * @param incomingContext the context in which to receive messages * @throws IOException */ public IncomingMessage(IncomingContext incomingContext) throws IOException { this.incomingContext = incomingContext; Communicator comm = incomingContext.getCommunicator(); comm.receiveMessage(this); } /** * Send a given message and return the incoming response. Re-try * if there is a comms problem. * @param message * @throws IOException */ public IncomingMessage(Device device, OutgoingMessage message, long timeout) throws IOException { Communicator comm = device.getCommunicator(); for(int i=0;i<3;i++) { // Allow 3 retries. //System.out.println("Retry: " + i); incomingContext = comm.sendMessage(device, message); try { comm.receiveMessage(this, timeout); } catch (IOException e) { e.printStackTrace(); System.err.println("IO error/timeout, resending"); // Just to prevent any unexpected spinning try { Thread.sleep(1); } catch (InterruptedException e1) { e1.printStackTrace(); } continue; } return; } // If it's not going to respond, try to continue regardless. System.err.println("Resend limit exceeded. Failing without reported error."); } /** * Implemented by subclasses to allow them to indicate if they * understand or expect a given packetType. This is used to * decide if a received packet should be accepted or possibly discarded. * @param packetType the type of packet to receive * @return true if the packetType matches what is expected */ protected abstract boolean isExpectedPacketType(byte packetType); /** * @return payload */ public byte[] getPayload() { return payload; } /** * Called by the framework to provide data to the IncomingMessage. * This should not normally be called by a user. * @param payload The completed message to insert into the IncomingMessage * @return true is the data was accepted, otherwise false. */ public boolean receiveData(byte [] payload) { // We assume the packet was for us, etc. But we need to // know it contains the correct contents if (payload == null || payload.length == 0) return false; if (isExpectedPacketType(payload[0])) { this.payload = (byte[])payload.clone(); return true; } else { // That's not what we were after, so discard and wait for more return false; } } }
alx/reprap-host-software
src/org/reprap/comms/IncomingMessage.java
Java
lgpl-2.1
3,047
package com.puppycrawl.tools.checkstyle.coding; public class InputEqualsAvoidNull { public boolean equals(Object o) { return false; } /** * methods that should get flagged * @return */ public void flagForEquals() { Object o = new Object(); String s = "pizza"; o.equals("hot pizza"); o.equals(s = "cold pizza"); o.equals(((s = "cold pizza"))); o.equals("cheese" + "ham" + "sauce"); o.equals(("cheese" + "ham") + "sauce"); o.equals((("cheese" + "ham")) + "sauce"); } /** * methods that should get flagged */ public void flagForEqualsIgnoreCase() { String s = "pizza"; s.equalsIgnoreCase("hot pizza"); s.equalsIgnoreCase(s = "cold pizza"); s.equalsIgnoreCase(((s = "cold pizza"))); s.equalsIgnoreCase("cheese" + "ham" + "sauce"); s.equalsIgnoreCase(("cheese" + "ham") + "sauce"); s.equalsIgnoreCase((("cheese" + "ham")) + "sauce"); } /** * methods that should get flagged */ public void flagForBoth() { Object o = new Object(); String s = "pizza"; o.equals("hot pizza"); o.equals(s = "cold pizza"); o.equals(((s = "cold pizza"))); o.equals("cheese" + "ham" + "sauce"); o.equals(("cheese" + "ham") + "sauce"); o.equals((("cheese" + "ham")) + "sauce"); s.equalsIgnoreCase("hot pizza"); s.equalsIgnoreCase(s = "cold pizza"); s.equalsIgnoreCase(((s = "cold pizza"))); s.equalsIgnoreCase("cheese" + "ham" + "sauce"); s.equalsIgnoreCase(("cheese" + "ham") + "sauce"); s.equalsIgnoreCase((("cheese" + "ham")) + "sauce"); } /** * methods that should not get flagged * * @return */ public void noFlagForEquals() { Object o = new Object(); String s = "peperoni"; o.equals(s += "mushrooms"); (s = "thin crust").equals("thick crust"); (s += "garlic").equals("basil"); ("Chicago Style" + "NY Style").equals("California Style" + "Any Style"); equals("peppers"); "onions".equals(o); o.equals(new Object()); o.equals(equals(o)); equals("yummy"); new Object().equals("more cheese"); InputEqualsAvoidNullOutter outter = new InputEqualsAvoidNullOutter(); outter.new InputEqualsAvoidNullInner().equals("eat pizza and enjoy inner classes"); } /** * methods that should not get flagged */ public void noFlagForEqualsIgnoreCase() { String s = "peperoni"; String s1 = "tasty"; s.equalsIgnoreCase(s += "mushrooms"); s1.equalsIgnoreCase(s += "mushrooms"); (s = "thin crust").equalsIgnoreCase("thick crust"); (s += "garlic").equalsIgnoreCase("basil"); ("Chicago Style" + "NY Style").equalsIgnoreCase("California Style" + "Any Style"); "onions".equalsIgnoreCase(s); s.equalsIgnoreCase(new String()); s.equals(s1); new String().equalsIgnoreCase("more cheese"); } public void noFlagForBoth() { Object o = new Object(); String s = "peperoni"; String s1 = "tasty"; o.equals(s += "mushrooms"); (s = "thin crust").equals("thick crust"); (s += "garlic").equals("basil"); ("Chicago Style" + "NY Style").equals("California Style" + "Any Style"); equals("peppers"); "onions".equals(o); o.equals(new Object()); o.equals(equals(o)); equals("yummy"); new Object().equals("more cheese"); InputEqualsAvoidNullOutter outter = new InputEqualsAvoidNullOutter(); outter.new InputEqualsAvoidNullInner().equals("eat pizza and enjoy inner classes"); s.equalsIgnoreCase(s += "mushrooms"); s1.equalsIgnoreCase(s += "mushrooms"); (s = "thin crust").equalsIgnoreCase("thick crust"); (s += "garlic").equalsIgnoreCase("basil"); ("Chicago Style" + "NY Style").equalsIgnoreCase("California Style" + "Any Style"); "onions".equalsIgnoreCase(s); s.equalsIgnoreCase(new String()); s.equals(s1); new String().equalsIgnoreCase("more cheese"); } } class InputEqualsAvoidNullOutter { public class InputEqualsAvoidNullInner { public boolean equals(Object o) { return true; } } }
maikelsteneker/checkstyle-throwsIndent
src/testinputs/com/puppycrawl/tools/checkstyle/coding/InputEqualsAvoidNull.java
Java
lgpl-2.1
4,676
package models; import java.util.List; /** * The model class to store the sorting information * * @author Sandro * */ public class Sort { private String text; private String supplier; private String status; private String dateCreateStart; private String dateCreateEnd; private String dateUpdateStart; private String dateUpdateEnd; private String sort; private List<String> recordsChecked; public Sort() { } /** * The constructor of the sort class * * @param text the search value of the text field * @param supplier the search value of the supplier field * @param status the search value of the status field * @param format the search value of the format field * @param dateUpdateStart the search value of the date start field * @param dateUpdateEnd the search value of the date end field * @param sort the sort type value * @param recordsChecked the UUID's of the records selected */ public Sort(String text, String supplier, String status, String dateCreateStart, String dateCreateEnd, String dateUpdateStart, String dateUpdateEnd, String sort, List<String> recordsChecked) { this.text = text; this.supplier = supplier; this.status = status; this.dateCreateStart = dateCreateStart; this.dateCreateEnd = dateCreateEnd; this.dateUpdateStart = dateUpdateStart; this.dateUpdateEnd = dateUpdateEnd; this.sort = sort; this.recordsChecked = recordsChecked; } public String getText() { return text; } public void setText(String text) { this.text = text; } public String getSupplier() { return supplier; } public void setSupplier(String supplier) { this.supplier = supplier; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getDateCreateStart() { return dateCreateStart; } public void setDateCreateStart(String dateCreateStart) { this.dateCreateStart = dateCreateStart; } public String getDateCreateEnd() { return dateCreateEnd; } public void setDateCreateEnd(String dateCreateEnd) { this.dateCreateEnd = dateCreateEnd; } public String getDateUpdateStart() { return dateUpdateStart; } public void setDateUpdateStart(String dateUpdateStart) { this.dateUpdateStart = dateUpdateStart; } public String getDateUpdateEnd() { return dateUpdateEnd; } public void setDateUpdateEnd(String dateUpdateEnd) { this.dateUpdateEnd = dateUpdateEnd; } public String getSort() { return sort; } public void setSort(String sort) { this.sort = sort; } public List<String> getRecordsChecked() { return recordsChecked; } public void setRecordsChecked(List<String> recordsChecked) { this.recordsChecked = recordsChecked; } }
IDgis/geoportaal
geoportaal-beheer/app/models/Sort.java
Java
lgpl-2.1
2,859
/** */ package org.w3._2001.smil20.language; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.w3._2001.smil20.Smil20Package; /** * <!-- begin-user-doc --> * The <b>Package</b> for the model. * It contains accessors for the meta objects to represent * <ul> * <li>each class,</li> * <li>each feature of each class,</li> * <li>each operation of each class,</li> * <li>each enum,</li> * <li>and each data type</li> * </ul> * <!-- end-user-doc --> * <!-- begin-model-doc --> * * <div xmlns="http://www.w3.org/1999/xhtml"> * <h1>About the XML namespace</h1> * * <div class="bodytext"> * <p> * This schema document describes the XML namespace, in a form * suitable for import by other schema documents. * </p> * <p> * See <a href="http://www.w3.org/XML/1998/namespace.html"> * http://www.w3.org/XML/1998/namespace.html</a> and * <a href="http://www.w3.org/TR/REC-xml"> * http://www.w3.org/TR/REC-xml</a> for information * about this namespace. * </p> * <p> * Note that local names in this namespace are intended to be * defined only by the World Wide Web Consortium or its subgroups. * The names currently defined in this namespace are listed below. * They should not be used with conflicting semantics by any Working * Group, specification, or document instance. * </p> * <p> * See further below in this document for more information about <a href="#usage">how to refer to this schema document from your own * XSD schema documents</a> and about <a href="#nsversioning">the * namespace-versioning policy governing this schema document</a>. * </p> * </div> * </div> * * * <div xmlns="http://www.w3.org/1999/xhtml"> * * <h3>Father (in any context at all)</h3> * * <div class="bodytext"> * <p> * denotes Jon Bosak, the chair of * the original XML Working Group. This name is reserved by * the following decision of the W3C XML Plenary and * XML Coordination groups: * </p> * <blockquote> * <p> * In appreciation for his vision, leadership and * dedication the W3C XML Plenary on this 10th day of * February, 2000, reserves for Jon Bosak in perpetuity * the XML name "xml:Father". * </p> * </blockquote> * </div> * </div> * * * <div id="usage" xml:id="usage" xmlns="http://www.w3.org/1999/xhtml"> * <h2> * <a name="usage">About this schema document</a> * </h2> * * <div class="bodytext"> * <p> * This schema defines attributes and an attribute group suitable * for use by schemas wishing to allow <code>xml:base</code>, * <code>xml:lang</code>, <code>xml:space</code> or * <code>xml:id</code> attributes on elements they define. * </p> * <p> * To enable this, such a schema must import this schema for * the XML namespace, e.g. as follows: * </p> * <pre> * &lt;schema . . .&gt; * . . . * &lt;import namespace="http://www.w3.org/XML/1998/namespace" * schemaLocation="http://www.w3.org/2001/xml.xsd"/&gt; * </pre> * <p> * or * </p> * <pre> * &lt;import namespace="http://www.w3.org/XML/1998/namespace" * schemaLocation="http://www.w3.org/2009/01/xml.xsd"/&gt; * </pre> * <p> * Subsequently, qualified reference to any of the attributes or the * group defined below will have the desired effect, e.g. * </p> * <pre> * &lt;type . . .&gt; * . . . * &lt;attributeGroup ref="xml:specialAttrs"/&gt; * </pre> * <p> * will define a type which will schema-validate an instance element * with any of those attributes. * </p> * </div> * </div> * * * <div id="nsversioning" xml:id="nsversioning" xmlns="http://www.w3.org/1999/xhtml"> * <h2> * <a name="nsversioning">Versioning policy for this schema document</a> * </h2> * <div class="bodytext"> * <p> * In keeping with the XML Schema WG's standard versioning * policy, this schema document will persist at * <a href="http://www.w3.org/2009/01/xml.xsd"> * http://www.w3.org/2009/01/xml.xsd</a>. * </p> * <p> * At the date of issue it can also be found at * <a href="http://www.w3.org/2001/xml.xsd"> * http://www.w3.org/2001/xml.xsd</a>. * </p> * <p> * The schema document at that URI may however change in the future, * in order to remain compatible with the latest version of XML * Schema itself, or with the XML namespace itself. In other words, * if the XML Schema or XML namespaces change, the version of this * document at <a href="http://www.w3.org/2001/xml.xsd"> * http://www.w3.org/2001/xml.xsd * </a> * will change accordingly; the version at * <a href="http://www.w3.org/2009/01/xml.xsd"> * http://www.w3.org/2009/01/xml.xsd * </a> * will not change. * </p> * <p> * Previous dated (and unchanging) versions of this schema * document are at: * </p> * <ul> * <li> * <a href="http://www.w3.org/2009/01/xml.xsd"> * http://www.w3.org/2009/01/xml.xsd</a> * </li> * <li> * <a href="http://www.w3.org/2007/08/xml.xsd"> * http://www.w3.org/2007/08/xml.xsd</a> * </li> * <li> * <a href="http://www.w3.org/2004/10/xml.xsd"> * http://www.w3.org/2004/10/xml.xsd</a> * </li> * <li> * <a href="http://www.w3.org/2001/03/xml.xsd"> * http://www.w3.org/2001/03/xml.xsd</a> * </li> * </ul> * </div> * </div> * * <!-- end-model-doc --> * @see org.w3._2001.smil20.language.LanguageFactory * @model kind="package" * @generated */ public interface LanguagePackage extends EPackage { /** * The package name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ String eNAME = "language"; /** * The package namespace URI. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ String eNS_URI = "http://www.w3.org/2001/SMIL20/Language"; /** * The package namespace name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ String eNS_PREFIX = "language"; /** * The singleton instance of the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ LanguagePackage eINSTANCE = org.w3._2001.smil20.language.impl.LanguagePackageImpl.init(); /** * The meta object id for the '{@link org.w3._2001.smil20.language.impl.AnimateColorTypeImpl <em>Animate Color Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateColorTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateColorType() * @generated */ int ANIMATE_COLOR_TYPE = 0; /** * The feature id for the '<em><b>Accumulate</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ACCUMULATE = Smil20Package.ANIMATE_COLOR_PROTOTYPE__ACCUMULATE; /** * The feature id for the '<em><b>Additive</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ADDITIVE = Smil20Package.ANIMATE_COLOR_PROTOTYPE__ADDITIVE; /** * The feature id for the '<em><b>Attribute Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ATTRIBUTE_NAME = Smil20Package.ANIMATE_COLOR_PROTOTYPE__ATTRIBUTE_NAME; /** * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ATTRIBUTE_TYPE = Smil20Package.ANIMATE_COLOR_PROTOTYPE__ATTRIBUTE_TYPE; /** * The feature id for the '<em><b>By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__BY = Smil20Package.ANIMATE_COLOR_PROTOTYPE__BY; /** * The feature id for the '<em><b>From</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__FROM = Smil20Package.ANIMATE_COLOR_PROTOTYPE__FROM; /** * The feature id for the '<em><b>To</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__TO = Smil20Package.ANIMATE_COLOR_PROTOTYPE__TO; /** * The feature id for the '<em><b>Values</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__VALUES = Smil20Package.ANIMATE_COLOR_PROTOTYPE__VALUES; /** * The feature id for the '<em><b>Group</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__GROUP = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Any</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ANY = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 1; /** * The feature id for the '<em><b>Alt</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ALT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Begin</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__BEGIN = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Calc Mode</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__CALC_MODE = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Class</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__CLASS = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__DUR = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>End</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__END = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Fill</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__FILL = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Fill Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__FILL_DEFAULT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ID = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Lang</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__LANG = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Longdesc</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__LONGDESC = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Max</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__MAX = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Min</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__MIN = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Repeat</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__REPEAT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Repeat Count</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__REPEAT_COUNT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Repeat Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__REPEAT_DUR = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Restart</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__RESTART = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Restart Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__RESTART_DEFAULT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 19; /** * The feature id for the '<em><b>Skip Content</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__SKIP_CONTENT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 20; /** * The feature id for the '<em><b>Sync Behavior</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__SYNC_BEHAVIOR = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 21; /** * The feature id for the '<em><b>Sync Behavior Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__SYNC_BEHAVIOR_DEFAULT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 22; /** * The feature id for the '<em><b>Sync Tolerance</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__SYNC_TOLERANCE = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 23; /** * The feature id for the '<em><b>Sync Tolerance Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__SYNC_TOLERANCE_DEFAULT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 24; /** * The feature id for the '<em><b>Target Element</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__TARGET_ELEMENT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 25; /** * The feature id for the '<em><b>Any Attribute</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE__ANY_ATTRIBUTE = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 26; /** * The number of structural features of the '<em>Animate Color Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE_FEATURE_COUNT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_FEATURE_COUNT + 27; /** * The number of operations of the '<em>Animate Color Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_COLOR_TYPE_OPERATION_COUNT = Smil20Package.ANIMATE_COLOR_PROTOTYPE_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.w3._2001.smil20.language.impl.AnimateMotionTypeImpl <em>Animate Motion Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateMotionTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateMotionType() * @generated */ int ANIMATE_MOTION_TYPE = 1; /** * The feature id for the '<em><b>Accumulate</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ACCUMULATE = Smil20Package.ANIMATE_MOTION_PROTOTYPE__ACCUMULATE; /** * The feature id for the '<em><b>Additive</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ADDITIVE = Smil20Package.ANIMATE_MOTION_PROTOTYPE__ADDITIVE; /** * The feature id for the '<em><b>By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__BY = Smil20Package.ANIMATE_MOTION_PROTOTYPE__BY; /** * The feature id for the '<em><b>From</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__FROM = Smil20Package.ANIMATE_MOTION_PROTOTYPE__FROM; /** * The feature id for the '<em><b>Origin</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ORIGIN = Smil20Package.ANIMATE_MOTION_PROTOTYPE__ORIGIN; /** * The feature id for the '<em><b>To</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__TO = Smil20Package.ANIMATE_MOTION_PROTOTYPE__TO; /** * The feature id for the '<em><b>Values</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__VALUES = Smil20Package.ANIMATE_MOTION_PROTOTYPE__VALUES; /** * The feature id for the '<em><b>Group</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__GROUP = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Any</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ANY = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 1; /** * The feature id for the '<em><b>Alt</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ALT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Begin</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__BEGIN = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Calc Mode</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__CALC_MODE = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Class</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__CLASS = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__DUR = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>End</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__END = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Fill</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__FILL = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Fill Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__FILL_DEFAULT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ID = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Lang</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__LANG = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Longdesc</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__LONGDESC = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Max</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__MAX = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Min</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__MIN = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Repeat</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__REPEAT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Repeat Count</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__REPEAT_COUNT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Repeat Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__REPEAT_DUR = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Restart</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__RESTART = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Restart Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__RESTART_DEFAULT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 19; /** * The feature id for the '<em><b>Skip Content</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__SKIP_CONTENT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 20; /** * The feature id for the '<em><b>Sync Behavior</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__SYNC_BEHAVIOR = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 21; /** * The feature id for the '<em><b>Sync Behavior Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__SYNC_BEHAVIOR_DEFAULT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 22; /** * The feature id for the '<em><b>Sync Tolerance</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__SYNC_TOLERANCE = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 23; /** * The feature id for the '<em><b>Sync Tolerance Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__SYNC_TOLERANCE_DEFAULT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 24; /** * The feature id for the '<em><b>Target Element</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__TARGET_ELEMENT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 25; /** * The feature id for the '<em><b>Any Attribute</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE__ANY_ATTRIBUTE = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 26; /** * The number of structural features of the '<em>Animate Motion Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE_FEATURE_COUNT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_FEATURE_COUNT + 27; /** * The number of operations of the '<em>Animate Motion Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_MOTION_TYPE_OPERATION_COUNT = Smil20Package.ANIMATE_MOTION_PROTOTYPE_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.w3._2001.smil20.language.impl.AnimateTypeImpl <em>Animate Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateType() * @generated */ int ANIMATE_TYPE = 2; /** * The feature id for the '<em><b>Accumulate</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ACCUMULATE = Smil20Package.ANIMATE_PROTOTYPE__ACCUMULATE; /** * The feature id for the '<em><b>Additive</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ADDITIVE = Smil20Package.ANIMATE_PROTOTYPE__ADDITIVE; /** * The feature id for the '<em><b>Attribute Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ATTRIBUTE_NAME = Smil20Package.ANIMATE_PROTOTYPE__ATTRIBUTE_NAME; /** * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ATTRIBUTE_TYPE = Smil20Package.ANIMATE_PROTOTYPE__ATTRIBUTE_TYPE; /** * The feature id for the '<em><b>By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__BY = Smil20Package.ANIMATE_PROTOTYPE__BY; /** * The feature id for the '<em><b>From</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__FROM = Smil20Package.ANIMATE_PROTOTYPE__FROM; /** * The feature id for the '<em><b>To</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__TO = Smil20Package.ANIMATE_PROTOTYPE__TO; /** * The feature id for the '<em><b>Values</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__VALUES = Smil20Package.ANIMATE_PROTOTYPE__VALUES; /** * The feature id for the '<em><b>Group</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__GROUP = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Any</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ANY = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 1; /** * The feature id for the '<em><b>Alt</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ALT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Begin</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__BEGIN = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Calc Mode</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__CALC_MODE = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Class</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__CLASS = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__DUR = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>End</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__END = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Fill</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__FILL = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Fill Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__FILL_DEFAULT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ID = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Lang</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__LANG = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Longdesc</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__LONGDESC = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Max</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__MAX = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Min</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__MIN = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Repeat</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__REPEAT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Repeat Count</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__REPEAT_COUNT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Repeat Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__REPEAT_DUR = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Restart</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__RESTART = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Restart Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__RESTART_DEFAULT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 19; /** * The feature id for the '<em><b>Skip Content</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__SKIP_CONTENT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 20; /** * The feature id for the '<em><b>Sync Behavior</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__SYNC_BEHAVIOR = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 21; /** * The feature id for the '<em><b>Sync Behavior Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__SYNC_BEHAVIOR_DEFAULT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 22; /** * The feature id for the '<em><b>Sync Tolerance</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__SYNC_TOLERANCE = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 23; /** * The feature id for the '<em><b>Sync Tolerance Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__SYNC_TOLERANCE_DEFAULT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 24; /** * The feature id for the '<em><b>Target Element</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__TARGET_ELEMENT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 25; /** * The feature id for the '<em><b>Any Attribute</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE__ANY_ATTRIBUTE = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 26; /** * The number of structural features of the '<em>Animate Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE_FEATURE_COUNT = Smil20Package.ANIMATE_PROTOTYPE_FEATURE_COUNT + 27; /** * The number of operations of the '<em>Animate Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int ANIMATE_TYPE_OPERATION_COUNT = Smil20Package.ANIMATE_PROTOTYPE_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.w3._2001.smil20.language.impl.DocumentRootImpl <em>Document Root</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.DocumentRootImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getDocumentRoot() * @generated */ int DOCUMENT_ROOT = 3; /** * The feature id for the '<em><b>Mixed</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__MIXED = 0; /** * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; /** * The feature id for the '<em><b>XSI Schema Location</b></em>' map. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; /** * The feature id for the '<em><b>Animate</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__ANIMATE = 3; /** * The feature id for the '<em><b>Animate Color</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__ANIMATE_COLOR = 4; /** * The feature id for the '<em><b>Animate Motion</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__ANIMATE_MOTION = 5; /** * The feature id for the '<em><b>Set</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT__SET = 6; /** * The number of structural features of the '<em>Document Root</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT_FEATURE_COUNT = 7; /** * The number of operations of the '<em>Document Root</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int DOCUMENT_ROOT_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.w3._2001.smil20.language.impl.SetTypeImpl <em>Set Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.SetTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getSetType() * @generated */ int SET_TYPE = 4; /** * The feature id for the '<em><b>Attribute Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ATTRIBUTE_NAME = Smil20Package.SET_PROTOTYPE__ATTRIBUTE_NAME; /** * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ATTRIBUTE_TYPE = Smil20Package.SET_PROTOTYPE__ATTRIBUTE_TYPE; /** * The feature id for the '<em><b>To</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__TO = Smil20Package.SET_PROTOTYPE__TO; /** * The feature id for the '<em><b>Group</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__GROUP = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Any</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ANY = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 1; /** * The feature id for the '<em><b>Alt</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ALT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Begin</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__BEGIN = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Class</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__CLASS = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__DUR = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>End</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__END = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Fill</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__FILL = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Fill Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__FILL_DEFAULT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ID = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Lang</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__LANG = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Longdesc</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__LONGDESC = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Max</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__MAX = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Min</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__MIN = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Repeat</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__REPEAT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Repeat Count</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__REPEAT_COUNT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Repeat Dur</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__REPEAT_DUR = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Restart</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__RESTART = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Restart Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__RESTART_DEFAULT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Skip Content</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__SKIP_CONTENT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 19; /** * The feature id for the '<em><b>Sync Behavior</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__SYNC_BEHAVIOR = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 20; /** * The feature id for the '<em><b>Sync Behavior Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__SYNC_BEHAVIOR_DEFAULT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 21; /** * The feature id for the '<em><b>Sync Tolerance</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__SYNC_TOLERANCE = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 22; /** * The feature id for the '<em><b>Sync Tolerance Default</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__SYNC_TOLERANCE_DEFAULT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 23; /** * The feature id for the '<em><b>Target Element</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__TARGET_ELEMENT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 24; /** * The feature id for the '<em><b>Any Attribute</b></em>' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE__ANY_ATTRIBUTE = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 25; /** * The number of structural features of the '<em>Set Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE_FEATURE_COUNT = Smil20Package.SET_PROTOTYPE_FEATURE_COUNT + 26; /** * The number of operations of the '<em>Set Type</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ int SET_TYPE_OPERATION_COUNT = Smil20Package.SET_PROTOTYPE_OPERATION_COUNT + 0; /** * Returns the meta object for class '{@link org.w3._2001.smil20.language.AnimateColorType <em>Animate Color Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Animate Color Type</em>'. * @see org.w3._2001.smil20.language.AnimateColorType * @generated */ EClass getAnimateColorType(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateColorType#getGroup <em>Group</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Group</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getGroup() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Group(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateColorType#getAny <em>Any</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getAny() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Any(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getAlt <em>Alt</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Alt</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getAlt() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Alt(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getBegin <em>Begin</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Begin</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getBegin() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Begin(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getCalcMode <em>Calc Mode</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Calc Mode</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getCalcMode() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_CalcMode(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getClass_ <em>Class</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Class</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getClass_() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Class(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getDur <em>Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Dur</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getDur() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Dur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getEnd <em>End</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>End</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getEnd() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_End(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getFill <em>Fill</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getFill() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Fill(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getFillDefault <em>Fill Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill Default</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getFillDefault() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_FillDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getId <em>Id</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Id</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getId() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Id(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getLang <em>Lang</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Lang</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getLang() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Lang(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getLongdesc <em>Longdesc</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Longdesc</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getLongdesc() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Longdesc(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getMax <em>Max</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Max</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getMax() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Max(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getMin <em>Min</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Min</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getMin() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Min(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getRepeat <em>Repeat</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getRepeat() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Repeat(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getRepeatCount <em>Repeat Count</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Count</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getRepeatCount() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_RepeatCount(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getRepeatDur <em>Repeat Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Dur</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getRepeatDur() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_RepeatDur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getRestart <em>Restart</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getRestart() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_Restart(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getRestartDefault <em>Restart Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart Default</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getRestartDefault() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_RestartDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#isSkipContent <em>Skip Content</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Skip Content</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#isSkipContent() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_SkipContent(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getSyncBehavior <em>Sync Behavior</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getSyncBehavior() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_SyncBehavior(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getSyncBehaviorDefault <em>Sync Behavior Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior Default</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getSyncBehaviorDefault() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_SyncBehaviorDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getSyncTolerance <em>Sync Tolerance</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getSyncTolerance() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_SyncTolerance(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getSyncToleranceDefault <em>Sync Tolerance Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance Default</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getSyncToleranceDefault() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_SyncToleranceDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateColorType#getTargetElement <em>Target Element</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Target Element</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getTargetElement() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_TargetElement(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateColorType#getAnyAttribute <em>Any Attribute</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any Attribute</em>'. * @see org.w3._2001.smil20.language.AnimateColorType#getAnyAttribute() * @see #getAnimateColorType() * @generated */ EAttribute getAnimateColorType_AnyAttribute(); /** * Returns the meta object for class '{@link org.w3._2001.smil20.language.AnimateMotionType <em>Animate Motion Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Animate Motion Type</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType * @generated */ EClass getAnimateMotionType(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateMotionType#getGroup <em>Group</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Group</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getGroup() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Group(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateMotionType#getAny <em>Any</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getAny() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Any(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getAlt <em>Alt</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Alt</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getAlt() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Alt(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getBegin <em>Begin</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Begin</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getBegin() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Begin(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getCalcMode <em>Calc Mode</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Calc Mode</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getCalcMode() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_CalcMode(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getClass_ <em>Class</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Class</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getClass_() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Class(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getDur <em>Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Dur</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getDur() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Dur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getEnd <em>End</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>End</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getEnd() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_End(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getFill <em>Fill</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getFill() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Fill(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getFillDefault <em>Fill Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill Default</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getFillDefault() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_FillDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getId <em>Id</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Id</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getId() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Id(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getLang <em>Lang</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Lang</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getLang() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Lang(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getLongdesc <em>Longdesc</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Longdesc</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getLongdesc() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Longdesc(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getMax <em>Max</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Max</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getMax() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Max(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getMin <em>Min</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Min</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getMin() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Min(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getRepeat <em>Repeat</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getRepeat() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Repeat(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getRepeatCount <em>Repeat Count</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Count</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getRepeatCount() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_RepeatCount(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getRepeatDur <em>Repeat Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Dur</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getRepeatDur() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_RepeatDur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getRestart <em>Restart</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getRestart() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_Restart(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getRestartDefault <em>Restart Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart Default</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getRestartDefault() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_RestartDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#isSkipContent <em>Skip Content</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Skip Content</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#isSkipContent() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_SkipContent(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getSyncBehavior <em>Sync Behavior</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getSyncBehavior() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_SyncBehavior(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getSyncBehaviorDefault <em>Sync Behavior Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior Default</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getSyncBehaviorDefault() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_SyncBehaviorDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getSyncTolerance <em>Sync Tolerance</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getSyncTolerance() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_SyncTolerance(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getSyncToleranceDefault <em>Sync Tolerance Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance Default</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getSyncToleranceDefault() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_SyncToleranceDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getTargetElement <em>Target Element</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Target Element</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getTargetElement() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_TargetElement(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateMotionType#getAnyAttribute <em>Any Attribute</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any Attribute</em>'. * @see org.w3._2001.smil20.language.AnimateMotionType#getAnyAttribute() * @see #getAnimateMotionType() * @generated */ EAttribute getAnimateMotionType_AnyAttribute(); /** * Returns the meta object for class '{@link org.w3._2001.smil20.language.AnimateType <em>Animate Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Animate Type</em>'. * @see org.w3._2001.smil20.language.AnimateType * @generated */ EClass getAnimateType(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateType#getGroup <em>Group</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Group</em>'. * @see org.w3._2001.smil20.language.AnimateType#getGroup() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Group(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateType#getAny <em>Any</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any</em>'. * @see org.w3._2001.smil20.language.AnimateType#getAny() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Any(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getAlt <em>Alt</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Alt</em>'. * @see org.w3._2001.smil20.language.AnimateType#getAlt() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Alt(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getBegin <em>Begin</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Begin</em>'. * @see org.w3._2001.smil20.language.AnimateType#getBegin() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Begin(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getCalcMode <em>Calc Mode</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Calc Mode</em>'. * @see org.w3._2001.smil20.language.AnimateType#getCalcMode() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_CalcMode(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getClass_ <em>Class</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Class</em>'. * @see org.w3._2001.smil20.language.AnimateType#getClass_() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Class(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getDur <em>Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Dur</em>'. * @see org.w3._2001.smil20.language.AnimateType#getDur() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Dur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getEnd <em>End</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>End</em>'. * @see org.w3._2001.smil20.language.AnimateType#getEnd() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_End(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getFill <em>Fill</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill</em>'. * @see org.w3._2001.smil20.language.AnimateType#getFill() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Fill(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getFillDefault <em>Fill Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill Default</em>'. * @see org.w3._2001.smil20.language.AnimateType#getFillDefault() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_FillDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getId <em>Id</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Id</em>'. * @see org.w3._2001.smil20.language.AnimateType#getId() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Id(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getLang <em>Lang</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Lang</em>'. * @see org.w3._2001.smil20.language.AnimateType#getLang() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Lang(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getLongdesc <em>Longdesc</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Longdesc</em>'. * @see org.w3._2001.smil20.language.AnimateType#getLongdesc() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Longdesc(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getMax <em>Max</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Max</em>'. * @see org.w3._2001.smil20.language.AnimateType#getMax() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Max(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getMin <em>Min</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Min</em>'. * @see org.w3._2001.smil20.language.AnimateType#getMin() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Min(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getRepeat <em>Repeat</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat</em>'. * @see org.w3._2001.smil20.language.AnimateType#getRepeat() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Repeat(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getRepeatCount <em>Repeat Count</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Count</em>'. * @see org.w3._2001.smil20.language.AnimateType#getRepeatCount() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_RepeatCount(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getRepeatDur <em>Repeat Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Dur</em>'. * @see org.w3._2001.smil20.language.AnimateType#getRepeatDur() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_RepeatDur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getRestart <em>Restart</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart</em>'. * @see org.w3._2001.smil20.language.AnimateType#getRestart() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_Restart(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getRestartDefault <em>Restart Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart Default</em>'. * @see org.w3._2001.smil20.language.AnimateType#getRestartDefault() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_RestartDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#isSkipContent <em>Skip Content</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Skip Content</em>'. * @see org.w3._2001.smil20.language.AnimateType#isSkipContent() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_SkipContent(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getSyncBehavior <em>Sync Behavior</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior</em>'. * @see org.w3._2001.smil20.language.AnimateType#getSyncBehavior() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_SyncBehavior(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getSyncBehaviorDefault <em>Sync Behavior Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior Default</em>'. * @see org.w3._2001.smil20.language.AnimateType#getSyncBehaviorDefault() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_SyncBehaviorDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getSyncTolerance <em>Sync Tolerance</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance</em>'. * @see org.w3._2001.smil20.language.AnimateType#getSyncTolerance() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_SyncTolerance(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getSyncToleranceDefault <em>Sync Tolerance Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance Default</em>'. * @see org.w3._2001.smil20.language.AnimateType#getSyncToleranceDefault() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_SyncToleranceDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateType#getTargetElement <em>Target Element</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Target Element</em>'. * @see org.w3._2001.smil20.language.AnimateType#getTargetElement() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_TargetElement(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.AnimateType#getAnyAttribute <em>Any Attribute</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any Attribute</em>'. * @see org.w3._2001.smil20.language.AnimateType#getAnyAttribute() * @see #getAnimateType() * @generated */ EAttribute getAnimateType_AnyAttribute(); /** * Returns the meta object for class '{@link org.w3._2001.smil20.language.DocumentRoot <em>Document Root</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Document Root</em>'. * @see org.w3._2001.smil20.language.DocumentRoot * @generated */ EClass getDocumentRoot(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.DocumentRoot#getMixed <em>Mixed</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Mixed</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getMixed() * @see #getDocumentRoot() * @generated */ EAttribute getDocumentRoot_Mixed(); /** * Returns the meta object for the map '{@link org.w3._2001.smil20.language.DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the map '<em>XMLNS Prefix Map</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getXMLNSPrefixMap() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_XMLNSPrefixMap(); /** * Returns the meta object for the map '{@link org.w3._2001.smil20.language.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the map '<em>XSI Schema Location</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getXSISchemaLocation() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_XSISchemaLocation(); /** * Returns the meta object for the containment reference '{@link org.w3._2001.smil20.language.DocumentRoot#getAnimate <em>Animate</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Animate</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getAnimate() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_Animate(); /** * Returns the meta object for the containment reference '{@link org.w3._2001.smil20.language.DocumentRoot#getAnimateColor <em>Animate Color</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Animate Color</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getAnimateColor() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_AnimateColor(); /** * Returns the meta object for the containment reference '{@link org.w3._2001.smil20.language.DocumentRoot#getAnimateMotion <em>Animate Motion</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Animate Motion</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getAnimateMotion() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_AnimateMotion(); /** * Returns the meta object for the containment reference '{@link org.w3._2001.smil20.language.DocumentRoot#getSet <em>Set</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Set</em>'. * @see org.w3._2001.smil20.language.DocumentRoot#getSet() * @see #getDocumentRoot() * @generated */ EReference getDocumentRoot_Set(); /** * Returns the meta object for class '{@link org.w3._2001.smil20.language.SetType <em>Set Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Set Type</em>'. * @see org.w3._2001.smil20.language.SetType * @generated */ EClass getSetType(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.SetType#getGroup <em>Group</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Group</em>'. * @see org.w3._2001.smil20.language.SetType#getGroup() * @see #getSetType() * @generated */ EAttribute getSetType_Group(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.SetType#getAny <em>Any</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any</em>'. * @see org.w3._2001.smil20.language.SetType#getAny() * @see #getSetType() * @generated */ EAttribute getSetType_Any(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getAlt <em>Alt</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Alt</em>'. * @see org.w3._2001.smil20.language.SetType#getAlt() * @see #getSetType() * @generated */ EAttribute getSetType_Alt(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getBegin <em>Begin</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Begin</em>'. * @see org.w3._2001.smil20.language.SetType#getBegin() * @see #getSetType() * @generated */ EAttribute getSetType_Begin(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getClass_ <em>Class</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Class</em>'. * @see org.w3._2001.smil20.language.SetType#getClass_() * @see #getSetType() * @generated */ EAttribute getSetType_Class(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getDur <em>Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Dur</em>'. * @see org.w3._2001.smil20.language.SetType#getDur() * @see #getSetType() * @generated */ EAttribute getSetType_Dur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getEnd <em>End</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>End</em>'. * @see org.w3._2001.smil20.language.SetType#getEnd() * @see #getSetType() * @generated */ EAttribute getSetType_End(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getFill <em>Fill</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill</em>'. * @see org.w3._2001.smil20.language.SetType#getFill() * @see #getSetType() * @generated */ EAttribute getSetType_Fill(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getFillDefault <em>Fill Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fill Default</em>'. * @see org.w3._2001.smil20.language.SetType#getFillDefault() * @see #getSetType() * @generated */ EAttribute getSetType_FillDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getId <em>Id</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Id</em>'. * @see org.w3._2001.smil20.language.SetType#getId() * @see #getSetType() * @generated */ EAttribute getSetType_Id(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getLang <em>Lang</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Lang</em>'. * @see org.w3._2001.smil20.language.SetType#getLang() * @see #getSetType() * @generated */ EAttribute getSetType_Lang(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getLongdesc <em>Longdesc</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Longdesc</em>'. * @see org.w3._2001.smil20.language.SetType#getLongdesc() * @see #getSetType() * @generated */ EAttribute getSetType_Longdesc(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getMax <em>Max</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Max</em>'. * @see org.w3._2001.smil20.language.SetType#getMax() * @see #getSetType() * @generated */ EAttribute getSetType_Max(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getMin <em>Min</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Min</em>'. * @see org.w3._2001.smil20.language.SetType#getMin() * @see #getSetType() * @generated */ EAttribute getSetType_Min(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getRepeat <em>Repeat</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat</em>'. * @see org.w3._2001.smil20.language.SetType#getRepeat() * @see #getSetType() * @generated */ EAttribute getSetType_Repeat(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getRepeatCount <em>Repeat Count</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Count</em>'. * @see org.w3._2001.smil20.language.SetType#getRepeatCount() * @see #getSetType() * @generated */ EAttribute getSetType_RepeatCount(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getRepeatDur <em>Repeat Dur</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Repeat Dur</em>'. * @see org.w3._2001.smil20.language.SetType#getRepeatDur() * @see #getSetType() * @generated */ EAttribute getSetType_RepeatDur(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getRestart <em>Restart</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart</em>'. * @see org.w3._2001.smil20.language.SetType#getRestart() * @see #getSetType() * @generated */ EAttribute getSetType_Restart(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getRestartDefault <em>Restart Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Restart Default</em>'. * @see org.w3._2001.smil20.language.SetType#getRestartDefault() * @see #getSetType() * @generated */ EAttribute getSetType_RestartDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#isSkipContent <em>Skip Content</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Skip Content</em>'. * @see org.w3._2001.smil20.language.SetType#isSkipContent() * @see #getSetType() * @generated */ EAttribute getSetType_SkipContent(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getSyncBehavior <em>Sync Behavior</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior</em>'. * @see org.w3._2001.smil20.language.SetType#getSyncBehavior() * @see #getSetType() * @generated */ EAttribute getSetType_SyncBehavior(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getSyncBehaviorDefault <em>Sync Behavior Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Behavior Default</em>'. * @see org.w3._2001.smil20.language.SetType#getSyncBehaviorDefault() * @see #getSetType() * @generated */ EAttribute getSetType_SyncBehaviorDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getSyncTolerance <em>Sync Tolerance</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance</em>'. * @see org.w3._2001.smil20.language.SetType#getSyncTolerance() * @see #getSetType() * @generated */ EAttribute getSetType_SyncTolerance(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getSyncToleranceDefault <em>Sync Tolerance Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Sync Tolerance Default</em>'. * @see org.w3._2001.smil20.language.SetType#getSyncToleranceDefault() * @see #getSetType() * @generated */ EAttribute getSetType_SyncToleranceDefault(); /** * Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.SetType#getTargetElement <em>Target Element</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Target Element</em>'. * @see org.w3._2001.smil20.language.SetType#getTargetElement() * @see #getSetType() * @generated */ EAttribute getSetType_TargetElement(); /** * Returns the meta object for the attribute list '{@link org.w3._2001.smil20.language.SetType#getAnyAttribute <em>Any Attribute</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Any Attribute</em>'. * @see org.w3._2001.smil20.language.SetType#getAnyAttribute() * @see #getSetType() * @generated */ EAttribute getSetType_AnyAttribute(); /** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the factory that creates the instances of the model. * @generated */ LanguageFactory getLanguageFactory(); /** * <!-- begin-user-doc --> * Defines literals for the meta objects that represent * <ul> * <li>each class,</li> * <li>each feature of each class,</li> * <li>each operation of each class,</li> * <li>each enum,</li> * <li>and each data type</li> * </ul> * <!-- end-user-doc --> * @generated */ interface Literals { /** * The meta object literal for the '{@link org.w3._2001.smil20.language.impl.AnimateColorTypeImpl <em>Animate Color Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateColorTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateColorType() * @generated */ EClass ANIMATE_COLOR_TYPE = eINSTANCE.getAnimateColorType(); /** * The meta object literal for the '<em><b>Group</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__GROUP = eINSTANCE.getAnimateColorType_Group(); /** * The meta object literal for the '<em><b>Any</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__ANY = eINSTANCE.getAnimateColorType_Any(); /** * The meta object literal for the '<em><b>Alt</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__ALT = eINSTANCE.getAnimateColorType_Alt(); /** * The meta object literal for the '<em><b>Begin</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__BEGIN = eINSTANCE.getAnimateColorType_Begin(); /** * The meta object literal for the '<em><b>Calc Mode</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__CALC_MODE = eINSTANCE.getAnimateColorType_CalcMode(); /** * The meta object literal for the '<em><b>Class</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__CLASS = eINSTANCE.getAnimateColorType_Class(); /** * The meta object literal for the '<em><b>Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__DUR = eINSTANCE.getAnimateColorType_Dur(); /** * The meta object literal for the '<em><b>End</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__END = eINSTANCE.getAnimateColorType_End(); /** * The meta object literal for the '<em><b>Fill</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__FILL = eINSTANCE.getAnimateColorType_Fill(); /** * The meta object literal for the '<em><b>Fill Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__FILL_DEFAULT = eINSTANCE.getAnimateColorType_FillDefault(); /** * The meta object literal for the '<em><b>Id</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__ID = eINSTANCE.getAnimateColorType_Id(); /** * The meta object literal for the '<em><b>Lang</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__LANG = eINSTANCE.getAnimateColorType_Lang(); /** * The meta object literal for the '<em><b>Longdesc</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__LONGDESC = eINSTANCE.getAnimateColorType_Longdesc(); /** * The meta object literal for the '<em><b>Max</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__MAX = eINSTANCE.getAnimateColorType_Max(); /** * The meta object literal for the '<em><b>Min</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__MIN = eINSTANCE.getAnimateColorType_Min(); /** * The meta object literal for the '<em><b>Repeat</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__REPEAT = eINSTANCE.getAnimateColorType_Repeat(); /** * The meta object literal for the '<em><b>Repeat Count</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__REPEAT_COUNT = eINSTANCE.getAnimateColorType_RepeatCount(); /** * The meta object literal for the '<em><b>Repeat Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__REPEAT_DUR = eINSTANCE.getAnimateColorType_RepeatDur(); /** * The meta object literal for the '<em><b>Restart</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__RESTART = eINSTANCE.getAnimateColorType_Restart(); /** * The meta object literal for the '<em><b>Restart Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__RESTART_DEFAULT = eINSTANCE.getAnimateColorType_RestartDefault(); /** * The meta object literal for the '<em><b>Skip Content</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__SKIP_CONTENT = eINSTANCE.getAnimateColorType_SkipContent(); /** * The meta object literal for the '<em><b>Sync Behavior</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__SYNC_BEHAVIOR = eINSTANCE.getAnimateColorType_SyncBehavior(); /** * The meta object literal for the '<em><b>Sync Behavior Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__SYNC_BEHAVIOR_DEFAULT = eINSTANCE.getAnimateColorType_SyncBehaviorDefault(); /** * The meta object literal for the '<em><b>Sync Tolerance</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__SYNC_TOLERANCE = eINSTANCE.getAnimateColorType_SyncTolerance(); /** * The meta object literal for the '<em><b>Sync Tolerance Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__SYNC_TOLERANCE_DEFAULT = eINSTANCE.getAnimateColorType_SyncToleranceDefault(); /** * The meta object literal for the '<em><b>Target Element</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__TARGET_ELEMENT = eINSTANCE.getAnimateColorType_TargetElement(); /** * The meta object literal for the '<em><b>Any Attribute</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_COLOR_TYPE__ANY_ATTRIBUTE = eINSTANCE.getAnimateColorType_AnyAttribute(); /** * The meta object literal for the '{@link org.w3._2001.smil20.language.impl.AnimateMotionTypeImpl <em>Animate Motion Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateMotionTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateMotionType() * @generated */ EClass ANIMATE_MOTION_TYPE = eINSTANCE.getAnimateMotionType(); /** * The meta object literal for the '<em><b>Group</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__GROUP = eINSTANCE.getAnimateMotionType_Group(); /** * The meta object literal for the '<em><b>Any</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__ANY = eINSTANCE.getAnimateMotionType_Any(); /** * The meta object literal for the '<em><b>Alt</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__ALT = eINSTANCE.getAnimateMotionType_Alt(); /** * The meta object literal for the '<em><b>Begin</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__BEGIN = eINSTANCE.getAnimateMotionType_Begin(); /** * The meta object literal for the '<em><b>Calc Mode</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__CALC_MODE = eINSTANCE.getAnimateMotionType_CalcMode(); /** * The meta object literal for the '<em><b>Class</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__CLASS = eINSTANCE.getAnimateMotionType_Class(); /** * The meta object literal for the '<em><b>Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__DUR = eINSTANCE.getAnimateMotionType_Dur(); /** * The meta object literal for the '<em><b>End</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__END = eINSTANCE.getAnimateMotionType_End(); /** * The meta object literal for the '<em><b>Fill</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__FILL = eINSTANCE.getAnimateMotionType_Fill(); /** * The meta object literal for the '<em><b>Fill Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__FILL_DEFAULT = eINSTANCE.getAnimateMotionType_FillDefault(); /** * The meta object literal for the '<em><b>Id</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__ID = eINSTANCE.getAnimateMotionType_Id(); /** * The meta object literal for the '<em><b>Lang</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__LANG = eINSTANCE.getAnimateMotionType_Lang(); /** * The meta object literal for the '<em><b>Longdesc</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__LONGDESC = eINSTANCE.getAnimateMotionType_Longdesc(); /** * The meta object literal for the '<em><b>Max</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__MAX = eINSTANCE.getAnimateMotionType_Max(); /** * The meta object literal for the '<em><b>Min</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__MIN = eINSTANCE.getAnimateMotionType_Min(); /** * The meta object literal for the '<em><b>Repeat</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__REPEAT = eINSTANCE.getAnimateMotionType_Repeat(); /** * The meta object literal for the '<em><b>Repeat Count</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__REPEAT_COUNT = eINSTANCE.getAnimateMotionType_RepeatCount(); /** * The meta object literal for the '<em><b>Repeat Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__REPEAT_DUR = eINSTANCE.getAnimateMotionType_RepeatDur(); /** * The meta object literal for the '<em><b>Restart</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__RESTART = eINSTANCE.getAnimateMotionType_Restart(); /** * The meta object literal for the '<em><b>Restart Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__RESTART_DEFAULT = eINSTANCE.getAnimateMotionType_RestartDefault(); /** * The meta object literal for the '<em><b>Skip Content</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__SKIP_CONTENT = eINSTANCE.getAnimateMotionType_SkipContent(); /** * The meta object literal for the '<em><b>Sync Behavior</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__SYNC_BEHAVIOR = eINSTANCE.getAnimateMotionType_SyncBehavior(); /** * The meta object literal for the '<em><b>Sync Behavior Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__SYNC_BEHAVIOR_DEFAULT = eINSTANCE.getAnimateMotionType_SyncBehaviorDefault(); /** * The meta object literal for the '<em><b>Sync Tolerance</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__SYNC_TOLERANCE = eINSTANCE.getAnimateMotionType_SyncTolerance(); /** * The meta object literal for the '<em><b>Sync Tolerance Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__SYNC_TOLERANCE_DEFAULT = eINSTANCE.getAnimateMotionType_SyncToleranceDefault(); /** * The meta object literal for the '<em><b>Target Element</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__TARGET_ELEMENT = eINSTANCE.getAnimateMotionType_TargetElement(); /** * The meta object literal for the '<em><b>Any Attribute</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_MOTION_TYPE__ANY_ATTRIBUTE = eINSTANCE.getAnimateMotionType_AnyAttribute(); /** * The meta object literal for the '{@link org.w3._2001.smil20.language.impl.AnimateTypeImpl <em>Animate Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.AnimateTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getAnimateType() * @generated */ EClass ANIMATE_TYPE = eINSTANCE.getAnimateType(); /** * The meta object literal for the '<em><b>Group</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__GROUP = eINSTANCE.getAnimateType_Group(); /** * The meta object literal for the '<em><b>Any</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__ANY = eINSTANCE.getAnimateType_Any(); /** * The meta object literal for the '<em><b>Alt</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__ALT = eINSTANCE.getAnimateType_Alt(); /** * The meta object literal for the '<em><b>Begin</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__BEGIN = eINSTANCE.getAnimateType_Begin(); /** * The meta object literal for the '<em><b>Calc Mode</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__CALC_MODE = eINSTANCE.getAnimateType_CalcMode(); /** * The meta object literal for the '<em><b>Class</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__CLASS = eINSTANCE.getAnimateType_Class(); /** * The meta object literal for the '<em><b>Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__DUR = eINSTANCE.getAnimateType_Dur(); /** * The meta object literal for the '<em><b>End</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__END = eINSTANCE.getAnimateType_End(); /** * The meta object literal for the '<em><b>Fill</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__FILL = eINSTANCE.getAnimateType_Fill(); /** * The meta object literal for the '<em><b>Fill Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__FILL_DEFAULT = eINSTANCE.getAnimateType_FillDefault(); /** * The meta object literal for the '<em><b>Id</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__ID = eINSTANCE.getAnimateType_Id(); /** * The meta object literal for the '<em><b>Lang</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__LANG = eINSTANCE.getAnimateType_Lang(); /** * The meta object literal for the '<em><b>Longdesc</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__LONGDESC = eINSTANCE.getAnimateType_Longdesc(); /** * The meta object literal for the '<em><b>Max</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__MAX = eINSTANCE.getAnimateType_Max(); /** * The meta object literal for the '<em><b>Min</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__MIN = eINSTANCE.getAnimateType_Min(); /** * The meta object literal for the '<em><b>Repeat</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__REPEAT = eINSTANCE.getAnimateType_Repeat(); /** * The meta object literal for the '<em><b>Repeat Count</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__REPEAT_COUNT = eINSTANCE.getAnimateType_RepeatCount(); /** * The meta object literal for the '<em><b>Repeat Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__REPEAT_DUR = eINSTANCE.getAnimateType_RepeatDur(); /** * The meta object literal for the '<em><b>Restart</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__RESTART = eINSTANCE.getAnimateType_Restart(); /** * The meta object literal for the '<em><b>Restart Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__RESTART_DEFAULT = eINSTANCE.getAnimateType_RestartDefault(); /** * The meta object literal for the '<em><b>Skip Content</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__SKIP_CONTENT = eINSTANCE.getAnimateType_SkipContent(); /** * The meta object literal for the '<em><b>Sync Behavior</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__SYNC_BEHAVIOR = eINSTANCE.getAnimateType_SyncBehavior(); /** * The meta object literal for the '<em><b>Sync Behavior Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__SYNC_BEHAVIOR_DEFAULT = eINSTANCE.getAnimateType_SyncBehaviorDefault(); /** * The meta object literal for the '<em><b>Sync Tolerance</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__SYNC_TOLERANCE = eINSTANCE.getAnimateType_SyncTolerance(); /** * The meta object literal for the '<em><b>Sync Tolerance Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__SYNC_TOLERANCE_DEFAULT = eINSTANCE.getAnimateType_SyncToleranceDefault(); /** * The meta object literal for the '<em><b>Target Element</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__TARGET_ELEMENT = eINSTANCE.getAnimateType_TargetElement(); /** * The meta object literal for the '<em><b>Any Attribute</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute ANIMATE_TYPE__ANY_ATTRIBUTE = eINSTANCE.getAnimateType_AnyAttribute(); /** * The meta object literal for the '{@link org.w3._2001.smil20.language.impl.DocumentRootImpl <em>Document Root</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.DocumentRootImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getDocumentRoot() * @generated */ EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); /** * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); /** * The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); /** * The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); /** * The meta object literal for the '<em><b>Animate</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__ANIMATE = eINSTANCE.getDocumentRoot_Animate(); /** * The meta object literal for the '<em><b>Animate Color</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__ANIMATE_COLOR = eINSTANCE.getDocumentRoot_AnimateColor(); /** * The meta object literal for the '<em><b>Animate Motion</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__ANIMATE_MOTION = eINSTANCE.getDocumentRoot_AnimateMotion(); /** * The meta object literal for the '<em><b>Set</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EReference DOCUMENT_ROOT__SET = eINSTANCE.getDocumentRoot_Set(); /** * The meta object literal for the '{@link org.w3._2001.smil20.language.impl.SetTypeImpl <em>Set Type</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.w3._2001.smil20.language.impl.SetTypeImpl * @see org.w3._2001.smil20.language.impl.LanguagePackageImpl#getSetType() * @generated */ EClass SET_TYPE = eINSTANCE.getSetType(); /** * The meta object literal for the '<em><b>Group</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__GROUP = eINSTANCE.getSetType_Group(); /** * The meta object literal for the '<em><b>Any</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__ANY = eINSTANCE.getSetType_Any(); /** * The meta object literal for the '<em><b>Alt</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__ALT = eINSTANCE.getSetType_Alt(); /** * The meta object literal for the '<em><b>Begin</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__BEGIN = eINSTANCE.getSetType_Begin(); /** * The meta object literal for the '<em><b>Class</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__CLASS = eINSTANCE.getSetType_Class(); /** * The meta object literal for the '<em><b>Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__DUR = eINSTANCE.getSetType_Dur(); /** * The meta object literal for the '<em><b>End</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__END = eINSTANCE.getSetType_End(); /** * The meta object literal for the '<em><b>Fill</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__FILL = eINSTANCE.getSetType_Fill(); /** * The meta object literal for the '<em><b>Fill Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__FILL_DEFAULT = eINSTANCE.getSetType_FillDefault(); /** * The meta object literal for the '<em><b>Id</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__ID = eINSTANCE.getSetType_Id(); /** * The meta object literal for the '<em><b>Lang</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__LANG = eINSTANCE.getSetType_Lang(); /** * The meta object literal for the '<em><b>Longdesc</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__LONGDESC = eINSTANCE.getSetType_Longdesc(); /** * The meta object literal for the '<em><b>Max</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__MAX = eINSTANCE.getSetType_Max(); /** * The meta object literal for the '<em><b>Min</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__MIN = eINSTANCE.getSetType_Min(); /** * The meta object literal for the '<em><b>Repeat</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__REPEAT = eINSTANCE.getSetType_Repeat(); /** * The meta object literal for the '<em><b>Repeat Count</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__REPEAT_COUNT = eINSTANCE.getSetType_RepeatCount(); /** * The meta object literal for the '<em><b>Repeat Dur</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__REPEAT_DUR = eINSTANCE.getSetType_RepeatDur(); /** * The meta object literal for the '<em><b>Restart</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__RESTART = eINSTANCE.getSetType_Restart(); /** * The meta object literal for the '<em><b>Restart Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__RESTART_DEFAULT = eINSTANCE.getSetType_RestartDefault(); /** * The meta object literal for the '<em><b>Skip Content</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__SKIP_CONTENT = eINSTANCE.getSetType_SkipContent(); /** * The meta object literal for the '<em><b>Sync Behavior</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__SYNC_BEHAVIOR = eINSTANCE.getSetType_SyncBehavior(); /** * The meta object literal for the '<em><b>Sync Behavior Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__SYNC_BEHAVIOR_DEFAULT = eINSTANCE.getSetType_SyncBehaviorDefault(); /** * The meta object literal for the '<em><b>Sync Tolerance</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__SYNC_TOLERANCE = eINSTANCE.getSetType_SyncTolerance(); /** * The meta object literal for the '<em><b>Sync Tolerance Default</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__SYNC_TOLERANCE_DEFAULT = eINSTANCE.getSetType_SyncToleranceDefault(); /** * The meta object literal for the '<em><b>Target Element</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__TARGET_ELEMENT = eINSTANCE.getSetType_TargetElement(); /** * The meta object literal for the '<em><b>Any Attribute</b></em>' attribute list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ EAttribute SET_TYPE__ANY_ATTRIBUTE = eINSTANCE.getSetType_AnyAttribute(); } } //LanguagePackage
geotools/geotools
modules/ogc/net.opengis.wmts/src/org/w3/_2001/smil20/language/LanguagePackage.java
Java
lgpl-2.1
137,841
/*! * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. */ package org.pentaho.reporting.engine.classic.core.layout.output; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.pentaho.reporting.engine.classic.core.event.ReportProgressEvent; import org.pentaho.reporting.engine.classic.core.event.ReportProgressListener; import org.pentaho.reporting.libraries.base.util.MemoryUsageMessage; import org.pentaho.reporting.libraries.formatting.FastMessageFormat; public class PerformanceProgressLogger implements ReportProgressListener { private static final Log logger = LogFactory.getLog( PerformanceProgressLogger.class ); private static final int ROW_PROGRESS = 5000; private int lastPage; private int lastRow; private int lastStage; private int lastActivity; private long startTime; private int rowCount; private boolean logPageProgress; private boolean logLevelProgress; private boolean logRowProgress; public PerformanceProgressLogger() { this( true, true, true ); } public PerformanceProgressLogger( final boolean logLevelProgress, final boolean logPageProgress, final boolean logRowProgress ) { this.logLevelProgress = logLevelProgress; this.logPageProgress = logPageProgress; this.logRowProgress = logRowProgress; } /** * Receives a notification that the report processing has started. * * @param event * the start event. */ public void reportProcessingStarted( final ReportProgressEvent event ) { if ( logger.isInfoEnabled() == false ) { return; } rowCount = -1; startTime = System.currentTimeMillis(); logger.info( new MemoryUsageMessage( "[" + Thread.currentThread().getName() + "] Report Processing started. " ) ); } /** * Receives a notification that the report processing made some progress. * * @param event * the update event. */ public void reportProcessingUpdate( final ReportProgressEvent event ) { if ( logger.isInfoEnabled() == false ) { return; } rowCount = event.getMaximumRow(); boolean print = false; if ( lastStage != event.getLevel() || lastActivity != event.getActivity() ) { lastStage = event.getLevel(); lastActivity = event.getActivity(); lastRow = 0; if ( logLevelProgress ) { print = true; } } if ( lastPage != event.getPage() ) { lastPage = event.getPage(); if ( logPageProgress ) { print = true; } } final int modRow = ( event.getRow() - lastRow ); if ( modRow > ROW_PROGRESS ) { lastRow = ( event.getRow() / ROW_PROGRESS ) * ROW_PROGRESS; if ( logRowProgress ) { print = true; } } if ( print ) { logger.info( new MemoryUsageMessage( "[" + Thread.currentThread().getName() + "] Activity: " + event.getActivity() + " Level: " + +lastStage + " Processing page: " + lastPage + " Row: " + lastRow + " Time: " + ( System.currentTimeMillis() - startTime ) + "ms " ) ); } } /** * Receives a notification that the report processing was finished. * * @param event * the finish event. */ public void reportProcessingFinished( final ReportProgressEvent event ) { if ( logger.isInfoEnabled() == false ) { return; } final FastMessageFormat messageFormat = new FastMessageFormat( "[{0}] Report Processing Finished: {1}ms - {2,number,0.000} rows/sec - " ); final long processTime = System.currentTimeMillis() - startTime; final double rowsPerSecond = rowCount * 1000.0f / ( processTime ); logger.info( new MemoryUsageMessage( messageFormat.format( new Object[] { Thread.currentThread().getName(), new Long( processTime ), new Double( rowsPerSecond ) } ) ) ); } }
mbatchelor/pentaho-reporting
engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/layout/output/PerformanceProgressLogger.java
Java
lgpl-2.1
4,599
package fr.toss.FF7Weapons; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.Item; import com.google.common.collect.Multimap; public class Druidmace extends FF7weapon { private float field_150934_a; private final Item.ToolMaterial field_150933_b; public Druidmace(Item.ToolMaterial p_i45356_1_) { super(); this.field_150933_b = p_i45356_1_; setUnlocalizedName("Druid_mace"); this.field_150934_a = 26F + p_i45356_1_.getDamageVsEntity(); } public float func_150931_i() { return this.field_150933_b.getDamageVsEntity(); } public String getToolMaterialName() { return this.field_150933_b.toString(); } public Multimap getItemAttributeModifiers() { Multimap multimap = super.getItemAttributeModifiers(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.field_150934_a, 0)); return multimap; } }
GhostMonk3408/MidgarCrusade
src/main/java/fr/toss/FF7Weapons/Druidmace.java
Java
lgpl-2.1
1,059
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.protocol.sip; import gov.nist.core.*; import gov.nist.javax.sip.*; import gov.nist.javax.sip.message.*; import java.io.*; import java.net.*; import java.util.*; import javax.sip.*; import net.java.sip.communicator.util.*; import org.jitsi.service.packetlogging.*; /** * This class passes log calls from JAIN-SIP to log4j, so that it is possible * to change the log level for the JAIN-SIP stack in logging.properties * * @author Sebastien Mazy */ public class SipLogger implements StackLogger, ServerLogger { /** * All messages will be passed to this logger. */ private static final Logger logger = Logger.getLogger(SipLogger.class); /** * SipStack to use. */ private SipStack sipStack; /* * Implementation of StackLogger */ /** * logs a stack trace. This helps to look at the stack frame. */ public void logStackTrace() { if (logger.isTraceEnabled()) logger.trace("JAIN-SIP stack trace", new Throwable()); } /** * logs a stack trace. This helps to look at the stack frame. * * @param traceLevel currently unused. */ public void logStackTrace(int traceLevel) { if (logger.isTraceEnabled()) logger.trace("JAIN-SIP stack trace", new Throwable()); } /** * Get the line count in the log stream. * * @return line count */ public int getLineCount() { return 0; } /** * Log an exception. * * @param ex the exception that we are to log. */ public void logException(Throwable ex) { logger.warn("Exception in the JAIN-SIP stack: " + ex.getMessage()); if (logger.isInfoEnabled()) logger.info("JAIN-SIP exception stack trace is", ex); } /** * Log a message into the log file. * * @param message * message to log into the log file. */ public void logDebug(String message) { if (logger.isDebugEnabled()) logger.debug("Debug output from the JAIN-SIP stack: " + message); } /** * Log an error message. * * @param message -- * error message to log. */ public void logFatalError(String message) { if (logger.isTraceEnabled()) logger.trace("Fatal error from the JAIN-SIP stack: " + message); } /** * Log an error message. * * @param message error message to log. */ public void logError(String message) { logger.error("Error from the JAIN-SIP stack: " + message); } /** * Determines whether logging is enabled. * * @return flag to indicate if logging is enabled. */ public boolean isLoggingEnabled() { return true; } /** * Return true/false if logging is enabled at a given level. * * @param logLevel the level that we'd like to check loggability for. * * @return always <tt>true</tt> regardless of <tt>logLevel</tt>'s value. */ public boolean isLoggingEnabled(int logLevel) { // always enable trace messages so we can receive packets // and log them to packet logging service if (logLevel == TRACE_DEBUG) return logger.isDebugEnabled(); if (logLevel == TRACE_MESSAGES) // same as TRACE_INFO return true; if (logLevel == TRACE_NONE) return false; return true; } /** * Logs an exception and an error message error message. * * @param message that message that we'd like to log. * @param ex the exception that we'd like to log. */ public void logError(String message, Exception ex) { logger.error("Error from the JAIN-SIP stack: " + message, ex); } /** * Log a warning message. * * @param string the warning that we'd like to log */ public void logWarning(String string) { logger.warn("Warning from the JAIN-SIP stack" + string); } /** * Log an info message. * * @param string the message that we'd like to log. */ public void logInfo(String string) { if (logger.isInfoEnabled()) logger.info("Info from the JAIN-SIP stack: " + string); } /** * Disable logging altogether. * */ public void disableLogging() {} /** * Enable logging (globally). */ public void enableLogging() {} /** * Logs the build time stamp of the jain-sip reference implementation. * * @param buildTimeStamp the build time stamp of the jain-sip reference * implementation. */ public void setBuildTimeStamp(String buildTimeStamp) { if (logger.isTraceEnabled()) logger.trace("JAIN-SIP RI build " + buildTimeStamp); } /** * Dummy implementation for {@link ServerLogger#setStackProperties( * Properties)} */ public void setStackProperties(Properties stackProperties) {} /** * Dummy implementation for {@link ServerLogger#closeLogFile()} */ public void closeLogFile() {} /** * Logs the specified message and details. * * @param message the message to log * @param from the message sender * @param to the message addressee * @param sender determines whether we are the origin of this message. * @param time the date this message was received at. */ public void logMessage(SIPMessage message, String from, String to, boolean sender, long time) { logMessage(message, from, to, null, sender, time); } /** * Logs the specified message and details. * * @param message the message to log * @param from the message sender * @param to the message addressee * @param status message status * @param sender determines whether we are the origin of this message. * @param time the date this message was received at. */ public void logMessage(SIPMessage message, String from, String to, String status, boolean sender, long time) { try { logPacket(message, sender); } catch(Throwable e) { logger.error("Error logging packet", e); } } /** * Logs the specified message and details to the packet logging service * if enabled. * * @param message the message to log * @param sender determines whether we are the origin of this message. */ private void logPacket(SIPMessage message, boolean sender) { try { PacketLoggingService packetLogging = SipActivator.getPacketLogging(); if( packetLogging == null || !packetLogging.isLoggingEnabled( PacketLoggingService.ProtocolName.SIP) /* Via not present in CRLF packet on TCP - causes NPE */ || message.getTopmostVia() == null ) return; String transport = message.getTopmostVia().getTransport(); boolean isTransportUDP = transport.equalsIgnoreCase("UDP"); byte[] srcAddr; int srcPort; byte[] dstAddr; int dstPort; // if addresses are not set use empty byte array with length // equals to the other address or just empty // byte array with length 4 (ipv4 0.0.0.0) if(sender) { if(!isTransportUDP) { InetSocketAddress localAddress = getLocalAddressForDestination( message.getRemoteAddress(), message.getRemotePort(), message.getLocalAddress(), transport); if (localAddress != null) { srcPort = localAddress.getPort(); srcAddr = localAddress.getAddress().getAddress(); } else { logger.warn("Could not obtain source address for " + " packet. Writing source as 0.0.0.0:0"); srcPort = 0; srcAddr = new byte[] { 0, 0, 0, 0 }; } } else { srcPort = message.getLocalPort(); if(message.getLocalAddress() != null) srcAddr = message.getLocalAddress().getAddress(); else if(message.getRemoteAddress() != null) srcAddr = new byte[ message.getRemoteAddress().getAddress().length]; else srcAddr = new byte[4]; } dstPort = message.getRemotePort(); if(message.getRemoteAddress() != null) dstAddr = message.getRemoteAddress().getAddress(); else dstAddr = new byte[srcAddr.length]; } else { if(!isTransportUDP) { InetSocketAddress dstAddress = getLocalAddressForDestination( message.getRemoteAddress(), message.getRemotePort(), message.getLocalAddress(), transport); dstPort = dstAddress.getPort(); dstAddr = dstAddress.getAddress().getAddress(); } else { dstPort = message.getLocalPort(); if(message.getLocalAddress() != null) dstAddr = message.getLocalAddress().getAddress(); else if(message.getRemoteAddress() != null) dstAddr = new byte[ message.getRemoteAddress().getAddress().length]; else dstAddr = new byte[4]; } srcPort = message.getRemotePort(); if(message.getRemoteAddress() != null) srcAddr = message.getRemoteAddress().getAddress(); else srcAddr = new byte[dstAddr.length]; } byte[] msg = null; if(message instanceof SIPRequest) { SIPRequest req = (SIPRequest)message; if(req.getMethod().equals(SIPRequest.MESSAGE) && message.getContentTypeHeader() != null && message.getContentTypeHeader() .getContentType().equalsIgnoreCase("text")) { int len = req.getContentLength().getContentLength(); if(len > 0) { SIPRequest newReq = (SIPRequest)req.clone(); byte[] newContent = new byte[len]; Arrays.fill(newContent, (byte)'.'); newReq.setMessageContent(newContent); msg = newReq.toString().getBytes("UTF-8"); } } } if(msg == null) { msg = message.toString().getBytes("UTF-8"); } packetLogging.logPacket( PacketLoggingService.ProtocolName.SIP, srcAddr, srcPort, dstAddr, dstPort, isTransportUDP ? PacketLoggingService.TransportName.UDP : PacketLoggingService.TransportName.TCP, sender, msg); } catch(Throwable e) { logger.error("Cannot obtain message body", e); } } /** * Logs the specified message and details. * * @param message the message to log * @param from the message sender * @param to the message addressee * @param status message status * @param sender determines whether we are the origin of this message. */ public void logMessage(SIPMessage message, String from, String to, String status, boolean sender) { if (!logger.isInfoEnabled()) return; String msgHeader; if(sender) msgHeader = "JAIN-SIP sent a message from=\""; else msgHeader = "JAIN-SIP received a message from=\""; if (logger.isInfoEnabled()) logger.info(msgHeader + from + "\" to=\"" + to + "\" (status: " + status + "):\n" + message); } /** * Prints the specified <tt>exception</tt> as a warning. * * @param exception the <tt>Exception</tt> we are passed from jain-sip. */ public void logException(Exception exception) { logger.warn("the following exception occured in JAIN-SIP: " + exception, exception); } /** * A dummy implementation. * * @param sipStack ignored; */ public void setSipStack(SipStack sipStack) { this.sipStack = sipStack; } /** * Returns a logger name. * * @return a logger name. */ public String getLoggerName() { return "SIP Communicator JAIN SIP logger."; } /** * Logs the specified trace with a debuf level. * * @param message the trace to log. */ public void logTrace(String message) { if (logger.isDebugEnabled()) logger.debug(message); } /** * Returns a local address to use with the specified TCP destination. * The method forces the JAIN-SIP stack to create * s and binds (if necessary) * and return a socket connected to the specified destination address and * port and then return its local address. * * @param dst the destination address that the socket would need to connect * to. * @param dstPort the port number that the connection would be established * with. * @param localAddress the address that we would like to bind on * (null for the "any" address). * @param transport the transport that will be used TCP ot TLS * * @return the SocketAddress that this handler would use when connecting to * the specified destination address and port. * * @throws IOException if we fail binding the local socket */ public java.net.InetSocketAddress getLocalAddressForDestination( java.net.InetAddress dst, int dstPort, java.net.InetAddress localAddress, String transport) throws IOException { if(ListeningPoint.TLS.equalsIgnoreCase(transport)) return (java.net.InetSocketAddress)(((SipStackImpl)this.sipStack) .getLocalAddressForTlsDst(dst, dstPort, localAddress)); else return (java.net.InetSocketAddress)(((SipStackImpl)this.sipStack) .getLocalAddressForTcpDst(dst, dstPort, localAddress, 0)); } }
0xbb/jitsi
src/net/java/sip/communicator/impl/protocol/sip/SipLogger.java
Java
lgpl-2.1
15,615
/* * JBoss, Home of Professional Open Source. * Copyright 2014, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.test.integration.management.cli; import java.io.File; import java.net.URL; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; import org.jboss.as.test.shared.TestSuiteEnvironment; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import org.junit.Test; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; /** * * @author Dominik Pospisil <dpospisi@redhat.com> */ public class JBossCliXmlValidationTestCase { @Test public void validateJBossCliXmlTestCase() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder parser = factory.newDocumentBuilder(); final String jbossDist = TestSuiteEnvironment.getSystemProperty("jboss.dist"); Document document = parser.parse(new File(jbossDist, "bin/jboss-cli.xml")); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); schemaFactory.setErrorHandler(new ErrorHandlerImpl()); //schemaFactory.setResourceResolver(new XMLResourceResolver()); Schema schema = schemaFactory.newSchema(resourceToURL("schema/wildfly-cli_3_4.xsd")); Validator validator = schema.newValidator(); validator.validate(new DOMSource(document)); } protected static final class ErrorHandlerImpl implements ErrorHandler { @Override public void error(SAXParseException e) throws SAXException { fail(formatMessage(e)); } @Override public void fatalError(SAXParseException e) throws SAXException { fail(formatMessage(e)); } @Override public void warning(SAXParseException e) throws SAXException { System.out.println(formatMessage(e)); } private String formatMessage(SAXParseException e) { StringBuffer sb = new StringBuffer(); sb.append(e.getLineNumber()).append(':').append(e.getColumnNumber()); if (e.getPublicId() != null) sb.append(" publicId='").append(e.getPublicId()).append('\''); if (e.getSystemId() != null) sb.append(" systemId='").append(e.getSystemId()).append('\''); sb.append(' ').append(e.getLocalizedMessage()); sb.append(" a possible cause may be that a subsystem is not using the most up to date schema."); return sb.toString(); } } private URL resourceToURL(final String name) { final ClassLoader classLoader = getClass().getClassLoader(); final URL resource = classLoader.getResource(name); assertNotNull("Can't locate resource " + name + " on " + classLoader, resource); return resource; } }
aloubyansky/wildfly-core
testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/JBossCliXmlValidationTestCase.java
Java
lgpl-2.1
4,132
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ /** * */ package org.hibernate.spatial.testing.dialects.h2geodb; import org.hibernate.spatial.testing.AbstractExpectationsFactory; import org.hibernate.spatial.testing.NativeSQLStatement; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Point; import org.geolatte.geom.ByteBuffer; import org.geolatte.geom.codec.Wkb; import org.geolatte.geom.jts.JTS; /** * A Factory class that generates expected {@link org.hibernate.spatial.testing.NativeSQLStatement}s for GeoDB * version < 0.4. These versions don't support storage of the SRID value with * the geometry. * * @author Jan Boonen, Geodan IT b.v. */ @Deprecated //Class no longer used. Remove. public class GeoDBNoSRIDExpectationsFactory extends AbstractExpectationsFactory { public GeoDBNoSRIDExpectationsFactory(GeoDBDataSourceUtils dataSourceUtils) { super( dataSourceUtils ); } @Override protected NativeSQLStatement createNativeAsBinaryStatement() { return createNativeSQLStatement( "select id, ST_AsEWKB(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeAsTextStatement() { return createNativeSQLStatement( "select id, ST_AsText(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeBoundaryStatement() { throw new UnsupportedOperationException( "Method ST_Bounday() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeBufferStatement(Double distance) { return createNativeSQLStatement( "select t.id, ST_Buffer(t.geom,?) from GEOMTEST t where ST_SRID(t.geom) = 4326", new Object[] { distance } ); } @Override protected NativeSQLStatement createNativeContainsStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Contains(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Contains(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeConvexHullStatement(Geometry geom) { throw new UnsupportedOperationException( "Method ST_ConvexHull() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeCrossesStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Crosses(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Crosses(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeDifferenceStatement(Geometry geom) { throw new UnsupportedOperationException( "Method ST_Difference() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeDimensionSQL() { throw new UnsupportedOperationException( "Method ST_Dimension() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeDisjointStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Disjoint(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Disjoint(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeTransformStatement(int epsg) { throw new UnsupportedOperationException(); } @Override protected NativeSQLStatement createNativeHavingSRIDStatement(int srid) { return createNativeSQLStatement( "select t.id, (st_srid(t.geom) = " + srid + ") from GeomTest t where ST_SRID(t.geom) = " + srid ); } @Override protected NativeSQLStatement createNativeDistanceStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, st_distance(t.geom, ST_GeomFromText(?, 4326)) from GeomTest t where ST_SRID(t.geom) = 4326", geom.toText() ); } @Override protected NativeSQLStatement createNativeEnvelopeStatement() { return createNativeSQLStatement( "select id, ST_Envelope(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeEqualsStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Equals(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Equals(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeFilterStatement(Geometry geom) { throw new UnsupportedOperationException( "Method ST_MBRIntersects() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeGeomUnionStatement(Geometry geom) { throw new UnsupportedOperationException( "Method ST_GeomUnion() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeGeometryTypeStatement() { return createNativeSQLStatement( "select id, GeometryType(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeIntersectionStatement(Geometry geom) { throw new UnsupportedOperationException( "Method ST_Intersection() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeIntersectsStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Intersects(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Intersects(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeIsEmptyStatement() { return createNativeSQLStatement( "select id, ST_IsEmpty(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeIsNotEmptyStatement() { return createNativeSQLStatement( "select id, not ST_IsEmpty(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeIsSimpleStatement() { return createNativeSQLStatement( "select id, ST_IsSimple(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeOverlapsStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Overlaps(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Overlaps(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeRelateStatement(Geometry geom, String matrix) { throw new UnsupportedOperationException( "Method ST_Relate() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeDwithinStatement(Point geom, double distance) { String sql = "select t.id, st_dwithin(t.geom, ST_GeomFromText(?, 4326), " + distance + " ) from GeomTest t where st_dwithin(t.geom, ST_GeomFromText(?, 4326), " + distance + ") = 'true' and ST_SRID(t.geom) = 4326"; return createNativeSQLStatementAllWKTParams( sql, geom.toText() ); } /* * (non-Javadoc) * * @seeorg.hibernatespatial.test.AbstractExpectationsFactory# * createNativeSridStatement() */ @Override protected NativeSQLStatement createNativeSridStatement() { return createNativeSQLStatement( "select id, ST_SRID(geom) from GEOMTEST" ); } @Override protected NativeSQLStatement createNativeSymDifferenceStatement( Geometry geom) { throw new UnsupportedOperationException( "Method ST_SymDifference() is not implemented in the current version of GeoDB." ); } @Override protected NativeSQLStatement createNativeTouchesStatement(Geometry geom) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Touches(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Touches(t.geom, ST_GeomFromText(?, 4326)) = 1", geom.toText() ); } @Override protected NativeSQLStatement createNativeWithinStatement( Geometry testPolygon) { return createNativeSQLStatementAllWKTParams( "select t.id, ST_Within(t.geom, ST_GeomFromText(?, 4326)) from GEOMTEST t where ST_Within(t.geom, ST_GeomFromText(?, 4326)) = 1 and ST_SRID(t.geom) = 4326", testPolygon.toText() ); } @Override protected Geometry decode(Object o) { return JTS.to( Wkb.fromWkb( ByteBuffer.from( (byte[]) o ) ) ); } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/h2geodb/GeoDBNoSRIDExpectationsFactory.java
Java
lgpl-2.1
8,367
/* * Created on 17-dic-2005 * * TODO To change the template for this generated file go to Window - * Preferences - Java - Code Style - Code Templates */ package org.herac.tuxguitar.gui.actions.transport; import org.eclipse.swt.events.TypedEvent; import org.herac.tuxguitar.gui.TuxGuitar; import org.herac.tuxguitar.gui.actions.Action; /** * @author julian * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class TransportStopAction extends Action { public static final String NAME = "action.transport.stop"; public TransportStopAction() { super(NAME, AUTO_LOCK | AUTO_UNLOCK | AUTO_UPDATE | KEY_BINDING_AVAILABLE); } protected int execute(TypedEvent e) { TuxGuitar.instance().getTransport().stop(); return 0; } }
jfinkels/tuxguitar
src/main/java/org/herac/tuxguitar/gui/actions/transport/TransportStopAction.java
Java
lgpl-2.1
857
import java.io.IOException; import jade.core.AID; import java.util.ArrayList; import java.util.Scanner; import jade.core.Agent; public class DutchModel { public static void main(String[] args) throws IOException { String option=""; ArrayList<BiderAgent> bidders= new ArrayList<BiderAgent>(); System.out.println("Welcome to Fish Dutch Auction!"); System.out.println("Press 1 to sell a product."); System.out.println("Press 2 to Bid for a product."); Scanner scan= new Scanner(System.in); option= scan.nextLine(); System.out.println(option); if(option.equals("1")) { } else if(option.equals("2")) { Loader bidderxml = new Loader("Bidders.xml"); bidders=bidderxml.loadXmlBidders(); Product p1= new Product("gg",1,"g1",null); AuctioneerAgent Ag = new AuctioneerAgent(10,1,1200); SellerAgent s1= new SellerAgent (p1); AID sel = s1.getSellerAid(); Ag.setSellerAid(sel); Ag.setup(); s1.setup(); } else { System.out.println("Wrong input... Time Out!"); } } }
joaofloressantos/Dutch_Auction
Dutch_Auction/src/DutchModel.java
Java
lgpl-2.1
1,221
/* * Copyright (C) 2010 Herve Quiroz * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.trancecode.collection; import com.google.common.base.Preconditions; import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; import com.google.common.collect.Iterables; import java.util.Set; /** * Utility methods related to {@link Set}. * * @author Herve Quiroz */ public final class TcSets { public static <T> ImmutableSet<T> immutableSet(final Iterable<T> set, final T element) { Preconditions.checkNotNull(set); Preconditions.checkNotNull(element); if (set instanceof Set && ((Set<?>) set).contains(element)) { return ImmutableSet.copyOf(set); } final Builder<T> builder = ImmutableSet.builder(); return builder.addAll(set).add(element).build(); } public static <T> ImmutableSet<T> immutableSet(final Set<T> set1, final Set<T> set2) { Preconditions.checkNotNull(set1); Preconditions.checkNotNull(set2); if (set1.isEmpty()) { return ImmutableSet.copyOf(set2); } if (set2.isEmpty()) { return ImmutableSet.copyOf(set1); } final Builder<T> builder = ImmutableSet.builder(); return builder.addAll(set1).addAll(set2).build(); } public static <T> ImmutableSet<T> immutableSetWithout(final Iterable<T> elements, final T element) { Preconditions.checkNotNull(elements); Preconditions.checkNotNull(element); if (elements instanceof Set && !((Set<?>) elements).contains(element)) { return ImmutableSet.copyOf(elements); } return ImmutableSet.copyOf(Iterables.filter(elements, Predicates.not(Predicates.equalTo(element)))); } private TcSets() { // No instantiation } }
herve-quiroz/tc-common
src/main/java/org/trancecode/collection/TcSets.java
Java
lgpl-2.1
2,646
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2013 Oliver Burn // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.checks.coding; import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import java.io.File; import org.junit.Test; /** * Test fixture for the UnnecessaryParenthesesCheck. * * @author Eric K. Roe */ public class UnnecessaryParenthesesCheckTest extends BaseCheckTestSupport { private static final String TEST_FILE = "coding" + File.separator + "InputUnnecessaryParentheses.java"; @Test public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(UnnecessaryParenthesesCheck.class); final String[] expected = { "4:22: Unnecessary parentheses around assignment right-hand side.", "4:29: Unnecessary parentheses around expression.", "4:31: Unnecessary parentheses around identifier 'i'.", "4:46: Unnecessary parentheses around assignment right-hand side.", "5:15: Unnecessary parentheses around assignment right-hand side.", "6:14: Unnecessary parentheses around identifier 'x'.", "6:17: Unnecessary parentheses around assignment right-hand side.", "7:15: Unnecessary parentheses around assignment right-hand side.", "8:14: Unnecessary parentheses around identifier 'x'.", "8:17: Unnecessary parentheses around assignment right-hand side.", "11:22: Unnecessary parentheses around assignment right-hand side.", "11:30: Unnecessary parentheses around identifier 'i'.", "11:46: Unnecessary parentheses around assignment right-hand side.", "15:17: Unnecessary parentheses around literal '0'.", "25:11: Unnecessary parentheses around assignment right-hand side.", "29:11: Unnecessary parentheses around assignment right-hand side.", "31:11: Unnecessary parentheses around assignment right-hand side.", "33:11: Unnecessary parentheses around assignment right-hand side.", "34:16: Unnecessary parentheses around identifier 'a'.", "35:14: Unnecessary parentheses around identifier 'a'.", "35:20: Unnecessary parentheses around identifier 'b'.", "35:26: Unnecessary parentheses around literal '600'.", "35:40: Unnecessary parentheses around literal '12.5f'.", "35:56: Unnecessary parentheses around identifier 'arg2'.", "36:14: Unnecessary parentheses around string \"this\".", "36:25: Unnecessary parentheses around string \"that\".", "37:11: Unnecessary parentheses around assignment right-hand side.", "37:14: Unnecessary parentheses around string \"this is a really, really...\".", "39:16: Unnecessary parentheses around return value.", "43:21: Unnecessary parentheses around literal '1'.", "43:26: Unnecessary parentheses around literal '13.5'.", "44:22: Unnecessary parentheses around literal 'true'.", "45:17: Unnecessary parentheses around identifier 'b'.", "49:17: Unnecessary parentheses around assignment right-hand side.", "51:11: Unnecessary parentheses around assignment right-hand side.", "53:16: Unnecessary parentheses around return value.", "63:13: Unnecessary parentheses around expression.", "67:16: Unnecessary parentheses around expression.", "72:19: Unnecessary parentheses around expression.", "73:23: Unnecessary parentheses around literal '4000'.", "78:19: Unnecessary parentheses around assignment right-hand side.", "80:11: Unnecessary parentheses around assignment right-hand side.", "80:16: Unnecessary parentheses around literal '3'.", "81:27: Unnecessary parentheses around assignment right-hand side.", }; verify(checkConfig, getPath(TEST_FILE), expected); } @Test public void test15Extensions() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(UnnecessaryParenthesesCheck.class); final String[] expected = {}; verify(checkConfig, getPath("Input15Extensions.java"), expected); } }
pbaranchikov/checkstyle
src/tests/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java
Java
lgpl-2.1
5,343
/***************************************************************** JADE - Java Agent DEvelopment Framework is a framework to develop multi-agent systems in compliance with the FIPA specifications. Copyright (C) 2000 CSELT S.p.A. GNU Lesser General Public License This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *****************************************************************/ package jade.core; //#APIDOC_EXCLUDE_FILE import jade.util.leap.Serializable; import jade.security.JADEPrincipal; import jade.security.Credentials; /** The <code>NodeDescriptor</code> class serves as a meta-level description of a kernel-level service. Instances of this class contain a <code>Node</code> object, along with its name and properties, and are used in service management operations, as well as in agent-level introspection of platform-level entities. @author Giovanni Rimassa - FRAMeTech s.r.l. @see Node */ public class NodeDescriptor implements Serializable { /** Builds a new node descriptor, describing the given node with the given name and properties. @param nn The name of the described node. @param node The described <code>Node</code> object. */ public NodeDescriptor(Node node) { myName = node.getName(); myNode = node; } /** Builds a node descriptor for a node hosting an agent container. @param cid The container ID for the hosted container. @param node The described <code>Node</code> object. @param principal The principal of the node owner. @param credentials The credentials of the node owner. */ public NodeDescriptor(ContainerID cid, Node node) { myName = cid.getName(); myNode = node; myContainer = cid; } /** Builds an uninitialized node descriptor. @see NodeDescriptor#setName(String sn) @see NodeDescriptor#setNode(Node node) */ public NodeDescriptor() { } /** Change the name (if any) of the described node. @param nn The name to assign to the described node. */ public void setName(String nn) { myName = nn; } /** Retrieve the name (if any) of the described node. @return The name of the described node, or <code>null</code> if no name was set. */ public String getName() { return myName; } /** Change the described node (if any). @param node The <code>Node</code> object that is to be described by this node descriptor. */ public void setNode(Node node) { myNode = node; } /** Retrieve the described node. @return The <code>Node</code> object described by this node descriptor, or <code>null</code> if no node was set. */ public Node getNode() { return myNode; } /** Retrieve the ID of the container (if any) hosted by the described node. @return The <code>ContainerID</code> of the hosted container, or <code>null</code> if no such container was set. */ public ContainerID getContainer() { return myContainer; } public void setParentNode(Node n) { parentNode = n; } public Node getParentNode() { return parentNode; } /** Set the username of the owner of the described node */ public void setUsername(String username) { this.username = username; } /** Retrieve the username of the owner of the described node */ public String getUsername() { return username; } /** Set the password of the owner of the described node */ public void setPassword(byte[] password) { this.password = password; } /** Retrieve the password of the owner of the described node */ public byte[] getPassword() { return password; } /** Set the principal of the described node */ public void setPrincipal(JADEPrincipal principal) { myPrincipal = principal; } /** Retrieve the principal of the described node */ public JADEPrincipal getPrincipal() { return myPrincipal; } /** Set the principal of the owner of this node */ public void setOwnerPrincipal(JADEPrincipal principal) { ownerPrincipal = principal; } /** Retrieve the principal of the owner of this node (if any) @return The principal of the owner of this node, or <code>null</code> if no principal was set. */ public JADEPrincipal getOwnerPrincipal() { return ownerPrincipal; } /** Set the credentials of the owner of this node */ public void setOwnerCredentials(Credentials credentials) { ownerCredentials = credentials; } /** Retrieve the credentials of the owner of this node (if any) @return The credentials of the owner of this node, or <code>null</code> if no credentials were set. */ public Credentials getOwnerCredentials() { return ownerCredentials; } private String myName; private Node myNode; private Node parentNode; private ContainerID myContainer; private String username; private byte[] password; private JADEPrincipal myPrincipal; private JADEPrincipal ownerPrincipal; private Credentials ownerCredentials; }
automenta/jadehell
src/main/java/jade/core/NodeDescriptor.java
Java
lgpl-2.1
5,958
/* * This file is part of the QuickServer library * Copyright (C) QuickServer.org * * Use, modification, copying and distribution of this software is subject to * the terms and conditions of the GNU Lesser General Public License. * You should have received a copy of the GNU LGP License along with this * library; if not, you can download a copy from <http://www.quickserver.org/>. * * For questions, suggestions, bug-reports, enhancement-requests etc. * visit http://www.quickserver.org * */ package org.quickserver.security; import java.io.*; import java.util.logging.*; import org.quickserver.util.xmlreader.*; import org.quickserver.util.io.*; import javax.net.ssl.*; import java.security.*; import org.quickserver.swing.*; /** * Class that loads Key Managers, Trust Managers, SSLContext and other secure * objects from QuickServer configuration passed. See &lt;secure-store-manager&gt; * in &lt;secure-store&gt; to set new manger to load your SecureStore. This * class can be overridden to change the way QuickServer configures the * secure mode. * @see org.quickserver.util.xmlreader.SecureStore * @author Akshathkumar Shetty * @since 1.4 */ public class SecureStoreManager { private static Logger logger = Logger.getLogger( SecureStoreManager.class.getName()); private SensitiveInput sensitiveInput = null; /** * Loads KeyManagers. KeyManagers are responsible for managing * the key material which is used to authenticate the local * SSLSocket to its peer. Can return null. */ public KeyManager[] loadKeyManagers(QuickServerConfig config) throws GeneralSecurityException, IOException { Secure secure = config.getSecure(); SecureStore secureStore = secure.getSecureStore(); if(secureStore==null) { logger.fine("SecureStore configuration not set! "+ "So returning null for KeyManager"); return null; } KeyStoreInfo keyStoreInfo = secureStore.getKeyStoreInfo(); if(keyStoreInfo==null) { logger.fine("KeyStoreInfo configuration not set! "+ "So returning null for KeyManager"); return null; } logger.finest("Loading KeyManagers"); KeyStore ks = getKeyStoreForKey(secureStore.getType(), secureStore.getProvider()); logger.info("KeyManager Provider: "+ks.getProvider()); char storepass[] = null; if(keyStoreInfo.getStorePassword()!=null) { logger.finest("KeyStore: Store password was present!"); storepass = keyStoreInfo.getStorePassword().toCharArray(); } else { logger.finest("KeyStore: Store password was not set.. so asking!"); if(sensitiveInput==null) { sensitiveInput = new SensitiveInput(config.getName()+" - Input Prompt"); } storepass = sensitiveInput.getInput("Store password for KeyStore"); if(storepass==null) { logger.finest("No password entered.. will pass null"); } } InputStream keyStoreStream = null; try { if(keyStoreInfo.getStoreFile().equalsIgnoreCase("none")==false) { logger.finest("KeyStore location: "+ ConfigReader.makeAbsoluteToConfig(keyStoreInfo.getStoreFile(), config)); keyStoreStream = new FileInputStream( ConfigReader.makeAbsoluteToConfig(keyStoreInfo.getStoreFile(), config)); } ks.load(keyStoreStream, storepass); logger.finest("KeyStore loaded"); } finally { if(keyStoreStream != null) { keyStoreStream.close(); keyStoreStream = null; } } char keypass[] = null; if(keyStoreInfo.getKeyPassword()!=null) { logger.finest("KeyStore: key password was present!"); keypass = keyStoreInfo.getKeyPassword().toCharArray(); } else { logger.finest("KeyStore: Key password was not set.. so asking!"); if(sensitiveInput==null) { sensitiveInput = new SensitiveInput(config.getName()+" - Input Prompt"); } keypass = sensitiveInput.getInput("Key password for KeyStore"); if(keypass==null) { logger.finest("No password entered.. will pass blank"); keypass = "".toCharArray(); } } KeyManagerFactory kmf = KeyManagerFactory.getInstance( secureStore.getAlgorithm()); kmf.init(ks, keypass); storepass = " ".toCharArray(); storepass = null; keypass = " ".toCharArray(); keypass = null; return kmf.getKeyManagers(); } /** * Loads TrustManagers. TrustManagers are responsible for managing the * trust material that is used when making trust decisions, and for * deciding whether credentials presented by a peer should be accepted. * Can return null. */ public TrustManager[] loadTrustManagers(QuickServerConfig config) throws GeneralSecurityException, IOException { Secure secure = config.getSecure(); SecureStore secureStore = secure.getSecureStore(); TrustStoreInfo trustStoreInfo = secureStore.getTrustStoreInfo(); if(trustStoreInfo==null) { return null; } logger.finest("Loading TrustManagers"); String type = null; if(trustStoreInfo.getType()!=null && trustStoreInfo.getType().trim().length()!=0) type = trustStoreInfo.getType(); else type = secureStore.getType(); String provider = null; if(trustStoreInfo.getProvider()!=null && trustStoreInfo.getProvider().trim().length()!=0) provider = trustStoreInfo.getProvider(); else provider = secureStore.getProvider(); KeyStore ts = getKeyStoreForTrust(type, provider); char trustpass[] = null; if(trustStoreInfo.getStorePassword()!=null) { logger.finest("TrustStore: Store password was present!"); trustpass = trustStoreInfo.getStorePassword().toCharArray(); } else { logger.finest("TrustStore: Store password was not set.. so asking!"); if(sensitiveInput==null) { sensitiveInput = new SensitiveInput(config.getName()+" - Input Prompt"); } trustpass = sensitiveInput.getInput("Store password for TrustStore"); if(trustpass==null) { logger.finest("No password entered.. will pass null"); } } InputStream trustStoreStream = null; try { if(trustStoreInfo.getStoreFile().equalsIgnoreCase("none")==false) { logger.finest("TrustStore location: "+ ConfigReader.makeAbsoluteToConfig( trustStoreInfo.getStoreFile(), config)); trustStoreStream = new FileInputStream( ConfigReader.makeAbsoluteToConfig( trustStoreInfo.getStoreFile(), config)); } ts.load(trustStoreStream, trustpass); logger.finest("TrustStore loaded"); } finally { if(trustStoreStream!=null) { trustStoreStream.close(); trustStoreStream = null; } } TrustManagerFactory tmf = TrustManagerFactory.getInstance( secureStore.getAlgorithm()); tmf.init(ts); return tmf.getTrustManagers(); } /** * Generates a SSLContext object that implements the specified secure * socket protocol. */ public SSLContext getSSLContext(String protocol) throws NoSuchAlgorithmException { return SSLContext.getInstance(protocol); } public SSLContext getSSLContext(QuickServerConfig config) throws NoSuchAlgorithmException, NoSuchProviderException { if(config.getSecure().getSecureStore().getProvider()!=null) { return SSLContext.getInstance( config.getSecure().getProtocol(), config.getSecure().getSecureStore().getProvider()); } else { return SSLContext.getInstance(config.getSecure().getProtocol()); } } /** * Generates a keystore object for the specified keystore type from * the specified provider to be used for loading/storeing keys. * @param type the type of keystore * @param provider the name of the provider if <code>null</code> any * provider package that implements this type of key may be given based * on the priority. */ protected KeyStore getKeyStoreForKey(String type, String provider) throws KeyStoreException, NoSuchProviderException { if(provider==null) return KeyStore.getInstance(type); return KeyStore.getInstance(type, provider); } /** * Generates a keystore object for the specified keystore type from * the specified provider to be used for loading/storing trusted * keys/certificates. * @param type the type of keystore * @param provider the name of the provider if <code>null</code> any * provider package that implements this type of key may be given based * on the priority. */ protected KeyStore getKeyStoreForTrust(String type, String provider) throws KeyStoreException, NoSuchProviderException { if(provider==null) return KeyStore.getInstance(type); return KeyStore.getInstance(type, provider); } /** * Returns a SSLSocketFactory object to be used for creating SSLSockets. */ public SSLSocketFactory getSocketFactory(SSLContext context) { return context.getSocketFactory(); } /** * Can be used to log details about the SSLServerSocket used to * create a secure server [SSL/TLS]. This method can also be * overridden to change the enabled cipher suites and/or enabled protocols. */ public void logSSLServerSocketInfo(SSLServerSocket sslServerSocket) { if(logger.isLoggable(Level.FINEST)==false) { return; } logger.finest("SecureServer Info: ClientAuth: "+ sslServerSocket.getNeedClientAuth()); logger.finest("SecureServer Info: ClientMode: "+ sslServerSocket.getUseClientMode()); String supportedSuites[] = sslServerSocket.getSupportedCipherSuites(); logger.finest("SecureServer Info: Supported Cipher Suites --------"); for(int i=0;i<supportedSuites.length;i++) logger.finest(supportedSuites[i]); logger.finest("---------------------------------------------------"); String enabledSuites[] = sslServerSocket.getEnabledCipherSuites(); logger.finest("SecureServer Info: Enabled Cipher Suites ----------"); for(int i=0;i<enabledSuites.length;i++) logger.finest(enabledSuites[i]); logger.finest("---------------------------------------------------"); String supportedProtocols[] = sslServerSocket.getSupportedProtocols(); logger.finest("SecureServer Info: Supported Protocols ------------"); for(int i=0;i<supportedProtocols.length;i++) logger.finest(supportedProtocols[i]); logger.finest("---------------------------------------------------"); String enabledProtocols[] = sslServerSocket.getEnabledProtocols(); logger.finest("SecureServer Info: Enabled Protocols --------------"); for(int i=0;i<enabledProtocols.length;i++) logger.finest(enabledProtocols[i]); logger.finest("---------------------------------------------------"); } }
QuickServerLab/QuickServer-Main
src/main/org/quickserver/security/SecureStoreManager.java
Java
lgpl-2.1
10,503
package com.quickserverlab.quickcached; import java.io.IOException; import java.net.SocketTimeoutException; import java.util.logging.Level; import java.util.logging.Logger; import com.quickserverlab.quickcached.cache.CacheException; import com.quickserverlab.quickcached.cache.CacheInterface; import org.quickserver.net.server.ClientHandler; import java.util.Iterator; import java.util.Map; import java.util.Set; /** * * @author Akshathkumar Shetty */ public class TextCommandProcessor { private static final Logger logger = Logger.getLogger(TextCommandProcessor.class.getName()); private static String versionOutput = null; static { versionOutput = "VERSION " + QuickCached.version + "\r\n"; } private CacheInterface cache; public void setCache(CacheInterface cache) { this.cache = cache; } public void handleTextCommand(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { if (QuickCached.DEBUG) { logger.log(Level.FINE, "command: {0}", command); } if (command.startsWith("get ") || command.startsWith("gets ")) { handleGetCommands(handler, command); } else if (command.equals("version")) { sendResponse(handler, versionOutput); } else if (command.startsWith("set ") || command.startsWith("add ") || command.startsWith("replace ") || command.startsWith("append ") || command.startsWith("prepend ") || command.startsWith("cas ")) { handleStorageCommands(handler, command); Data data = (Data) handler.getClientData(); if (data.isAllDataIn()) { processStorageCommands(handler); return; } else { return; } } else if (command.startsWith("delete ")) { handleDeleteCommands(handler, command); } else if (command.startsWith("flush_all")) { handleFlushAll(handler, command); } else if (command.equals("stats")) { Map stats = CommandHandler.getStats(handler.getServer()); Set keySet = stats.keySet(); Iterator iterator = keySet.iterator(); String key = null; String value = null; while (iterator.hasNext()) { key = (String) iterator.next(); value = (String) stats.get(key); sendResponse(handler, "STAT " + key + " " + value + "\r\n"); } sendResponse(handler, "END\r\n"); } else if (command.startsWith("stats ")) { //TODO sendResponse(handler, "ERROR\r\n"); } else if (command.equals("quit")) { handler.closeConnection(); } else if (command.startsWith("incr ") || command.startsWith("decr ")) { handleIncrDecrCommands(handler, command); } else if (command.startsWith("touch ")) { handleTouchCommands(handler, command); } else { logger.log(Level.WARNING, "unknown command! {0}", command); sendResponse(handler, "ERROR\r\n"); } } private void handleFlushAll(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { /* flush_all [exptime] [noreply]\r\n */ String cmdData[] = command.split(" "); String cmd = cmdData[0]; String exptime = null; if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}", new Object[]{cmd}); } boolean noreplay = false; if(cmdData[cmdData.length-1].equals("noreply")) { noreplay = true; } if (noreplay==false && cmdData.length >= 2) { exptime = cmdData[1]; } else if (noreplay==true && cmdData.length >= 3) { exptime = cmdData[1]; } if (exptime == null) { cache.flush(); } else { final int sleeptime = Integer.parseInt(exptime); Thread t = new Thread() { public void run() { try { sleep(1000 * sleeptime); } catch (InterruptedException ex) { logger.log(Level.WARNING, "Error: "+ex, ex); } try { cache.flush(); } catch (CacheException ex) { logger.log(Level.SEVERE, "Error: "+ex, ex); } } }; t.start(); } if (noreplay) { return; } sendResponse(handler, "OK\r\n"); } private void handleDeleteCommands(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { /* delete <key> [noreply]\r\n */ String cmdData[] = command.split(" "); String cmd = cmdData[0]; String key = cmdData[1]; if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}, key: {1}", new Object[]{cmd, key}); } boolean noreplay = false; if (cmdData.length == 3) { if ("noreply".equals(cmdData[2])) { noreplay = true; } } boolean flag = cache.delete(key); if (noreplay) { return; } if (flag == true) { sendResponse(handler, "DELETED\r\n"); } else { sendResponse(handler, "NOT_FOUND\r\n"); } } private void handleTouchCommands(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { /* touch <key> <exptime> [noreply]\r\n */ String cmdData[] = command.split(" "); String cmd = cmdData[0]; String key = cmdData[1]; int exptime = Integer.parseInt(cmdData[2]); boolean noreplay = false; if (cmdData.length >= 4) { if ("noreply".equals(cmdData[3])) { noreplay = true; } } if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}, key: {1}", new Object[]{cmd, key}); } boolean flag = cache.touch(key, exptime); if(noreplay) return; if(flag==false) { sendResponse(handler, "NOT_FOUND\r\n"); } else { sendResponse(handler, "TOUCHED\r\n"); } } private void handleGetCommands(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { /* get <key>*\r\n gets <key>*\r\n */ String cmdData[] = command.split(" "); String cmd = cmdData[0]; String key = null; for (int i = 1; i < cmdData.length; i++) { key = cmdData[i]; if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}, key: {1}", new Object[]{cmd, key}); } DataCarrier dc = (DataCarrier) cache.get(key); if (dc != null) { StringBuilder sb = new StringBuilder(); sb.append("VALUE "); sb.append(key); sb.append(" "); sb.append(dc.getFlags()); sb.append(" "); sb.append(dc.getData().length); sb.append(" "); sb.append(dc.getCas()); sb.append("\r\n"); sendResponse(handler, sb.toString()); sendResponse(handler, dc.getData()); sendResponse(handler, "\r\n"); } } sendResponse(handler, "END\r\n"); /* VALUE <key> <flags> <bytes> [<cas unique>]\r\n <data block>\r\n */ } private void handleIncrDecrCommands(ClientHandler handler, String command) throws SocketTimeoutException, IOException, CacheException { /* incr <key> <value> [noreply]\r\n decr <key> <value> [noreply]\r\n */ String cmdData[] = command.split(" "); if (cmdData.length < 3) { sendResponse(handler, "CLIENT_ERROR Bad number of args passed\r\n"); if (cmdData[0].equals("incr")) { CommandHandler.incrMisses++; } else if (cmdData[0].equals("decr")) { CommandHandler.decrMisses++; } return; } String cmd = cmdData[0]; String key = cmdData[1]; String _value = cmdData[2]; long value = 0; try { value = Long.parseLong(_value); } catch (Exception e) { sendResponse(handler, "CLIENT_ERROR parse of client value failed\r\n"); if (cmd.equals("incr")) { CommandHandler.incrMisses++; } else if (cmd.equals("decr")) { CommandHandler.decrMisses++; } return; } if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}, key: {1}", new Object[]{cmd, key}); } boolean noreplay = false; if (cmdData.length >= 4) { if ("noreply".equals(cmdData[3])) { noreplay = true; } } DataCarrier dc = (DataCarrier) cache.get(key, false); if (dc == null) { if (noreplay == false) { sendResponse(handler, "NOT_FOUND\r\n"); } if (cmd.equals("incr")) { CommandHandler.incrMisses++; } else if (cmd.equals("decr")) { CommandHandler.decrMisses++; } return; } StringBuilder sb = new StringBuilder(); dc.writeLock.lock(); try { long oldvalue = Long.parseLong(new String(dc.getData(), HexUtil.getCharset())); if (cmd.equals("incr")) { value = oldvalue + value; } else if (cmd.equals("decr")) { value = oldvalue - value; if (value < 0) { value = 0; } } else { throw new IllegalArgumentException("Unknown command "+cmd); } sb.append(value); dc.setData(sb.toString().getBytes(HexUtil.getCharset())); cache.update(key, dc, dc.getSize()); } catch(Exception e) { if(noreplay == false) { sendResponse(handler, "CLIENT_ERROR parse of server value failed\r\n"); } if (cmd.equals("incr")) { CommandHandler.incrMisses++; } else if (cmd.equals("decr")) { CommandHandler.decrMisses++; } return; } finally { dc.writeLock.unlock(); } if (cmd.equals("incr")) { CommandHandler.incrHits++; } else if (cmd.equals("decr")) { CommandHandler.decrHits++; } if (noreplay) { return; } sb.append("\r\n"); sendResponse(handler, sb.toString()); } private void handleStorageCommands(ClientHandler handler, String command) throws SocketTimeoutException, IOException { Data data = (Data) handler.getClientData(); /* <command name> <key> <flags> <exptime> <bytes> [noreply]\r\n cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n */ String cmdData[] = command.split(" "); String cmd = cmdData[0]; String key = cmdData[1]; String flags = cmdData[2]; int exptime = Integer.parseInt(cmdData[3]); long bytes = Integer.parseInt(cmdData[4]); String casunique = null; boolean noreplay = false; if (cmdData.length >= 6) { if ("noreply".equals(cmdData[5])) { noreplay = true; } else { casunique = cmdData[5]; } if (cmdData.length >= 7) { if ("noreply".equals(cmdData[6])) { noreplay = true; } } } if(key.length()>Data.getMaxSizeAllowedForKey()) { throw new IllegalArgumentException( "key passed to big to store "+key); } if(Data.getMaxSizeAllowedForValue()>0) { if(bytes > Data.getMaxSizeAllowedForValue()) { throw new IllegalArgumentException( "value passed to big to store "+bytes+" for key "+key); } } data.setCmd(cmd); data.setKey(key); data.setFlags(flags); data.setExptime(exptime); data.setDataRequiredLength(bytes); data.setCasUnique(casunique); data.setNoreplay(noreplay); } public void processStorageCommands(ClientHandler handler) throws SocketTimeoutException, IOException, CacheException { Data data = (Data) handler.getClientData(); if(QuickCached.DEBUG==false) { logger.log(Level.FINE, "cmd: {0}, key: {1}", new Object[]{data.getCmd(), data.getKey()}); } byte dataToStore[] = data.getDataByte(); DataCarrier dc = new DataCarrier(dataToStore); dc.setFlags(data.getFlags()); if (data.getCmd().equals("set")) { DataCarrier olddata = (DataCarrier) cache.get(data.getKey(), false); if(olddata==null) { cache.set(data.getKey(), dc, dc.getSize(), data.getExptime()); } else { olddata.writeLock.lock(); try { olddata.setData(dc.getData()); olddata.setFlags(dc.getFlags()); cache.update(data.getKey(), olddata, olddata.getSize(), data.getExptime()); } finally { olddata.writeLock.unlock(); } } if (data.isNoreplay() == false) { sendResponse(handler, "STORED\r\n"); } } else if (data.getCmd().equals("add")) { Object olddata = cache.get(data.getKey(), false); if (olddata == null) { cache.set(data.getKey(), dc, dc.getSize(), data.getExptime()); if (data.isNoreplay() == false) { sendResponse(handler, "STORED\r\n"); } } else { if (data.isNoreplay() == false) { sendResponse(handler, "NOT_STORED\r\n"); } } } else if (data.getCmd().equals("replace")) { DataCarrier olddata = (DataCarrier) cache.get(data.getKey(), false); if (olddata != null) { olddata.writeLock.lock(); try { olddata.setData(dc.getData()); cache.update(data.getKey(), olddata, olddata.getSize()); } finally { olddata.writeLock.unlock(); } dc.setData(null); dc = null; if (data.isNoreplay() == false) { if (data.isNoreplay() == false) { sendResponse(handler, "STORED\r\n"); } } } else { if (data.isNoreplay() == false) { sendResponse(handler, "NOT_STORED\r\n"); } } } else if (data.getCmd().equals("append")) { DataCarrier olddata = (DataCarrier) cache.get(data.getKey(), false); if (olddata != null) { olddata.writeLock.lock(); try { olddata.append(dc.getData()); cache.update(data.getKey(), olddata, olddata.getSize()); } finally { olddata.writeLock.unlock(); } dc.setData(null); dc = null; if (data.isNoreplay() == false) { if (data.isNoreplay() == false) { sendResponse(handler, "STORED\r\n"); } } } else { if (data.isNoreplay() == false) { sendResponse(handler, "NOT_STORED\r\n"); } } } else if (data.getCmd().equals("prepend")) { DataCarrier olddata = (DataCarrier) cache.get(data.getKey(), false); if (olddata != null) { olddata.writeLock.lock(); try { olddata.prepend(dc.getData()); cache.update(data.getKey(), olddata, olddata.getSize()); } finally { olddata.writeLock.unlock(); } dc.setData(null); dc = null; if (data.isNoreplay() == false) { if (data.isNoreplay() == false) { sendResponse(handler, "STORED\r\n"); } } } else { if (data.isNoreplay() == false) { sendResponse(handler, "NOT_STORED\r\n"); } } } else if (data.getCmd().equals("cas")) { String reply = null; DataCarrier olddata = (DataCarrier) cache.get(data.getKey(), false); if(olddata != null) { olddata.writeLock.lock(); try { int oldcas = olddata.getCas(); int passedcas = Integer.parseInt(data.getCasUnique()); if (oldcas == passedcas) { olddata.setData(dc.getData()); cache.update(data.getKey(), olddata, olddata.getSize()); dc.setData(null); dc = null; CommandHandler.casHits++; if (data.isNoreplay() == false) { reply = "STORED\r\n"; } } else { CommandHandler.casBadval++; if (data.isNoreplay() == false) { reply = "EXISTS\r\n"; } } } finally { olddata.writeLock.unlock(); } } else { CommandHandler.casMisses++; if (data.isNoreplay() == false) { reply = "NOT_FOUND\r\n"; } } if(reply!=null) { sendResponse(handler, reply); } } data.clear(); } public void sendResponse(ClientHandler handler, String data) throws SocketTimeoutException, IOException { sendResponse(handler, data.getBytes(HexUtil.getCharset())); } public void sendResponse(ClientHandler handler, byte data[]) throws SocketTimeoutException, IOException { if(handler.getCommunicationLogging() || QuickCached.DEBUG) { logger.log(Level.FINE, "S: {0}", new String(data, HexUtil.getCharset())); } else { logger.log(Level.FINE, "S: {0} bytes", data.length); } handler.sendClientBinary(data); } }
QuickServerLab/QuickCached
src/main/com/quickserverlab/quickcached/TextCommandProcessor.java
Java
lgpl-2.1
15,156
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.service.protocol.event; import java.util.*; import net.java.sip.communicator.service.protocol.*; /** * Events of this class represent the fact that a server stored * subscription/contact has been moved from one server stored group to another. * Such events are only generated by implementations of * OperationSetPersistentPresence as non persistent presence operation sets do * not support the notion of server stored groups. * * @author Emil Ivov */ public class SubscriptionMovedEvent extends EventObject { /** * Serial version UID. */ private static final long serialVersionUID = 0L; private ContactGroup oldParent = null; private ContactGroup newParent = null; private ProtocolProviderService sourceProvider = null; /** * Creates an event instance with the specified source contact and old and * new parent. * * @param sourceContact the <tt>Contact</tt> that has been moved. * @param sourceProvider a reference to the <tt>ProtocolProviderService</tt> * that the source <tt>Contact</tt> belongs to. * @param oldParent the <tt>ContactGroup</tt> that has previously been * the parent * @param newParent the new <tt>ContactGroup</tt> parent of * <tt>sourceContact</tt> */ public SubscriptionMovedEvent(Contact sourceContact, ProtocolProviderService sourceProvider, ContactGroup oldParent, ContactGroup newParent) { super(sourceContact); this.oldParent = oldParent; this.newParent = newParent; this.sourceProvider = sourceProvider; } /** * Returns a reference to the contact that has been moved. * @return a reference to the <tt>Contact</tt> that has been moved. */ public Contact getSourceContact() { return (Contact)getSource(); } /** * Returns a reference to the ContactGroup that contained the source contact * before it was moved. * @return a reference to the previous <tt>ContactGroup</tt> parent of * the source <tt>Contact</tt>. */ public ContactGroup getOldParentGroup() { return oldParent; } /** * Returns a reference to the ContactGroup that currently contains the * source contact. * * @return a reference to the current <tt>ContactGroup</tt> parent of * the source <tt>Contact</tt>. */ public ContactGroup getNewParentGroup() { return newParent; } /** * Returns the provider that the source contact belongs to. * @return the provider that the source contact belongs to. */ public ProtocolProviderService getSourceProvider() { return sourceProvider; } /** * Returns a String representation of this ContactPresenceStatusChangeEvent * * @return A a String representation of this * SubscriptionMovedEvent. */ public String toString() { StringBuffer buff = new StringBuffer("SubscriptionMovedEvent-[ ContactID="); buff.append(getSourceContact().getAddress()); buff.append(", OldParentGroup=").append(getOldParentGroup().getGroupName()); buff.append(", NewParentGroup=").append(getNewParentGroup().getGroupName()); return buff.toString(); } }
zhaozw/android-1
src/net/java/sip/communicator/service/protocol/event/SubscriptionMovedEvent.java
Java
lgpl-2.1
3,564
package net.gigimoi.zombietc.tile; import net.gigimoi.zombietc.ZombieTC; import net.gigimoi.zombietc.util.IListenerZTC; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; /** * Created by gigimoi on 8/8/2014. */ public abstract class TileZTC extends TileEntity implements IListenerZTC { @Override public void updateEntity() { super.updateEntity(); if(!ZombieTC.gameManager.isRegisteredListener(this)) { ZombieTC.gameManager.registerListener(this); } } @Override public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); writeToNBT(tagCompound); return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tagCompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { super.onDataPacket(net, pkt); readFromNBT(pkt.func_148857_g()); } }
gigimoi/Zombie-Total-Conversion-Craft
src/main/java/net/gigimoi/zombietc/tile/TileZTC.java
Java
lgpl-2.1
1,114
package net.minecraft.server; import java.util.Iterator; import java.util.List; import net.minecraft.src.BiomeGenBase; import cpw.mods.fml.common.registry.IMinecraftRegistry; import cpw.mods.fml.server.FMLBukkitHandler; public class BukkitRegistry implements IMinecraftRegistry { @Override public void addRecipe(net.minecraft.src.ItemStack output, Object... params) { CraftingManager.getInstance().registerShapedRecipe((ItemStack) output, params); } @Override public void addShapelessRecipe(net.minecraft.src.ItemStack output, Object... params) { CraftingManager.getInstance().registerShapelessRecipe((ItemStack) output, params); } @SuppressWarnings("unchecked") @Override public void addRecipe(net.minecraft.src.IRecipe recipe) { CraftingManager.getInstance().getRecipies().add(recipe); } @Override public void addSmelting(int input, net.minecraft.src.ItemStack output) { FurnaceRecipes.getInstance().registerRecipe(input, (ItemStack) output); } @Override public void registerBlock(net.minecraft.src.Block block) { registerBlock(block, ItemBlock.class); } @Override public void registerBlock(net.minecraft.src.Block block, Class <? extends net.minecraft.src.ItemBlock > itemclass) { try { assert block != null : "registerBlock: block cannot be null"; assert itemclass != null : "registerBlock: itemclass cannot be null"; int blockItemId = ((Block)block).id - 256; itemclass.getConstructor(int.class).newInstance(blockItemId); } catch (Exception e) { //HMMM } } @SuppressWarnings("unchecked") @Override public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id) { EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id); } @SuppressWarnings("unchecked") @Override public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) { EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id, backgroundEggColour, foregroundEggColour); } @SuppressWarnings("unchecked") @Override public void registerTileEntity(Class <? extends net.minecraft.src.TileEntity > tileEntityClass, String id) { TileEntity.addNewTileEntityMapping((Class<? extends TileEntity>) tileEntityClass, id); } @Override public void addBiome(BiomeGenBase biome) { FMLBukkitHandler.instance().addBiomeToDefaultWorldGenerator((BiomeBase) biome); } @Override public void addSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomes) { BiomeBase[] realBiomes=(BiomeBase[]) biomes; for (BiomeBase biome : realBiomes) { @SuppressWarnings("unchecked") List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType)typeOfCreature); for (BiomeMeta entry : spawns) { //Adjusting an existing spawn entry if (entry.a == entityClass) { entry.d = weightedProb; entry.b = min; entry.c = max; break; } } spawns.add(new BiomeMeta(entityClass, weightedProb, min, max)); } } @Override @SuppressWarnings("unchecked") public void addSpawn(String entityName, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes) { Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { addSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes); } } @Override public void removeBiome(BiomeGenBase biome) { FMLBukkitHandler.instance().removeBiomeFromDefaultWorldGenerator((BiomeBase)biome); } @Override public void removeSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomesO) { BiomeBase[] biomes=(BiomeBase[]) biomesO; for (BiomeBase biome : biomes) { @SuppressWarnings("unchecked") List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType) typeOfCreature); Iterator<BiomeMeta> entries = spawns.iterator(); while (entries.hasNext()) { BiomeMeta entry = entries.next(); if (entry.a == entityClass) { entries.remove(); } } } } @Override @SuppressWarnings("unchecked") public void removeSpawn(String entityName, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes) { Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { removeSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, spawnList, biomes); } } }
aerospark/FML
bukkit/net/minecraft/server/BukkitRegistry.java
Java
lgpl-2.1
5,591
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.xpn.xwiki.web; /** * Enumeration of supported object policy types. A object policy type is an * implementation on how to manage parameters in the query string that wants to * modify objects in page. They are usually on the form of * 'Space.PageClass_0_prop. In the default implementation of XWiki, these * parameters will initialize values of properties of existing object (see * 'UPDATE'). * * The second implementation, called 'UDPATE_OR_CREATE' will also create objects * if they don't exist. For example, let's take a page that contains one object * Space.PageClass. Given the following parameters: * <ul> * <li>Space.PageClass_0_prop=abc</li> * <li>Space.PageClass_1_prop=def</li> * <li>Space.PageClass_2_prop=ghi</li> * <li>Space.PageClass_6_prop=jkl</li> * </ul> * * The object number 0 will have it's property initialized with 'abc'. The * objects number 1 and 2 will be created and respectively initialized with * 'def' and 'ghi'. The final parameter will be ignored since the number doesn't * refer to a following number. * * @version $Id$ * @since 7.0RC1 */ public enum ObjectPolicyType { /** Only update objects. */ UPDATE("update"), /** Update and/or create objects. */ UPDATE_OR_CREATE("updateOrCreate"); /** Name that is used in HTTP parameters to specify the object policy. */ private final String name; /** * @param name The string name corresponding to the object policy type. */ ObjectPolicyType(String name) { this.name = name; } /** * @return The string name corresponding to the object policy type. */ public String getName() { return this.name; } /** * @param name The string name corresponding to the object policy type. * @return The ObjectPolicyType corresponding to the parameter 'name'. */ public static ObjectPolicyType forName(String name) { for (ObjectPolicyType type : values()) { if (type.getName().equals(name)) { return type; } } return null; } }
pbondoer/xwiki-platform
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/ObjectPolicyType.java
Java
lgpl-2.1
2,998
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.asic.cades.signature.asics; import eu.europa.esig.dss.asic.cades.ASiCWithCAdESContainerExtractor; import eu.europa.esig.dss.asic.cades.ASiCWithCAdESSignatureParameters; import eu.europa.esig.dss.asic.cades.ASiCWithCAdESTimestampParameters; import eu.europa.esig.dss.asic.cades.signature.ASiCWithCAdESService; import eu.europa.esig.dss.asic.common.ASiCContent; import eu.europa.esig.dss.diagnostic.DiagnosticData; import eu.europa.esig.dss.diagnostic.SignatureWrapper; import eu.europa.esig.dss.diagnostic.jaxb.XmlDigestMatcher; import eu.europa.esig.dss.enumerations.ASiCContainerType; import eu.europa.esig.dss.enumerations.SignatureLevel; import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.model.InMemoryDocument; import eu.europa.esig.dss.signature.DocumentSignatureService; import eu.europa.esig.dss.utils.Utils; import eu.europa.esig.dss.validation.SignedDocumentValidator; import eu.europa.esig.dss.validation.reports.Reports; import org.junit.jupiter.api.BeforeEach; import java.util.Arrays; import java.util.Date; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; public class ASiCSCAdESLevelLTTest extends AbstractASiCSCAdESTestSignature { private DocumentSignatureService<ASiCWithCAdESSignatureParameters, ASiCWithCAdESTimestampParameters> service; private ASiCWithCAdESSignatureParameters signatureParameters; private DSSDocument documentToSign; @BeforeEach public void init() throws Exception { documentToSign = new InMemoryDocument("Hello World !".getBytes(), "test.text"); signatureParameters = new ASiCWithCAdESSignatureParameters(); signatureParameters.bLevel().setSigningDate(new Date()); signatureParameters.setSigningCertificate(getSigningCert()); signatureParameters.setCertificateChain(getCertificateChain()); signatureParameters.setSignatureLevel(SignatureLevel.CAdES_BASELINE_LT); signatureParameters.aSiC().setContainerType(ASiCContainerType.ASiC_S); service = new ASiCWithCAdESService(getCompleteCertificateVerifier()); service.setTspSource(getGoodTsa()); } @Override protected void onDocumentSigned(byte[] byteArray) { super.onDocumentSigned(byteArray); ASiCWithCAdESContainerExtractor containerExtractor = new ASiCWithCAdESContainerExtractor(new InMemoryDocument(byteArray)); ASiCContent result = containerExtractor.extract(); List<DSSDocument> signatureDocuments = result.getSignatureDocuments(); assertTrue(Utils.isCollectionNotEmpty(signatureDocuments)); for (DSSDocument signatureDocument : signatureDocuments) { // validate with no detached content DiagnosticData diagnosticData = validateDocument(signatureDocument); SignatureWrapper signature = diagnosticData.getSignatureById(diagnosticData.getFirstSignatureId()); List<XmlDigestMatcher> digestMatchers = signature.getDigestMatchers(); assertEquals(1, digestMatchers.size()); assertFalse(digestMatchers.get(0).isDataFound()); assertFalse(digestMatchers.get(0).isDataIntact()); // with detached content diagnosticData = validateDocument(signatureDocument, Arrays.asList(getSignedData(result))); signature = diagnosticData.getSignatureById(diagnosticData.getFirstSignatureId()); digestMatchers = signature.getDigestMatchers(); assertEquals(1, digestMatchers.size()); assertTrue(digestMatchers.get(0).isDataFound()); assertTrue(digestMatchers.get(0).isDataIntact()); } } private DiagnosticData validateDocument(DSSDocument signatureDocument) { return validateDocument(signatureDocument, null); } private DiagnosticData validateDocument(DSSDocument signatureDocument, List<DSSDocument> detachedContents) { SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(signatureDocument); validator.setCertificateVerifier(getOfflineCertificateVerifier()); if (Utils.isCollectionNotEmpty(detachedContents)) { validator.setDetachedContents(detachedContents); } Reports reports = validator.validateDocument(); return reports.getDiagnosticData(); } @Override protected DocumentSignatureService<ASiCWithCAdESSignatureParameters, ASiCWithCAdESTimestampParameters> getService() { return service; } @Override protected ASiCWithCAdESSignatureParameters getSignatureParameters() { return signatureParameters; } @Override protected DSSDocument getDocumentToSign() { return documentToSign; } @Override protected String getSigningAlias() { return GOOD_USER; } }
esig/dss
dss-asic-cades/src/test/java/eu/europa/esig/dss/asic/cades/signature/asics/ASiCSCAdESLevelLTTest.java
Java
lgpl-2.1
5,526
/** * Copyright 2006-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.solmix.generator.plugin; import static org.solmix.commons.util.StringUtils.stringHasValue; import static org.solmix.generator.util.Messages.getString; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.solmix.generator.api.IntrospectedTable; import org.solmix.generator.api.PluginAdapter; /** * This plugin demonstrates overriding the initialized() method to rename the * generated example classes. Instead of xxxExample, the classes will be named * xxxCriteria. * * <p>This plugin accepts two properties: * * <ul> * <li><tt>searchString</tt> (required) the regular expression of the name * search.</li> * <li><tt>replaceString</tt> (required) the replacement String.</li> * </ul> * * <p>For example, to change the name of the generated Example classes from * xxxExample to xxxCriteria, specify the following: * * <dl> * <dt>searchString</dt> * <dd>Example$</dd> * <dt>replaceString</dt> * <dd>Criteria</dd> * </dl> * * * @author Jeff Butler * */ public class RenameExampleClassPlugin extends PluginAdapter { private String searchString; private String replaceString; private Pattern pattern; public RenameExampleClassPlugin() { } @Override public boolean validate(List<String> warnings) { searchString = properties.getProperty("searchString"); replaceString = properties.getProperty("replaceString"); boolean valid = stringHasValue(searchString) && stringHasValue(replaceString); if (valid) { pattern = Pattern.compile(searchString); } else { if (!stringHasValue(searchString)) { warnings.add(getString("ValidationError.18", "RenameExampleClassPlugin", "searchString")); } if (!stringHasValue(replaceString)) { warnings.add(getString("ValidationError.18", "RenameExampleClassPlugin", "replaceString")); } } return valid; } @Override public void initialized(IntrospectedTable introspectedTable) { String oldType = introspectedTable.getExampleType(); Matcher matcher = pattern.matcher(oldType); oldType = matcher.replaceAll(replaceString); introspectedTable.setExampleType(oldType); } }
solmix/datax
generator/core/src/main/java/org/solmix/generator/plugin/RenameExampleClassPlugin.java
Java
lgpl-2.1
3,084
/****************************************************************************** * Copyright (C) 2010-2016 CERN. All rights not expressly granted are reserved. * * This file is part of the CERN Control and Monitoring Platform 'C2MON'. * C2MON is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the license. * * C2MON is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for * more details. * * You should have received a copy of the GNU Lesser General Public License * along with C2MON. If not, see <http://www.gnu.org/licenses/>. *****************************************************************************/ package cern.c2mon.client.ext.history.common; import java.sql.Timestamp; import cern.c2mon.client.ext.history.common.id.HistoryUpdateId; /** * This interface is used to keep track of the data which is from the history. * It have a function to get the execution time of the update so the player will know * when to execute the update. And it also have an identifier. * * @author vdeila * */ public interface HistoryUpdate { /** * * @return the id of the update */ HistoryUpdateId getUpdateId(); /** * * @return the time of when this update should execute */ Timestamp getExecutionTimestamp(); }
c2mon/c2mon-client-ext-history
src/main/java/cern/c2mon/client/ext/history/common/HistoryUpdate.java
Java
lgpl-3.0
1,559
/* * SonarQube Java * Copyright (C) 2012-2017 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.maven.model; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.stream.XMLStreamReader; /** * Adapter in charge of converting attributes from XML object, being String, to located attribute, * storing information related to the location of the attribute. */ public class LocatedAttributeAdapter extends XmlAdapter<String, LocatedAttribute> { private final XMLStreamReader reader; public LocatedAttributeAdapter(XMLStreamReader reader) { this.reader = reader; } @Override public LocatedAttribute unmarshal(String value) throws Exception { LocatedAttribute result = new LocatedAttribute(value); result.setEndLocation(XmlLocation.getLocation(reader.getLocation())); result.setStartLocation(XmlLocation.getStartLocation(value, reader.getLocation())); return result; } @Override public String marshal(LocatedAttribute attribute) throws Exception { return attribute.getValue(); } }
mbring/sonar-java
java-maven-model/src/main/java/org/sonar/maven/model/LocatedAttributeAdapter.java
Java
lgpl-3.0
1,812
package com.silicolife.textmining.core.datastructures.dataaccess.database.dataaccess.implementation.model.core.entities; // Generated 23/Mar/2015 16:36:00 by Hibernate Tools 4.3.1 import javax.persistence.Column; import javax.persistence.Embeddable; /** * ClusterProcessHasLabelsId generated by hbm2java */ @Embeddable public class ClusterProcessHasLabelsId implements java.io.Serializable { private long cphClusterProcessId; private long cphClusterLabelId; public ClusterProcessHasLabelsId() { } public ClusterProcessHasLabelsId(long cphClusterProcessId, long cphClusterLabelId) { this.cphClusterProcessId = cphClusterProcessId; this.cphClusterLabelId = cphClusterLabelId; } @Column(name = "cph_cluster_process_id", nullable = false) public long getCphClusterProcessId() { return this.cphClusterProcessId; } public void setCphClusterProcessId(long cphClusterProcessId) { this.cphClusterProcessId = cphClusterProcessId; } @Column(name = "cph_cluster_label_id", nullable = false) public long getCphClusterLabelId() { return this.cphClusterLabelId; } public void setCphClusterLabelId(long cphClusterLabelId) { this.cphClusterLabelId = cphClusterLabelId; } public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof ClusterProcessHasLabelsId)) return false; ClusterProcessHasLabelsId castOther = (ClusterProcessHasLabelsId) other; return (this.getCphClusterProcessId() == castOther.getCphClusterProcessId()) && (this.getCphClusterLabelId() == castOther.getCphClusterLabelId()); } public int hashCode() { int result = 17; result = 37 * result + (int) this.getCphClusterProcessId(); result = 37 * result + (int) this.getCphClusterLabelId(); return result; } }
biotextmining/core
src/main/java/com/silicolife/textmining/core/datastructures/dataaccess/database/dataaccess/implementation/model/core/entities/ClusterProcessHasLabelsId.java
Java
lgpl-3.0
1,802
/** * Copyright (C) 2010-2012 Regis Montoya (aka r3gis - www.r3gis.fr) * This file is part of CSipSimple. * * CSipSimple is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * If you own a pjsip commercial license you can also redistribute it * and/or modify it under the terms of the GNU Lesser General Public License * as an android library. * * CSipSimple 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 CSipSimple. If not, see <http://www.gnu.org/licenses/>. */ package com.csipsimple.ui.outgoingcall; import android.app.PendingIntent; import android.app.PendingIntent.CanceledException; import android.database.Cursor; import android.os.Bundle; import android.os.RemoteException; import android.support.v4.content.Loader; import android.view.View; import android.widget.ListView; import com.csipsimple.api.ISipService; import com.csipsimple.api.SipProfile; import com.csipsimple.ui.account.AccountsLoader; import com.csipsimple.utils.CallHandlerPlugin; import com.csipsimple.utils.Log; import com.csipsimple.widgets.CSSListFragment; public class OutgoingCallListFragment extends CSSListFragment { private static final String THIS_FILE = "OutgoingCallListFragment"; private OutgoingAccountsAdapter mAdapter; private AccountsLoader accLoader; private long startDate; private boolean callMade = false; @Override public void onCreate(Bundle state) { super.onCreate(state); setHasOptionsMenu(true); } @Override public void onResume() { super.onResume(); callMade = false; attachAdapter(); getLoaderManager().initLoader(0, null, this); startDate = System.currentTimeMillis(); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); } private void attachAdapter() { if(getListAdapter() == null) { if(mAdapter == null) { mAdapter = new OutgoingAccountsAdapter(this, null); } setListAdapter(mAdapter); } } @Override public Loader<Cursor> onCreateLoader(int loader, Bundle args) { OutgoingCallChooser superActivity = ((OutgoingCallChooser) getActivity()); accLoader = new AccountsLoader(getActivity(), superActivity.getPhoneNumber(), superActivity.shouldIgnoreRewritingRules()); return accLoader; } final long MOBILE_CALL_DELAY_MS = 600; /** * Place the call for a given cursor positionned at right index in list * @param c The cursor pointing the entry we'd like to call * @return true if call performed, false else */ private boolean placeCall(Cursor c) { OutgoingCallChooser superActivity = ((OutgoingCallChooser)getActivity()); ISipService service = superActivity.getConnectedService(); long accountId = c.getLong(c.getColumnIndex(SipProfile.FIELD_ID)); if(accountId > SipProfile.INVALID_ID) { // Extra check for the account id. if(service == null) { return false; } boolean canCall = c.getInt(c.getColumnIndex(AccountsLoader.FIELD_STATUS_OUTGOING)) == 1; if(!canCall) { return false; } try { String toCall = c.getString(c.getColumnIndex(AccountsLoader.FIELD_NBR_TO_CALL)); service.makeCall(toCall, (int) accountId); superActivity.finishServiceIfNeeded(true); return true; } catch (RemoteException e) { Log.e(THIS_FILE, "Unable to make the call", e); } }else if(accountId < SipProfile.INVALID_ID) { // This is a plugin row. if(accLoader != null) { CallHandlerPlugin ch = accLoader.getCallHandlerWithAccountId(accountId); if(ch == null) { Log.w(THIS_FILE, "Call handler not anymore available in loader... something gone wrong"); return false; } String nextExclude = ch.getNextExcludeTelNumber(); long delay = 0; if (nextExclude != null && service != null) { try { service.ignoreNextOutgoingCallFor(nextExclude); } catch (RemoteException e) { Log.e(THIS_FILE, "Ignore next outgoing number failed"); } delay = MOBILE_CALL_DELAY_MS - (System.currentTimeMillis() - startDate); } if(ch.getIntent() != null) { PluginCallRunnable pendingTask = new PluginCallRunnable(ch.getIntent(), delay); Log.d(THIS_FILE, "Deferring call task of " + delay); pendingTask.start(); } return true; } } return false; } private class PluginCallRunnable extends Thread { private PendingIntent pendingIntent; private long delay; public PluginCallRunnable(PendingIntent pi, long d) { pendingIntent = pi; delay = d; } @Override public void run() { if(delay > 0) { try { sleep(delay); } catch (InterruptedException e) { Log.e(THIS_FILE, "Thread that fires outgoing call has been interrupted"); } } OutgoingCallChooser superActivity = ((OutgoingCallChooser)getActivity()); try { pendingIntent.send(); } catch (CanceledException e) { Log.e(THIS_FILE, "Pending intent cancelled", e); } superActivity.finishServiceIfNeeded(false); } } @Override public synchronized void changeCursor(Cursor c) { if(c != null && callMade == false) { OutgoingCallChooser superActivity = ((OutgoingCallChooser)getActivity()); Long accountToCall = superActivity.getAccountToCallTo(); // Move to first to search in this cursor c.moveToFirst(); // First of all, if only one is available... try call with it if(c.getCount() == 1) { if(placeCall(c)) { c.close(); callMade = true; return; } }else { // Now lets search for one in for call mode if service is ready do { if(c.getInt(c.getColumnIndex(AccountsLoader.FIELD_FORCE_CALL)) == 1) { if(placeCall(c)) { c.close(); callMade = true; return; } } if(accountToCall != SipProfile.INVALID_ID) { if(accountToCall == c.getLong(c.getColumnIndex(SipProfile.FIELD_ID))) { if(placeCall(c)) { c.close(); callMade = true; return; } } } } while(c.moveToNext()); } } // Set adapter content if nothing to force was found if(mAdapter != null) { mAdapter.changeCursor(c); } } @Override public synchronized void onListItemClick(ListView l, View v, int position, long id) { if(mAdapter != null) { placeCall((Cursor) mAdapter.getItem(position)); } } public AccountsLoader getAccountLoader() { return accLoader; } }
fingi/csipsimple
src/com/csipsimple/ui/outgoingcall/OutgoingCallListFragment.java
Java
lgpl-3.0
8,351
package fun.guruqu.portal.structures; public class BlockStructure { /** * @param args */ public static void main(String[] args) { } }
guruqu/BeaconTeleport
src/fun/guruqu/portal/structures/BlockStructure.java
Java
lgpl-3.0
149
package com.sirma.itt.seip.rest.handlers.readers; import static com.sirma.itt.seip.rest.utils.request.params.RequestParams.PATH_ID; import java.io.IOException; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import javax.inject.Inject; import javax.ws.rs.BeanParam; import javax.ws.rs.Consumes; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.Provider; import com.sirma.itt.seip.domain.instance.Instance; import com.sirma.itt.seip.rest.exceptions.BadRequestException; import com.sirma.itt.seip.rest.resources.instances.InstanceResourceParser; import com.sirma.itt.seip.rest.utils.JSON; import com.sirma.itt.seip.rest.utils.Versions; import com.sirma.itt.seip.rest.utils.request.RequestInfo; /** * Converts a JSON object to {@link Instance}. * * @author yasko */ @Provider @Consumes(Versions.V2_JSON) public class InstanceBodyReader implements MessageBodyReader<Instance> { @Inject private InstanceResourceParser instanceResourceParser; @BeanParam private RequestInfo request; @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return Instance.class.isAssignableFrom(type); } @Override public Instance readFrom(Class<Instance> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> headers, InputStream stream) throws IOException { String id = PATH_ID.get(request); Instance instance = JSON.readObject(stream, instanceResourceParser.toSingleInstance(id)); if (instance != null) { return instance; } throw new BadRequestException("There was a problem with the stream reading or instance resolving."); } }
SirmaITT/conservation-space-1.7.0
docker/sirma-platform/platform/seip-parent/platform/rest-api/src/main/java/com/sirma/itt/seip/rest/handlers/readers/InstanceBodyReader.java
Java
lgpl-3.0
1,803
/*** Copyright (c) 2012 - 2021 Hércules S. S. José Este arquivo é parte do programa Orçamento Doméstico. Orçamento Doméstico é um software livre; você pode redistribui-lo e/ou modificá-lo dentro dos termos da Licença Pública Geral Menor GNU como publicada pela Fundação do Software Livre (FSF); na versão 3.0 da Licença. Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral Menor GNU em português para maiores detalhes. Você deve ter recebido uma cópia da Licença Pública Geral Menor GNU sob o nome de "LICENSE" junto com este programa, se não, acesse o site do projeto no endereco https://github.com/herculeshssj/orcamento ou escreva para a Fundação do Software Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Para mais informações sobre o programa Orçamento Doméstico e seu autor entre em contato pelo e-mail herculeshssj@outlook.com, ou ainda escreva para Hércules S. S. José, Rua José dos Anjos, 160 - Bl. 3 Apto. 304 - Jardim Alvorada - CEP: 26261-130 - Nova Iguaçu, RJ, Brasil. ***/ package br.com.hslife.orcamento.entity; import static org.junit.Assert.assertEquals; import java.util.Date; import org.junit.Before; import org.junit.Test; import br.com.hslife.orcamento.enumeration.TipoCategoria; import br.com.hslife.orcamento.exception.ValidationException; public class DividaTerceiroTest { private DividaTerceiro entity; @Before public void setUp() throws Exception { Usuario usuario = new Usuario(); usuario.setNome("Usuário de teste"); Favorecido favorecido = new Favorecido(); favorecido.setNome("Favorecido de teste"); Moeda moeda = new Moeda(); moeda.setNome("Real"); moeda.setSimboloMonetario("R$"); entity = new DividaTerceiro(); entity.setDataNegociacao(new Date()); entity.setFavorecido(favorecido); entity.setJustificativa("Justificativa da dívida de teste"); entity.setTermoDivida("Termo da dívida de teste"); entity.setTermoQuitacao("Termo de quitação da dívida de teste"); entity.setTipoCategoria(TipoCategoria.CREDITO); entity.setUsuario(usuario); entity.setValorDivida(1000); entity.setMoeda(moeda); PagamentoDividaTerceiro pagamento; for (int i = 0; i < 3; ++i) { pagamento = new PagamentoDividaTerceiro(); pagamento.setComprovantePagamento("Comprovante de pagamento da dívida de teste " + i); pagamento.setDataPagamento(new Date()); pagamento.setDividaTerceiro(entity); pagamento.setValorPago(100); entity.getPagamentos().add(pagamento); } } @Test(expected=ValidationException.class) public void testValidateDataNegociacao() { entity.setDataNegociacao(null); entity.validate(); } @Test(expected=ValidationException.class) public void testValidateJustificativa() { entity.setJustificativa(null); entity.validate(); } @Test(expected=ValidationException.class) public void testValidateTamanhoJustificativa() { StringBuilder s = new StringBuilder(10000); for (int i = 0; i < 10000; ++i) s.append("a"); entity.setJustificativa(s.toString()); entity.validate(); } @Test(expected=ValidationException.class) public void testValidateCategoria() { entity.setTipoCategoria(null); entity.validate(); } @Test(expected=ValidationException.class) public void testValidateFavorecido() { entity.setFavorecido(null); entity.validate(); } @Test(expected=ValidationException.class) public void testValidateMoeda() { entity.setMoeda(null); entity.validate(); } @Test public void testLabel() { assertEquals("Crédito com Favorecido de teste no valor de R$ 1000.0 - Registrado", entity.getLabel()); } @Test public void testTotalPago() { assertEquals(300.0, entity.getTotalPago(), 0); } @Test public void testTotalAPagar() { assertEquals(700.0, entity.getTotalAPagar(), 0); } @Test(expected=ValidationException.class) public void testValidateDataPagamento() { for (PagamentoDividaTerceiro pagamento : entity.getPagamentos()) { pagamento.setDataPagamento(null); pagamento.validate(); } } }
herculeshssj/orcamento
orcamento/src/test/java/br/com/hslife/orcamento/entity/DividaTerceiroTest.java
Java
lgpl-3.0
4,219
/** * GetAllUsersResponse.java * Created by pgirard at 2:07:29 PM on Aug 19, 2010 * in the com.qagwaai.starmalaccamax.shared.services.action package * for the JobMalaccamax project */ package com.qagwaai.starmalaccamax.client.service.action; import java.util.ArrayList; import com.google.gwt.user.client.rpc.IsSerializable; import com.qagwaai.starmalaccamax.shared.model.JobDTO; /** * @author pgirard * */ public final class GetAllJobsResponse extends AbstractResponse implements IsSerializable { /** * */ private ArrayList<JobDTO> jobs; /** * */ private int totalJobs; /** * @return the users */ public ArrayList<JobDTO> getJobs() { return jobs; } /** * @return the totalJobs */ public int getTotalJobs() { return totalJobs; } /** * @param jobs * the users to set */ public void setJobs(final ArrayList<JobDTO> jobs) { this.jobs = jobs; } /** * @param totalJobs * the totalJobs to set */ public void setTotalJobs(final int totalJobs) { this.totalJobs = totalJobs; } /** * {@inheritDoc} */ @Override public String toString() { return "GetAllJobsResponse [jobs=" + jobs + ", totalJobs=" + totalJobs + "]"; } }
qagwaai/StarMalaccamax
src/com/qagwaai/starmalaccamax/client/service/action/GetAllJobsResponse.java
Java
lgpl-3.0
1,407
/* * Copyright (C) 2006-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.jlan.client; import org.alfresco.jlan.smb.PCShare; import org.alfresco.jlan.smb.SMBDeviceType; import org.alfresco.jlan.smb.SMBException; /** * SMB print session class * * <p>The print session allows a new print job to be created, using the SMBFile * class or as an SMBOutputStream. * * <p>When the SMBFile/SMBOutputStream is closed the print job will be queued to * the remote printer. * * <p>A print session is created using the SessionFactory.OpenPrinter() method. The * SessionFactory negotiates the appropriate SMB dialect and creates the appropriate * PrintSession derived object. * * @see SessionFactory * * @author gkspencer */ public abstract class PrintSession extends Session { // Print modes public static final int TextMode = 0; public static final int GraphicsMode = 1; // Default number of print queue entries to return public static final int DefaultEntryCount = 20; /** * Construct an SMB print session * * @param shr Remote server details * @param dialect SMB dialect that this session is using */ protected PrintSession(PCShare shr, int dialect) { super(shr, dialect, null); // Set the device type this.setDeviceType(SMBDeviceType.Printer); } /** * Determine if the print session has been closed. * * @return true if the print session has been closed, else false. */ protected final boolean isClosed() { return m_treeid == Closed ? true : false; } /** * Open a spool file on the remote print server. * * @param id Identifier string for this print request. * @param mode Print mode, either TextMode or GraphicsMode. * @param setuplen Length of data in the start of the spool file that is printer setup code. * @return SMBFile for the new spool file, else null. * @exception java.io.IOException If an I/O error occurs. * @exception SMBException If an SMB level error occurs */ public abstract SMBFile OpenSpoolFile(String id, int mode, int setuplen) throws java.io.IOException, SMBException; /** * Open a spool file as an output stream. * * @param id Identifier string for this print request. * @param mode Print mode, either TextMode or GraphicsMode. * @param setuplen Length of data in the start of the spool file that is printer setup code. * @return SMBOutputStream for the spool file, else null. * @exception java.io.IOException If an I/O error occurs. * @exception SMBException If an SMB level error occurs */ public SMBOutputStream OpenSpoolStream(String id, int mode, int setuplen) throws java.io.IOException, SMBException { // Open an SMBFile first SMBFile sfile = OpenSpoolFile(id, mode, setuplen); if ( sfile == null) return null; // Create an output stream attached to the SMBFile return new SMBOutputStream(sfile); } }
loftuxab/community-edition-old
projects/alfresco-jlan/source/java/org/alfresco/jlan/client/PrintSession.java
Java
lgpl-3.0
3,570
// // Ce fichier a été généré par l'implémentation de référence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b130911.1802 // Voir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Toute modification apportée à ce fichier sera perdue lors de la recompilation du schéma source. // Généré le : 2015.10.08 à 11:14:04 PM CEST // package org.klipdev.spidergps3p.kml; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java pour vec2Type complex type. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * * <pre> * &lt;complexType name="vec2Type"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="x" type="{http://www.w3.org/2001/XMLSchema}double" default="1.0" /> * &lt;attribute name="y" type="{http://www.w3.org/2001/XMLSchema}double" default="1.0" /> * &lt;attribute name="xunits" type="{http://www.opengis.net/kml/2.2}unitsEnumType" default="fraction" /> * &lt;attribute name="yunits" type="{http://www.opengis.net/kml/2.2}unitsEnumType" default="fraction" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "vec2Type") public class Vec2Type { @XmlAttribute(name = "x") protected Double x; @XmlAttribute(name = "y") protected Double y; @XmlAttribute(name = "xunits") protected UnitsEnumType xunits; @XmlAttribute(name = "yunits") protected UnitsEnumType yunits; /** * Obtient la valeur de la propriété x. * * @return * possible object is * {@link Double } * */ public double getX() { if (x == null) { return 1.0D; } else { return x; } } /** * Définit la valeur de la propriété x. * * @param value * allowed object is * {@link Double } * */ public void setX(Double value) { this.x = value; } /** * Obtient la valeur de la propriété y. * * @return * possible object is * {@link Double } * */ public double getY() { if (y == null) { return 1.0D; } else { return y; } } /** * Définit la valeur de la propriété y. * * @param value * allowed object is * {@link Double } * */ public void setY(Double value) { this.y = value; } /** * Obtient la valeur de la propriété xunits. * * @return * possible object is * {@link UnitsEnumType } * */ public UnitsEnumType getXunits() { if (xunits == null) { return UnitsEnumType.FRACTION; } else { return xunits; } } /** * Définit la valeur de la propriété xunits. * * @param value * allowed object is * {@link UnitsEnumType } * */ public void setXunits(UnitsEnumType value) { this.xunits = value; } /** * Obtient la valeur de la propriété yunits. * * @return * possible object is * {@link UnitsEnumType } * */ public UnitsEnumType getYunits() { if (yunits == null) { return UnitsEnumType.FRACTION; } else { return yunits; } } /** * Définit la valeur de la propriété yunits. * * @param value * allowed object is * {@link UnitsEnumType } * */ public void setYunits(UnitsEnumType value) { this.yunits = value; } }
klipdev/SpiderGps
workspace/SpiderGps/src3p/org/klipdev/spidergps3p/kml/Vec2Type.java
Java
lgpl-3.0
3,972
package com.pahlsoft.ws.iaas.provision.deploy.behaviors; import org.apache.log4j.Logger; import com.pahlsoft.ws.iaas.provision.generated.InstructionType; import com.pahlsoft.ws.iaas.provision.generated.ProvisionProperties; import com.pahlsoft.ws.iaas.provision.generated.ProvisionResponse; import com.pahlsoft.ws.iaas.utilities.PropertyParser; public class JbossDeployBehavior implements DeployBehavior { public Logger LOG = Logger.getLogger(JbossDeployBehavior.class); public ProvisionResponse pr = new ProvisionResponse(); public ProvisionResponse deploy(String hostname, ProvisionProperties props) { LOG.info("Deploying JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.DEPLOY); pr.setStatus(true); return pr; } public ProvisionResponse redeploy(String hostname, ProvisionProperties props) { LOG.info("Redeploying JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.REDEPLOY); pr.setStatus(true); return pr; } public ProvisionResponse clean(String hostname, ProvisionProperties props) { LOG.info("Cleaning JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.CLEAN); pr.setStatus(true); return pr; } public ProvisionResponse backup(String hostname, ProvisionProperties props) { LOG.info("Backing Up JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.BACKUP); pr.setStatus(true); return pr; } public ProvisionResponse configure(String hostname, ProvisionProperties props) { LOG.info("Configuring JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.CONFIGURE); pr.setStatus(true); return pr; } public ProvisionResponse install(String hostname, ProvisionProperties props) { LOG.info("Installing JBOSS :" + hostname); PropertyParser.listProps(props); pr.setHostname(hostname); pr.setProperties(props); pr.setInstruction(InstructionType.INSTALL); pr.setStatus(true); return pr; } }
ajpahl1008/iaas
iaas-provision-service/src/main/java/com/pahlsoft/ws/iaas/provision/behaviors/deploy/JbossDeployBehavior.java
Java
lgpl-3.0
2,342
package org.eso.ias.cdb; import org.eso.ias.cdb.json.CdbFiles; import org.eso.ias.cdb.json.CdbJsonFiles; import org.eso.ias.cdb.json.JsonReader; import org.eso.ias.cdb.rdb.RdbReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.reflect.Constructor; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Optional; /** * The factory to get the CdbReader implementation to use. * * This class checks the parameters of the command line, the java properties * and the environment variable to build and return the {@link CdbReader} to use * for reading the CDB. * * It offers a common strategy to be used consistently by all the IAS tools. * * The strategy is as follow: * - if -cdbClass java.class param is present in the command line then the passed class * is dynamically loaded and built (empty constructor); the configuration * parameters eventually expected by such class will be passed by means of java * properties (-D...) * - else if jCdb file.path param is present in the command line then the JSON CDB * implementation will be returned passing the passed file path * - else the RDB implementation is returned (note that the parameters to connect to the RDB are passed * in the hibernate configuration file * * RDB implementation is the fallback if none of the other possibilities succeeds. * */ public class CdbReaderFactory { /** * The logger */ private static final Logger logger = LoggerFactory.getLogger(CdbReaderFactory.class); /** * The parameter to set in the command line to build a CdbReader from a custom java class */ public static final String cdbClassCmdLineParam="-cdbClass"; /** * The long parameter to set in the command line to build a JSON CdbReader */ public static final String jsonCdbCmdLineParamLong ="-jCdb"; /** * The short parameter to set in the command line to build a JSON CdbReader */ public static final String jsonCdbCmdLineParamShort ="-j"; /** * get the value of the passed parameter from the eray of strings. * * The value of the parameter is in the position next to the passed param name like in * -jcdb path * * @param paramName the not null nor empty parameter * @param cmdLine the command line * @return the value of the parameter or empty if not found in the command line */ private static Optional<String> getValueOfParam(String paramName, String cmdLine[]) { if (paramName==null || paramName.isEmpty()) { throw new IllegalArgumentException("Invalid null/empty name of parameter"); } if (cmdLine==null || cmdLine.length<2) { return Optional.empty(); } List<String> params = Arrays.asList(cmdLine); int pos=params.indexOf(paramName); if (pos==-1) { // Not found return Optional.empty(); } String ret = null; try { ret=params.get(pos+1); } catch (IndexOutOfBoundsException e) { logger.error("Missing parameter for {}}",paramName); } return Optional.ofNullable(ret); } /** * Build and return the user provided CdbReader from the passed class using introspection * * @param cls The class implementing the CdbReader * @return the user defined CdbReader */ private static final CdbReader loadUserDefinedReader(String cls) throws IasCdbException { if (cls==null || cls.isEmpty()) { throw new IllegalArgumentException("Invalid null/empty class"); } ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Class<?> theClass=null; try { theClass=classLoader.loadClass(cls); } catch (Exception e) { throw new IasCdbException("Error loading the external class "+cls,e); } Constructor constructor = null; try { constructor=theClass.getConstructor(null); } catch (Exception e) { throw new IasCdbException("Error getting the default (empty) constructor of the external class "+cls,e); } Object obj=null; try { obj=constructor.newInstance(null); } catch (Exception e) { throw new IasCdbException("Error building an object of the external class "+cls,e); } return (CdbReader)obj; } /** * Gets and return the CdbReader to use to read the CDB applying the policiy described in the javadoc * of the class * * @param cmdLine The command line * @return the CdbReader to read th CDB * @throws Exception in case of error building the CdbReader */ public static CdbReader getCdbReader(String[] cmdLine) throws Exception { Objects.requireNonNull(cmdLine,"Invalid null command line"); Optional<String> userCdbReader = getValueOfParam(cdbClassCmdLineParam,cmdLine); if (userCdbReader.isPresent()) { logger.info("Using external (user provided) CdbReader from class {}",userCdbReader.get()); return loadUserDefinedReader(userCdbReader.get()); } else { logger.debug("No external CdbReader found"); } Optional<String> jsonCdbReaderS = getValueOfParam(jsonCdbCmdLineParamShort,cmdLine); Optional<String> jsonCdbReaderL = getValueOfParam(jsonCdbCmdLineParamLong,cmdLine); if (jsonCdbReaderS.isPresent() && jsonCdbReaderL.isPresent()) { throw new Exception("JSON CDB path defined twice: check "+jsonCdbCmdLineParamShort+"and "+jsonCdbCmdLineParamLong+" params in cmd line"); } if (jsonCdbReaderL.isPresent() || jsonCdbReaderS.isPresent()) { String cdbPath = jsonCdbReaderL.orElseGet(() -> jsonCdbReaderS.get()); logger.info("Loading JSON CdbReader with folder {}",cdbPath); CdbFiles cdbfiles = new CdbJsonFiles(cdbPath); return new JsonReader(cdbfiles); } else { logger.debug("NO JSON CdbReader requested"); } return new RdbReader(); } }
IntegratedAlarmSystem-Group/ias
Cdb/src/main/java/org/eso/ias/cdb/CdbReaderFactory.java
Java
lgpl-3.0
6,266
/** *A PUBLIC CLASS FOR ACTIONS.JAVA */ class Actions{ public Fonts font = new Fonts(); /** *@see FONTS.JAVA *this is a font class which is for changing the font, style & size */ public void fonT(){ font.setVisible(true); //setting the visible is true font.pack(); //pack the panel //making an action for ok button, so we can change the font font.getOkjb().addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae){ n.getTextArea().setFont(font.font()); //after we chose the font, then the JDialog will be closed font.setVisible(false); } }); //making an action for cancel button, so we can return to the old font. font.getCajb().addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae){ //after we cancel the, then the JDialog will be closed font.setVisible(false); } }); } //for wraping the line & wraping the style word public void lineWraP(){ if(n.getLineWrap().isSelected()){ /** *make the line wrap & wrap style word is true *when the line wrap is selected */ n.getTextArea().setLineWrap(true); n.getTextArea().setWrapStyleWord(true); } else{ /** *make the line wrap & wrap style word is false *when the line wrap isn't selected */ n.getTextArea().setLineWrap(false); n.getTextArea().setWrapStyleWord(false); } } }
SergiyKolesnikov/fuji
examples/Notepad_casestudies/NotepadBenDelaware/features/Font/Actions.java
Java
lgpl-3.0
1,444
import java.util.*; import Jakarta.util.FixDosOutputStream; import java.io.*; public class ImpQual { /* returns name of AST_QualifiedName */ public String GetName() { String result = ( ( AST_QualifiedName ) arg[0] ).GetName(); if ( arg[1].arg[0] != null ) result = result + ".*"; return result; } }
SergiyKolesnikov/fuji
examples/AHEAD/preprocess/ImpQual.java
Java
lgpl-3.0
369
package com.ihidea.component.datastore.archive; import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.FileItem; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.RequestMapping; import com.ihidea.component.datastore.FileSupportService; import com.ihidea.component.datastore.fileio.FileIoEntity; import com.ihidea.core.CoreConstants; import com.ihidea.core.support.exception.ServiceException; import com.ihidea.core.support.servlet.ServletHolderFilter; import com.ihidea.core.util.ImageUtilsEx; import com.ihidea.core.util.ServletUtilsEx; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageEncoder; /** * 收件扫描 * @author TYOTANN */ @Controller public class ArchiveController { protected Log logger = LogFactory.getLog(getClass()); @Autowired private FileSupportService fileSupportService; @Autowired private ArchiveService archiveService; @RequestMapping("/twain.do") public String doTwain(ModelMap model, HttpServletRequest request) { String twainHttp = CoreConstants.twainHost; model.addAttribute("path", request.getParameter("path")); model.addAttribute("params", request.getParameter("cs")); model.addAttribute("picname", request.getParameter("picname")); model.addAttribute("frame", request.getParameter("frame")); model.addAttribute("HostIP", twainHttp.split(":")[0]); model.addAttribute("HTTPPort", twainHttp.split(":")[1]); model.addAttribute("storeName", "ds_archive"); model.addAttribute("storeType", "2"); return "archive/twain"; } @RequestMapping("/editPicture.do") public String doEditPicture(ModelMap model, HttpServletRequest request) { model.addAttribute("ywid", request.getParameter("ywid")); model.addAttribute("img", request.getParameter("img")); model.addAttribute("name", request.getParameter("name")); return "aie/imageeditor"; } @RequestMapping("/showPicture.do") public void showPicture(HttpServletRequest request, HttpServletResponse response, ModelMap model) { OutputStream os = null; String id = request.getParameter("id"); FileIoEntity file = fileSupportService.get(id); byte[] b = file.getContent(); response.setContentType("image/png"); try { os = response.getOutputStream(); FileCopyUtils.copy(b, os); } catch (IOException e) { logger.debug("出错啦!", e); } finally { if (os != null) { try { os.close(); } catch (IOException e) { logger.debug("出错啦!", e); } } } } /** * 扫描收件获取图片信息 * @param request * @param response * @param model */ @RequestMapping("/doPictureData.do") public void doPictureData(HttpServletRequest request, HttpServletResponse response, ModelMap model) { String tid = request.getParameter("id"); String spcode = request.getParameter("spcode"); String sncode = request.getParameter("sncode"); String typeid = request.getParameter("typeid"); String dm = request.getParameter("dm"); String dwyq = request.getParameter("dwyq"); if (tid == null || tid.trim().equals("") || tid.trim().equals("null")) { tid = "-1"; } List<Map<String, Object>> pList = null; // 根据sncode或spcode查询所有收件 if (StringUtils.isBlank(spcode) && StringUtils.isBlank(sncode)) { pList = archiveService.getPicture(Integer.valueOf(tid)); } else { Map<String, Object> params = new HashMap<String, Object>(); params.put("spcode", spcode); params.put("sncode", sncode); params.put("typeid", typeid); params.put("dm", dm); pList = archiveService.getPicture("09100E", params); } // 查询单位印签只需要最后一张 List<Map<String, Object>> picList = new ArrayList<Map<String, Object>>(); if (!StringUtils.isBlank(dwyq)) { for (int i = 0; i < pList.size(); i++) { Map<String, Object> pic = pList.get(i); if (dwyq.equals(pic.get("ino").toString())) { picList.add(pic); break; } } } else { picList = pList; } Map<String, List<Map<String, Object>>> map = new HashMap<String, List<Map<String, Object>>>(); map.put("images", picList); ServletUtilsEx.renderJson(response, map); } @SuppressWarnings({ "unchecked" }) @RequestMapping("/uploadDataFile.do") public String uploadFjToFile(HttpServletRequest request, HttpServletResponse response, ModelMap model) { String ino = null; int id = request.getParameter("id") == null ? 0 : Integer.valueOf(request.getParameter("id")); String strFileName = request.getParameter("filename"); Map<String, Object> paramMap = ServletHolderFilter.getContext().getParamMap(); FileItem cfile = null; // 得到上传的文件 for (String key : paramMap.keySet()) { if (paramMap.get(key) instanceof List) { if (((List) paramMap.get(key)).get(0) instanceof FileItem) cfile = ((List<FileItem>) paramMap.get(key)).get(0); break; } } ino = fileSupportService.add(cfile.getName(), cfile.get(), "ds_archive"); fileSupportService.submit(ino, "收件扫描-扫描"); // 保存到收件明细表ARCSJMX archiveService.savePicture(id, ino, strFileName, ""); return null; } /** * 扫描收件时上传图片 * @param request * @param response * @param model * @return * @throws Exception */ @SuppressWarnings({ "unchecked" }) @RequestMapping("/uploadUnScanDataFile.do") public String uploadUnScanFjToFile(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception { Map<String, Object> paramMap = ServletHolderFilter.getContext().getParamMap(); int id = paramMap.get("id") == null ? 0 : Integer.valueOf(String.valueOf(paramMap.get("id"))); String strFileName = paramMap.get("filename") == null ? StringUtils.EMPTY : String.valueOf(paramMap.get("filename")); String storeName = "ds_archive"; FileOutputStream fos = null; String ino = null; try { List<FileItem> remoteFile = (List<FileItem>) paramMap.get("uploadFile"); FileItem cfile = remoteFile.get(0); String cfileOrjgName = cfile.getName(); String cfileName = cfileOrjgName.substring(0, cfileOrjgName.lastIndexOf(".")); ino = fileSupportService.add(cfile.getName(), cfile.get(), "ds_archive"); fileSupportService.submit(ino, "收件扫描-本地上传"); if (strFileName != null) { cfileName = strFileName; } // 保存到收件明细表ARCSJMX archiveService.savePicture(id, ino, cfileName, ""); } catch (Exception e) { throw new ServiceException(e.getMessage()); } finally { if (fos != null) { fos.flush(); fos.close(); } } model.addAttribute("isSubmit", "1"); model.addAttribute("params", id); model.addAttribute("path", ""); model.addAttribute("picname", strFileName); model.addAttribute("storeName", storeName); model.addAttribute("success", "上传成功!"); model.addAttribute("ino", ino); return "archive/twain"; } /** * 扫描收件时查看 * @param request * @param response * @param model * @return */ @RequestMapping("/doPicture.do") public String doPicture(HttpServletRequest request, HttpServletResponse response, ModelMap model) { String img = request.getParameter("img"); String ywid = request.getParameter("ywid"); model.addAttribute("img", img); model.addAttribute("ywid", ywid); model.addAttribute("storeName", "ds_archive"); return "aie/showPicture"; } /** * 下载图片 * @param request * @param response * @throws Exception */ @RequestMapping("/downloadFj.do") public void downloadFj(HttpServletRequest request, HttpServletResponse response) throws Exception { String id = request.getParameter("id") == null ? "" : String.valueOf(request.getParameter("id")); if (StringUtils.isBlank(id)) { id = request.getParameter("file") == null ? "" : String.valueOf(request.getParameter("file")); } ServletOutputStream fos = null; try { fos = response.getOutputStream(); response.setContentType("application/octet-stream"); FileIoEntity file = fileSupportService.get(id); FileCopyUtils.copy(file.getContent(), fos); } catch (Exception e) { logger.error(e.getMessage(), e); } finally { if (fos != null) { fos.flush(); fos.close(); } } } @RequestMapping("/changePicture.do") public void changePicture(HttpServletRequest request, HttpServletResponse response, ModelMap model) { String type = request.getParameter("type"); String path = request.getParameter("imagepath"); // 旋转 if (type.equals("rotate")) { String aktion = request.getParameter("aktion"); // 角度 if (aktion.equals("rotieren")) { int degree = Integer.valueOf(request.getParameter("degree")); try { Image imageOriginal = ImageIO.read(new ByteArrayInputStream(fileSupportService.get(path).getContent())); // if (uploadType.equals("file")) { // 文件方式存储 // File tfile = new File(path); // if (!tfile.exists()) { // return; // } // imageOriginal = ImageIO.read(tfile); // } else { // 数据库方式存储 // String errfilename = // this.getClass().getResource("/").getPath() // .replace("WEB-INF/classes", // "resources/images/sjerr.png"); // ByteArrayOutputStream os = new ByteArrayOutputStream(); // archiveService.getPictureFromDB(request.getParameter("imagepath"), // errfilename, os); // byte[] data = os.toByteArray(); // InputStream is = new ByteArrayInputStream(data); // imageOriginal = ImageIO.read(is); // } int widthOriginal = imageOriginal.getWidth(null); int heightOriginal = imageOriginal.getHeight(null); BufferedImage bi = new BufferedImage(widthOriginal, heightOriginal, BufferedImage.TYPE_3BYTE_BGR); Graphics2D g2d = bi.createGraphics(); g2d.drawImage(imageOriginal, 0, 0, null); BufferedImage bu = ImageUtilsEx.rotateImage(bi, degree); ByteArrayOutputStream bos = new ByteArrayOutputStream(); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos); encoder.encode(bu); byte[] data = bos.toByteArray(); // 更新文件内容 fileSupportService.updateContent(path, data); // if (uploadType.equals("file")) { // 文件方式存储 // FileOutputStream fos = new FileOutputStream(path); // JPEGImageEncoder encoder = // JPEGCodec.createJPEGEncoder(fos); // encoder.encode(bu); // // fos.flush(); // fos.close(); // fos = null; // } else { // 数据库方式存储 // ByteArrayOutputStream bos = new ByteArrayOutputStream(); // JPEGImageEncoder encoder = // JPEGCodec.createJPEGEncoder(bos); // encoder.encode(bu); // byte[] data = bos.toByteArray(); // InputStream is = new ByteArrayInputStream(data); // archiveService.updatePictureToDB(request.getParameter("imagepath"), // is, data.length); // // bos.flush(); // bos.close(); // bos = null; // // is.close(); // is = null; // } } catch (IOException e) { e.printStackTrace(); logger.error("错误:" + e.getMessage()); } // 翻转 } else { String degree = request.getParameter("degree"); try { Image imageOriginal = ImageIO.read(new ByteArrayInputStream(fileSupportService.get(path).getContent())); // if (uploadType.equals("file")) { // 文件方式存储 // File tfile = new File(path); // if (!tfile.exists()) { // return; // } // imageOriginal = ImageIO.read(tfile); // } else { // 数据库方式存储 // String errfilename = // this.getClass().getResource("/").getPath() // .replace("WEB-INF/classes", // "resources/images/sjerr.png"); // ByteArrayOutputStream os = new ByteArrayOutputStream(); // archiveService.getPictureFromDB(request.getParameter("imagepath"), // errfilename, os); // byte[] data = os.toByteArray(); // InputStream is = new ByteArrayInputStream(data); // imageOriginal = ImageIO.read(is); // } int widthOriginal = imageOriginal.getWidth(null); int heightOriginal = imageOriginal.getHeight(null); BufferedImage bi = new BufferedImage(widthOriginal, heightOriginal, BufferedImage.TYPE_3BYTE_BGR); Graphics2D g2d = bi.createGraphics(); g2d.drawImage(imageOriginal, 0, 0, null); BufferedImage bu = null; if (degree.equals("flip")) { bu = ImageUtilsEx.flipImage(bi); } else { bu = ImageUtilsEx.flopImage(bi); } ByteArrayOutputStream bos = new ByteArrayOutputStream(); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos); encoder.encode(bu); byte[] data = bos.toByteArray(); // 更新文件内容 fileSupportService.updateContent(path, data); // if (uploadType.equals("file")) { // 文件方式存储 // FileOutputStream fos = new FileOutputStream(path); // JPEGImageEncoder encoder = // JPEGCodec.createJPEGEncoder(fos); // encoder.encode(bu); // // fos.flush(); // fos.close(); // fos = null; // } else { // 数据库方式存储 // ByteArrayOutputStream bos = new ByteArrayOutputStream(); // JPEGImageEncoder encoder = // JPEGCodec.createJPEGEncoder(bos); // encoder.encode(bu); // byte[] data = bos.toByteArray(); // InputStream is = new ByteArrayInputStream(data); // archiveService.updatePictureToDB(request.getParameter("imagepath"), // is, data.length); // // bos.flush(); // bos.close(); // bos = null; // // is.close(); // is = null; // } } catch (IOException e) { e.printStackTrace(); logger.error("错误:" + e.getMessage()); } } } } // 公共方法 // 下载附件 @RequestMapping("/arcDownloadFj.do") public void arcDownloadFj(HttpServletRequest request, HttpServletResponse response) { int id = Integer.parseInt(request.getParameter("id")); Map<String, Object> map = this.archiveService.getArcfj(id); if (map == null) { return; } ServletOutputStream fos = null; FileInputStream fis = null; BufferedInputStream bfis = null; BufferedOutputStream bfos = null; try { File file = new File(map.get("filepath").toString()); if (!file.exists()) { response.setCharacterEncoding("GBK"); response.getWriter().write("<script>alert('文件不存在');window.history.back();</script>"); return; } fos = response.getOutputStream(); response.setHeader("Content-Disposition", "attachment; filename=\"" + new String(map.get("filename").toString().getBytes("GBK"), "ISO8859_1") + "\""); fis = new FileInputStream(file); bfis = new BufferedInputStream(fis); bfos = new BufferedOutputStream(fos); FileCopyUtils.copy(bfis, bfos); } catch (Exception e) { // e.printStackTrace(); } finally { try { if (fos != null) { fos.close(); } if (bfis != null) { bfis.close(); } if (bfos != null) { bfos.close(); } if (fis != null) { fis.close(); } } catch (Exception e) { } } } }
tyotann/tyo-java-frame
src/com/ihidea/component/datastore/archive/ArchiveController.java
Java
lgpl-3.0
15,946
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.server.almsettings.ws; import org.sonar.api.server.ServerSide; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.ALM; import org.sonar.db.alm.setting.AlmSettingDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.almsettings.MultipleAlmFeatureProvider; import org.sonar.server.component.ComponentFinder; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.UserSession; import org.sonarqube.ws.AlmSettings; import static java.lang.String.format; import static org.sonar.api.web.UserRole.ADMIN; @ServerSide public class AlmSettingsSupport { private final DbClient dbClient; private final UserSession userSession; private final ComponentFinder componentFinder; private final MultipleAlmFeatureProvider multipleAlmFeatureProvider; public AlmSettingsSupport(DbClient dbClient, UserSession userSession, ComponentFinder componentFinder, MultipleAlmFeatureProvider multipleAlmFeatureProvider) { this.dbClient = dbClient; this.userSession = userSession; this.componentFinder = componentFinder; this.multipleAlmFeatureProvider = multipleAlmFeatureProvider; } public MultipleAlmFeatureProvider getMultipleAlmFeatureProvider() { return multipleAlmFeatureProvider; } public void checkAlmSettingDoesNotAlreadyExist(DbSession dbSession, String almSetting) { dbClient.almSettingDao().selectByKey(dbSession, almSetting) .ifPresent(a -> { throw new IllegalArgumentException(format("An ALM setting with key '%s' already exists", a.getKey())); }); } public void checkAlmMultipleFeatureEnabled(ALM alm) { try (DbSession dbSession = dbClient.openSession(false)) { if (!multipleAlmFeatureProvider.enabled() && !dbClient.almSettingDao().selectByAlm(dbSession, alm).isEmpty()) { throw BadRequestException.create("A " + alm + " setting is already defined"); } } } public ProjectDto getProjectAsAdmin(DbSession dbSession, String projectKey) { return getProject(dbSession, projectKey, ADMIN); } public ProjectDto getProject(DbSession dbSession, String projectKey, String projectPermission) { ProjectDto project = componentFinder.getProjectByKey(dbSession, projectKey); userSession.checkProjectPermission(projectPermission, project); return project; } public AlmSettingDto getAlmSetting(DbSession dbSession, String almSetting) { return dbClient.almSettingDao().selectByKey(dbSession, almSetting) .orElseThrow(() -> new NotFoundException(format("ALM setting with key '%s' cannot be found", almSetting))); } public static AlmSettings.Alm toAlmWs(ALM alm) { switch (alm) { case GITHUB: return AlmSettings.Alm.github; case BITBUCKET: return AlmSettings.Alm.bitbucket; case BITBUCKET_CLOUD: return AlmSettings.Alm.bitbucketcloud; case AZURE_DEVOPS: return AlmSettings.Alm.azure; case GITLAB: return AlmSettings.Alm.gitlab; default: throw new IllegalStateException(format("Unknown ALM '%s'", alm.name())); } } }
SonarSource/sonarqube
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/AlmSettingsSupport.java
Java
lgpl-3.0
4,030
package org.eso.ias.plugin; /** * The exception returned by the Plugin * @author acaproni * */ public class PluginException extends Exception { public PluginException() { } public PluginException(String message) { super(message); } public PluginException(Throwable cause) { super(cause); } public PluginException(String message, Throwable cause) { super(message, cause); } public PluginException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
IntegratedAlarmSystem-Group/ias
plugin/src/main/java/org/eso/ias/plugin/PluginException.java
Java
lgpl-3.0
581
package clearvolume.renderer; /** * Overlays that implement this interface can declare a key binding that will be * used to toggle it's display on/off * * @author Loic Royer (2015) * */ public interface SingleKeyToggable { /** * Returns key code of toggle key combination. * * @return toggle key as short code. */ public short toggleKeyCode(); /** * Returns modifier of toggle key combination. * * @return toggle key as short code. */ public int toggleKeyModifierMask(); /** * Toggle on/off * * @return new state */ public boolean toggle(); }
ClearVolume/ClearVolume
src/java/clearvolume/renderer/SingleKeyToggable.java
Java
lgpl-3.0
587
package co.edu.unal.sistemasinteligentes.ajedrez.agentes; import co.edu.unal.sistemasinteligentes.ajedrez.base.*; import co.edu.unal.sistemasinteligentes.ajedrez.reversi.Tablero; import co.edu.unal.sistemasinteligentes.ajedrez.reversi.Reversi.EstadoReversi; import java.io.PrintStream; /** * Created by jiacontrerasp on 3/30/15. */ public class AgenteHeuristicoBasico extends _AgenteHeuristico { private Jugador jugador; private PrintStream output = null; private int niveles; /** * Constructor de AgenteHeuristico1 * @param niveles: niveles de recursión */ public AgenteHeuristicoBasico(int niveles) { super(); this.niveles = niveles; } public AgenteHeuristicoBasico(int niveles, PrintStream output) { super(); this.niveles = niveles; this.output = output; } @Override public Jugador jugador() { return jugador; } @Override public void comienzo(Jugador jugador, Estado estado) { this.jugador = jugador; } @Override public void fin(Estado estado) { // No hay implementación. } @Override public void movimiento(Movimiento movimiento, Estado estado) { if(output != null){ output.println(String.format("Jugador %s mueve %s.", movimiento.jugador(), movimiento)); printEstado(estado); } } protected void printEstado(Estado estado) { if(output != null){ output.println("\t"+ estado.toString().replace("\n", "\n\t")); } } @Override public String toString() { return String.format("Agente Heuristico Basico " + jugador.toString()); } @Override public double darHeuristica(Estado estado) { char miFicha = (jugador().toString() == "JugadorNegras" ? 'N' :'B'); char fichaContrario = (jugador().toString() == "JugadorNegras" ? 'B' :'N'); Tablero tablero = ((EstadoReversi)(estado)).getTablero(); int misFichas = tablero.cantidadFichas(miFicha); int fichasContrario = tablero.cantidadFichas(fichaContrario); return misFichas - fichasContrario; } @Override public int niveles() { return niveles; } @Override public double maximoValorHeuristica() { return 18; } }
UNColombia/bog-2025995-2-2015-01
elCinco/MinMax/src/co/edu/unal/sistemasinteligentes/ajedrez/agentes/AgenteHeuristicoBasico.java
Java
lgpl-3.0
2,312
package tk.teemocode.module.base.vo; import java.io.Serializable; public class Vo implements Serializable, Cloneable { private Long id; private String uuid; private Integer tag; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Integer getTag() { return tag; } public void setTag(Integer tag) { this.tag = tag; } }
yangylsky/teemocode
teemocode-modulebase/src/main/java/tk/teemocode/module/base/vo/Vo.java
Java
lgpl-3.0
520
/******************************************************************************* * Copyright (c) 2011 Dipanjan Das * Language Technologies Institute, * Carnegie Mellon University, * All Rights Reserved. * * IntCounter.java is part of SEMAFOR 2.0. * * SEMAFOR 2.0 is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SEMAFOR 2.0 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 SEMAFOR 2.0. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package edu.cmu.cs.lti.ark.util.ds.map; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntIterator; import gnu.trove.TObjectIntProcedure; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * Simple integer counter: stores integer values for keys; lookup on nonexistent keys returns 0. * Stores the sum of all values and provides methods for normalizing them. * * A {@code null} key is allowed, although the Iterator returned by {@link #getIterator()} * will not include an entry whose key is {@code null}. * * @author Nathan Schneider (nschneid) * @since 2009-03-19 * @param <T> Type for keys */ public class IntCounter<T> extends AbstractCounter<T, Integer> implements java.io.Serializable { private static final long serialVersionUID = -5622820446958578575L; protected TObjectIntHashMap<T> m_map; protected int m_sum = 0; public final int DEFAULT_VALUE = 0; public IntCounter() { m_map = new TObjectIntHashMap<T>(); } public IntCounter(TObjectIntHashMap<T> map) { m_map = map; int vals[] = map.getValues(); for (int val : vals) { m_sum += val; } } /** * @param key * @return The value stored for a particular key (if present), or 0 otherwise */ public int getT(T key) { if (m_map.containsKey(key)) return m_map.get(key); return DEFAULT_VALUE; } /** Calls {@link #getT(T)}; required for compliance with {@link Map} */ @SuppressWarnings("unchecked") public Integer get(Object key) { return getT((T)key); } /** * @param key * @param newValue * @return Previous value for the key */ public int set(T key, int newValue) { int preval = getT(key); m_map.put(key, newValue); m_sum += newValue - preval; return preval; } /** * Increments a value in the counter by 1. * @param key * @return The new value */ public int increment(T key) { return incrementBy(key, 1); } /** * Changes a value in the counter by adding the specified delta to its current value. * @param key * @param delta * @return The new value */ public int incrementBy(T key, int delta) { int curval = getT(key); int newValue = curval+delta; set(key, newValue); return newValue; } /** * Returns a new counter containing only keys with nonzero values in * at least one of the provided counters. Each key's value is the * number of counters in which it occurs. */ public static <T> IntCounter<T> or(Collection<IntCounter<? extends T>> counters) { IntCounter<T> result = new IntCounter<T>(); for (IntCounter<? extends T> counter : counters) { for (TObjectIntIterator<? extends T> iter = counter.getIterator(); iter.hasNext();) { iter.advance(); if (iter.value()!=0) result.increment(iter.key()); } } return result; } /** * @return Sum of all values currently in the Counter */ public int getSum() { return m_sum; } public IntCounter<T> add(final int val) { final IntCounter<T> result = new IntCounter<T>(); m_map.forEachEntry(new TObjectIntProcedure<T>() { private boolean first = true; public boolean execute(T key, int value) { if ( first ) first = false; int newValue = value + val; result.set(key, newValue); return true; } }); return result; } /** * @return Iterator for the counter. Ignores the {@code null} key (if present). */ public TObjectIntIterator<T> getIterator() { return m_map.iterator(); } @SuppressWarnings("unchecked") public Set<T> keySet() { Object[] okeys = m_map.keys(); HashSet<T> keyset = new HashSet<T>(); for(Object o:okeys) { keyset.add((T)o); } return keyset; } /** * @param valueThreshold * @return New IntCounter containing only entries whose value equals or exceeds the given threshold */ public IntCounter<T> filter(int valueThreshold) { IntCounter<T> result = new IntCounter<T>(); for (TObjectIntIterator<T> iter = getIterator(); iter.hasNext();) { iter.advance(); T key = iter.key(); int value = getT(key); if (value >= valueThreshold) { result.set(key, value); } } int nullValue = getT(null); if (containsKey(null) && nullValue >= valueThreshold) result.set(null, nullValue); return result; } /** Calls {@link #containsKeyT(T)}; required for compliance with {@link Map} */ @SuppressWarnings("unchecked") public boolean containsKey(Object key) { return containsKeyT((T)key); } public boolean containsKeyT(T key) { return m_map.containsKey(key); } public int size() { return m_map.size(); } public String toString() { return toString(Integer.MIN_VALUE, null); } public String toString(int valueThreshold) { return toString(valueThreshold, null); } /** * @param sep Array with two Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default) */ public String toString(String[] sep) { return toString(Integer.MIN_VALUE, sep); } /** * @param valueThreshold * @param sep Array with two Strings: an entry separator ("," by default, if this is {@code null}), and a key-value separator ("=" by default) * @return A string representation of all (key, value) pairs such that the value equals or exceeds the given threshold */ public String toString(final int valueThreshold, String[] sep) { String entrySep = ","; // default String kvSep = "="; // default if (sep!=null && sep.length>0) { if (sep[0]!=null) entrySep = sep[0]; if (sep.length>1 && sep[1]!=null) kvSep = sep[1]; } final String ENTRYSEP = entrySep; final String KVSEP = kvSep; final StringBuilder buf = new StringBuilder("{"); m_map.forEachEntry(new TObjectIntProcedure<T>() { private boolean first = true; public boolean execute(T key, int value) { if (value >= valueThreshold) { if ( first ) first = false; else buf.append(ENTRYSEP); buf.append(key); buf.append(KVSEP); buf.append(value); } return true; } }); buf.append("}"); return buf.toString(); } public IntCounter<T> clone() { return new IntCounter<T>(m_map.clone()); } // Other methods implemented by the Map interface @Override public void clear() { throw new UnsupportedOperationException("IntCounter.clear() unsupported"); } @Override public boolean containsValue(Object value) { return m_map.containsValue((Integer)value); } @Override public Set<java.util.Map.Entry<T, Integer>> entrySet() { throw new UnsupportedOperationException("IntCounter.entrySet() unsupported"); } @Override public boolean isEmpty() { return m_map.isEmpty(); } @Override public Integer put(T key, Integer value) { return set(key,value); } @Override public void putAll(Map<? extends T, ? extends Integer> m) { throw new UnsupportedOperationException("IntCounter.putAll() unsupported"); } @Override public Integer remove(Object key) { throw new UnsupportedOperationException("IntCounter.remove() unsupported"); } @Override public Collection<Integer> values() { throw new UnsupportedOperationException("IntCounter.values() unsupported"); } }
jtraviesor/semafor-parser
semafor/src/main/java/edu/cmu/cs/lti/ark/util/ds/map/IntCounter.java
Java
lgpl-3.0
8,362
/* * Project: NextGIS Mobile * Purpose: Mobile GIS for Android. * Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com * Author: NikitaFeodonit, nfeodonit@yandex.com * Author: Stanislav Petriakov, becomeglory@gmail.com * ***************************************************************************** * Copyright (c) 2015-2017, 2019 NextGIS, info@nextgis.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.nextgis.maplib.util; import android.accounts.Account; import android.annotation.TargetApi; import android.content.ContentResolver; import android.content.Context; import android.content.SyncInfo; import android.os.Build; import android.util.Base64; import com.nextgis.maplib.api.IGISApplication; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.io.IOException; import java.security.KeyFactory; import java.security.PublicKey; import java.security.Signature; import java.security.spec.X509EncodedKeySpec; import static com.nextgis.maplib.util.Constants.JSON_END_DATE_KEY; import static com.nextgis.maplib.util.Constants.JSON_SIGNATURE_KEY; import static com.nextgis.maplib.util.Constants.JSON_START_DATE_KEY; import static com.nextgis.maplib.util.Constants.JSON_SUPPORTED_KEY; import static com.nextgis.maplib.util.Constants.JSON_USER_ID_KEY; import static com.nextgis.maplib.util.Constants.SUPPORT; public class AccountUtil { public static boolean isProUser(Context context) { File support = context.getExternalFilesDir(null); if (support == null) support = new File(context.getFilesDir(), SUPPORT); else support = new File(support, SUPPORT); try { String jsonString = FileUtil.readFromFile(support); JSONObject json = new JSONObject(jsonString); if (json.optBoolean(JSON_SUPPORTED_KEY)) { final String id = json.getString(JSON_USER_ID_KEY); final String start = json.getString(JSON_START_DATE_KEY); final String end = json.getString(JSON_END_DATE_KEY); final String data = id + start + end + "true"; final String signature = json.getString(JSON_SIGNATURE_KEY); return verifySignature(data, signature); } } catch (JSONException | IOException ignored) { } return false; } private static boolean verifySignature(String data, String signature) { try { // add public key KeyFactory keyFactory = KeyFactory.getInstance("RSA"); String key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzbmnrTLjTLxqCnIqXgIJ\n" + "jebXVOn4oV++8z5VsBkQwK+svDkGK/UcJ4YjXUuPqyiZwauHGy1wizGCgVIRcPNM\n" + "I0n9W6797NMFaC1G6Rp04ISv7DAu0GIZ75uDxE/HHDAH48V4PqQeXMp01Uf4ttti\n" + "XfErPKGio7+SL3GloEqtqGbGDj6Yx4DQwWyIi6VvmMsbXKmdMm4ErczWFDFHIxpV\n" + "ln/VfX43r/YOFxqt26M7eTpaBIvAU6/yWkIsvidMNL/FekQVTiRCl/exPgioDGrf\n" + "06z5a0sd3NDbS++GMCJstcKxkzk5KLQljAJ85Jciiuy2vv14WU621ves8S9cMISO\n" + "HwIDAQAB"; byte[] keyBytes = Base64.decode(key.getBytes("UTF-8"), Base64.DEFAULT); X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes); PublicKey publicKey = keyFactory.generatePublic(spec); // verify signature Signature signCheck = Signature.getInstance("SHA256withRSA"); signCheck.initVerify(publicKey); signCheck.update(data.getBytes("UTF-8")); byte[] sigBytes = Base64.decode(signature, Base64.DEFAULT); return signCheck.verify(sigBytes); } catch (Exception e) { return false; } } public static boolean isSyncActive(Account account, String authority) { return isSyncActiveHoneycomb(account, authority); } public static boolean isSyncActiveHoneycomb(Account account, String authority) { for (SyncInfo syncInfo : ContentResolver.getCurrentSyncs()) { if (syncInfo.account.equals(account) && syncInfo.authority.equals(authority)) { return true; } } return false; } public static AccountData getAccountData(Context context, String accountName) throws IllegalStateException { IGISApplication app = (IGISApplication) context.getApplicationContext(); Account account = app.getAccount(accountName); if (null == account) { throw new IllegalStateException("Account is null"); } AccountData accountData = new AccountData(); accountData.url = app.getAccountUrl(account); accountData.login = app.getAccountLogin(account); accountData.password = app.getAccountPassword(account); return accountData; } public static class AccountData { public String url; public String login; public String password; } }
nextgis/android_maplib
src/main/java/com/nextgis/maplib/util/AccountUtil.java
Java
lgpl-3.0
5,591
package edu.ucsd.arcum.interpreter.ast; import java.util.List; import java.util.Set; import org.eclipse.core.runtime.CoreException; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import edu.ucsd.arcum.exceptions.ArcumError; import edu.ucsd.arcum.exceptions.SourceLocation; import edu.ucsd.arcum.interpreter.ast.expressions.ConstraintExpression; import edu.ucsd.arcum.interpreter.query.EntityDataBase; import edu.ucsd.arcum.interpreter.query.OptionMatchTable; import edu.ucsd.arcum.util.StringUtil; public class MapTraitArgument extends MapNameValueBinding { private RequireMap map; private ConstraintExpression patternExpr; private List<FormalParameter> formals; // TODO: paramNames should be allowed to have the types explicit, just like // any other realize statement public MapTraitArgument(SourceLocation location, RequireMap map, String traitName, List<FormalParameter> formals, ConstraintExpression patternExpr) { super(location, traitName); this.map = map; this.patternExpr = patternExpr; this.formals = formals; } public void initializeValue(EntityDataBase edb, Option option, OptionMatchTable table) throws CoreException { StaticRealizationStatement pseudoStmt; OptionInterface optionIntf = option.getOptionInterface(); List<FormalParameter> allParams = optionIntf.getSingletonParameters(); List<FormalParameter> formals = null; for (FormalParameter param : allParams) { if (param.getIdentifier().equals(getName())) { formals = param.getTraitArguments(); break; } } if (formals == null) { ArcumError.fatalUserError(getLocation(), "Couldn't find %s", getName()); } pseudoStmt = StaticRealizationStatement.makeNested(map, getName(), patternExpr, formals, this.getLocation()); pseudoStmt.typeCheckAndValidate(optionIntf); List<StaticRealizationStatement> stmts = Lists.newArrayList(pseudoStmt); try { EntityDataBase.pushCurrentDataBase(edb); RealizationStatement.collectivelyRealizeStatements(stmts, edb, table); } finally { EntityDataBase.popMostRecentDataBase(); } } @Override public Object getValue() { return this; } @Override public String toString() { return String.format("%s(%s): %s", getName(), StringUtil.separate(formals), patternExpr.toString()); } public void checkUserDefinedPredicates(List<TraitSignature> tupleSets) { Set<String> names = Sets.newHashSet(); names.addAll(Lists.transform(formals, FormalParameter.getIdentifier)); patternExpr.checkUserDefinedPredicates(tupleSets, names); } }
mshonle/Arcum
src/edu/ucsd/arcum/interpreter/ast/MapTraitArgument.java
Java
lgpl-3.0
2,934
package edu.hm.gamedev.server.packets.client2server; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonProperty; import edu.hm.gamedev.server.packets.Packet; import edu.hm.gamedev.server.packets.Type; public class JoinGame extends Packet { private final String gameName; @JsonCreator public JoinGame(@JsonProperty("gameName") String gameName) { super(Type.JOIN_GAME); this.gameName = gameName; } public String getGameName() { return gameName; } @Override public String toString() { return "JoinGame{" + "gameName='" + gameName + '\'' + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } JoinGame joinGame = (JoinGame) o; if (gameName != null ? !gameName.equals(joinGame.gameName) : joinGame.gameName != null) { return false; } return true; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (gameName != null ? gameName.hashCode() : 0); return result; } }
phxql/gamedev-server
src/main/java/edu/hm/gamedev/server/packets/client2server/JoinGame.java
Java
lgpl-3.0
1,227
package uk.co.wehavecookies56.kk.common.container.slot; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; import uk.co.wehavecookies56.kk.common.item.ItemSynthesisBagS; import uk.co.wehavecookies56.kk.common.item.base.ItemSynthesisMaterial; public class SlotSynthesisBag extends SlotItemHandler { public SlotSynthesisBag (IItemHandler inventory, int index, int x, int y) { super(inventory, index, x, y); } @Override public boolean isItemValid (ItemStack stack) { return !(stack.getItem() instanceof ItemSynthesisBagS) && stack.getItem() instanceof ItemSynthesisMaterial; } }
Wehavecookies56/Kingdom-Keys-Re-Coded
src/main/java/uk/co/wehavecookies56/kk/common/container/slot/SlotSynthesisBag.java
Java
lgpl-3.0
697
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.duplications.statement; import org.sonar.duplications.statement.matcher.AnyTokenMatcher; import org.sonar.duplications.statement.matcher.BridgeTokenMatcher; import org.sonar.duplications.statement.matcher.ExactTokenMatcher; import org.sonar.duplications.statement.matcher.ForgetLastTokenMatcher; import org.sonar.duplications.statement.matcher.OptTokenMatcher; import org.sonar.duplications.statement.matcher.TokenMatcher; import org.sonar.duplications.statement.matcher.UptoTokenMatcher; public final class TokenMatcherFactory { private TokenMatcherFactory() { } public static TokenMatcher from(String token) { return new ExactTokenMatcher(token); } public static TokenMatcher to(String... tokens) { return new UptoTokenMatcher(tokens); } public static TokenMatcher bridge(String lToken, String rToken) { return new BridgeTokenMatcher(lToken, rToken); } public static TokenMatcher anyToken() { // TODO Godin: we can return singleton instance return new AnyTokenMatcher(); } public static TokenMatcher opt(TokenMatcher optMatcher) { return new OptTokenMatcher(optMatcher); } public static TokenMatcher forgetLastToken() { // TODO Godin: we can return singleton instance return new ForgetLastTokenMatcher(); } public static TokenMatcher token(String token) { return new ExactTokenMatcher(token); } }
SonarSource/sonarqube
sonar-duplications/src/main/java/org/sonar/duplications/statement/TokenMatcherFactory.java
Java
lgpl-3.0
2,239
package com.farevee.groceries; public class BulkItem implements Item { //+--------+------------------------------------------------------ // | Fields | // +--------+ /** * The type of food of the bulk item */ BulkFood food; /** * The unit of the bulk item */ Units unit; /** * The amount of bulk item */ int amount; // +--------------+------------------------------------------------ // | Constructor | // +--------------+ public BulkItem(BulkFood food, Units unit, int amount) { this.food = food; this.unit = unit; this.amount = amount; } // BulkItem (BulkFood, Units, int) //+-----------+--------------------------------------------------- // | Methods | // +-----------+ /** * Retrieve the Weight of BulkItem, including unit and amount */ public Weight getWeight() { return new Weight(this.unit, this.amount); }//getWeight() /** * Retrieve the amount of Weight of BulkItem */ @Override public int getWeightAmount() { return this.getWeight().amount; }//getWeightAmount() //Get the unit of weight @Override public Units getWeightUnit() { return this.unit; }//getWeightUnit() //Get the price public int getPrice() { return this.food.pricePerUnit * this.amount; }//getPrice() //Creates a string for the name public String toString() { return (amount + " " + unit.name + " of " + food.name); }//toString() //Gets the name @Override public String getName() { return this.food.name; }//getName() //Get the type of BulkFood public BulkFood getBulkFoodType() { return this.food; }//getBulkFoodType() //Get the amount of BulkItem public int getBulkItemAmount() { return this.amount; }//getBulkItemAmount() //Compares two BulkItem public boolean equalZ(Object thing) { if (thing instanceof BulkItem) { BulkItem anotherBulkItem = (BulkItem) thing; return ((this.food.name.equals(anotherBulkItem.food.name)) && (this.unit.name.equals(anotherBulkItem.unit.name))); } else { return Boolean.FALSE; } }//equals(Object) public void increaseAmount(int x) { this.amount += x; }//increaseAmount(int) }
lordzason/csc207-hw07-combined-with-hw06
src/com/farevee/groceries/BulkItem.java
Java
lgpl-3.0
2,267
package org.logicobjects.converter.old; import java.util.Arrays; import java.util.List; import org.jpc.term.Term; import org.jpc.util.ParadigmLeakUtil; import org.logicobjects.converter.IncompatibleAdapterException; import org.logicobjects.converter.context.old.AdaptationContext; import org.logicobjects.converter.context.old.AnnotatedElementAdaptationContext; import org.logicobjects.converter.context.old.BeanPropertyAdaptationContext; import org.logicobjects.converter.context.old.ClassAdaptationContext; import org.logicobjects.converter.descriptor.LogicObjectDescriptor; import org.logicobjects.core.LogicObject; import org.logicobjects.methodadapter.LogicAdapter; import org.minitoolbox.reflection.BeansUtil; public class AnnotatedObjectToTermConverter<From> extends LogicAdapter<From, Term> { @Override public Term adapt(From object) { return adapt(object, null); } public Term adapt(From object, AdaptationContext context) { AnnotatedElementAdaptationContext annotatedContext; if(context != null) { if(understandsContext(context)) annotatedContext = (AnnotatedElementAdaptationContext)context; else throw new UnrecognizedAdaptationContextException(this.getClass(), context); } else { annotatedContext = new ClassAdaptationContext(object.getClass()); //the current context is null, then create default context } if(annotatedContext.hasObjectToTermConverter()) { //first check if there is an explicit adapter, in the current implementation, an Adapter annotation overrides any method invoker description return adaptToTermWithAdapter(object, annotatedContext); } else if(annotatedContext.hasLogicObjectDescription()) { return adaptToTermFromDescription(object, annotatedContext); } throw new IncompatibleAdapterException(this.getClass(), object); } protected Term adaptToTermWithAdapter(From object, AnnotatedElementAdaptationContext annotatedContext) { ObjectToTermConverter termAdapter = annotatedContext.getObjectToTermConverter(); return termAdapter.adapt(object); } protected Term adaptToTermFromDescription(From object, AnnotatedElementAdaptationContext annotatedContext) { LogicObjectDescriptor logicObjectDescription = annotatedContext.getLogicObjectDescription(); String logicObjectName = logicObjectDescription.name(); if(logicObjectName.isEmpty()) logicObjectName = infereLogicObjectName(annotatedContext); List<Term> arguments; String argsListPropertyName = logicObjectDescription.argsList(); if(argsListPropertyName != null && !argsListPropertyName.isEmpty()) { BeanPropertyAdaptationContext adaptationContext = new BeanPropertyAdaptationContext(object.getClass(), argsListPropertyName); Object argsListObject = BeansUtil.getProperty(object, argsListPropertyName, adaptationContext.getGuidingClass()); List argsList = null; if(List.class.isAssignableFrom(argsListObject.getClass())) argsList = (List) argsListObject; else if(Object[].class.isAssignableFrom(argsListObject.getClass())) argsList = Arrays.asList((Object[])argsListObject); else throw new RuntimeException("Property " + argsListPropertyName + " is neither a list nor an array"); arguments = new ObjectToTermConverter().adaptObjects(argsList, adaptationContext); } else { arguments = LogicObject.propertiesAsTerms(object, logicObjectDescription.args()); } return new LogicObject(logicObjectName, arguments).asTerm(); } /** * In case the id is not explicitly specified (e.g., with an annotation), it will have to be inferred * It can be inferred from a class id (if the transformation context is a class instance to a logic object), from a field id (if the context is the transformation of a field), etc * Different context override this method to specify how they infer the logic id of the object * @return */ public String infereLogicObjectName(AnnotatedElementAdaptationContext annotatedContext) { return ParadigmLeakUtil.javaClassNameToProlog(annotatedContext.getGuidingClass().getSimpleName()); } public static boolean understandsContext(AdaptationContext context) { return context != null && context instanceof AnnotatedElementAdaptationContext; } }
java-prolog-connectivity/logicobjects
src/main/java/org/logicobjects/converter/old/AnnotatedObjectToTermConverter.java
Java
lgpl-3.0
4,202
/* * SonarQube * Copyright (C) 2009-2017 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.api.utils; import org.apache.commons.io.FileUtils; import org.junit.Test; import java.io.File; import java.io.IOException; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; public class TempFileUtilsTest { @Test public void createTempDirectory() throws IOException { File dir = TempFileUtils.createTempDirectory(); try { assertThat(dir.exists(), is(true)); assertThat(dir.isDirectory(), is(true)); assertThat(dir.listFiles().length, is(0)); } finally { FileUtils.deleteDirectory(dir); } } }
lbndev/sonarqube
sonar-plugin-api/src/test/java/org/sonar/api/utils/TempFileUtilsTest.java
Java
lgpl-3.0
1,443
package net.anthavio.sewer.test; import net.anthavio.sewer.ServerInstance; import net.anthavio.sewer.ServerInstanceManager; import net.anthavio.sewer.ServerMetadata; import net.anthavio.sewer.ServerMetadata.CacheScope; import net.anthavio.sewer.ServerType; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; /** * * public class MyCoolTests { * * @Rule * private SewerRule sewer = new SewerRule(ServerType.JETTY, "src/test/jetty8", 0); * * @Test * public void test() { * int port = sewer.getServer().getLocalPorts()[0]; * } * * } * * Can interact with method annotations - http://www.codeaffine.com/2012/09/24/junit-rules/ * * @author martin.vanek * */ public class SewerRule implements TestRule { private final ServerInstanceManager manager = ServerInstanceManager.INSTANCE; private final ServerMetadata metadata; private ServerInstance server; public SewerRule(ServerType type, String home) { this(type, home, -1, null, CacheScope.JVM); } public SewerRule(ServerType type, String home, int port) { this(type, home, port, null, CacheScope.JVM); } public SewerRule(ServerType type, String home, int port, CacheScope cache) { this(type, home, port, null, cache); } public SewerRule(ServerType type, String home, int port, String[] configs, CacheScope cache) { this.metadata = new ServerMetadata(type, home, port, configs, cache); } public ServerInstance getServer() { return server; } @Override public Statement apply(Statement base, Description description) { return new SewerStatement(base); } public class SewerStatement extends Statement { private final Statement base; public SewerStatement(Statement base) { this.base = base; } @Override public void evaluate() throws Throwable { server = manager.borrowServer(metadata); try { base.evaluate(); } finally { manager.returnServer(metadata); } } } }
anthavio/anthavio-sewer
src/main/java/net/anthavio/sewer/test/SewerRule.java
Java
lgpl-3.0
1,989
/* * SonarQube * Copyright (C) 2009-2017 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.api.ce.posttask; /** * @since 5.5 */ public interface CeTask { /** * Id of the Compute Engine task. * <p> * This is the id under which the processing of the project analysis report has been added to the Compute Engine * queue. * */ String getId(); /** * Indicates whether the Compute Engine task ended successfully or not. */ Status getStatus(); enum Status { SUCCESS, FAILED } }
lbndev/sonarqube
sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/CeTask.java
Java
lgpl-3.0
1,287
package calc.lib; /** Class (POJO) used to store Uninhabited Solar System JSON objects * * @author Carlin Robertson * @version 1.0 * */ public class SolarSystemUninhabited { private String[] information; private String requirePermit; private Coords coords; private String name; public String[] getInformation () { return information; } public void setInformation (String[] information) { this.information = information; } public String getRequirePermit () { return requirePermit; } public void setRequirePermit (String requirePermit) { this.requirePermit = requirePermit; } public Coords getCoords () { return coords; } public void setCoords (Coords coords) { this.coords = coords; } public String getName () { return name; } public void setName (String name) { this.name = name; } }
TheJavaMagician/CalculusBot
src/main/java/calc/lib/SolarSystemUninhabited.java
Java
lgpl-3.0
977
// Catalano Fuzzy Library // The Catalano Framework // // Copyright © Diego Catalano, 2013 // diego.catalano at live.com // // Copyright © Andrew Kirillov, 2007-2008 // andrew.kirillov at gmail.com // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // package Catalano.Fuzzy; /** * Interface with the common methods of Fuzzy Unary Operator. * @author Diego Catalano */ public interface IUnaryOperator { /** * Calculates the numerical result of a Unary operation applied to one fuzzy membership value. * @param membership A fuzzy membership value, [0..1]. * @return The numerical result of the operation applied to <paramref name="membership"/>. */ float Evaluate( float membership ); }
accord-net/java
Catalano.Fuzzy/src/Catalano/Fuzzy/IUnaryOperator.java
Java
lgpl-3.0
1,453
package flabs.mods.magitech.aura; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.WorldSavedData; public class AuraSavedData extends WorldSavedData{ public static final String nbtName="MagiAura"; public AuraSavedData(String name) { super(name); } @Override public void readFromNBT(NBTTagCompound nbttagcompound) { System.out.println("Reading Aura Data"); } @Override public void writeToNBT(NBTTagCompound nbttagcompound) { System.out.println("Writing Aura Data"); } }
froschi3b/Magitech
magitech_common/flabs/mods/magitech/aura/AuraSavedData.java
Java
lgpl-3.0
532
package edu.ut.mobile.network; public class NetInfo{ //public static byte[] IPAddress = {Integer.valueOf("54").byteValue(),Integer.valueOf("73").byteValue(),Integer.valueOf("28").byteValue(),Integer.valueOf("236").byteValue()}; static byte[] IPAddress = {Integer.valueOf("192").byteValue(),Integer.valueOf("168").byteValue(),Integer.valueOf("1").byteValue(),Integer.valueOf("67").byteValue()}; static int port = 6000; static int waitTime = 100000; }
huberflores/BenchmarkingAndroidx86
Simulator/MobileOffloadSimulator/src/main/java/edu/ut/mobile/network/NetInfo.java
Java
lgpl-3.0
473
/* Copyright 2009 Semantic Discovery, Inc. (www.semanticdiscovery.com) This file is part of the Semantic Discovery Toolkit. The Semantic Discovery Toolkit is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The Semantic Discovery Toolkit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with The Semantic Discovery Toolkit. If not, see <http://www.gnu.org/licenses/>. */ package org.sd.text; import org.sd.io.FileUtil; import org.sd.nlp.AbstractLexicon; import org.sd.nlp.AbstractNormalizer; import org.sd.nlp.Break; import org.sd.nlp.BreakStrategy; import org.sd.nlp.Categories; import org.sd.nlp.Category; import org.sd.nlp.CategoryFactory; import org.sd.nlp.GeneralNormalizer; import org.sd.nlp.GenericLexicon; import org.sd.nlp.Lexicon; import org.sd.nlp.LexiconPipeline; import org.sd.nlp.TokenizationStrategy; import org.sd.nlp.TokenizerWrapper; import org.sd.nlp.StringWrapper; import org.sd.util.PropertiesParser; import org.sd.util.tree.Tree; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; /** * Utility to find meaningful words in strings. * <p> * @author Spence Koehler */ public class MungedWordFinder { private static final String UNDETERMINED_LETTER = "X"; private static final String UNDETERMINED_WORD = "U"; private static final String WORD = "W"; private static final String NUMBER = "N"; private static final String SEQUENCE = "S"; private static final String CONSTITUENT = "C"; private static final String[] CATEGORIES = new String[] { UNDETERMINED_LETTER, UNDETERMINED_WORD, WORD, NUMBER, SEQUENCE, CONSTITUENT, }; private static final AbstractNormalizer NORMALIZER = GeneralNormalizer.getCaseInsensitiveInstance(); private static final BreakStrategy BREAK_STRATEGY = new MyBreakStrategy(); private static final Comparator<WordSequence> SEQUENCE_COMPARATOR = new Comparator<WordSequence>() { public int compare(WordSequence ws1, WordSequence ws2) { return ws1.size() - ws2.size(); } public boolean equals(Object o) { return this == o; } }; private CategoryFactory categoryFactory; private Map<String, File> wordFiles; private Map<String, String[]> wordSets; private List<Lexicon> lexicons; private TokenizerWrapper _tokenizerWrapper; /** * Construct without any dictionaries. * <p> * Add dictionaries to use for finding munged words using the * addWordFile, addWordSet, and addLexicon methods. */ public MungedWordFinder() { this.categoryFactory = new CategoryFactory(CATEGORIES); this.wordFiles = new HashMap<String, File>(); this.wordSets = new HashMap<String, String[]>(); this.lexicons = new ArrayList<Lexicon>(); this._tokenizerWrapper = null; } /** * Add a word file defining words to recognize. */ public final void addWordFile(String name, File wordFile) { this.wordFiles.put(name, wordFile); this._tokenizerWrapper = null; // force rebuild. } /** * Add a word set defining words to recognize. */ public final void addWordSet(String name, String[] words) { this.wordSets.put(name, words); this._tokenizerWrapper = null; // force rebuild. } /** * Add a lexicon defining words to recognize. */ public final void addLexicon(Lexicon lexicon) { this.lexicons.add(lexicon); this._tokenizerWrapper = null; // force rebuild. } protected final TokenizerWrapper getTokenizerWrapper() { if (_tokenizerWrapper == null) { try { final Lexicon lexicon = new LexiconPipeline(buildLexicons()); _tokenizerWrapper = new TokenizerWrapper( lexicon, categoryFactory, TokenizationStrategy.Type.LONGEST_TO_SHORTEST, NORMALIZER, BREAK_STRATEGY, false, 0, false); //NOTE: lexicon should classify every token } catch (IOException e) { throw new IllegalStateException(e); } } return _tokenizerWrapper; } private final Lexicon[] buildLexicons() throws IOException { final List<Lexicon> result = new ArrayList<Lexicon>(); final Category wordCategory = categoryFactory.getCategory(WORD); // add a lexicon that identifies/recognizes number sequences. result.add(new NumberLexicon(categoryFactory.getCategory(NUMBER))); // add a lexicon for each wordSet for (Map.Entry<String, String[]> wordSetEntry : wordSets.entrySet()) { final String name = wordSetEntry.getKey(); final String[] terms = wordSetEntry.getValue(); final GenericLexicon genericLexicon = new GenericLexicon(terms, NORMALIZER, wordCategory, false, true, false, "name=" + name); genericLexicon.setMaxNumWords(0); // disable "word" limit. each char counts as a word with our break strategy. result.add(genericLexicon); } // add a lexicon for each wordFile for (Map.Entry<String, File> wordFileEntry : wordFiles.entrySet()) { final String name = wordFileEntry.getKey(); final File wordFile = wordFileEntry.getValue(); final GenericLexicon genericLexicon = new GenericLexicon(FileUtil.getInputStream(wordFile), NORMALIZER, wordCategory, false, true, false, "name=" + name); genericLexicon.setMaxNumWords(0); // disable "word" limit. each char counts as a word with our break strategy. result.add(genericLexicon); } // add each lexicon for (Lexicon lexicon : lexicons) { result.add(lexicon); } // add a lexicon that identifies a single letter as unknown. result.add(new UnknownLexicon(categoryFactory.getCategory(UNDETERMINED_LETTER))); return result.toArray(new Lexicon[result.size()]); //todo: what about conjugations? } public List<WordSequence> getBestSplits(String string) { List<WordSequence> result = new ArrayList<WordSequence>(); final TokenizerWrapper tokenizerWrapper = getTokenizerWrapper(); final Tree<StringWrapper.SubString> tokenTree = tokenizerWrapper.tokenize(string); final List<Tree<StringWrapper.SubString>> leaves = tokenTree.gatherLeaves(); int maxScore = -1; for (Tree<StringWrapper.SubString> leaf : leaves) { final WordSequence wordSequence = new WordSequence(leaf); final int curScore = wordSequence.getScore(); if (curScore >= maxScore) { if (curScore > maxScore) { result.clear(); maxScore = curScore; } result.add(wordSequence); } } if (result.size() > 0) { Collections.sort(result, SEQUENCE_COMPARATOR); } return result; } public List<WordSequence> getBestDomainSplits(String domain) { final int dotPos = domain.indexOf('.'); if (dotPos > 0 && dotPos < domain.length() - 1) { final DetailedUrl dUrl = new DetailedUrl(domain); domain = dUrl.getHost(false, false, false); } return getBestSplits(domain); } public String getSplitsAsString(List<WordSequence> splits) { final StringBuilder result = new StringBuilder(); if (splits != null) { for (Iterator<WordSequence> splitIter = splits.iterator(); splitIter.hasNext(); ) { final WordSequence split = splitIter.next(); result.append(split.toString()); if (splitIter.hasNext()) result.append('|'); } } return result.toString(); } // symbols are hard breaks... letters are soft breaks... consecutive digits aren't (don't break numbers) private static final class MyBreakStrategy implements BreakStrategy { public Break[] computeBreaks(int[] codePoints) { final Break[] result = new Break[codePoints.length]; boolean inNumber = false; for (int i = 0; i < codePoints.length; ++i) { Break curBreak = Break.NONE; final int cp = codePoints[i]; if (Character.isDigit(cp)) { if (i > 0 && !inNumber && result[i - 1] != Break.HARD) { curBreak = Break.SOFT_SPLIT; } else { curBreak = Break.NONE; } inNumber = true; } else if (Character.isLetter(cp)) { // first letter after a hard break (or at start) isn't a break if (i == 0 || result[i - 1] == Break.HARD) { curBreak = Break.NONE; } else { curBreak = Break.SOFT_SPLIT; } inNumber = false; } else { // if following a digit or with-digit-symbol, then consider the number parts as a whole if (inNumber) { curBreak = Break.NONE; } // else if a digit or digit-symbol follows, then consider the number parts as a whole else if (i + 1 < codePoints.length && (Character.isDigit(codePoints[i + 1]) || (i + 2 < codePoints.length && Character.isDigit(codePoints[i + 2])))) { curBreak = Break.NONE; inNumber = true; } else { curBreak = Break.HARD; inNumber = false; } } result[i] = curBreak; } return result; } } private static final class NumberLexicon extends AbstractLexicon { private Category category; public NumberLexicon(Category category) { super(null); this.category = category; } /** * Define applicable categories in the subString. * <p> * In this case, if a digit is found in the subString, then the NUMBER category is added. * * @param subString The substring to define. * @param normalizer The normalizer to use. */ protected void define(StringWrapper.SubString subString, AbstractNormalizer normalizer) { if (!subString.hasDefinitiveDefinition()) { boolean isNumber = true; int lastNumberPos = -1; for (int i = subString.startPos; i < subString.endPos; ++i) { final int cp = subString.stringWrapper.getCodePoint(i); if (cp > '9' || cp < '0') { isNumber = false; break; } lastNumberPos = i; } if (!isNumber) { // check for "text" numbers if (lastNumberPos >= 0 && lastNumberPos == subString.endPos - 3) { // check for number suffix isNumber = TextNumber.isNumberEnding(subString.originalSubString.substring(lastNumberPos + 1).toLowerCase()); } else if (lastNumberPos < 0) { // check for number word isNumber = TextNumber.isNumber(subString.originalSubString.toLowerCase()); } } if (isNumber) { subString.setAttribute("name", NUMBER); subString.addCategory(category); subString.setDefinitive(true); } } } /** * Determine whether the categories container already has category type(s) * that this lexicon would add. * <p> * NOTE: this is used to avoid calling "define" when categories already exist * for the substring. * * @return true if this lexicon's category type(s) are already present. */ protected boolean alreadyHasTypes(Categories categories) { return categories.hasType(category); } } private static final class UnknownLexicon extends AbstractLexicon { private Category category; public UnknownLexicon(Category category) { super(null); this.category = category; } /** * Define applicable categories in the subString. * <p> * In this case, if a digit is found in the subString, then the NUMBER category is added. * * @param subString The substring to define. * @param normalizer The normalizer to use. */ protected void define(StringWrapper.SubString subString, AbstractNormalizer normalizer) { if (!subString.hasDefinitiveDefinition() && subString.length() == 1) { subString.addCategory(category); subString.setAttribute("name", UNDETERMINED_WORD); } } /** * Determine whether the categories container already has category type(s) * that this lexicon would add. * <p> * NOTE: this is used to avoid calling "define" when categories already exist * for the substring. * * @return true if this lexicon's category type(s) are already present. */ protected boolean alreadyHasTypes(Categories categories) { return categories.hasType(category); } } /** * Container class for a word. */ public static final class Word { public final StringWrapper.SubString word; public final String type; private Integer _score; public Word(StringWrapper.SubString word, String type) { this.word = word; this.type = type; this._score = null; } /** * Get this word's score. * <p> * A word's score is its number of defined letters. */ public int getScore() { if (_score == null) { _score = UNDETERMINED_WORD.equals(type) ? 0 : word.length() * word.length(); } return _score; } public String toString() { final StringBuilder result = new StringBuilder(); result.append(type).append('=').append(word.originalSubString); return result.toString(); } } /** * Container for a sequence of words for a string. */ public static final class WordSequence { public final String string; public final List<Word> words; private int score; public WordSequence(Tree<StringWrapper.SubString> leaf) { final LinkedList<Word> theWords = new LinkedList<Word>(); this.words = theWords; this.score = 0; String theString = null; while (leaf != null) { final StringWrapper.SubString subString = leaf.getData(); if (subString == null) break; // hit root. final String nameValue = subString.getAttribute("name"); final Word word = new Word(subString, nameValue == null ? UNDETERMINED_WORD : nameValue); theWords.addFirst(word); score += word.getScore(); if (theString == null) theString = subString.stringWrapper.string; leaf = leaf.getParent(); } this.string = theString; } /** * Get this sequence's score. * <p> * The score is the total number of defined letters in the sequence's words. */ public int getScore() { return score; } public int size() { return words.size(); } public String toString() { return asString(","); } public String asString(String delim) { final StringBuilder result = new StringBuilder(); for (Iterator<Word> wordIter = words.iterator(); wordIter.hasNext(); ) { final Word word = wordIter.next(); result.append(word.toString()); if (wordIter.hasNext()) result.append(delim); } // result.append('(').append(getScore()).append(')'); return result.toString(); } } //java -Xmx640m org.sd.nlp.MungedWordFinder wordSet="foo,bar,baz" wordSetName="fbb" foobarbaz "foo-bar-baz" "foobArbaz" gesundheit public static final void main(String[] args) throws IOException { // properties: // wordFiles="file1,file2,..." // wordSet="word1,word2,..." // wordSetName="name" // non-property arguments are munged strings to split. // STDIN has other munged strings or domains to split. final PropertiesParser propertiesParser = new PropertiesParser(args); final Properties properties = propertiesParser.getProperties(); final String wordFileNames = properties.getProperty("wordFiles"); final String wordSet = properties.getProperty("wordSet"); final String wordSetName = properties.getProperty("wordSetName"); final MungedWordFinder mungedWordFinder = new MungedWordFinder(); if (wordFileNames != null) { for (String wordFile : wordFileNames.split("\\s*,\\s*")) { final File file = new File(wordFile); mungedWordFinder.addWordFile(file.getName().split("\\.")[0], file); } } if (wordSet != null) { mungedWordFinder.addWordSet(wordSetName, wordSet.split("\\s*,\\s*")); } final String[] mungedWords = propertiesParser.getArgs(); for (String mungedWord : mungedWords) { final List<WordSequence> splits = mungedWordFinder.getBestDomainSplits(mungedWord); final String splitsString = mungedWordFinder.getSplitsAsString(splits); System.out.println(mungedWord + "|" + splitsString); } final BufferedReader reader = FileUtil.getReader(System.in); String line = null; while ((line = reader.readLine()) != null) { final List<WordSequence> splits = mungedWordFinder.getBestDomainSplits(line); final String splitsString = mungedWordFinder.getSplitsAsString(splits); System.out.println(line + "|" + splitsString); } reader.close(); } }
jtsay362/semanticdiscoverytoolkit-text
src/main/java/org/sd/text/MungedWordFinder.java
Java
lgpl-3.0
17,721
/******************************************************************************* * Copyright (c) 2015 Open Software Solutions GmbH. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.html * * Contributors: * Open Software Solutions GmbH ******************************************************************************/ package org.oss.pdfreporter.sql.factory; import java.io.InputStream; import java.util.Date; import org.oss.pdfreporter.sql.IBlob; import org.oss.pdfreporter.sql.IConnection; import org.oss.pdfreporter.sql.IDate; import org.oss.pdfreporter.sql.IDateTime; import org.oss.pdfreporter.sql.ITime; import org.oss.pdfreporter.sql.ITimestamp; import org.oss.pdfreporter.sql.SQLException; /** * Sql connectivity factory. * The interface supports queries with prepared statements. * No DDL or modifying operations are supported, neither transactions or cursors. * @author donatmuller, 2013, last change 5:39:58 PM */ public interface ISqlFactory { /** * Returns a connection for the connection parameter. * It is up to the implementor to define the syntax of the connection parameter.<br> * The parameter could include a driver class name or just an url and assume that a driver * was already loaded. * @param url * @param user * @param password * @return */ IConnection newConnection(String url, String user, String password) throws SQLException; /** * used by dynamic loading of specific database driver and JDBC-URL, when the implementation don't know about the specific driver-implementation. * @param jdbcUrl * @param user * @param password * @return * @throws SQLException */ IConnection createConnection(String jdbcUrl, String user, String password) throws SQLException; /** * Creates a Date. * @param date * @return */ IDate newDate(Date date); /** * Creates a Time. * @param time * @return */ ITime newTime(Date time); /** * Creates a Timestamp. * @param timestamp * @return */ ITimestamp newTimestamp(long milliseconds); /** * Creates a DateTime. * @param datetime * @return */ IDateTime newDateTime(Date datetime); /** * Creates a Blob. * @param is * @return */ IBlob newBlob(InputStream is); /** * Creates a Blob. * @param bytes * @return */ IBlob newBlob(byte[] bytes); }
OpenSoftwareSolutions/PDFReporter
pdfreporter-core/src/org/oss/pdfreporter/sql/factory/ISqlFactory.java
Java
lgpl-3.0
2,507
/* * Copyright (C) 2005-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.repo.admin.registry; import java.io.Serializable; import java.util.Collection; /** * Interface for service providing access to key-value pairs for storage * of system-controlled metadata. * * @author Derek Hulley */ public interface RegistryService { /** * Assign a value to the registry key, which must be of the form <b>/a/b/c</b>. * * @param key the registry key. * @param value any value that can be stored in the repository. */ void addProperty(RegistryKey key, Serializable value); /** * @param key the registry key. * @return Returns the value stored in the key or <tt>null</tt> if * no value exists at the path and name provided * * @see #addProperty(String, Serializable) */ Serializable getProperty(RegistryKey key); /** * Fetches all child elements for the given path. The key's property should be * <tt>null</tt> as it is completely ignored. * <code><pre> * ... * registryService.addValue(KEY_A_B_C_1, VALUE_ONE); * registryService.addValue(KEY_A_B_C_2, VALUE_TWO); * ... * assertTrue(registryService.getChildElements(KEY_A_B_null).contains("C")); * ... * </pre></code> * * @param key the registry key with the path. The last element in the path * will be ignored, and can be any acceptable value localname or <tt>null</tt>. * @return Returns all child elements (not values) for the given key, ignoring * the last element in the key. * * @see RegistryKey#getPath() */ Collection<String> getChildElements(RegistryKey key); /** * Copies the path or value from the source to the target location. The source and target * keys <b>must</b> be both either path-specific or property-specific. If the source doesn't * exist, then nothing will be done; there is no guarantee that the target will exist after * the call. * <p> * This is essentially a merge operation. Use {@link #delete(RegistryKey) delete} first * if the target must be cleaned. * * @param sourceKey the source registry key to take values from * @param targetKey the target registyr key to move the path or value to */ void copy(RegistryKey sourceKey, RegistryKey targetKey); /** * Delete the path element or value described by the key. If the key points to nothing, * then nothing is done. * <code>delete(/a/b/c)</code> will remove value <b>c</b> from path <b>/a/b</b>.<br/> * <code>delete(/a/b/null)</code> will remove node <b>/a/b</b> along with all values and child * elements. * * @param key the path or value to delete */ void delete(RegistryKey key); }
loftuxab/community-edition-old
projects/repository/source/java/org/alfresco/repo/admin/registry/RegistryService.java
Java
lgpl-3.0
3,781
import java.util.*; import Jakarta.util.FixDosOutputStream; import java.io.*; //------------------------ j2jBase layer ------------------- //------ mixin-layer for dealing with Overrides and New Modifier //------ offhand, I wonder why we can't let j2j map these modifiers //------ to nothing, instead of letting PJ do some of this mapping // it would make more sense for PJ and Mixin to have similar // output. public class ModOverrides { public void reduce2java( AstProperties props ) { // Step 1: the overrides modifier should not be present, UNLESS // there is a SoUrCe property. It's an error otherwise. if ( props.getProperty( "SoUrCe" ) == null ) { AstNode.error( tok[0], "overrides modifier should not be present" ); return; } // Step 2: it's OK to be present. If so, the reduction is to // print the white-space in front for pretty-printing props.print( getComment() ); } }
SergiyKolesnikov/fuji
examples/AHEAD/j2jBase/ModOverrides.java
Java
lgpl-3.0
1,048
/* * Copyright (C) 2003-2014 eXo Platform SAS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.exoplatform.social.core.storage.proxy; import java.lang.reflect.Proxy; import org.exoplatform.social.core.activity.model.ExoSocialActivity; /** * Created by The eXo Platform SAS * Author : eXoPlatform * exo@exoplatform.com * Apr 28, 2014 */ public class ActivityProxyBuilder { @SuppressWarnings("unchecked") static <T> T of(ProxyInvocation invocation) { Class<?> targetClass = invocation.getTargetClass(); //1. loader - the class loader to define the proxy class //2. the list of interfaces for the proxy class to implement //3. the invocation handler to dispatch method invocations to return (T) Proxy.newProxyInstance(targetClass.getClassLoader(), new Class<?>[]{targetClass}, invocation); } public static <T> T of(Class<T> aClass, ExoSocialActivity activity) { return of(new ProxyInvocation(aClass, activity)); } }
thanhvc/poc-sam
services/src/main/java/org/exoplatform/social/core/storage/proxy/ActivityProxyBuilder.java
Java
lgpl-3.0
1,655
/* * XAdES4j - A Java library for generation and verification of XAdES signatures. * Copyright (C) 2010 Luis Goncalves. * * XAdES4j is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or any later version. * * XAdES4j is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License along * with XAdES4j. If not, see <http://www.gnu.org/licenses/>. */ package xades4j.xml.unmarshalling; import xades4j.algorithms.Algorithm; import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.data.SignatureTimeStampData; import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; /** * * @author Luís */ class FromXmlSignatureTimeStampConverter extends FromXmlBaseTimeStampConverter<SignatureTimeStampData> implements UnsignedSigPropFromXmlConv { FromXmlSignatureTimeStampConverter() { super(SignatureTimeStampProperty.PROP_NAME); } @Override public void convertFromObjectTree( XmlUnsignedSignaturePropertiesType xmlProps, QualifyingPropertiesDataCollector propertyDataCollector) throws PropertyUnmarshalException { super.convertTimeStamps(xmlProps.getSignatureTimeStamp(), propertyDataCollector); } @Override protected SignatureTimeStampData createTSData(Algorithm c14n) { return new SignatureTimeStampData(c14n); } @Override protected void setTSData( SignatureTimeStampData tsData, QualifyingPropertiesDataCollector propertyDataCollector) { propertyDataCollector.addSignatureTimeStamp(tsData); } }
entaksi/xades4j
src/main/java/xades4j/xml/unmarshalling/FromXmlSignatureTimeStampConverter.java
Java
lgpl-3.0
1,991