public boolean contains(short value) { return data.contains(value); }
private short chooseMinLabelPartition(short currentPartition) { short newPartition; if (maxIndices.size() == 1) { newPartition = maxIndices.get(0); } else { if (maxIndices.contains(currentPartition)) { newPartition = currentPartition; } else { newPartition = maxIndices.get(0); } } return newPartition; }
private short chooseRandomPartitionOrCurrent(short currentPartition) { short newPartition; if (maxIndices.size() == 1) { newPartition = maxIndices.get(0); } else { // break ties randomly unless current if (maxIndices.contains(currentPartition)) { newPartition = currentPartition; } else { newPartition = maxIndices .get(rnd.nextInt(maxIndices.size())); } } return newPartition; }