All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.url.CMapData Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.url;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;

import net.sourceforge.plantuml.text.BackSlash;

public class CMapData {
    // ::remove file when __HAXE__

	private final StringBuilder stringBuilder = new StringBuilder();

	public String asString(String nameId) {
		return "\n" + stringBuilder.toString() + "\n";
	}

	public boolean containsData() {
		return stringBuilder.length() > 0;
	}

	public void appendString(String s) {
		stringBuilder.append(s);
	}

	public void appendLong(long s) {
		stringBuilder.append(s);
	}

	private void appendUrl(int seq, Url url, double scale) {
		appendString("\"\"");

		appendString(BackSlash.NEWLINE);
	}

	public static CMapData cmapString(Set allUrlEncountered, double scale) {
		final CMapData cmapdata = new CMapData();

		final List all = new ArrayList<>(allUrlEncountered);
		Collections.sort(all, Url.SURFACE_COMPARATOR);

		int seq = 1;
		for (Url u : all) {
			if (u.hasData() == false) {
				continue;
			}
			cmapdata.appendUrl(seq, u, scale);
			seq++;
		}
		return cmapdata;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy