Skip to content
Snippets Groups Projects
Commit 1c7ff359 authored by Kaj Koivunen's avatar Kaj Koivunen :coffee:
Browse files

XML:n lukeminen

parent 1f9ad834
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,7 @@ import javax.xml.stream.XMLInputFactory
import javax.xml.stream.events.XMLEvent
class Character {
var literal: String? = null
class Character(var literal: String = "") : Comparable<Character> {
var rmgroups: MutableList<RMGroup> = mutableListOf()
fun print() {
......@@ -17,6 +16,14 @@ class Character {
n.print()
}
}
override fun equals(other: Any?): Boolean {
if (other is Character) {
return this.literal == other.literal
}
return super.equals(other)
}
override fun compareTo(other: Character) = this.literal.compareTo(other.literal)
}
class RMGroup {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment