code
stringlengths
73
34.1k
label
stringclasses
1 value
public void setFile(File file) throws IOException { if(!file.isFile()) throw new IllegalArgumentException(file+" must be a file."); else { if(file.getName().endsWith("gz")) initGzReader(file); else initReader(file); } }
java
public void setFileFromAJar(String fileName) { InputStream is = this.getClass().getResourceAsStream(fileName); if(is != null) { this.fileName = fileName; reader = new InputStreamReader(is); } }
java
private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) { TypeInfo typeInfo = typeMaps.get(path); if (typeInfo == null) { typeInfo = new TypeInfo(superType); typeMaps.put(path, typeInfo); } return typeInfo; }
java
protected void successfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult);...
java
public ApiResponse<Templates> deleteTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = deleteTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiEndpointsSuccess> getApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVarReturnType...
java
public ApiResponse<Templates> getTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiPostEndpointsSuccess> postApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiPostEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVar...
java
public ApiResponse<Templates> postTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<Templates> putTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetLogout> getLogoutWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLogoutValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLogout>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiSuccessResponse> initProvisioningWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = initProvisioningValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType...
java
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException { return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis()); }
java
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException { try { return createDTO(entity, dtoTemplate, true, proxyClassName); } catch (CannotInstantiateProxyException | DTODefinitionException e) { e.printStackTrace(); throw new HyalineException(); } }
java
public ApiResponse<GetEnabledResponse> getEnabledWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getEnabledValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetEnabledResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetLocationResponse> getLocationsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLocationsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); ...
java
public ApiResponse<PostLocationResponse> postLocationWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postLocationValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); ...
java
public ApiResponse<GetSubResponse> checkMigrateConflictsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkMigrateConflictsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnTy...
java
public ApiResponse<CheckPostMigrateStatistic> checkPostMigrateStatisticWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkPostMigrateStatisticValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<CheckPostMigrateStatistic>(){}.getType(); return apiClient....
java
public ApiResponse<GetExportStatisticDefinitions> getExportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getExportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetExportStatisticDefinitions>(){}.getType(); r...
java
public ApiResponse<GetStatisticDefinitionsResponse> getStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return ap...
java
public ApiResponse<PostImportStatisticDefinitions> postImportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportStatisticDefinitions>(){}.getType(); ...
java
public ApiResponse<GetStatisticDefinitionsResponse> postStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return ...
java
public static QueueConfiguration customGame(boolean force, String gameId, int team) { return new CustomGameQueueConfiguration(force, gameId, team); }
java
public static PortletApplicationContext getPortletApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortle...
java
public static ApplicationContext getWebApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortlet.PORTLET_A...
java
public void initializeWithCode(String authCode, String redirectUri) throws ProvisioningApiException { initialize(null, authCode, redirectUri); }
java
public UpdatableGameState update(GameUpdateApiResponse gameUpdateData) { return new UpdatableGameState( gameUpdateData.getTurn(), startData, MapPatcher.patch(gameUpdateData.getMapDiff(), rawMapArray), MapPatcher.patch(gameUpdateData.getCitiesDiff(), rawCitiesArray), ...
java
public ApiResponse<GetMOHFilesResponse> getMOHFilesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHFilesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHFilesResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetMOHSettings> getMOHSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHSettings>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostCheckInactivity> checkInactivityWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkInactivityValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostCheckInactivity>(){}.getType(); return apiClient.execute(call, localVarReturnType...
java
public ApiResponse<GetSubResponse> getSubWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getSubValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostImportResponse> postImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostUsers> postUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostValidateImportResponse> postValidateImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postValidateImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostValidateImportResponse>(){}.getType(); return apiClient.execute(call...
java
public ApiResponse<PutUsers> putUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PutUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
protected Class<?> determineContextClass(PortletContext portletContext) { String contextClassName = portletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (contextClassName != null) { try { return ClassUtils.forName(contextClassName, ClassUtils.getDefaultClassLoader()); ...
java
public ApiResponse<GetArgsResponse> argsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = argsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetArgsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<DynconfigGetConfigResponse> dynconfigGetConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = dynconfigGetConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<DynconfigGetConfigResponse>(){}.getType(); return apiClient.execute(call...
java
public ApiResponse<GetConfigResponse> getConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetConfigResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public void deleteUser(String userDBID, Boolean keepPlaces) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.deleteUser(userDBID, keepPlaces); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error deleting user. Code: " + resp.getStatus().getC...
java
public void updateUser(String userDBID, User user) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user))); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiExcepti...
java
public Results<DnGroup> searchDnGroups(SearchParams searchParams) throws ProvisioningApiException { return searchDnGroups( searchParams.getLimit(), searchParams.getOffset(), searchParams.getSearchTerm(), searchParams.getSearchKey(), searchParams.getMatchMethod(), searchParams.getSortKey(), ...
java
public ApiResponse<GetInboundResponse> getInboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getInboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetInboundResponse>(){}.getType(); return apiClient.execute(call, localVarReturn...
java
public ApiResponse<GetOutboundResponse> getOutboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getOutboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetOutboundResponse>(){}.getType(); return apiClient.execute(call, localVarRe...
java
private static Element lookupId(List<Element> fields) { Element objectIdField = null; Element uuidField = null; Element _idField = null; Element idField = null; for (Element field : fields) { if (field.getAnnotation(Id.class) != null) { return field; } if (isObjectId(field)) { objectIdField =...
java
public User getUser(String fieldName, String fieldValue){ Select q = new Select().from(User.class); String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName(); q.where(new Expression(q.getPool(),nameColumn,Operator.EQ,new BindVariable(q.getPool(),fieldValue)...
java
@Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); request = request.newBuilder() .addHeader(TRACEID_HEADER, makeUniqueId()) .addHeader(SPANID_HEADER, makeUniqueId()).build(); return chain.p...
java
public ApiResponse<GetAuditResponse> getAuditWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getAuditValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetAuditResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public Options getOptions(String personDBID, String agentGroupDBID) throws ProvisioningApiException { try { OptionsGetResponseSuccess resp = optionsApi.optionsGet( personDBID, agentGroupDBID ); if (!resp.getStatus().getCode().eq...
java
public void modifyOptions(Map<String, Object> options) throws ProvisioningApiException { try { OptionsPostResponseStatusSuccess resp = optionsApi.optionsPost(new OptionsPost().data(new OptionsPostData().options(options))); if (!resp.getStatus().getCode().equals(0)) { ...
java
public void updateOptions(Map<String, Object> newOptions, Map<String, Object> changedOptions, Map<String, Object> deletedOptions) throws ProvisioningApiException { try { OptionsPutResponseStatusSuccess resp = optionsApi.optionsPut( new OptionsPut() ...
java
private final EvalResult doDefine(List<SExpression> subexpressions, Environment environment, ParametricBfgBuilder builder, EvalContext context) { int nameToBind = subexpressions.get(1).getConstantIndex(); if (subexpressions.size() == 3) { // (define name value-expression) // Binds a name to th...
java
public static String password(int length) { StringBuilder result = new StringBuilder(); byte[] values = byteArray(length); // We use a modulus of an increasing index rather than of the byte values // to avoid certain characters coming up more often. int index = 0; for (...
java
public CcgSyntaxTree getSyntacticParse() { HeadedSyntacticCategory originalSyntax = null; if (unaryRule != null) { originalSyntax = unaryRule.getUnaryRule().getInputSyntacticCategory().getCanonicalForm(); } else { originalSyntax = syntax; } if (isTerminal()) { return CcgSyntaxTree...
java
public Expression2 getLogicalForm() { Expression2 preUnaryLogicalForm = getPreUnaryLogicalForm(); if (unaryRule == null) { return preUnaryLogicalForm; } else if (preUnaryLogicalForm == null || unaryRule.getUnaryRule().getLogicalForm() == null) { return null; } else { return Expression2...
java
public SpannedExpression getLogicalFormForSpan(int spanStart, int spanEnd) { CcgParse spanningParse = getParseForSpan(spanStart, spanEnd); Expression2 lf = spanningParse.getPreUnaryLogicalForm(); if (lf != null) { return new SpannedExpression(spanningParse.getHeadedSyntacticCategory(), spann...
java
public List<SpannedExpression> getSpannedLogicalForms() { List<SpannedExpression> spannedExpressions = Lists.newArrayList(); getSpannedLogicalFormsHelper(spannedExpressions); return spannedExpressions; }
java
public List<String> getSpannedWords() { if (isTerminal()) { return words; } else { List<String> words = Lists.newArrayList(); words.addAll(left.getSpannedWords()); words.addAll(right.getSpannedWords()); return words; } }
java
public List<String> getSpannedPosTags() { if (isTerminal()) { return posTags; } else { List<String> tags = Lists.newArrayList(); tags.addAll(left.getSpannedPosTags()); tags.addAll(right.getSpannedPosTags()); return tags; } }
java
public List<LexiconEntryInfo> getSpannedLexiconEntries() { if (isTerminal()) { return Arrays.asList(lexiconEntry); } else { List<LexiconEntryInfo> lexiconEntries = Lists.newArrayList(); lexiconEntries.addAll(left.getSpannedLexiconEntries()); lexiconEntries.addAll(right.getSpannedLexiconE...
java
public List<DependencyStructure> getAllDependencies() { List<DependencyStructure> deps = Lists.newArrayList(); if (!isTerminal()) { deps.addAll(left.getAllDependencies()); deps.addAll(right.getAllDependencies()); } deps.addAll(dependencies); return deps; }
java
public Multimap<Integer, DependencyStructure> getAllDependenciesIndexedByHeadWordIndex() { Multimap<Integer, DependencyStructure> map = HashMultimap.create(); for (DependencyStructure dep : getAllDependencies()) { map.put(dep.getHeadWordIndex(), dep); } return map; }
java
@Override public void load(UnitDaoFactory unitDaoFactory) { BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream)); BufferedReaderIterator iterator = new BufferedReaderIterator(reader); StringBuilder currentQuery = new StringBuilder(); while (iterator.hasNext()) { String line = ...
java
private static ParserInfo createParser(LexiconInductionCcgParserFactory factory, SufficientStatistics currentParameters, Collection<LexiconEntry> currentLexicon) { ParametricCcgParser family = factory.getParametricCcgParser(currentLexicon); SufficientStatistics newParameters = family.getNewSufficientStati...
java
private double getPartitionFunction(List<CcgParse> parses) { double partitionFunction = 0.0; for (CcgParse parse : parses) { partitionFunction += parse.getSubtreeProbability(); } return partitionFunction; }
java
public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines, String featureDelimiter) { // Read in the possible values of each variable. List<String> words = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 0, featureDelimiter); List<String> labels = Stri...
java
public void addConstantFactor(String factorName, PlateFactor factor) { constantFactors.add(factor); constantFactorNames.add(factorName); }
java
public void addFactor(String factorName, T factor, VariablePattern factorPattern) { parametricFactors.add(factor); factorPatterns.add(factorPattern); parametricFactorNames.add(factorName); }
java
@Override public void load(UnitDaoFactory unitDaoFactory) { for (String query : queries) { unitDaoFactory.getUnitDao().execute(query); } }
java
private static final boolean longMultisetsEqual(long[] firstDeps, long[] secondDeps) { if (firstDeps.length != secondDeps.length) { return false; } Arrays.sort(firstDeps); Arrays.sort(secondDeps); for (int i = 0; i < firstDeps.length; i++) { if (firstDeps[i] != secondDeps[i]) { ...
java
public int add(T item) { if (itemIndex.containsKey(item)) { // Items can only be added once return itemIndex.get(item); } int index = items.size(); itemIndex.put(item, index); items.add(item); return index; }
java
public int getIndex(Object item) { if (!itemIndex.containsKey(item)) { throw new NoSuchElementException("No such item: " + item); } return itemIndex.get(item); }
java
public T get(int index) { if (index >= items.size() || index < 0) { throw new IndexOutOfBoundsException("size: " + items.size() + " index: " + index); } return items.get(index); }
java
public int getParentExpressionIndex(int index) { if (index == 0) { return -1; } else { int[] parts = findSubexpression(index); int parentIndex = subexpressions.get(parts[0]).getParentExpressionIndex(parts[1]); if (parentIndex == -1) { // index refers to a child of this exp...
java
public void nextState(IncEvalState prev, IncEvalState next, Object continuation, Environment env, Object denotation, Object diagram, Object otherArgs, LogFunction log) { next.set(continuation, env, denotation, diagram, prev.getProb(), null); }
java
public static Object convert(String dataType, Object record){ if(record == null){return null;} if(dataType.equals(UUID)){ return java.util.UUID.fromString(record.toString()); } //TODO: add a lot of else if here for the other data types else{ return record; } }
java
public ModelDef[] correct(){ for(ModelDef m : modelList){ this.model = m; correct1to1Detail(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasOneToSelf(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasManyToSelf(); } for(ModelDef m : modelList){ ...
java
private void removeHasOneToBothPrimaryAndForeignKey() { String[] primaryKeys = model.getPrimaryAttributes(); String[] hasOne = model.getHasOne(); String[] hasOneLocal = model.getHasOneLocalColumn(); String[] hasOneReferenced = model.getHasOneReferencedColumn(); for(String pk : primaryKeys){ int pkIndex = C...
java
private void correct1to1Detail(){ String[] hasManyTables = model.getHasMany(); for(String hasMany : hasManyTables){ if(shouldBeMoved(model, hasMany)){ model = moveFromHasManyToHasOne(model, hasMany); } } }
java
private void crossOutLinkerTables(){ String[] primaryKeys = model.getPrimaryAttributes(); if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys //if both primary keys look up to different table which is also a primary key String[] hasOne = model.getHasOne(); String[] hasOneLoca...
java
public Map<U, Double> getActiveFeatures(Tensor featureVector) { Preconditions.checkArgument(featureVector.getDimensionSizes().length == 1 && featureVector.getDimensionSizes()[0] == getNumberOfFeatures()); Map<U, Double> features = Maps.newHashMap(); Iterator<KeyValue> keyValueIter = featureVector.k...
java
public void sendAdvertisement(final BasicTrustGraphAdvertisement message, final TrustGraphNodeId sender, final TrustGraphNodeId toNeighbor, final int ttl) { final BasicTrustGraphAdvertisement outboundMessage = ...
java
public LocalTrustGraphNode addNode(final TrustGraphNodeId nodeId) { final LocalTrustGraphNode node = createNode(nodeId); addNode(node); return node; }
java
public void addDirectedRoute(final LocalTrustGraphNode from, final LocalTrustGraphNode to) { from.getRoutingTable().addNeighbor(to.getId()); }
java
public void addDirectedRoute(final TrustGraphNodeId from, final TrustGraphNodeId to) { final TrustGraphNode fromNode = nodes.get(from); fromNode.getRoutingTable().addNeighbor(to); }
java
public void addRoute(final TrustGraphNodeId a, final TrustGraphNodeId b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
java
public void addRoute(final LocalTrustGraphNode a, final LocalTrustGraphNode b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
java
public static Status valueOf(int code) { Status result = null; switch (code) { case 100: result = INFO_CONTINUE; break; case 101: result = INFO_SWITCHING_PROTOCOL; break; case 102: result...
java
private <T> T populateEntity(final T t, final Map<Field, Long> enumeratesMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final Map<Field, GenContainer> genContainers = this.populateScanner....
java
private Object generateObject(final Field field, final GenContainer container, final Map<Field, Long> enumerateMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { ...
java
private Object generateEmbeddedObject(final Annotation annotation, final Field field, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final int fieldDepth = getDepth(a...
java
private Object generateEnumerateObject(final Field field, final Map<Field, Long> enumerateMap) { final Long currentEnumerateValue = enumerateMap.get(field); Object objValue = BasicCastUtils.castToNumber(currentEnumerateValue, field.getType()); // Incre...
java
private Map<Field, Long> buildEnumerateMap(final Class t) { return this.enumerateScanner.scan(t).entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> ((GenEnumerate) e.getValue().get(0)).from()) ); }
java
public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) { List<Assignment> roots = Lists.newArrayList(); if (tree.getSubstitutions().size() == 0) { roots.add(expressionVar.outcomeArrayToAssignment(tree.getExpressionNode())); } else { for (ExpressionTree substitution : tree...
java
public synchronized void clearDisappearedJob() { getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> { final LaJobKey jobKey = job.getJobKey(); jobKeyJobMap.remove(jobKey); jobOrderedList.remove(job); job.getJobUnique().ifPresent(jobUniqu...
java
public void addUnreplicatedFactor(String factorName, Factor factor, VariableNumMap vars) { plateFactors.add(new ReplicatedFactor(factor, new WrapperVariablePattern(vars))); plateFactorNames.add(factorName); }
java
private boolean isComplex(final Field field) { final Class<?> declaringClass = field.getType(); return (declaringClass.equals(List.class) || declaringClass.equals(Set.class) || declaringClass.equals(Map.class)) || declaringClass.getTypeName().endsWith("[][...
java
private GenContainer findGenAnnotation(final Field field) { for (Annotation annotation : field.getDeclaredAnnotations()) { for (Annotation inline : annotation.annotationType().getDeclaredAnnotations()) { if (isGen.test(inline)) { return GenContainer.asGen(inline, ...
java
private static void markEntityVars(HeadedSyntacticCategory cat, int[] uniqueVars, boolean[] isEntityVar) { if (cat.isAtomic()) { for (int var : cat.getUniqueVariables()) { int index = Ints.indexOf(uniqueVars, var); isEntityVar[index] = true; } } else { markEntityVars(cat....
java