see below code. This line is marked as invalid by Eclipse:
var map = Map[MyEnum,Point]()
I am trying to make the scala Java equivalent:
private enum Letters{ A,B,C} private Map<Letters,Integer> thing= new HashMap<Letters,Integer> ();
And this is the file / context in which it is written.
class Point(var x:Int = 0, var y:Int = 0, var hasBeenSet:Boolean = false){ } object MyEnum extends Enumeration{ MyEnum = Value val UL,U,UR,L,R,DL,D,DR = Value } object MyEnumHolder { var map = Map[MyEnum,Point]() MyEnum.values.foreach(x => (map + (x -> new Point()) ) }
I am trying to initialize a map instance with each enum value being mapped to an empty dot (which happens in every loop).
EDIT: I had to edit because I messed up some things by editing the inserted code, but it should be valid now
source share