This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demov5 | |
/* **** GENERAL PRIMEABLE FIELDS **** */ | |
class PrimedReference[T] { | |
private var _obj: Option[T] = None | |
private var _isCalced = false | |
def cachedObj: Option[T] = { | |
if (!_isCalced) { | |
throw new RuntimeException("Attempting to access unprimed resource!... impossible!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demov4 | |
/* **** GENERAL PRIMEABLE FIELDS **** */ | |
class PrimedReference[T] { | |
private var _obj: Option[T] = None | |
private var _isCalced = false | |
def cachedObj: Option[T] = { | |
if (!_isCalced) { | |
throw new RuntimeException("Attempting to access unprimed resource!... impossible!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo | |
/* *********** USER ************** */ | |
class User(id: Int) { def name = "User" + id } | |
/* *********** END OF USER ************** */ | |
/* *********** Page ************** */ | |
class Page(id: Int) { def name = "Page" + id } | |
/* *********** END OF USER ************** */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo | |
/* *********** USER ************** */ | |
class User(id: Int) { def name = "User" + id } | |
/* *********** END OF USER ************** */ | |
/* *********** VENUE ************** */ | |
sealed abstract class Venue { | |
def venueId: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo | |
class Bar(id: Int) { def name = "Bar" + id } | |
class Baz(id: Int) { def name = "Baz" + id } | |
sealed abstract class Foo { | |
def id: Int | |
def barId: Int | |
def bazId: Int | |
} |