Java tutorial
//package com.java2s; import java.util.HashSet; import java.util.Set; public class Main { public static Set<String> FATDMASlotPattern = null; /** * Returns the slot pattern. * * Start slot Block size Increment * 0 5 25 * 10 5 25 * 18 4 25 * @return */ private static Set<String> getFATDMASlotPattern() { if (FATDMASlotPattern == null) { FATDMASlotPattern = new HashSet<String>(); for (int startSlot = 0; startSlot <= 2500; startSlot += 25) { for (int i = 0; i <= 4; ++i) { int slot = startSlot + i; FATDMASlotPattern.add(slot + ""); } } for (int startSlot = 10; startSlot <= 2500; startSlot += 25) { for (int i = 0; i <= 4; ++i) { int slot = startSlot + i; FATDMASlotPattern.add(slot + ""); } } for (int startSlot = 18; startSlot <= 2500; startSlot += 25) { for (int i = 0; i <= 3; ++i) { int slot = startSlot + i; FATDMASlotPattern.add(slot + ""); } } return FATDMASlotPattern; } else { return FATDMASlotPattern; } } }