I'm trying to adapt code from here and I can't figure out why they've declared and instantiated their HashMaps using square brackets. Here's some simplified sample code:
class CommunityStructure {
HashMap<Modularity.Community, Float>[] nodeConnectionsWeight;
HashMap<Modularity.Community, Integer>[] nodeConnectionsCount;
int N;
...
CommunityStructure(Graph graph) {
...
N = graph.getNodeCount();
nodeConnectionsWeight = new HashMap[N];
}
...
}
I thought square brackets were mainly meant for arrays, so I was confused to see them applied to Maps as well.