2015. 9. 3. 14:26

스칼라에서 enum 같은 거 사용하기 : scalax.file.Path 중 발췌


  /**
   * Enumeration of the Access modes possible for accessing files
   */
  object AccessModes {
    sealed trait AccessMode
    case object Execute extends AccessMode
    case object Read extends AccessMode
    case object Write extends AccessMode
    def values:Set[AccessMode] = Set(Execute, Read, Write)
  }

Posted by 나야

댓글을 달아 주세요