TreeSet ceiling - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TreeSet ceiling method.

This code example shows how to use the following methods:add, ceiling, floor
package ru.antonevane.ch7; 
 
import java.util.SortedMap; 
import java.util.TreeMap; 
import java.util.TreeSet; 
 
public class Navigatable { 
 
	public static void main(String[] args) {
		TreeSet<Integer> times = new TreeSet<Integer>();
		times.add(1545);
		times.add(1645);
		times.add(1945);
		 
 
		System.out.println(times.floor(1644));
		System.out.println(times.ceiling(1644));
 
		TreeMap<String, String> map = new TreeMap<String, String>();
		map.put("a", "ant");

6
CodeRank
This code example shows how to use the following methods:add, ceiling
    public void updateTable(boolean dedup, String procedure, long partition, long timestamp,
            long invocations, long minIN, long maxIN, long avgIN)
    { 
        ProcInputRow in = new ProcInputRow(procedure, partition, timestamp,
            invocations, minIN, maxIN, avgIN);
        ProcInputRow exists = m_rowsTable.ceiling(in);
        if (exists != null && in.procedure.equals(exists.procedure)) {
            exists.updateWith(dedup, in);
        } else { 
            m_rowsTable.add(in);
        } 
    } 
 
    // Return table ordered by total bytes out 
    public VoltTable sortByInput(String tableName)
    { 
        List<ProcInputRow> sorted = new ArrayList<ProcInputRow>(m_rowsTable);
        Collections.sort(sorted, new Comparator<ProcInputRow>() {
            @Override 
            public int compare(ProcInputRow r1, ProcInputRow r2) {
5
CodeRank
This code example shows how to use the following methods:ceiling
        return _policyTable;
    } 
 
    public NetworkPolicyModel lookupNetworkPolicy(String uuid) {
        NetworkPolicyModel vmKey = new NetworkPolicyModel(uuid, null);
        NetworkPolicyModel current = _policyTable.ceiling(vmKey);
        if (current != null && current.getUuid().equals(uuid)) {
            return current;
        } 
        return null; 
    } 
} 
4
CodeRank
ceiling Method Overview
Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
See Code Examples for other Java 8 TreeSet Methods: