Commit 336eae6a authored by npedot's avatar npedot
Browse files

adds remLabels to Labelled

parent 435185b0
......@@ -95,6 +95,13 @@ class Column (): Labelled {
return addLabels(newLabels.joinToString(","))
}
override fun remLabels(newLabels: List<Label>): String {
val labels2 = labels ?: return ""
return resetLabels(labels2.split(",")
.filter { !newLabels.contains(it) }
.joinToString(","))
}
override fun hasLabel(label: String): Boolean {
return labels?.contains(label)?:false
}
......
......@@ -165,6 +165,13 @@ class Constraint : Labelled {
return labels?: ""
}
override fun remLabels(newLabels: List<Label>): String {
val labels2 = labels ?: return ""
return resetLabels(labels2.split(",")
.filter { !newLabels.contains(it) }
.joinToString(","))
}
fun toStringWithName(): String {
return "${this.name}:${toString()}"
}
......
......@@ -8,6 +8,8 @@ interface Labelled {
fun addLabels(newLabels:List<Label>): String
fun remLabels(newLabels:List<Label>): String
fun labelsAsString():String
fun hasLabel(label:String) :Boolean
......
......@@ -102,6 +102,13 @@ class Table (): Labelled {
return labels?: ""
}
override fun remLabels(newLabels: List<Label>): String {
val labels2 = labels ?: return ""
return resetLabels(labels2.split(",")
.filter { !newLabels.contains(it) }
.joinToString(","))
}
fun addColomunsLabels(labelsAsString: String): String {
for (column in columns) column.addLabels(labelsAsString)
return ""
......
Supports Markdown
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