清空服务列表

@return 带回收的服务列表
2561
protected Map<ProviderInfo, ClientTransport> clearProviders() {
        providerLock.lock();
        try {
            // 当前存活+重试的
            HashMap<ProviderInfo, ClientTransport> all = new HashMap<ProviderInfo, ClientTransport>(aliveConnections);
            all.putAll(subHealthConnections);
            all.putAll(retryConnections);
            all.putAll(uninitializedConnections);
            subHealthConnections.clear();
            aliveConnections.clear();
            retryConnections.clear();
            uninitializedConnections.clear();
            return all;
        } finally {
            providerLock.unlock();
        }
    }
864591
protected function clearValues()
    {
        $nPath = $this->getNamespacePath();
        $dp = @opendir($nPath);
        while ($file = @readdir($dp)) {
            if ('.' === $file || '..' === $file) {
                continue;
            }
            $cur_file = "{$nPath}/{$file}";
            if (is_file($cur_file)) {
                @unlink($cur_file);
            }
        }
        @closedir($dp);
        @rmdir($nPath);
        return true;
    }
1296498
public final T clear()
  {
    T hold;
    _lock.lock();
    try
    {
      hold = _val;
      _val = null;
    } finally {
      _lock.unlock();
    }
    return hold;
  }
300733
public static Editor clear() {
        final Editor editor = getPreferences().edit().clear();
        editor.apply();
        return editor;
    }
1053490
public UnicodeSet clear() {
        checkFrozen();
        list[0] = HIGH;
        len = 1;
        pat = null;
        strings.clear();
        return this;
    }
1097532
public static boolean cleanEmpty(File directory) throws IORuntimeException {
		if (directory == null || directory.exists() == false || false == directory.isDirectory()) {
			return true;
		}

		final File[] files = directory.listFiles();
		if(ArrayUtil.isEmpty(files)) {
			//空文件夹则删除之
			directory.delete();
		}
		for (File childFile : files) {
			clean(childFile);
		}
		return true;
	}
143318
@Override
    public Map<K, V> clearAll() {
        Map<K, V> result = new LinkedHashMap<K, V>(map.size());

        for (Map.Entry<K, V> entry : map.entrySet()) {
            K key = entry.getKey();
            V value = entry.getValue();

            boolean removed = map.remove(key, value);

            if (removed) {
                result.put(key, value);
            }
        }

        return result;
    }
1065144
public M removeNullValueAttrs() {
		for (Iterator<Entry<String, Object>> it = attrs.entrySet().iterator(); it.hasNext();) {
			Entry<String, Object> e = it.next();
			if (e.getValue() == null) {
				it.remove();
				_getModifyFlag().remove(e.getKey());
			}
		}
		return (M)this;
	}
1123600
private Set<String> cleanUpResult(Set<String> s) {
        s.remove(null);
        return s;
    }
338923
private List<Statement> trim(List<Statement> nodes) throws ParseException {
        if (!removeDirectiveBlankLine) {
            return nodes;
        }

        // 待移除的空的 Text Node (主要是 Text Node 不允许为空的内容，只能在循环外把它delete了)
        List<Integer> empty_text_index_list = new ArrayList<Integer>();

        for (int i = 0; i < nodes.size(); i++) {
            Statement node = nodes.get(i);

            if (isTrimableDirective(node)) {
                if (i > 0) {
                    int prev_index = i - 1;
                    Statement prev = nodes.get(prev_index);

                    if (isNoLiteralText(prev)
                            && !empty_text_index_list.contains(prev_index)) {
                        // 删除上一个文本节点最后一个\n之后的所有空白符
                        String text = ((Text) prev).getContent();
                        int pos = text.lastIndexOf('\n');
                        if (pos >= 0) {
                            String tail = text.substring(pos + 1);
                            if (tail.length() > 0 && tail.trim().length() == 0) {
                                text = text.substring(0, pos + 1);
                                if (text.length() == 0) {
                                    empty_text_index_list.add(prev_index); // 将会是空节点，加入到待删除队列
                                } else {
                                    nodes.set(prev_index, new Text(text, false,
                                            prev.getOffset())); // 修改
                                }
                            }
                        }
                    }
                } // prev text node

                if (i + 1 < nodes.size()) {
                    int next_index = i + 1;
                    Statement next = nodes.get(next_index);

                    if (isNoLiteralText(next)) {
                        // 删除下一个文本节点地一个\n之前的所有空白符
                        String text = ((Text) next).getContent();
                        int pos = text.indexOf('\n');
                        if (pos >= 0) {
                            String head = text.substring(0, pos);
                            if (head.trim().length() == 0) {
                                text = text.substring(pos + 1);
                                boolean isEmptyNode = false;
                                if (text.length() == 0) {
                                    empty_text_index_list.add(next_index); // 将会是空节点，加入到待删除队列
                                    isEmptyNode = true;
                                } else if (text.indexOf('\n') == -1
                                        && text.trim().length() == 0) {
                                    // 看看下面是不是还是个指令，是不是可以全部丢掉
                                    if (next_index + 1 < nodes.size()) {
                                        Statement next_next = nodes
                                                .get(next_index + 1);
                                        if (isTrimableDirective(next_next)) {
                                            empty_text_index_list
                                                    .add(next_index); // 将会是空节点，加入到待删除队列
                                            isEmptyNode = true;
                                        }
                                    }
                                }
                                if (!isEmptyNode) {
                                    nodes.set(next_index, new Text(text, false,
                                            next.getOffset())); // 修改
                                }
                            }
                        }
                        i++; // skip next
                    }
                } // next text node
            } // not Directive
        }

        // 删除需要删掉的空节点。
        if (empty_text_index_list.size() > 0) {
            // 必须先删除后面的node
            for (int i = empty_text_index_list.size() - 1; i >= 0; i--) {
                int index = empty_text_index_list.get(i); // 必须转成小 int,
                // 否则就是删除对象，不是删除指定的index
                nodes.remove(index);
            }
        }
        return nodes;
    }
278774
public S getEmptySequence() {
        if (empty == null)
            synchronized (this) {
                if (empty == null)
                    empty = createBuilder().createAndDestroy();
            }
        return empty;
    }
148766
public static String cleanWhitespace(String str) {
        int length = str.length();

        StringBuffer buf = new StringBuffer(length);
        for (int i=0; i<length; i++) {
            char c = str.charAt(i);
            if (Character.isWhitespace(c)) {
                buf.append(' ');
            }
            else {
                buf.append(c);
            }
        }

        return buf.toString();
    }
886598
public static String trimWhitespaceToNull(final String s) {
        final String result = trimWhitespace(s);
        return StringUtils.isEmpty(result) ? null : s;
    }
408527
public function flush()
	{
		$this->where = null;
		$this->_aSelect = array();
		$this->_sFrom = '';
		$this->_sFromAs = '';
		$this->_aJoin = array();
		$this->_sUpdate = '';
		$this->_mWhere = array();
		$this->_aSet = array();
		$this->_sInsertInto = '';
		$this->_aValues = array();
		$this->_sDelete = '';
		$this->_aOrderBy = array();
		$this->_aGroupBy = array();
		$this->_iLimit = null;
		return $this;
	}
113480
final void clear () {

        immediateFlag = false;
        operationCode = OperationCode.LOGIN_REQUEST;
        finalFlag = false;

        totalAHSLength = 0x00;
        dataSegmentLength = 0x00000000;
        initiatorTaskTag = 0x00000000;

        parser = null;
    }
656964
public boolean flushall() {
        String result = "";
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            result = jedis.flushAll();
            logger.info("redis client name: " + this.getCacheName() + " flushall.");

        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            this.jedisPool.returnBrokenResource(jedis);
        } finally {
            if (jedis != null) {
                this.jedisPool.returnResource(jedis);
            }
        }
        return "OK".equalsIgnoreCase(result);
    }
254771
public function clearAll(): bool
    {
        // 取缓存目录
        $fileList = $this->getFileList();

        // 删除目录 中的每一个数据缓存文件
        foreach ($fileList as $key => $expire) {
            $info = $this->getFile($key);
            unlink($info[1]);
            unlink($info[2]);
        }

        // 删除目录文件
        $this->delFileList();
        return true;
    }