Example usage for java.util EnumSet toString

List of usage examples for java.util EnumSet toString

Introduction

In this page you can find the example usage for java.util EnumSet toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:gov.nih.nci.ispy.service.clinical.ClinicalFileBasedQueryService.java

private Set<String> getPatientDIDsForPcr(EnumSet<PcrType> pcrSet) {
    Set<String> patientDIDs = new HashSet<String>();
    for (int i = 0; i < pcrSet.size(); i++) {
        System.out.println("pcrSet.toString()" + pcrSet.toString());
    }/*from w  ww  .j a v a  2  s  .co m*/

    for (PatientData pd : patientDataMap.values()) {
        System.out.println("pd.getPcr():" + pd.getPcr());

        if (pcrSet.contains(pd.getPcrType())) {
            patientDIDs.add(pd.getISPY_ID());
        }
    }
    return patientDIDs;
}

From source file:gov.nih.nci.ispy.service.clinical.ClinicalFileBasedQueryService.java

private Set<String> getPatientDIDsForRace(EnumSet<RaceType> raceValues) {
    Set<String> patientDIDs = new HashSet<String>();

    for (int i = 0; i < raceValues.size(); i++) {
        System.out.println("raceValues.toString()" + raceValues.toString());
    }//from   ww  w  . ja  va2  s  . co m

    for (PatientData pd : patientDataMap.values()) {

        if (raceValues.contains(pd.getRace())) {
            patientDIDs.add(pd.getISPY_ID());
        }
    }

    return patientDIDs;
}

From source file:org.apache.hadoop.yarn.server.resourcemanager.TestApplicationMasterService.java

@Test(timeout = 3000000)
public void testResourceTypes() throws Exception {
    HashMap<YarnConfiguration, EnumSet<SchedulerResourceTypes>> driver = new HashMap<YarnConfiguration, EnumSet<SchedulerResourceTypes>>();

    CapacitySchedulerConfiguration csconf = new CapacitySchedulerConfiguration();
    csconf.setResourceComparator(DominantResourceCalculator.class);
    YarnConfiguration testCapacityDRConf = new YarnConfiguration(csconf);
    testCapacityDRConf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,
            ResourceScheduler.class);
    YarnConfiguration testCapacityDefConf = new YarnConfiguration();
    testCapacityDefConf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,
            ResourceScheduler.class);
    YarnConfiguration testFairDefConf = new YarnConfiguration();
    testFairDefConf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class, ResourceScheduler.class);

    driver.put(conf, EnumSet.of(SchedulerResourceTypes.MEMORY));
    driver.put(testCapacityDRConf,//from  www.  j a v a  2  s  .c o m
            EnumSet.of(SchedulerResourceTypes.CPU, SchedulerResourceTypes.MEMORY, SchedulerResourceTypes.GPU));
    driver.put(testCapacityDefConf, EnumSet.of(SchedulerResourceTypes.MEMORY));
    driver.put(testFairDefConf, EnumSet.of(SchedulerResourceTypes.CPU, SchedulerResourceTypes.MEMORY));

    for (Map.Entry<YarnConfiguration, EnumSet<SchedulerResourceTypes>> entry : driver.entrySet()) {
        EnumSet<SchedulerResourceTypes> expectedValue = entry.getValue();
        MockRM rm = new MockRM(entry.getKey());
        rm.start();
        MockNM nm1 = rm.registerNode("127.0.0.1:1234", 6 * GB);
        RMApp app1 = rm.submitApp(2048);
        nm1.nodeHeartbeat(true);
        RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
        MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
        RegisterApplicationMasterResponse resp = am1.registerAppAttempt();
        EnumSet<SchedulerResourceTypes> types = resp.getSchedulerResourceTypes();
        LOG.info("types = " + types.toString());
        Assert.assertEquals(expectedValue, types);
        rm.stop();
    }
}