All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.wumoe.hime.module.socket.HimeSocketToken.kt Maven / Gradle / Ivy

Go to download

This is the interpreter of Hime language, a dialect of Lisp, run on JVM platform.

There is a newer version: 2.7.4
Show newest version
package cn.wumoe.hime.module.socket

import cn.wumoe.hime.lexer.Tag
import cn.wumoe.hime.lexer.Token
import java.io.InputStream
import java.io.PrintWriter
import java.net.Socket
import java.util.*

class HimeSocketToken(val socket: Socket) : Token(Tag.SOCKET) {
    val inputStream: InputStream = socket.getInputStream()
    val printWriter = PrintWriter(socket.getOutputStream())

    override fun toString(): String {
        return "socket"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || javaClass != other.javaClass) return false
        val that = other as HimeSocketToken
        return socket == that.socket
    }

    override fun hashCode(): Int {
        return Objects.hash(socket)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy