Returns the number of wildcards of this {@link MediaType}.
975108
public int numWildcards() {
        int numWildcards = 0;
        if (WILDCARD.equals(type())) {
            numWildcards++;
        }
        if (WILDCARD.equals(subtype())) {
            numWildcards++;
        }
        return numWildcards;
    }
790465
public List<SequenceLabel> getNumericNames() {
    final List<SequenceLabel> result = new ArrayList<SequenceLabel>();
    while (hasNextToken()) {
      result.add(getNextToken());
    }
    return result;
  }
1272253
public Long getFileNumber() {
        Long fileNumber = 0L;
        if (items.size() != 0) {
            for (TableStat item : items) {
                fileNumber += item.getFileCount();
            }
        }
        return fileNumber;
    }
732633
def _get_imagesave_wildcards(self):
        ''
        default_filetype = self.get_default_filetype()
        filetypes = self.get_supported_filetypes_grouped()
        sorted_filetypes = filetypes.items()
        sorted_filetypes.sort()
        wildcards = []
        extensions = []
        filter_index = 0
        for i, (name, exts) in enumerate(sorted_filetypes):
            ext_list = ';'.join(['*.%s' % ext for ext in exts])
            extensions.append(exts[0])
            wildcard = '%s (%s)|%s' % (name, ext_list, ext_list)
            if default_filetype in exts:
                filter_index = i
            wildcards.append(wildcard)
        wildcards = '|'.join(wildcards)
        return wildcards, extensions, filter_index
1134109
@Override
    public Set<String> getSupportedInputMediaTypes() {
        ImmutableSet.Builder<String> result = ImmutableSet.builder();
        result.addAll(MediaType.NATIVE_MEDIATYPE_SYNTAX_MAP.keySet());
        result.addAll(this.serviceTransformationEngine.getSupportedMediaTypes());
        return result.build();
    }
532406
public long numRecords() {
        if (numRecords == null) {
            try {
                numRecords = indexToKey.getNumRecords();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return numRecords;
    }
1202976
private boolean isMimeTypeMatch(MediaType mediaType, MediaType rangePattern) {
    String WILDCARD = "*";
    String rangePatternType = rangePattern.getType();
    String rangePatternSubtype = rangePattern.getSubtype();
    return (rangePatternType.equals(WILDCARD) || rangePatternType.equals(mediaType.getType()))
        && (rangePatternSubtype.equals(WILDCARD) || rangePatternSubtype.equals(mediaType.getSubtype()));
  }
433505
protected String[] getTypes(boolean all) {

        if (!all) {
            String[] array = new String[3];
            return Arrays.asList(m_types).subList(0, 3).toArray(array);
        }
        return m_types;
    }
742202
public int getPropertyCount()
    {
        int count;
        if (_superClass == null)
            count = 0;
        else
            count = _superClass.getPropertyCount();

        for (AptPropertySet propertySet : _propertySets) {
            // if a property set is set to optional and hasSetters is set to false,
            // there isn't a getter or setter available for that property
            if (propertySet.hasSetters() || !propertySet.isOptional()) {
                count += propertySet.getProperties().size();
            }
        }

        count += _intfProps.size();
        return count;
    }
634908
public int numChars() {
		ensureMaterialized();
		if (inFirstSegment()) {
			int len = 0;
			for (int i = 0; i < sizeInBytes; i += numBytesForFirstByte(getByteOneSegment(i))) {
				len++;
			}
			return len;
		} else {
			return numCharsSlow();
		}
	}
159152
public static MediaType parseMediaType(String mediaType) {
		Assert.hasLength(mediaType, "'mediaType' must not be empty");
		String[] parts = StringUtils.tokenizeToStringArray(mediaType, ";");

		String fullType = parts[0].trim();
		// java.net.HttpURLConnection returns a *; q=.2 Accept header
		if (WILDCARD_TYPE.equals(fullType)) {
			fullType = "*/*";
		}
		int subIndex = fullType.indexOf('/');
		if (subIndex == -1) {
			throw new InvalidMediaTypeException(mediaType, "does not contain '/'");
		}
		if (subIndex == fullType.length() - 1) {
			throw new InvalidMediaTypeException(mediaType, "does not contain subtype after '/'");
		}
		String type = fullType.substring(0, subIndex);
		String subtype = fullType.substring(subIndex + 1, fullType.length());
		if (WILDCARD_TYPE.equals(type) && !WILDCARD_TYPE.equals(subtype)) {
			throw new InvalidMediaTypeException(mediaType, "wildcard type is legal only in '*/*' (all media types)");
		}

		Map<String, String> parameters = null;
		if (parts.length > 1) {
			parameters = new LinkedHashMap<String, String>(parts.length - 1);
			for (int i = 1; i < parts.length; i++) {
				String parameter = parts[i];
				int eqIndex = parameter.indexOf('=');
				if (eqIndex != -1) {
					String attribute = parameter.substring(0, eqIndex);
					String value = parameter.substring(eqIndex + 1, parameter.length());
					parameters.put(attribute, value);
				}
			}
		}

		try {
			return new MediaType(type, subtype, parameters);
		}
		catch (UnsupportedCharsetException ex) {
			throw new InvalidMediaTypeException(mediaType, "unsupported charset '" + ex.getCharsetName() + "'");
		}
		catch (IllegalArgumentException ex) {
			throw new InvalidMediaTypeException(mediaType, ex.getMessage());
		}
	}
586761
public int countMatches() {
		if (null != this.positions && this.positions.isPresent()) {
			return this.positions.get().size();
		}
		
		if (Strs.isEmpty(target4Betn)) {
			return 0;
		}
		
		if (!region.isPresent()) {
			return 0;
		}
		
		if (isEqual(region.get()[0], region.get()[1])) {
			int matchCount = count(target4Betn, region.get()[1]);
			
			if (this.matchWay.get() == 'R' 
					|| this.matchWay.get() == 'L') {
				return matchCount;
			}
			
			matchCount = (matchCount % 2 == 0) ? matchCount : (matchCount - 1);
			return matchCount / 2;
		}
		
		return Math.min(count(target4Betn, region.get()[0]), count(target4Betn, region.get()[1]));
	}
846998
public boolean isArray(Type t) {
        while (t.hasTag(WILDCARD))
            t = wildUpperBound(t);
        return t.hasTag(ARRAY);
    }
462612
public int getScriptCount(File dir) {
		int scripts = 0;
		
		for (ScriptType type : this.getScriptTypes()) {
			File locDir = new File(dir, type.getName());
			if (locDir.exists()) {
				for (File f : locDir.listFiles()) {
					String ext = f.getName().substring(f.getName().lastIndexOf(".") + 1);
					String engineName = this.getEngineNameForExtension(ext);
					if (engineName != null) {
						scripts++;
					}
				}
			}
		}
		return scripts;
	}
636502
public int getNumberOfElements() {
        int count = 0;
        for (FormSectionController section : getSections()) {
            count += section.getElements().size();
        }

        return count;
    }
1177785
public int getSubIfdCount() {
    int c = 0;
    if (metadata != null && metadata.contains("SubIFDs"))
      c = getMetadataList("SubIFDs").size();
    return c;
  }
1178679
@Override
	public int getNumberLeaves() {
		while (true) {
			try {
				int result = 0;
				for (Slot slot: subSlots){
					result += slot.getNumberLeaves();
				}
				return result;
			}
			catch (ConcurrentModificationException e) {
				// ignore and retry
			}
		}
	}