Extract a list of work pattern assignments.

@param workPatterns string representation of work pattern assignments
@return list of work pattern assignment rows
510781
private List<Row> createWorkPatternAssignmentRowList(String workPatterns) throws ParseException
   {
      List<Row> list = new ArrayList<Row>();
      String[] patterns = workPatterns.split(",|:");
      int index = 1;
      while (index < patterns.length)
      {
         Integer workPattern = Integer.valueOf(patterns[index + 1]);
         Date startDate = DatatypeConverter.parseBasicTimestamp(patterns[index + 3]);
         Date endDate = DatatypeConverter.parseBasicTimestamp(patterns[index + 4]);

         Map<String, Object> map = new HashMap<String, Object>();
         map.put("WORK_PATTERN", workPattern);
         map.put("START_DATE", startDate);
         map.put("END_DATE", endDate);

         list.add(new MapRow(map));

         index += 5;
      }

      return list;
   }
530895
public static boolean stringInPatterns(String s, List<Pattern> patterns) {
    for (Pattern pattern : patterns) {
      if (pattern.matcher(s).matches()) {
        return true;
      }
    }
    return false;
  }
254820
public static List<String> splitAsList(Pattern splitPattern, String text) {
        return splitAsStream(splitPattern, text).collect(toList());
    }
249598
protected List<DisambiguationPatternRule> makeAntiPatterns(List<List<PatternToken>> patternList, Language language) {
    List<DisambiguationPatternRule> rules = new ArrayList<>();
    for (List<PatternToken> patternTokens : patternList) {
      rules.add(new DisambiguationPatternRule("INTERNAL_ANTIPATTERN", "(no description)", language,
              patternTokens, null, null, DisambiguationPatternRule.DisambiguatorAction.IMMUNIZE));
    }
    return rules;
  }
867337
public static ExtractRegular getInstance(List<UrlPattern> urlPatterns){
        if (extractRegular != null) {
            return extractRegular;
        }
        synchronized (ExtractRegular.class) {
            if (extractRegular == null) {
                extractRegular = new ExtractRegular();
                //初始化抽取规则
                extractRegular.init(urlPatterns);
            }
        }
        return extractRegular;
    }
741897
public List<BaseDescr> getRemainingPatterns() {
        if ( this.patterns.size() > 1 ) {
            return this.patterns.subList( 1,
                                          this.patterns.size() );
        } else if ( this.patterns.size() == 1 ) {
            // in case there is only one pattern, we do a rewrite, so:
            // forall( Cheese( type == "stilton" ) )
            // becomes
            // forall( BASE_IDENTIFIER : Cheese() Cheese( this == BASE_IDENTIFIER, type == "stilton" ) )
            PatternDescr original = (PatternDescr) this.patterns.get( 0 );
            PatternDescr remaining = (PatternDescr) original.clone();
            remaining.addConstraint( new ExprConstraintDescr( "this == " + BASE_IDENTIFIER ) );
            remaining.setResource(original.getResource());
            return Collections.singletonList( (BaseDescr)remaining );
        }
        return Collections.emptyList();
    }
400803
public Iterable<BoxTaskAssignment.Info> getAllAssignments(String ... fields) {
        final QueryStringBuilder builder = new QueryStringBuilder();
        if (fields.length > 0) {
            builder.appendParam("fields", fields);
        }
        return new Iterable<BoxTaskAssignment.Info>() {
            public Iterator<BoxTaskAssignment.Info> iterator() {
                URL url = GET_ASSIGNMENTS_URL_TEMPLATE.buildWithQuery(
                        BoxTask.this.getAPI().getBaseURL(), builder.toString(), BoxTask.this.getID());
                return new BoxTaskAssignmentIterator(BoxTask.this.getAPI(), url);
            }
        };
    }
101403
public static Annotation[] findAnnotations(AbstractVariableDeclaration field, Pattern namePattern) {
		List<Annotation> result = new ArrayList<Annotation>();
		if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
		for (Annotation annotation : field.annotations) {
			TypeReference typeRef = annotation.type;
			if (typeRef != null && typeRef.getTypeName() != null) {
				char[][] typeName = typeRef.getTypeName();
				String suspect = new String(typeName[typeName.length - 1]);
				if (namePattern.matcher(suspect).matches()) {
					result.add(annotation);
				}
			}
		}	
		return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
	}
1368126
public static Matcher<String> containsPatterns(String... patterns) {
        List<Matcher<? super String>> matchers = new ArrayList<Matcher<? super String>>();
        for (String pattern : patterns) {
            matchers.add(pattern(pattern));
        }
        return allOf(matchers);
    }
709187
private void resolvePatternSpecificity(Map<String, PatternCacheControl> patterns) {
        List<String> patternList = new ArrayList<>();
        patternList.addAll(patterns.keySet());

        int patternCount = patternList.size();

        for (int i = 0; i < patternCount - 1; i++) {
            String specificPattern = patternList.get(i);
            for (int j = i + 1; j < patternCount; j++) {
                String generalPattern = patternList.get(j);
                checkPatternMatching(patterns, specificPattern, generalPattern);
                checkPatternMatching(patterns, generalPattern, specificPattern);
            }
        }
    }
1168107
private static boolean matchesPatternList(final String str, final List<Pattern> patterns) {
        if (patterns != null) {
            for (final Pattern pattern : patterns) {
                if (pattern.matcher(str).matches()) {
                    return true;
                }
            }
        }
        return false;
    }
444079
protected List<WorkUnit> getPreviousWorkUnitsForRetry(SourceState state) {
    List<WorkUnit> workUnits = Lists.newArrayList();
    for (WorkUnitState workUnitState : getPreviousWorkUnitStatesForRetry(state)) {
      // Make a copy here as getWorkUnit() below returns an ImmutableWorkUnit
      workUnits.add(WorkUnit.copyOf(workUnitState.getWorkunit()));
    }

    return workUnits;
  }
234643
@Deprecated
    public Pattern getPattern() {
        if (patterns != null && !patterns.isEmpty()) {
            return patterns.get(0);
        } else {
            return null;
        }
    }
103178
public static WildcardPattern[] create(@Nullable String[] patterns) {
    if (patterns == null) {
      return new WildcardPattern[0];
    }
    WildcardPattern[] exclusionPAtterns = new WildcardPattern[patterns.length];
    for (int i = 0; i < patterns.length; i++) {
      exclusionPAtterns[i] = create(patterns[i]);
    }
    return exclusionPAtterns;
  }
513039
protected static Pattern[] commaDelimitedListToPatternArray(String commaDelimitedPatterns) {
        String[] patterns = commaDelimitedListToStringArray(commaDelimitedPatterns);
        List<Pattern> patternsList = new ArrayList<Pattern>();
        for (String pattern : patterns) {
            try {
                patternsList.add(Pattern.compile(pattern));
            } catch (PatternSyntaxException e) {
                throw new IllegalArgumentException("Illegal pattern syntax '" + pattern + "'", e);
            }
        }
        return patternsList.toArray(new Pattern[0]);
    }
345610
public void setVariableNotationPatterns(String... variableNotationPatterns) {
        this.variableNotationPatterns = Arrays.asList(variableNotationPatterns);

        String pattern = "(.*?)";
        allVariablesPattern = "((" + this.variableNotationPatterns.get(0) + ")";
        for (int i = 1; i < this.variableNotationPatterns.size(); i++) {
            allVariablesPattern += "|(" + this.variableNotationPatterns.get(i) + ")";
        }
        allVariablesPattern += ")";
        pattern += allVariablesPattern;
        regexPattern = Pattern.compile(pattern);
    }
806014
@Override
    public List getPatternList() {
        ExtensionFactory delegate = this.delegate;
        if (delegate != null)
            return delegate.getPatternList();
        return Collections.emptyList();
    }