Commit e77d442c authored by npedot's avatar npedot
Browse files

removes Labeller

parent a7955794
......@@ -30,8 +30,6 @@ class Column (): Labelled {
@JacksonXmlProperty(isAttribute = true)
var dbtable: String? = null
private var labeller = Labeller()
@JsonCreator
constructor(
@JsonProperty("name") name: String,
......@@ -79,26 +77,26 @@ class Column (): Labelled {
}
}
override fun resetLabels(labelsAsString: String): String {
labels = labeller.resetLabels(labelsAsString)
return labelsAsString()
labels = labelsAsString
return labels!!
}
override fun addLabels(labelsAsString: String): String {
labels = labeller.addLabels(labelsAsString)
return labelsAsString()
if (labels==null) labels = labelsAsString
else labels += labelsAsString
return labels!!
}
override fun addLabels(newLabels: List<Label>): String {
labels = labeller.addLabels(newLabels)
return labelsAsString()
return addLabels(newLabels.joinToString(","))
}
override fun labelsAsString(): String {
return labels?: ""
override fun hasLabel(label: String): Boolean {
return labels?.contains(label)?:false
}
override fun hasLabel(label: String): Boolean {
return labeller.hasLabel(label)
override fun labelsAsString(): String {
return labels?: ""
}
override fun toString(): String {
......
......@@ -46,8 +46,6 @@ class Constraint(): Labelled {
@JacksonXmlProperty(isAttribute = true)
var labels: String? = null
private var labeller = Labeller()
fun clone():Constraint {
val objectMapper = ObjectMapper()
val asString = objectMapper.writeValueAsString(this)
......@@ -145,26 +143,26 @@ class Constraint(): Labelled {
}
override fun resetLabels(labelsAsString: String): String {
labels = labeller.resetLabels(labelsAsString)
return labelsAsString()
labels = labelsAsString
return labels!!
}
override fun addLabels(labelsAsString: String): String {
labels = labeller.addLabels(labelsAsString)
return labelsAsString()
if (labels==null) labels = labelsAsString
else labels += labelsAsString
return labels!!
}
override fun addLabels(newLabels: List<Label>): String {
labels = labeller.addLabels(newLabels)
return labelsAsString()
return addLabels(newLabels.joinToString(","))
}
override fun labelsAsString(): String {
return labels?: ""
override fun hasLabel(label: String): Boolean {
return labels?.contains(label)?:false
}
override fun hasLabel(label: String): Boolean {
return labeller.hasLabel(label)
override fun labelsAsString(): String {
return labels?: ""
}
override fun toString(): String {
......
package unibz.cs.semint.kprime.domain.ddl
class Labeller: Labelled {
private var labels : MutableList<Label>? = null
override
fun resetLabels(labelsAsString: String):String {
if (labels==null) labels = mutableListOf()
else labels?.clear()
addLabels(labelsAsString)
return labelsAsString()
}
override
fun addLabels(labelsAsString: String):String {
if (labels==null) labels = mutableListOf()
labels?.addAll(labelsAsString.split(","))
return labelsAsString()
}
override
fun addLabels(newLabels: List<Label>): String {
if (labels==null) labels = mutableListOf()
labels?.addAll(newLabels)
return labelsAsString()
}
override
fun labelsAsString(): String {
return labels?.joinToString(",")?: ""
}
override
fun hasLabel(label:String):Boolean {
return labelsAsString().contains(label)
}
}
\ No newline at end of file
......@@ -35,7 +35,6 @@ class Table (): Labelled {
@JacksonXmlProperty(isAttribute = true)
var source: String? = null
private var labeller = Labeller()
fun hasColumn(nameToFind:String): Boolean {
for (col in columns) {
......@@ -81,31 +80,30 @@ class Table (): Labelled {
}
override fun resetLabels(labelsAsString: String): String {
labels = labeller.resetLabels(labelsAsString)
return labelsAsString()
labels = labelsAsString
return labels!!
}
override fun addLabels(labelsAsString: String): String {
labels = labeller.addLabels(labelsAsString)
return labelsAsString()
if (labels==null) labels = labelsAsString
else labels += labelsAsString
return labels!!
}
fun addColomunsLabels(labelsAsString: String): String {
for (column in columns) column.addLabels(labelsAsString)
return ""
override fun addLabels(newLabels: List<Label>): String {
return addLabels(newLabels.joinToString(","))
}
override fun addLabels(newLabels: List<Label>): String {
labels = labeller.addLabels(newLabels)
return labelsAsString()
override fun hasLabel(label: String): Boolean {
return labels?.contains(label)?:false
}
override fun labelsAsString(): String {
return labels?: ""
}
override fun hasLabel(label: String): Boolean {
return labeller.hasLabel(label)
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