Guava TreeMultiset - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava TreeMultiset class.

This code example shows how to use the following methods:add, remove
	@Override 
	public void addKeepAliveTimeout(SelectableChannel channel, Timeout timeout) {
		logger.debug("added keep-alive timeout: {}", timeout);
		DecoratedTimeout oldTimeout = index.get(channel);
		if (oldTimeout != null) {
			timeouts.remove(oldTimeout);
		} 
		DecoratedTimeout decorated = new DecoratedTimeout(channel, timeout);
		timeouts.add(decorated);
		index.put(channel, decorated);
	} 
 
	@Override 
	public void addTimeout(Timeout timeout) {
		logger.debug("added generic timeout: {}", timeout);
		timeouts.add(new DecoratedTimeout(timeout));		
	} 
 
	@Override 
	public boolean hasKeepAliveTimeout(SelectableChannel channel) {
6
CodeRank
See Code Examples for Guava TreeMultiset Methods: