Skip to content

Commit

Permalink
Removes delegate property.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Gasser <[email protected]>
  • Loading branch information
ppanopticon committed Dec 10, 2024
1 parent 5751a04 commit 0533298
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import org.vitrivr.engine.core.model.content.element.TextContent
import org.vitrivr.engine.core.model.content.impl.memory.InMemoryImageContent
import org.vitrivr.engine.core.model.content.impl.memory.InMemoryTextContent
import org.vitrivr.engine.core.util.extension.BufferedImage
import java.awt.image.BufferedImage
import java.text.SimpleDateFormat
import java.util.*

Expand Down Expand Up @@ -65,7 +64,6 @@ sealed class InputData() {
@Serializable
data class TextInputData(val data: String, override val comparison: String? = "==") : InputData() {
override val type = InputType.TEXT

override fun toContent(): TextContent = InMemoryTextContent(data)
}

Expand All @@ -76,11 +74,9 @@ data class TextInputData(val data: String, override val comparison: String? = "=
@Serializable
data class VectorInputData(val data: List<Float>, override val comparison: String? = "==") : InputData(){
override val type = InputType.VECTOR

override fun toContent(): ContentElement<*> {
throw UnsupportedOperationException("Cannot derive content from VectorInputData")
}

}

/**
Expand All @@ -90,13 +86,7 @@ data class VectorInputData(val data: List<Float>, override val comparison: Strin
@Serializable
data class ImageInputData(val data: String, override val comparison: String? = "==") : InputData() {
override val type = InputType.VECTOR
override fun toContent(): ImageContent = InMemoryImageContent(image)

/**
* [BufferedImage] representation of the base64 input.
*/
private val image: BufferedImage by lazy { BufferedImage(data) }

override fun toContent(): ImageContent = InMemoryImageContent(BufferedImage(data))
}

/**
Expand Down Expand Up @@ -150,7 +140,7 @@ data class DateInputData(val data: String, override val comparison: String? = "=
/**
* Parses the input in YYYY-mm-dd format.
*/
fun parseDate():Date{
fun parseDate(): Date {
val formatter = SimpleDateFormat("YYYY-mm-dd", Locale.ENGLISH)
return formatter.parse(data)
}
Expand Down

0 comments on commit 0533298

Please sign in to comment.