Here you can find the source of close(Appendable sb, String comp)
Parameter | Description |
---|---|
sb | _more_ |
comp | _more_ |
public static Appendable close(Appendable sb, String comp)
//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 ""; } }