Example usage for java.util TreeSet TreeSet

List of usage examples for java.util TreeSet TreeSet

Introduction

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

Prototype

public TreeSet() 

Source Link

Document

Constructs a new, empty tree set, sorted according to the natural ordering of its elements.

Usage

From source file:byps.test.TestSerializerSet.java

/**
 * Test with null values for all lists./*from w w w  .j av a  2s  .  com*/
 * @throws BException
 */
@Test
public void testSetEmpty() throws BException {
    log.info("testSetEmpty(");
    BOutput bout = transport.getOutput();

    SetTypes obj = new SetTypes();
    obj.boolean1 = new HashSet<Boolean>();
    obj.byte1 = new HashSet<Byte>();
    obj.char1 = new TreeSet<Character>();
    obj.double1 = new HashSet<Double>();
    obj.float1 = new HashSet<Float>();
    obj.int1 = new HashSet<Integer>();
    obj.long1 = new HashSet<Long>();
    obj.primitiveTypes1 = new HashSet<PrimitiveTypes>();
    obj.short1 = new HashSet<Short>();
    obj.string1 = new HashSet<String>();

    bout.store(obj);

    ByteBuffer buf = bout.toByteBuffer();
    TestUtils.printBuffer(log, buf);

    BInput bin = transport.getInput(null, buf);
    SetTypes objR = (SetTypes) bin.load();
    TestUtils.assertEquals(log, "", obj, objR);
    log.info(")testSetEmpty");
}

From source file:com.qpark.maven.plugin.springintegration.SpringIntegrationConfigGenerator.java

public void generate() {
    this.log.debug("+generate");
    final TreeSet<String> serviceIds = new TreeSet<String>();
    for (final ElementType element : this.config.getElementTypes()) {
        if (element.isRequest()) {
            serviceIds.add(element.getServiceId());
        }//from  w w  w. j  a va  2 s .  com
    }
    for (final String serviceId : serviceIds) {
        this.generateService(serviceId);
    }
    this.log.debug("-generate");
}

From source file:com.creditcloud.ump.model.ump.base.BaseResponse.java

public String chkString() {
    Map<String, String> values = MessageUtils.getFieldValuesMap(this);
    Set<String> sets = new TreeSet<>();

    for (String key : values.keySet()) {
        String value = values.get(key);
        if (!key.equals("sign") && !key.equals("sign_type") && !key.equals("rspType")) {
            // skip sign and sign_type and rspType field, they are not in checksum string
            if (value != null) {
                sets.add(key + "=" + value);
            }/*from  w ww  . ja  v  a  2  s . c o m*/
        }
    }

    return StringUtils.join(sets, "&");
}

From source file:net.sf.sripathi.ws.mock.util.Folder.java

/**
 * Gets the folder information for the path provided.
 * If the folder is not present creates a new folder.
 * /*from w w w. j a v a2  s .c  om*/
 * @param path folder path string.
 * 
 * @return instance of Folder class.
 */
public static Folder getInstance(String path) {

    Folder folder = null;
    Folder.folderMap = new HashMap<String, Folder>();
    Folder.fileSet = new TreeSet<String>();

    try {
        File file = new File(path);

        if (!file.exists()) {
            file.mkdir();
        }

        if (!file.isDirectory() && !file.canRead() && !file.canWrite()) {
            throw new MockException("Unable to read dir " + path + " make sure access is set correctly");
        }

        //Get root and sub directories
        folder = new Folder(path, file);

        Folder.folderMap.put(path, folder);

    } catch (Exception e) {
        throw new MockException("Unable to read dir " + path + " make sure access is set correctly");
    }

    return folder;
}

From source file:com.appeligo.util.ActiveCache.java

public ActiveCache(int minCached, int maxCached) {
    map = new HashMap<K, ActiveObject<K, V>>();
    activeSet = new TreeSet<ActiveObject<K, V>>();
    this.minCached = minCached;
    this.maxCached = maxCached;
}

From source file:com.jiwhiz.domain.post.BlogPost.java

/**
 * Parse user input tag string and trim the key words, remove duplicate and store as sorted tags.
 * // ww  w  .  j  a v a2  s.  c o  m
 * @param tagString
 */
public void parseAndSetTagString(String tagString) {
    Set<String> tagSet = new TreeSet<String>();

    for (String tag : tagString.split(",")) {
        String newTag = tag.trim();
        if (newTag.length() > 0) {
            tagSet.add(newTag);
        }
    }

    Iterator<String> iter = tagSet.iterator();
    StringBuilder sb = new StringBuilder();
    while (iter.hasNext()) {
        sb.append(iter.next());
        if (iter.hasNext()) {
            sb.append(",");
        }
    }
    this.tagString = sb.toString();
}

From source file:edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity.java

public PlannedActivity() {
    plannedActivityLabels = new TreeSet<PlannedActivityLabel>();
}

From source file:com.jdom.axis.and.allies.view.AndroidStrategy.java

public SortedSet<String> getAvailableGames() {
    SortedSet<String> available = new TreeSet<String>();
    for (File file : context.getFilesDir().listFiles()) {
        if (file.isFile()) {
            available.add(file.getName().replaceAll(PROPERTIES_EXTENSION, ""));
        }//from  w  w w  .  j  ava2 s  . c  o m
    }
    return available;
}

From source file:com.inmobi.databus.partition.TestPartitionReaderHadoopStream.java

@BeforeTest
public void setup() throws Exception {
    consumerNumber = 1;//from   w w w  .j a  v a 2  s. c  om
    // setup fs
    files = new String[] { HadoopUtil.files[1], HadoopUtil.files[3], HadoopUtil.files[5] };
    fs = FileSystem.getLocal(conf);
    streamDir = new Path(new Path(TestUtil.getConfiguredRootDir(), this.getClass().getSimpleName()), testStream)
            .makeQualified(fs);
    HadoopUtil.setupHadoopCluster(conf, files, null, databusFiles, streamDir, false);
    inputFormatClass = SequenceFileInputFormat.class.getName();
    partitionMinList = new TreeSet<Integer>();
    for (int i = 0; i < 60; i++) {
        partitionMinList.add(i);
    }
    Map<Integer, PartitionCheckpoint> chkpoints = new TreeMap<Integer, PartitionCheckpoint>();
    partitionCheckpointList = new PartitionCheckpointList(chkpoints);
}

From source file:com.jaeksoft.searchlib.renderer.filter.RendererFilterQueries.java

private Set<String> getTermSet(String fieldName) {
    Set<String> queries = filterTerms.get(fieldName);
    if (queries != null)
        return queries;
    queries = new TreeSet<String>();
    filterTerms.put(fieldName, queries);
    return queries;
}