Prepare URL's prefixes.

@return list of schema prefixes and local prefixes if local URL are allowed.
197566
private List<String> preparePrefixes() {
        // Prepare prefixes for all schemas
        List<String> prefixes = new ArrayList<String>(Schema.values().length + (local ? 3 : 0));
        for (Schema schema : Schema.values()) {
            prefixes.add(schema.getPrefix());
        }

        // For local URls prefixes are "./", "../", "/"
        if (local) {
            Collections.addAll(prefixes, LOCAL_PREFIXES);
        }
        return prefixes;
    }
111705
private void initializePrefixes()
	{
		if (namespaceMap == null) {
			// TODO use logger
			System.err
					.println("Cannot use whitespace filter without initializing the namespace-prefix map for the current Wikipedia language version. DISABLING FILTER.");
		}
		else {
			prefixesToAllow = new HashSet<String>();
			prefixesToReject = new HashSet<String>();

			for (Entry<Integer, String> namespace : namespaceMap.entrySet()) {
				if (allowedNamespaces.contains(namespace.getKey())) {
					prefixesToAllow.add(namespace.getValue() + ":");
				}
				else {
					prefixesToReject.add(namespace.getValue() + ":");
				}
			}
		}
	}
1308046
public function prefixes()
    {
        $ds = DIRECTORY_SEPARATOR;
        $paths = $this->_prefixDirsPsr4;

        foreach ($this->getPrefixes() as $namespace => $dirs) {
            foreach ($dirs as $key => $dir) {
                $paths[$namespace][$key] = $dir . $ds . trim(strtr($namespace, '\\', $ds), $ds);
            }
        }
        return $paths;
    }
629057
public static Set<String> getAvailableLocaleSuffixes() {

		Set<String> availableLocaleSuffixes = new HashSet<>();
		Locale[] availableLocales = Locale.getAvailableLocales();
		for (Locale locale : availableLocales) {
			StringBuilder sb = new StringBuilder();
			if (locale != null) {

				String language = locale.getLanguage();
				String country = locale.getCountry();
				String variant = locale.getVariant();

				if (StringUtils.isNotEmpty(variant)) {
					sb.append(language).append('_').append(country).append('_').append(variant);
				} else if (StringUtils.isNotEmpty(country)) {
					sb.append(language).append('_').append(country);
				} else {
					sb.append(language);
				}
			}
			availableLocaleSuffixes.add(sb.toString());
		}
		return availableLocaleSuffixes;
	}
615393
def __construct_from_components(self, ns_uri, prefix=None, schema_location=None):
        """"""

        assert ns_uri  # other fields are optional

        self.uri = ns_uri
        self.schema_location = schema_location or None
        self.prefixes = OrderedSet()

        if prefix:
            self.prefixes.add(prefix)
        self.preferred_prefix = prefix or None
1304588
private Map<String,Namespace> buildByPrefixMap()
    {
        int len = mNamespaces.size();
        if (len == 0) {
            return Collections.emptyMap();
        }

        LinkedHashMap<String,Namespace> m = new LinkedHashMap<String,Namespace>(1 + len + (len>>1));
        for (int i = 0; i < len; ++i) {
            Namespace ns = mNamespaces.get(i);
            String prefix = ns.getPrefix();
            if (prefix == null) { // shouldn't happen but...
                prefix = "";
            }
            m.put(prefix, ns);
        }
        return m;
    }
155737
public Set<Entry<String, String>> getParameters() {
		Map<String,String> retval = new HashMap<String,String> ();
		for(Entry<String, String> nameValue : this.parameters.entrySet()) {
			retval.put(nameValue.getKey(), (RFC2396UrlDecoder.decode(nameValue.getValue())));
		}
		return retval.entrySet();
	}
1298567
def list_prefix(self):
        

        # fetch attributes from request.json
        attr = XhrController.extract_prefix_attr(request.json)

        try:
            prefixes = Prefix.list(attr)
        except NipapError, e:
            return json.dumps({'error': 1, 'message': e.args, 'type': type(e).__name__})

        return json.dumps(prefixes, cls=NipapJSONEncoder)
40556
public java.util.List<SchemaExtensionInfo> getSchemaExtensionsInfo() {
        if (schemaExtensionsInfo == null) {
            schemaExtensionsInfo = new com.amazonaws.internal.SdkInternalList<SchemaExtensionInfo>();
        }
        return schemaExtensionsInfo;
    }
1338046
public void clearLocalPrefixes() {
		final Map<Integer, PrefixConfig> prefixConfigs = getPrefixConfigs();
		for (final PrefixConfig config : prefixConfigs.values()) {
			config.setPrefix(null);
		}
	}
1158911
private List<String> buildUrls(List<String> references) {
		List<String> urls = new ArrayList<String>(references.size());
		for (String url : references) {
			if (url.toUpperCase().startsWith("RFC")) {
				url = RFC_REFERENCE_BASE_URL + url;
			} else if (url.startsWith("http")) {
				// already an URL so do nothing
			} else {
				url = MIME_TYPE_REFERENCE_BASE_URL + "#" + url;
			}
			urls.add(url);
		}
		return urls;
	}
815914
def get_prefixes(self, ns_uri):
        """"""
        ni = self.__lookup_uri(ns_uri)
        return ni.prefixes.copy()
96200
public List<String> getExtensionPoints(String prefix,String suffix){
		return extensionPointsCache.get(prefix+"@"+suffix);
	}
828917
public java.util.List<RouteFilterPrefix> getExistingAllowedPrefixesToDirectConnectGateway() {
        if (existingAllowedPrefixesToDirectConnectGateway == null) {
            existingAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return existingAllowedPrefixesToDirectConnectGateway;
    }
196145
public List<Field> resolveFieldsWithPrefix(Optional<QualifiedName> prefix)
    {
        return visibleFields.stream()
                .filter(input -> input.matchesPrefix(prefix))
                .collect(toImmutableList());
    }
200946
public List<URL> getURLs() {
        final List<URL> resourceURLs = new ArrayList<>(this.size());
        for (final Resource resource : this) {
            resourceURLs.add(resource.getURL());
        }
        return resourceURLs;
    }
665839
public java.util.List<RouteFilterPrefix> getRouteFilterPrefixes() {
        if (routeFilterPrefixes == null) {
            routeFilterPrefixes = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return routeFilterPrefixes;
    }