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

net.sourceforge.plantuml.dedication.TinyHashableString 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.dedication;

import static java.nio.charset.StandardCharsets.UTF_8;

public final class TinyHashableString {

	private final String sentence;
	private int cachedTinyHash = -1;

	public TinyHashableString(String sentence) {
		this.sentence = sentence;
	}

	public String getSentence() {
		return sentence;
	}

	public synchronized int tinyHash() {
		if (cachedTinyHash == -1)
			cachedTinyHash = Noise.shortHash(sentence.getBytes(UTF_8), Dedication.N.toByteArray());

		return cachedTinyHash;

	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy