I was under the impression that you're iterating over different edge types as the first dimension here. If that's the case, you could use EDGETYPE.values().