repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
el-groucho/jsRules
src/test/java/org/grouchotools/jsrules/loader/ResponseLoaderTest.java
// Path: src/main/java/org/grouchotools/jsrules/config/ResponseConfig.java // public class ResponseConfig extends JsonBean implements Config { // private String response; // private String responseClass; // // public ResponseConfig() { // // } // // public ResponseConfig(String response, String r...
import org.grouchotools.jsrules.config.ResponseConfig; import org.grouchotools.jsrules.exception.InvalidConfigException; import org.grouchotools.jsrules.loader.impl.ResponseLoaderImpl; import org.junit.*; import org.junit.rules.ExpectedException; import static org.junit.Assert.assertEquals;
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/config/ResponseConfig.java // public class ResponseConfig extends JsonBean implements Config { // private String response; // private String responseClass; // // public ResponseConfig() { // // } // // public ResponseConfig(String response, String r...
exception.expect(InvalidConfigException.class);
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/FirstTrueRulesetExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.RuleExecutor; import org.grouchotools.jsrules.RulesetExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import java.util.List; import java.util.Map;
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
public T execute(Map<String, Object> parameters) throws InvalidParameterException {
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/FirstTrueRulesetExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.RuleExecutor; import org.grouchotools.jsrules.RulesetExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import java.util.List; import java.util.Map;
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
Parameter left = rule.getLeftParameter();
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/FirstTrueRulesetListExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/RulesetExecutor.java // public abstract class RulesetExecutor<T> extends Executor { // public abstract T execute(Map<String, Object> parameters) throws InvalidParameterException; // // public abstract String getName(); // } // // Path: src/main/java/org/gro...
import org.grouchotools.jsrules.RulesetExecutor; import org.grouchotools.jsrules.RulesetListExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import java.util.List; import java.util.Map;
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/RulesetExecutor.java // public abstract class RulesetExecutor<T> extends Executor { // public abstract T execute(Map<String, Object> parameters) throws InvalidParameterException; // // public abstract String getName(); // } // // Path: src/main/java/org/gro...
public T execute(Map<String, Object> parameters) throws InvalidParameterException {
el-groucho/jsRules
src/test/java/org/grouchotools/jsrules/loader/ParamLoaderTest.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import static org.junit.Assert.assertEquals; import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.config.ParamConfig; import org.grouchotools.jsrules.exception.InvalidConfigException; import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl; import org.junit.*; import org.junit.rules.ExpectedEx...
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
private final ParamLoader paramLoader = new ParamLoaderImpl();
el-groucho/jsRules
src/test/java/org/grouchotools/jsrules/loader/ParamLoaderTest.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import static org.junit.Assert.assertEquals; import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.config.ParamConfig; import org.grouchotools.jsrules.exception.InvalidConfigException; import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl; import org.junit.*; import org.junit.rules.ExpectedEx...
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
ParamConfig paramConfig = new ParamConfig(paramName, "long", "10");
el-groucho/jsRules
src/test/java/org/grouchotools/jsrules/loader/ParamLoaderTest.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import static org.junit.Assert.assertEquals; import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.config.ParamConfig; import org.grouchotools.jsrules.exception.InvalidConfigException; import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl; import org.junit.*; import org.junit.rules.ExpectedEx...
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
Parameter mockParam = new Parameter(paramName, Long.class, 10l);
el-groucho/jsRules
src/test/java/org/grouchotools/jsrules/loader/ParamLoaderTest.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import static org.junit.Assert.assertEquals; import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.config.ParamConfig; import org.grouchotools.jsrules.exception.InvalidConfigException; import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl; import org.junit.*; import org.junit.rules.ExpectedEx...
/* * The MIT License * * Copyright 2015 Paul. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, me...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
exception.expect(InvalidConfigException.class);
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/Operator.java
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidParameterException.java // public class InvalidParameterException extends JsRulesException { // // public InvalidParameterException() { // } // // public InvalidParameterException(String message) { // super(message); // } // // ...
import org.grouchotools.jsrules.exception.InvalidParameterException; import org.joda.time.DateTime; import java.util.ArrayList; import java.util.List; import java.util.Set;
/* * 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.grouchotools.jsrules; /** * @author Paul */ public enum Operator { GT { @Override
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidParameterException.java // public class InvalidParameterException extends JsRulesException { // // public InvalidParameterException() { // } // // public InvalidParameterException(String message) { // super(message); // } // // ...
public Boolean compare(Object left, Object right) throws InvalidParameterException {
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/RuleExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.Rule; import org.grouchotools.jsrules.RuleExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
/* * 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.grouchotools.jsrules.impl; /** * * @author Paul * @param <T> * @param <P> */ public class RuleExecutorImpl<T, P> ext...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
private final Rule<T, P> rule;
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/RuleExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.Rule; import org.grouchotools.jsrules.RuleExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
/* * 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.grouchotools.jsrules.impl; /** * * @author Paul * @param <T> * @param <P> */ public class RuleExecutorImpl<T, P> ext...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
public T execute(Object leftParameter, Object rightParameter) throws InvalidParameterException {
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/impl/RuleExecutorImpl.java
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
import org.grouchotools.jsrules.Parameter; import org.grouchotools.jsrules.Rule; import org.grouchotools.jsrules.RuleExecutor; import org.grouchotools.jsrules.exception.InvalidParameterException; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
/* * 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.grouchotools.jsrules.impl; /** * * @author Paul * @param <T> * @param <P> */ public class RuleExecutorImpl<T, P> ext...
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java // public class Parameter<T> extends JsonBean { // public Parameter(String name, Class<T> klasse) { // this.name = name; // this.klasse = klasse; // this.staticValue = null; // } // // public Parameter(String name, Class...
public Parameter getLeftParameter() {
ceylon/ceylon-js
src/main/java/com/redhat/ceylon/compiler/js/util/Options.java
// Path: src/main/java/com/redhat/ceylon/compiler/js/DiagnosticListener.java // public interface DiagnosticListener { // void error(File file, long line, long column, String message); // void warning(File file, long line, long column, String message); // // // FIXME: special API for default module? Else sp...
import java.io.File; import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; import java.util.Iterator; import java.util.List; import com.redhat.ceylon.common.config.DefaultToolOptions; import com.redhat.ceylon.common.log.Logger; import com.redhat.ceylon.compiler.js.Diagnos...
package com.redhat.ceylon.compiler.js.util; /** Represents all the options for compiling. * * @author Enrique Zamudio */ public class Options { private File cwd; private List<String> repos = new ArrayList<String>(); private String systemRepo; private String user; private String pass; pri...
// Path: src/main/java/com/redhat/ceylon/compiler/js/DiagnosticListener.java // public interface DiagnosticListener { // void error(File file, long line, long column, String message); // void warning(File file, long line, long column, String message); // // // FIXME: special API for default module? Else sp...
private DiagnosticListener diagnosticListener;
ceylon/ceylon-js
src/main/java/com/redhat/ceylon/compiler/js/util/ContinueBreakVisitor.java
// Path: src/main/java/com/redhat/ceylon/compiler/js/BlockWithCaptureVisitor.java // public class BlockWithCaptureVisitor extends Visitor { // // private boolean hasCapture; // private final Scope scope; // // public BlockWithCaptureVisitor(Tree.Block block) { // scope = ModelUtil.getRealScope(blo...
import java.util.IdentityHashMap; import com.redhat.ceylon.compiler.js.BlockWithCaptureVisitor; import com.redhat.ceylon.compiler.typechecker.tree.Tree; import com.redhat.ceylon.compiler.typechecker.tree.Visitor; import com.redhat.ceylon.model.typechecker.model.Scope;
package com.redhat.ceylon.compiler.js.util; public class ContinueBreakVisitor extends Visitor { private boolean breaks; private boolean continues; private boolean returns; private final Scope scope; private final JsIdentifierNames names; private String bname; private String cname; pr...
// Path: src/main/java/com/redhat/ceylon/compiler/js/BlockWithCaptureVisitor.java // public class BlockWithCaptureVisitor extends Visitor { // // private boolean hasCapture; // private final Scope scope; // // public BlockWithCaptureVisitor(Tree.Block block) { // scope = ModelUtil.getRealScope(blo...
ignore=new BlockWithCaptureVisitor(that).hasCapture();
ceylon/ceylon-js
src/main/java/com/redhat/ceylon/compiler/js/loader/JsModuleSourceMapper.java
// Path: src/main/java/com/redhat/ceylon/compiler/js/CeylonRunJsException.java // public class CeylonRunJsException extends ToolError { // // private static final long serialVersionUID = 1L; // // public CeylonRunJsException(String message) { // super(message); // } // // public CeylonRunJsEx...
import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.List; import java.util.Map; import com.redhat.ceylon.cmr.api.ArtifactContext; import com.redhat.ceylon.cmr.impl.JSUtils; import com.redhat.ceylon.common.Backends; import com.redhat.ceylon.common.config.CeylonConfig; import co...
package com.redhat.ceylon.compiler.js.loader; public class JsModuleSourceMapper extends ModuleSourceMapper { /** Tells whether the language module has been loaded yet. */ private boolean clLoaded; private String encoding; public JsModuleSourceMapper(Context context, ModuleManager moduleManager, Str...
// Path: src/main/java/com/redhat/ceylon/compiler/js/CeylonRunJsException.java // public class CeylonRunJsException extends ToolError { // // private static final long serialVersionUID = 1L; // // public CeylonRunJsException(String message) { // super(message); // } // // public CeylonRunJsEx...
throw new CompilerErrorException("Can't find metamodel definition in " + jsFile.getAbsolutePath());
ceylon/ceylon-js
src/main/java/com/redhat/ceylon/compiler/js/loader/JsModuleSourceMapper.java
// Path: src/main/java/com/redhat/ceylon/compiler/js/CeylonRunJsException.java // public class CeylonRunJsException extends ToolError { // // private static final long serialVersionUID = 1L; // // public CeylonRunJsException(String message) { // super(message); // } // // public CeylonRunJsEx...
import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.List; import java.util.Map; import com.redhat.ceylon.cmr.api.ArtifactContext; import com.redhat.ceylon.cmr.impl.JSUtils; import com.redhat.ceylon.common.Backends; import com.redhat.ceylon.common.config.CeylonConfig; import co...
package com.redhat.ceylon.compiler.js.loader; public class JsModuleSourceMapper extends ModuleSourceMapper { /** Tells whether the language module has been loaded yet. */ private boolean clLoaded; private String encoding; public JsModuleSourceMapper(Context context, ModuleManager moduleManager, Str...
// Path: src/main/java/com/redhat/ceylon/compiler/js/CeylonRunJsException.java // public class CeylonRunJsException extends ToolError { // // private static final long serialVersionUID = 1L; // // public CeylonRunJsException(String message) { // super(message); // } // // public CeylonRunJsEx...
throw new CeylonRunJsException("The JavaScript module " + jsFile +
ceylon/ceylon-js
src/main/java/com/redhat/ceylon/compiler/js/loader/JsonPackage.java
// Path: src/main/java/com/redhat/ceylon/compiler/js/CompilerErrorException.java // public class CompilerErrorException extends ToolError { // // private static final long serialVersionUID = 5L; // // public CompilerErrorException(String message) { // super(message); // } // }
import static com.redhat.ceylon.model.typechecker.model.ModelUtil.getSignature; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import com.redhat.ceylon.common.B...
for (TypeParameter typeParam : typeParams) { if (typeParam.getName().equals(tname)) { td = typeParam; } } } } else { String mname = (String)m.get(MetamodelGener...
// Path: src/main/java/com/redhat/ceylon/compiler/js/CompilerErrorException.java // public class CompilerErrorException extends ToolError { // // private static final long serialVersionUID = 5L; // // public CompilerErrorException(String message) { // super(message); // } // } // Path: src/main/...
throw new CompilerErrorException("Package not found: " + pname);
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/DefaultsAndInheritanceVisitor.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import java.util.List; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2016 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public boolean containerBegin(ContainerNode<? extends Node> node) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/DefaultsAndInheritanceVisitor.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import java.util.List; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2016 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public boolean containerBegin(ContainerNode<? extends Node> node) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/DefaultsAndInheritanceVisitor.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import java.util.List; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2016 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public boolean listBegin(ListNode<? extends Node> node) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/DefaultsAndInheritanceVisitor.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import java.util.List; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2016 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public void scalar(ScalarNode<Object> node) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/impl/DefaultScalarNode.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/Node.java // public interface Node { // /** // * Apply the defaults or apply some kind of inheritance in case the values of some attributes were not set // * explicitly. See also {@link DefaultsAndInheritanceVisitor}. // * // * @pa...
import java.util.ArrayList; import java.util.List; import java.util.Stack; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.util.Equals;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/Node.java // public interface Node { // /** // * Apply the defaults or apply some kind of inheritance in case the values of some attributes were not set // * explicitly. See also {@link DefaultsAndInheritanceVisitor}. // * // * @pa...
private final Equals<T> equals;
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/impl/DefaultScalarNode.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/Node.java // public interface Node { // /** // * Apply the defaults or apply some kind of inheritance in case the values of some attributes were not set // * explicitly. See also {@link DefaultsAndInheritanceVisitor}. // * // * @pa...
import java.util.ArrayList; import java.util.List; import java.util.Stack; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.util.Equals;
private final List<String> commentBefore = new ArrayList<>(); private T defaultValue; private final String name; private final Class<T> type; private T value; private final Equals<T> equals; public DefaultScalarNode(String name, Class<T> type) { this(name, null, type); } @S...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/Node.java // public interface Node { // /** // * Apply the defaults or apply some kind of inheritance in case the values of some attributes were not set // * explicitly. See also {@link DefaultsAndInheritanceVisitor}. // * // * @pa...
public void applyDefaultsAndInheritance(Stack<Node> configurationStack) {
srcdeps/srcdeps-core
srcdeps-core/src/test/java/org/srcdeps/core/BuildRequestTest.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildRequest.java // public enum Verbosity { // debug, error, info, trace, warn; // // public static Verbosity fastValueOf(String level) { // SrcdepsCoreUtils.assertArgNotNull(level, "Verbosity name"); // switch (level.toLowerCase(Locale.ROOT...
import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.junit.Assert; import org...
/** * Copyright 2015-2019 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildRequest.java // public enum Verbosity { // debug, error, info, trace, warn; // // public static Verbosity fastValueOf(String level) { // SrcdepsCoreUtils.assertArgNotNull(level, "Verbosity name"); // switch (level.toLowerCase(Locale.ROOT...
Collections.singleton(Ga.of("org:a")), false, 50000, Verbosity.error);
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/AbstractVisitor.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import java.util.Stack; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public boolean containerBegin(ContainerNode<? extends Node> node) {
srcdeps/srcdeps-core
srcdeps-core/src/test/java/org/srcdeps/core/config/scalar/CharStreamSourceTest.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/scalar/CharStreamSource.java // public enum Scheme { // classpath { // @Override // public Reader openReader(String resource, Charset encoding, Path resolveAgainst) { // return new InputStreamReader(getClass().getResourceAsStrea...
import org.junit.Assert; import org.junit.Test; import org.srcdeps.core.config.scalar.CharStreamSource.Scheme;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/scalar/CharStreamSource.java // public enum Scheme { // classpath { // @Override // public Reader openReader(String resource, Charset encoding, Path resolveAgainst) { // return new InputStreamReader(getClass().getResourceAsStrea...
Assert.assertEquals(new CharStreamSource(Scheme.classpath, "/my/path"),
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/TreeWalker.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public void walk(Node node, Visitor visitor) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/TreeWalker.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
public void walk(Node node, Visitor visitor) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/TreeWalker.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
if (node instanceof ScalarNode) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/tree/walk/TreeWalker.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.srcdeps.core.config.tree.ContainerNode; import org.srcdeps.core.config.tree.ListNode; import org.srcdeps.core.config.tree.Node; import org.srcdeps.core.config.tree.ScalarNode; import org.srcdeps.core.config.tree.Visitor;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/config/tree/ContainerNode.java // public interface ContainerNode<C extends Node> extends Node { // /** // * @return a map of child nodes // */ // Map<String, C> getChildren(); // // } // // Path: srcdeps-core/src/main/java/org/srcdeps/core/config/...
} else if (node instanceof ListNode) {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/GavSetWalker.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/util/BitStack.java // public class BitStack { // private final BitSet bits = new BitSet(); // private int size = 0; // // /** // * Pushes an item onto the top of this stack. // * // * @param item the item to push // * @return the {@co...
import java.util.TreeMap; import org.srcdeps.core.util.BitStack; import org.srcdeps.core.util.Consumer; import java.io.File; import java.io.IOException; import java.nio.file.FileVisitResult; import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java....
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/util/BitStack.java // public class BitStack { // private final BitSet bits = new BitSet(); // private int size = 0; // // /** // * Pushes an item onto the top of this stack. // * // * @param item the item to push // * @return the {@co...
private final BitStack dirCanContainArtifacts = new BitStack();
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/shell/Shell.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildException.java // public class BuildException extends Exception { // private static final long serialVersionUID = 1520625837859688798L; // // public BuildException(String message) { // super(message); // } // // public BuildException(St...
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org...
} public void cancel() { this.cancelled = true; } @Override public void run() { try (BufferedReader r = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) { String line; while (!cancelled && (line = r.r...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildException.java // public class BuildException extends Exception { // private static final long serialVersionUID = 1520625837859688798L; // // public BuildException(String message) { // super(message); // } // // public BuildException(St...
public static CommandResult execute(ShellCommand command) throws BuildException, CommandTimeoutException {
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/config/scalar/Scalars.java
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildRequest.java // public enum Verbosity { // debug, error, info, trace, warn; // // public static Verbosity fastValueOf(String level) { // SrcdepsCoreUtils.assertArgNotNull(level, "Verbosity name"); // switch (level.toLowerCase(Locale.ROOT...
import java.lang.reflect.Type; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.srcdeps.core.BuildRequest.Verbosity; import org.srcdeps.core.config.tree.ScalarDeserializer;
/** * Copyright 2015-2018 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
// Path: srcdeps-core/src/main/java/org/srcdeps/core/BuildRequest.java // public enum Verbosity { // debug, error, info, trace, warn; // // public static Verbosity fastValueOf(String level) { // SrcdepsCoreUtils.assertArgNotNull(level, "Verbosity name"); // switch (level.toLowerCase(Locale.ROOT...
primitives.put(Verbosity.class, new ScalarDeserializer() {
LapisBlue/Commons
src/test/java/blue/lapis/common/command/ParsingTest.java
// Path: src/main/java/blue/lapis/common/command/impl/Parsing.java // public class Parsing { // // public static String toLowerCase(String s) { // return s.toLowerCase(Locale.ENGLISH); // } // // public static boolean startsWithIgnoreCase(String s, String start) { // return s.regionMatches...
import com.google.common.collect.ImmutableList; import org.junit.Test; import java.util.List; import java.util.regex.Pattern; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import blue.lapis.common.command.impl.Parsing; import com.goog...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/impl/Parsing.java // public class Parsing { // // public static String toLowerCase(String s) { // return s.toLowerCase(Locale.ENGLISH); // } // // public static boolean startsWithIgnoreCase(String s, String start) { // return s.regionMatches...
assertEquals(Parsing.toLowerCase("lApIsCoMmOnS"), "lapiscommons");
LapisBlue/Commons
src/main/java/blue/lapis/common/permission/Group.java
// Path: src/main/java/blue/lapis/common/permission/impl/StandardGroup.java // public class StandardGroup implements Group { // // private String id = "untitled"; // // IndexedSet<Group> immediateSupers; // IndexedSet<Group> immediateSubsets; // IndexedSet<Group> cache; // // public StandardGroup...
import blue.lapis.common.permission.impl.StandardGroup; import com.google.common.collect.ImmutableSet;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/permission/impl/StandardGroup.java // public class StandardGroup implements Group { // // private String id = "untitled"; // // IndexedSet<Group> immediateSupers; // IndexedSet<Group> immediateSubsets; // IndexedSet<Group> cache; // // public StandardGroup...
public static final Group ALL_GROUPS = new StandardGroup("root");
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/PlayerTokenParser.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import java.util.Collection; import java.util.List; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import com.google.common.collect.Lists; import org.spongepowered.api.entity.player.Player; import org.spongep...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
Collection<Player> players = LapisCommonsPlugin.getGame().getServer().getOnlinePlayers();
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/PlayerTokenParser.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import java.util.Collection; import java.util.List; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import com.google.common.collect.Lists; import org.spongepowered.api.entity.player.Player; import org.spongep...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
throw new InvalidTokenException(token, Player.class);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/IntegerTokenParser.java
// Path: src/main/java/blue/lapis/common/command/token/InvalidTokenException.java // public class InvalidTokenException extends RuntimeException { // // private String token; // private Class<?> expectedType; // // public InvalidTokenException(String token, Class<?> expectedType) { // this.token =...
import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import com.google.common.collect.ImmutableList; import org.spongepowered.api.util.command.CommandSource; import java.util.List;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/token/InvalidTokenException.java // public class InvalidTokenException extends RuntimeException { // // private String token; // private Class<?> expectedType; // // public InvalidTokenException(String token, Class<?> expectedType) { // this.token =...
throw new InvalidTokenException(token, Integer.class);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/token/TokenParserRegistry.java
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.annotation.Nullable; import blue.lapis.common.command.impl.BooleanTokenParser; import blue.lapis.common.command.impl.IntegerTokenParser; import blue.lapis.common.command.impl.PlayerTokenParser; import com.google.common.collect.Maps; import org.spong...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
register(Player.class, new PlayerTokenParser());
LapisBlue/Commons
src/main/java/blue/lapis/common/command/token/TokenParserRegistry.java
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.annotation.Nullable; import blue.lapis.common.command.impl.BooleanTokenParser; import blue.lapis.common.command.impl.IntegerTokenParser; import blue.lapis.common.command.impl.PlayerTokenParser; import com.google.common.collect.Maps; import org.spong...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
register(Integer.class, new IntegerTokenParser());
LapisBlue/Commons
src/main/java/blue/lapis/common/command/token/TokenParserRegistry.java
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.annotation.Nullable; import blue.lapis.common.command.impl.BooleanTokenParser; import blue.lapis.common.command.impl.IntegerTokenParser; import blue.lapis.common.command.impl.PlayerTokenParser; import com.google.common.collect.Maps; import org.spong...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java // public class BooleanTokenParser implements TokenParser<Boolean> { // private static final ImmutableList<String> TRUE = ImmutableList.of("1", "true", "yes", "on"); // private static final ImmutableList<String> FALSE = ImmutableList....
register(Boolean.class, new BooleanTokenParser());
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/BooleanTokenParser.java
// Path: src/main/java/blue/lapis/common/command/token/InvalidTokenException.java // public class InvalidTokenException extends RuntimeException { // // private String token; // private Class<?> expectedType; // // public InvalidTokenException(String token, Class<?> expectedType) { // this.token =...
import java.util.List; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import org.spongepowered.api.util.command.CommandSource; import java.util.ArrayList;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/token/InvalidTokenException.java // public class InvalidTokenException extends RuntimeException { // // private String token; // private Class<?> expectedType; // // public InvalidTokenException(String token, Class<?> expectedType) { // this.token =...
throw new InvalidTokenException(token, Boolean.class);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/StandardCommandRecognizer.java
// Path: src/main/java/blue/lapis/common/command/CommandRecognizer.java // public interface CommandRecognizer { // boolean recognize(final CommandSource source, // final String inputLine, // final LapisCommand command); // } // // Path: src/main/java/blue/lapis/common/co...
import blue.lapis.common.command.CommandRecognizer; import blue.lapis.common.command.LapisCommand; import org.spongepowered.api.util.command.CommandSource;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/CommandRecognizer.java // public interface CommandRecognizer { // boolean recognize(final CommandSource source, // final String inputLine, // final LapisCommand command); // } // // Path: src/main/java/blue/lapis/common/co...
final LapisCommand command) {
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/Economy.java
// Path: src/main/java/blue/lapis/common/economy/formatter/BalanceFormatterRegistry.java // public final class BalanceFormatterRegistry { // // private static final ReentrantReadWriteLock mutex = new ReentrantReadWriteLock(); // private static final Map<String, BalanceFormatter> registrations = Maps.newHashMap...
import blue.lapis.common.economy.formatter.BalanceFormatterRegistry; import java.util.List; import javax.annotation.Nullable;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/economy/formatter/BalanceFormatterRegistry.java // public final class BalanceFormatterRegistry { // // private static final ReentrantReadWriteLock mutex = new ReentrantReadWriteLock(); // private static final Map<String, BalanceFormatter> registrations = Maps.newHashMap...
return BalanceFormatterRegistry.get(prefix).format(amount);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/CommandContextImpl.java
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
import org.spongepowered.api.util.command.CommandSource; import java.util.List; import javax.annotation.Nullable; import blue.lapis.common.command.CommandContext; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.Toke...
@Override public S getSource() { return source; } @Override public String getLine() { return line; } @Override public ImmutableList<String> getTokens() { return tokens; } @Override @Nullable @SuppressWarnings("unchecked") public <T> T get(C...
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
TokenParser<T> parser = TokenParserRegistry.get(clazz);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/CommandContextImpl.java
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
import org.spongepowered.api.util.command.CommandSource; import java.util.List; import javax.annotation.Nullable; import blue.lapis.common.command.CommandContext; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.Toke...
@Override public S getSource() { return source; } @Override public String getLine() { return line; } @Override public ImmutableList<String> getTokens() { return tokens; } @Override @Nullable @SuppressWarnings("unchecked") public <T> T get(C...
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
TokenParser<T> parser = TokenParserRegistry.get(clazz);
LapisBlue/Commons
src/main/java/blue/lapis/common/command/impl/CommandContextImpl.java
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
import org.spongepowered.api.util.command.CommandSource; import java.util.List; import javax.annotation.Nullable; import blue.lapis.common.command.CommandContext; import blue.lapis.common.command.token.InvalidTokenException; import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.Toke...
@Nullable @SuppressWarnings("unchecked") public <T> T get(Class<T> clazz, int argNum) { Preconditions.checkState(args.size() == tokens.size()); //invariant Preconditions.checkArgument(argNum >= 0); //Requesting past the end of args is still valid if (args.size() <= argNum) r...
// Path: src/main/java/blue/lapis/common/command/CommandContext.java // public interface CommandContext<S extends CommandSource> { // // /** // * @return the CommandSource which this command was issued from // */ // S getSource(); // // /** // * @return the entire line of text entered, exce...
throw new InvalidTokenException(args.get(argNum).getClass().getSimpleName(), clazz);
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/EconomyAccount.java
// Path: src/main/java/blue/lapis/common/economy/formatter/BalanceFormatter.java // public interface BalanceFormatter { // // /** // * Converts a machine-readable currency into a human-readable String which expresses its quantity and units // * // * @param amount The amount of currency to render // ...
import blue.lapis.common.economy.formatter.BalanceFormatter;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/economy/formatter/BalanceFormatter.java // public interface BalanceFormatter { // // /** // * Converts a machine-readable currency into a human-readable String which expresses its quantity and units // * // * @param amount The amount of currency to render // ...
BalanceFormatter getFormatter();
LapisBlue/Commons
src/test/java/blue/lapis/common/command/TokenizerTest.java
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
import java.util.List; import static org.junit.Assert.assertEquals; import blue.lapis.common.CommonsTests; import blue.lapis.common.command.impl.StandardTokenizer; import com.google.common.collect.ImmutableList; import org.junit.Before; import org.junit.Test;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
CommonsTests.mockPlugin();
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/Transaction.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import javax.annotation.Nullable; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.economy.event.TransactionEvent; import blue.lapis.common.economy.event.TransactionException; import blue.lapis.common.economy.event.impl.TransactionEventImpl; import com.google.common.base.Preconditions; import com.g...
* @param amount The amount to reduce the account balance by * @return This object for further modification */ public Transaction subtract(double amount) { delta -= amount; return this; } /** * Express a constant balance that the account should be changed to * *...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
TransactionEvent event = new TransactionEventImpl(this);
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/Transaction.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import javax.annotation.Nullable; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.economy.event.TransactionEvent; import blue.lapis.common.economy.event.TransactionException; import blue.lapis.common.economy.event.impl.TransactionEventImpl; import com.google.common.base.Preconditions; import com.g...
* @param amount The amount to reduce the account balance by * @return This object for further modification */ public Transaction subtract(double amount) { delta -= amount; return this; } /** * Express a constant balance that the account should be changed to * *...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
TransactionEvent event = new TransactionEventImpl(this);
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/Transaction.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import javax.annotation.Nullable; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.economy.event.TransactionEvent; import blue.lapis.common.economy.event.TransactionException; import blue.lapis.common.economy.event.impl.TransactionEventImpl; import com.google.common.base.Preconditions; import com.g...
* @return This object for further modification */ public Transaction subtract(double amount) { delta -= amount; return this; } /** * Express a constant balance that the account should be changed to * * @param amount The amount that the new account balance should be ...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
LapisCommonsPlugin.getGame().getEventManager().post(event);
LapisBlue/Commons
src/main/java/blue/lapis/common/economy/Transaction.java
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
import javax.annotation.Nullable; import blue.lapis.common.LapisCommonsPlugin; import blue.lapis.common.economy.event.TransactionEvent; import blue.lapis.common.economy.event.TransactionException; import blue.lapis.common.economy.event.impl.TransactionEventImpl; import com.google.common.base.Preconditions; import com.g...
return this; } /** * Express a constant balance that the account should be changed to * * @param amount The amount that the new account balance should be * @return This object for further modification */ public Transaction setAbsolute(double amount) { balance = amou...
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java // @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT") // public class LapisCommonsPlugin { // private static LapisCommonsPlugin instance; // // private final Game game; // private final PluginContainer container;...
onResult.onFailure(new TransactionException("Transaction cancelled.", this));
LapisBlue/Commons
src/test/java/blue/lapis/common/command/TokenParserTest.java
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.TokenParserRegistry; import junit.framework.AssertionFailedError; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.util.comma...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
CommonsTests.mockPlugin();
LapisBlue/Commons
src/test/java/blue/lapis/common/command/TokenParserTest.java
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.TokenParserRegistry; import junit.framework.AssertionFailedError; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.util.comma...
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
TokenParser<Player> parser = getParser(Player.class);
LapisBlue/Commons
src/test/java/blue/lapis/common/command/TokenParserTest.java
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.TokenParserRegistry; import junit.framework.AssertionFailedError; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.util.comma...
assertParseFail(parser, "1E3"); // would like to see this accepted as 1000 instead. } @Test public void resolveBooleans() { TokenParser<Boolean> parser = getParser(Boolean.class); assertTrue(parser.parse(source, "true")); assertTrue(parser.parse(source, "yEs")); ass...
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
TokenParser<T> parser = TokenParserRegistry.get(type);
LapisBlue/Commons
src/test/java/blue/lapis/common/command/TokenParserTest.java
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
import blue.lapis.common.command.token.TokenParser; import blue.lapis.common.command.token.TokenParserRegistry; import junit.framework.AssertionFailedError; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.util.comma...
assertTrue(parser.parse(source, "On")); assertTrue(parser.parse(source, "1")); assertFalse(parser.parse(source, "FalSE")); assertFalse(parser.parse(source, "no")); assertFalse(parser.parse(source, "oFF")); assertFalse(parser.parse(source, "0")); } @Test publ...
// Path: src/test/java/blue/lapis/common/CommonsTests.java // public final class CommonsTests { // // public static void mockPlugin() { // Game game = mock(Game.class); // PluginContainer container = mock(PluginContainer.class); // // LapisCommonsPlugin plugin = new LapisCommonsPlugin(game...
} catch (InvalidTokenException ignored) {
LapisBlue/Commons
src/main/java/blue/lapis/common/permission/impl/CompoundGroup.java
// Path: src/main/java/blue/lapis/common/command/impl/Parsing.java // public class Parsing { // // public static String toLowerCase(String s) { // return s.toLowerCase(Locale.ENGLISH); // } // // public static boolean startsWithIgnoreCase(String s, String start) { // return s.regionMatches...
import blue.lapis.common.command.impl.Parsing; import blue.lapis.common.permission.Group; import com.google.common.base.Preconditions; import java.util.List;
/* * LapisCommons * Copyright (c) 2014, Lapis <https://github.com/LapisBlue> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the righ...
// Path: src/main/java/blue/lapis/common/command/impl/Parsing.java // public class Parsing { // // public static String toLowerCase(String s) { // return s.toLowerCase(Locale.ENGLISH); // } // // public static boolean startsWithIgnoreCase(String s, String start) { // return s.regionMatches...
List<String> implication = Parsing.split(name, "=>");
namlit/siteswap_generator
app/src/main/java/namlit/siteswapgenerator/AddFilterDialog.java
// Path: app/src/main/java/siteswaplib/Filter.java // public abstract class Filter implements Serializable { // // public enum FilterType {NUMBER_FILTER, PATTERN_FILTER, INTERFACE_FILTER, // LOCAL_PATTERN_FILTER, LOCAL_INTERFACE_FILTER}; // // public abstract boolean isFulfilled(Siteswap siteswap); // // /**...
import android.content.Context; import androidx.fragment.app.DialogFragment; import siteswaplib.Filter;
/* * Siteswap Generator: Android App for generating juggling siteswaps * Copyright (C) 2017 Tilman Sinning * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or *...
// Path: app/src/main/java/siteswaplib/Filter.java // public abstract class Filter implements Serializable { // // public enum FilterType {NUMBER_FILTER, PATTERN_FILTER, INTERFACE_FILTER, // LOCAL_PATTERN_FILTER, LOCAL_INTERFACE_FILTER}; // // public abstract boolean isFulfilled(Siteswap siteswap); // // /**...
public void onAddSiteswapFilter(Filter filter);
namlit/siteswap_generator
app/src/main/java/siteswaplib/FilterList.java
// Path: app/src/main/java/siteswaplib/NumberFilter.java // public enum Type {GREATER_EQUAL, SMALLER_EQUAL, EQUAL}
import siteswaplib.NumberFilter.Type; import java.io.Serializable; import java.util.LinkedList; import java.util.List;
/* * Siteswap Generator: Android App for generating juggling siteswaps * Copyright (C) 2017 Tilman Sinning * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or *...
// Path: app/src/main/java/siteswaplib/NumberFilter.java // public enum Type {GREATER_EQUAL, SMALLER_EQUAL, EQUAL} // Path: app/src/main/java/siteswaplib/FilterList.java import siteswaplib.NumberFilter.Type; import java.io.Serializable; import java.util.LinkedList; import java.util.List; /* * Siteswap Generator: And...
addFirst(new NumberFilter(Siteswap.PASS, Type.GREATER_EQUAL, 1, numberOfSynchronousHands));
MinhasKamal/AlgorithmImplementations
thread/shortestJob/nonpremitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.shor...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Process> waitingQueue = new LinkedList<Process>();
MinhasKamal/AlgorithmImplementations
thread/shortestJob/nonpremitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.shor...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Result> result = new LinkedList<Result>();
MinhasKamal/AlgorithmImplementations
thread/shortestJob/premitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.shor...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Process> waitingQueue = new LinkedList<Process>();
MinhasKamal/AlgorithmImplementations
thread/shortestJob/premitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.shor...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Result> result = new LinkedList<Result>();
MinhasKamal/AlgorithmImplementations
thread/priorityBased/premitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.prio...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Process> waitingQueue = new LinkedList<Process>();
MinhasKamal/AlgorithmImplementations
thread/priorityBased/premitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.prio...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Result> result = new LinkedList<Result>();
MinhasKamal/AlgorithmImplementations
thread/priorityBased/nonpremitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.prio...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Process> waitingQueue = new LinkedList<Process>();
MinhasKamal/AlgorithmImplementations
thread/priorityBased/nonpremitive/CPU.java
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
import java.util.Queue; import thread.utilClasses.Process; import thread.utilClasses.Result; import java.util.LinkedList;
/************************************************************************************************ * Developer: Minhas Kamal(BSSE-0509, IIT, DU) * * Date: Sep-2014 * *************************************************************************************************/ package thread.prio...
// Path: thread/utilClasses/Process.java // public class Process { // public String jobName; // public int arrivalTime; // public int cpuTime; // public int priority; // public char symbol; // // public Process(){ // this.jobName = ""; // this.arrivalTime = 0; // this.cpuTime = 0; // this.pri...
public Queue<Result> result = new LinkedList<Result>();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/CandidateAssertionsTest.java
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.github.liblevenshtein.distance.IDistance; import com.github.liblevenshtein.transducer.Candidate; import static com.github.liblevenshtein.assertion.Ca...
package com.github.liblevenshtein.assertion; public class CandidateAssertionsTest { private static final String FOO = "foo"; private static final String BAR = "bar";
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
private final ThreadLocal<IDistance<String>> distance = new ThreadLocal<>();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/CandidateAssertionsTest.java
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.github.liblevenshtein.distance.IDistance; import com.github.liblevenshtein.transducer.Candidate; import static com.github.liblevenshtein.assertion.Ca...
package com.github.liblevenshtein.assertion; public class CandidateAssertionsTest { private static final String FOO = "foo"; private static final String BAR = "bar"; private final ThreadLocal<IDistance<String>> distance = new ThreadLocal<>(); @BeforeMethod @SuppressWarnings("unchecked") public void...
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
final Candidate candidate = new Candidate(BAR, 3);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/CandidateAssertionsTest.java
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.github.liblevenshtein.distance.IDistance; import com.github.liblevenshtein.transducer.Candidate; import static com.github.liblevenshtein.assertion.Ca...
package com.github.liblevenshtein.assertion; public class CandidateAssertionsTest { private static final String FOO = "foo"; private static final String BAR = "bar"; private final ThreadLocal<IDistance<String>> distance = new ThreadLocal<>(); @BeforeMethod @SuppressWarnings("unchecked") public void...
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
assertThat(candidate).hasDistance(distance.get(), FOO);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/MergeFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.Test; import static org.assertj.core.api.Assertions.assertThat; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; public class MergeFunctionTest { private final StateFactory stateFactory = new StateFactory();
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final PositionFactory positionFactory = new PositionFactory();
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/transducer/PositionTransitionFunction.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import java.io.Serializable; import lombok.Setter; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; /** * Implements common logic shared among the position-transition functions, which * for their specific algorithm take one of the positions in a state and a few * parameters, and return all posible positions leading from that one, under the * constraints of the giv...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
protected StateFactory stateFactory;
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/transducer/PositionTransitionFunction.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import java.io.Serializable; import lombok.Setter; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; /** * Implements common logic shared among the position-transition functions, which * for their specific algorithm take one of the positions in a state and a few * parameters, and return all posible positions leading from that one, under the * constraints of the giv...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
protected PositionFactory positionFactory;
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/CandidateAssertions.java
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
import org.assertj.core.api.AbstractAssert; import com.github.liblevenshtein.distance.IDistance; import com.github.liblevenshtein.transducer.Candidate;
package com.github.liblevenshtein.assertion; /** * AssertJ-style assertions for {@link Candidate}s. */ public class CandidateAssertions extends AbstractAssert<CandidateAssertions, Candidate> { /** * Constructs a new {@link Candidate} to assert-against. * @param actual {@link Candidate} to assert-again...
// Path: src/main/java/com/github/liblevenshtein/distance/IDistance.java // public interface IDistance<Term> extends Serializable { // // /** // * Finds the distance between two terms, {@code v} and {@code w}. The distance // * between two terms is complemented by their similarity, which is determined // * ...
final IDistance<String> distance,
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/SetAssertionsTest.java
// Path: src/test/java/com/github/liblevenshtein/assertion/SetAssertions.java // public static <Type> SetAssertions<Type> assertThat(final Set<Type> actual) { // return new SetAssertions<Type>(actual); // }
import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.testng.annotations.Test; import static com.github.liblevenshtein.assertion.SetAssertions.assertThat;
package com.github.liblevenshtein.assertion; public class SetAssertionsTest { @Test public void testContains() {
// Path: src/test/java/com/github/liblevenshtein/assertion/SetAssertions.java // public static <Type> SetAssertions<Type> assertThat(final Set<Type> actual) { // return new SetAssertions<Type>(actual); // } // Path: src/test/java/com/github/liblevenshtein/assertion/SetAssertionsTest.java import java.util.Arrays; im...
assertThat(set(1, 2, 3)).contains(2);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/factory/CandidateFactoryTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java // @Value // public class Candidate implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Candidate term from the dictionary automaton. // * @return Candidate term from the dictionary automat...
import com.github.liblevenshtein.transducer.Candidate; import org.testng.annotations.Test; import static org.assertj.core.api.Assertions.assertThat; import lombok.val;
package com.github.liblevenshtein.transducer.factory; public class CandidateFactoryTest { private static final String FOO = "foo"; @Test public void testWithDistance() { val candidateFactory = new CandidateFactory.WithDistance();
// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java // @Value // public class Candidate implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Candidate term from the dictionary automaton. // * @return Candidate term from the dictionary automat...
final Candidate candidate = candidateFactory.build(FOO, 2);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StateTransitionFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import java.util.Arrays; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.PositionTransitionFactory; import com.github.libleve...
package com.github.liblevenshtein.transducer; /** * These tests were taken from the transition tables on page 29 of "Fast String * Correction with Levenshtein Automata". */ public class StateTransitionFunctionTest { private static final int N = 1; private static final int W = 5;
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final PositionFactory positionFactory = new PositionFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StateTransitionFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import java.util.Arrays; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.PositionTransitionFactory; import com.github.libleve...
package com.github.liblevenshtein.transducer; /** * These tests were taken from the transition tables on page 29 of "Fast String * Correction with Levenshtein Automata". */ public class StateTransitionFunctionTest { private static final int N = 1; private static final int W = 5; private final PositionF...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final StateFactory stateFactory = new StateFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StateTransitionFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import java.util.Arrays; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.PositionTransitionFactory; import com.github.libleve...
package com.github.liblevenshtein.transducer; /** * These tests were taken from the transition tables on page 29 of "Fast String * Correction with Levenshtein Automata". */ public class StateTransitionFunctionTest { private static final int N = 1; private static final int W = 5; private final PositionF...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final PositionTransitionFactory transitionFactory =
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/IteratorAssertionsTest.java
// Path: src/test/java/com/github/liblevenshtein/assertion/IteratorAssertions.java // public static <Type> IteratorAssertions<Type> assertThat( // final Iterator<Type> actual) { // return new IteratorAssertions<>(actual); // }
import java.util.Arrays; import java.util.Iterator; import org.testng.annotations.Test; import static com.github.liblevenshtein.assertion.IteratorAssertions.assertThat;
package com.github.liblevenshtein.assertion; public class IteratorAssertionsTest { private static final String FOO = "foo"; private static final String BAR = "bar"; private static final String BAZ = "baz"; private static final String QUX = "qux"; @Test public void testOperations() {
// Path: src/test/java/com/github/liblevenshtein/assertion/IteratorAssertions.java // public static <Type> IteratorAssertions<Type> assertThat( // final Iterator<Type> actual) { // return new IteratorAssertions<>(actual); // } // Path: src/test/java/com/github/liblevenshtein/assertion/IteratorAssertionsTest.jav...
assertThat(iter(FOO, BAR, BAZ))
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/SpecialPositionDistanceFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.Test; import lombok.val; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory; import static com.github.liblevenshtein.assertion.DistanceFunctionAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class SpecialPositionDistanceFunctionTest { @Test public void testAt() {
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
val stateFactory = new StateFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/SpecialPositionDistanceFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.Test; import lombok.val; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory; import static com.github.liblevenshtein.assertion.DistanceFunctionAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class SpecialPositionDistanceFunctionTest { @Test public void testAt() { val stateFactory = new StateFactory();
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
val positionFactory = new PositionFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/SpecialPositionDistanceFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.Test; import lombok.val; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory; import static com.github.liblevenshtein.assertion.DistanceFunctionAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class SpecialPositionDistanceFunctionTest { @Test public void testAt() { val stateFactory = new StateFactory(); val positionFactory = new PositionFactory(); final State state = stateFactory.build( positionFactory.build(2, 3, false), ...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
assertThat(distance).hasDistance(state, 4, 4);
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/distance/MemoizedTransposition.java
// Path: src/main/java/com/github/liblevenshtein/collection/SymmetricImmutablePair.java // @Value // public class SymmetricImmutablePair<Type extends Comparable<Type>> // implements Comparable<SymmetricImmutablePair<Type>>, Serializable { // // private static final long serialVersionUID = 1L; // // /** // ...
import lombok.val; import com.github.liblevenshtein.collection.SymmetricImmutablePair;
package com.github.liblevenshtein.distance; /** * Memoizes the distance between two terms, where the distance is calculated * using the standard Levenshtein distance extended with transposition. * @author Dylon Edwards * @since 2.1.0 */ public class MemoizedTransposition extends AbstractMemoized { private st...
// Path: src/main/java/com/github/liblevenshtein/collection/SymmetricImmutablePair.java // @Value // public class SymmetricImmutablePair<Type extends Comparable<Type>> // implements Comparable<SymmetricImmutablePair<Type>>, Serializable { // // private static final long serialVersionUID = 1L; // // /** // ...
val key = new SymmetricImmutablePair<String>(v, w);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/collection/dictionary/DawgTest.java
// Path: src/main/java/com/github/liblevenshtein/collection/dictionary/factory/DawgFactory.java // @Slf4j // public class DawgFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Returns a new DAWG. // * @param terms Terms to insert into the DAWG // * @r...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import com.google.common.base...
package com.github.liblevenshtein.collection.dictionary; @Slf4j public class DawgTest { private List<String> terms;
// Path: src/main/java/com/github/liblevenshtein/collection/dictionary/factory/DawgFactory.java // @Slf4j // public class DawgFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Returns a new DAWG. // * @param terms Terms to insert into the DAWG // * @r...
private DawgFactory dawgFactory;
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/collection/dictionary/DawgTest.java
// Path: src/main/java/com/github/liblevenshtein/collection/dictionary/factory/DawgFactory.java // @Slf4j // public class DawgFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Returns a new DAWG. // * @param terms Terms to insert into the DAWG // * @r...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import com.google.common.base...
@BeforeClass public void setUp() throws IOException { try (final BufferedReader reader = new BufferedReader( new InputStreamReader( getClass().getResourceAsStream("/wordsEn.txt"), StandardCharsets.UTF_8))) { final List<String> termsList = new ArrayList<>(); String...
// Path: src/main/java/com/github/liblevenshtein/collection/dictionary/factory/DawgFactory.java // @Slf4j // public class DawgFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Returns a new DAWG. // * @param terms Terms to insert into the DAWG // * @r...
assertThat(emptyDawg).doesNotContain(term);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/UnsubsumeFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.assertj.core.api.Assertions.assertThat; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; public class UnsubsumeFunctionTest { private static final int QUERY_LENGTH = 20;
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final StateFactory stateFactory = new StateFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/UnsubsumeFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.assertj.core.api.Assertions.assertThat; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; public class UnsubsumeFunctionTest { private static final int QUERY_LENGTH = 20; private final StateFactory stateFactory = new StateFactory();
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final PositionFactory positionFactory = new PositionFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StateTest.java
// Path: src/test/java/com/github/liblevenshtein/assertion/StateAssertions.java // public static StateAssertions assertThat(final State actual) { // return new StateAssertions(actual); // }
import java.util.Comparator; import org.testng.annotations.Test; import static com.github.liblevenshtein.assertion.StateAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class StateTest { @Test public void testInsertionAndIterationOperations() { final Position p00 = new Position(0, 0); final Position p01 = new Position(0, 1); final Position p10 = new Position(1, 0); final Position p11 = new Position(1, 1); ...
// Path: src/test/java/com/github/liblevenshtein/assertion/StateAssertions.java // public static StateAssertions assertThat(final State actual) { // return new StateAssertions(actual); // } // Path: src/test/java/com/github/liblevenshtein/transducer/StateTest.java import java.util.Comparator; import org.testng.anno...
assertThat(state)
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/transducer/factory/CandidateFactory.java
// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java // @Value // public class Candidate implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Candidate term from the dictionary automaton. // * @return Candidate term from the dictionary automat...
import java.io.Serializable; import lombok.AccessLevel; import lombok.NoArgsConstructor; import com.github.liblevenshtein.transducer.Candidate;
package com.github.liblevenshtein.transducer.factory; /** * Builds spelling candidates of the requested type, optionally including the * distance of the candidate from the query term. * @author Dylon Edwards * @param <CandidateType> Kind of spelling candidate built by this factory. * @since 2.1.2 */ @NoArgsCo...
// Path: src/main/java/com/github/liblevenshtein/transducer/Candidate.java // @Value // public class Candidate implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Candidate term from the dictionary automaton. // * @return Candidate term from the dictionary automat...
public static class WithDistance extends CandidateFactory<Candidate> {
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/transducer/StateTransitionFunction.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionTransitionFactory.java // @Setter // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public abstract class PositionTransitionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * ...
import java.io.Serializable; import java.util.Comparator; import lombok.Setter; import com.github.liblevenshtein.transducer.factory.PositionTransitionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; /** * Transitions one state to another, given a set of inputs. This function * doesn't need to know about the Levenshtein algorithm, as the * algorithm-specific components are injected via setters. * @author Dylon Edwards * @since 2.1.0 */ @Setter public class St...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionTransitionFactory.java // @Setter // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public abstract class PositionTransitionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * ...
private StateFactory stateFactory;
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/transducer/StateTransitionFunction.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionTransitionFactory.java // @Setter // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public abstract class PositionTransitionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * ...
import java.io.Serializable; import java.util.Comparator; import lombok.Setter; import com.github.liblevenshtein.transducer.factory.PositionTransitionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory;
package com.github.liblevenshtein.transducer; /** * Transitions one state to another, given a set of inputs. This function * doesn't need to know about the Levenshtein algorithm, as the * algorithm-specific components are injected via setters. * @author Dylon Edwards * @since 2.1.0 */ @Setter public class St...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionTransitionFactory.java // @Setter // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public abstract class PositionTransitionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * ...
private PositionTransitionFactory transitionFactory;
universal-automata/liblevenshtein-java
src/main/java/com/github/liblevenshtein/distance/MemoizedStandard.java
// Path: src/main/java/com/github/liblevenshtein/collection/SymmetricImmutablePair.java // @Value // public class SymmetricImmutablePair<Type extends Comparable<Type>> // implements Comparable<SymmetricImmutablePair<Type>>, Serializable { // // private static final long serialVersionUID = 1L; // // /** // ...
import lombok.val; import com.github.liblevenshtein.collection.SymmetricImmutablePair;
package com.github.liblevenshtein.distance; /** * Memoizes the distance between two terms, where the distance is calculated * using the standard Levenshtein distance, including the elementary operations * of insertion, deletion and substitution. * @author Dylon Edwards * @since 2.1.0 */ public class MemoizedSt...
// Path: src/main/java/com/github/liblevenshtein/collection/SymmetricImmutablePair.java // @Value // public class SymmetricImmutablePair<Type extends Comparable<Type>> // implements Comparable<SymmetricImmutablePair<Type>>, Serializable { // // private static final long serialVersionUID = 1L; // // /** // ...
val key = new SymmetricImmutablePair<String>(v, w);
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/SpecialPositionComparatorTest.java
// Path: src/test/java/com/github/liblevenshtein/assertion/ComparatorAssertions.java // public static <Type> ComparatorAssertions<Type> assertThat( // final Comparator<Type> actual) { // return new ComparatorAssertions<>(actual); // }
import org.testng.annotations.Test; import static com.github.liblevenshtein.assertion.ComparatorAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class SpecialPositionComparatorTest { private final SpecialPositionComparator comparator = new SpecialPositionComparator(); @Test public void testCompare() {
// Path: src/test/java/com/github/liblevenshtein/assertion/ComparatorAssertions.java // public static <Type> ComparatorAssertions<Type> assertThat( // final Comparator<Type> actual) { // return new ComparatorAssertions<>(actual); // } // Path: src/test/java/com/github/liblevenshtein/transducer/SpecialPositionCo...
assertThat(comparator)
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/SubsumesFunctionAssertionsTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/Position.java // @Data // @RequiredArgsConstructor // public class Position implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Reference to the next node in this linked-list. The next node may be null // ...
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.github.liblevenshtein.transducer.Position; import com.github.liblevenshtein.transducer.SubsumesFunction; import static com.github.liblevenshtein.asse...
package com.github.liblevenshtein.assertion; public class SubsumesFunctionAssertionsTest { private static final int TERM_LENGTH = 4;
// Path: src/main/java/com/github/liblevenshtein/transducer/Position.java // @Data // @RequiredArgsConstructor // public class Position implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Reference to the next node in this linked-list. The next node may be null // ...
private final ThreadLocal<SubsumesFunction> standardSubsumes = new ThreadLocal<>();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/assertion/SubsumesFunctionAssertionsTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/Position.java // @Data // @RequiredArgsConstructor // public class Position implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Reference to the next node in this linked-list. The next node may be null // ...
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.github.liblevenshtein.transducer.Position; import com.github.liblevenshtein.transducer.SubsumesFunction; import static com.github.liblevenshtein.asse...
package com.github.liblevenshtein.assertion; public class SubsumesFunctionAssertionsTest { private static final int TERM_LENGTH = 4; private final ThreadLocal<SubsumesFunction> standardSubsumes = new ThreadLocal<>(); private final ThreadLocal<SubsumesFunction> specialSubsumes = new ThreadLocal<>();
// Path: src/main/java/com/github/liblevenshtein/transducer/Position.java // @Data // @RequiredArgsConstructor // public class Position implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Reference to the next node in this linked-list. The next node may be null // ...
private final ThreadLocal<Position> lhs = new ThreadLocal<>();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/SubsumesFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import static com.github.liblevenshtein.assertion.SubsumesFunctionAssertions.assertThat;
{1, 1, false, 1, 2, false, 4, true}, {3, 1, false, 0, 2, true, 4, false}, {1, 1, false, 0, 2, true, 4, true}, {3, 3, true, 3, 3, false, 4, false}, {4, 4, true, 4, 4, false, 4, true}, {1, 1, true, 2, 1, true, 4, false}, {1, 1, true, 1, 1, true, 4, true}, }; } @DataProvi...
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
assertThat(standardSubsumes)
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StandardPositionTransitionFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory; import static com.github.liblevenshtein.assertion.StandardPositionTransitionFunctionAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class StandardPositionTransitionFunctionTest { private static final int N = 2; // max number of errors private static final int W = 4; // length of characteristic vector
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final StateFactory stateFactory = new StateFactory();
universal-automata/liblevenshtein-java
src/test/java/com/github/liblevenshtein/transducer/StandardPositionTransitionFunctionTest.java
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import com.github.liblevenshtein.transducer.factory.PositionFactory; import com.github.liblevenshtein.transducer.factory.StateFactory; import static com.github.liblevenshtein.assertion.StandardPositionTransitionFunctionAssertions.assertThat;
package com.github.liblevenshtein.transducer; public class StandardPositionTransitionFunctionTest { private static final int N = 2; // max number of errors private static final int W = 4; // length of characteristic vector private final StateFactory stateFactory = new StateFactory();
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java // @NoArgsConstructor // public class PositionFactory implements Serializable { // // private static final long serialVersionUID = 1L; // // /** // * Builds a dummy position. // * @return Dummy position. // */ // p...
private final PositionFactory positionFactory = new PositionFactory();