Mercurial Hosting > nabble
diff src/fschmidt/html/HtmlCdata.java @ 68:00520880ad02
add fschmidt source
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Oct 2025 17:24:15 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/fschmidt/html/HtmlCdata.java Sun Oct 05 17:24:15 2025 -0600 @@ -0,0 +1,28 @@ +package fschmidt.html; + + +public final class HtmlCdata { + public final String text; + + public HtmlCdata(String text) { + this.text = text; + } + + public String toString() { + return "<![CDATA["+text+"]]>"; + } + + public boolean equals(Object obj) { + if( obj == this ) + return true; + if( !(obj instanceof HtmlCdata) ) + return false; + HtmlCdata m = (HtmlCdata)obj; + return m.text.equals(text); + } + + public int hashCode() { + return text.hashCode(); + } + +}