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

java.text.ParsePosition.scala Maven / Gradle / Ivy

package java.text

class ParsePosition(private[this] var index: Int) {
  private[this] var errorIndex: Int = -1

  def getIndex(): Int = index

  def setIndex(index: Int): Unit = this.index = index

  def setErrorIndex(ei: Int): Unit = this.errorIndex = ei

  def getErrorIndex(): Int = errorIndex

  override def equals(other: Any): Boolean =
    other match {
      case that: ParsePosition =>
        getErrorIndex() == that.getErrorIndex() &&
        getIndex() == that.getIndex()
      case _                   => false
    }

  override def hashCode(): Int = {
    val state = Seq(getErrorIndex(), getIndex())
    state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b)
  }

  override def toString(): String =
    s"java.text.ParsePosition[index=${getIndex()},errorIndex=${getErrorIndex()}]"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy