Commit bfb28c5a by Hut

added glyph

parent c071d812
package markov;
public class Glyph {
public enum Type {
word, interpunction, control, whitespace
}
private Type type;
private String content;
public Type getType() {
return type;
}
public String getContent() {
return content;
}
public Glyph(Type type, String content) {
this.type = type;
this.content = content;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Glyph glyph = (Glyph) o;
if (type != glyph.type) return false;
return content != null ? content.equals(glyph.content) : glyph.content == null;
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (content != null ? content.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Glyph{" +
"type=" + type +
", content='" + content + '\'' +
'}';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment