Java Stream Close close(Appendable sb, String comp)

Here you can find the source of close(Appendable sb, String comp)

Description

_more_

License

Apache License

Parameter

Parameter Description
sb _more_
comp _more_

Return

_more_

Declaration

public static Appendable close(Appendable sb, String comp) 

Method Source Code

//package com.java2s;
/*//from   w w w  . ja  v  a 2s.  com
* Copyright (c) 2008-2018 Geode Systems LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
*     http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.io.IOException;

public class Main {
    /**
     * _more_
     *
     * @param comp _more_
     *
     * @return _more_
     */
    public static String close(String comp) {
        StringBuilder sb = new StringBuilder();
        close(sb, comp);

        return sb.toString();
    }

    /**
     * _more_
     *
     * @param sb _more_
     * @param comp _more_
     *
     * @return _more_
     */
    public static Appendable close(Appendable sb, String comp) {
        try {
            sb.append("</");
            sb.append(comp);
            sb.append(">");
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }

        return sb;
    }

    /**
     * _more_
     *
     * @param v _more_
     *
     * @return _more_
     */
    private static String toString(double v) {
        if (v == v) {
            return "" + v;
        }

        return "";
    }
}

Related

  1. close(Appendable output)
  2. close(BufferedReader br)
  3. close(BufferedReader br)
  4. close(BufferedWriter bufferedWriter)
  5. close(ClassLoader cl)