Example usage for org.apache.commons.collections4.bidimap TreeBidiMap nextKey

List of usage examples for org.apache.commons.collections4.bidimap TreeBidiMap nextKey

Introduction

In this page you can find the example usage for org.apache.commons.collections4.bidimap TreeBidiMap nextKey.

Prototype

public K nextKey(final K key) 

Source Link

Document

Gets the next key after the one specified.

Usage

From source file:org.apache.poi.hpsf.Section.java

/**
 * Retrieves the length of the given property (by key)
 *
 * @param offset2Id the offset to id map
 * @param entryOffset the current entry key
 * @param maxSize the maximum offset/size of the section stream
 * @return the length of the current property
 *///from w  w  w .  j a  va 2 s  .com
private static int propLen(TreeBidiMap<Long, Long> offset2Id, Long entryOffset, long maxSize) {
    Long nextKey = offset2Id.nextKey(entryOffset);
    long begin = entryOffset;
    long end = (nextKey != null) ? nextKey : maxSize;
    return (int) (end - begin);
}