org.geowebcache.diskquota.storage.Quota.subtract()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.geowebcache.diskquota.storage.Quota.subtract方法的一些代码示例,展示了Quota.subtract的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.subtract方法的具体详情如下:
包路径:org.geowebcache.diskquota.storage.Quota
类名称:Quota
方法名:subtract

Quota.subtract介绍

[英]Shorthand for #subtract(BigInteger)
[中]#subtract(大整数)的缩写

代码示例

代码示例来源:origin: GeoWebCache/geowebcache

/** Shorthand for {@link #subtract(BigInteger) subtract(quota.getBytes())} */
public void subtract(final Quota quota) {
  subtract(quota.getBytes());
}

代码示例来源:origin: GeoWebCache/geowebcache

/** Shorthand for {@link #subtract(BigInteger) subtract(units.toBytes(amount))} */
public void subtract(final double amount, final StorageUnit units) {
  subtract(units.toBytes(amount));
}

代码示例来源:origin: GeoWebCache/geowebcache

public void call(Transaction transaction) {
    EntityCursor<TileSet> tileSets =
        tileSetsByLayer.entities(transaction, layerName, true, layerName, true, null);
    TileSet tileSet;
    Quota freed;
    Quota global;
    try {
      while (null != (tileSet = tileSets.next())) {
        if (shouldDelete.test(tileSet)) {
          freed =
              usedQuotaByTileSetId.get(
                  transaction, tileSet.getId(), LockMode.DEFAULT);
          global =
              usedQuotaByTileSetId.get(
                  transaction, GLOBAL_QUOTA_NAME, LockMode.DEFAULT);
          tileSets.delete();
          global.subtract(freed.getBytes());
          usedQuotaById.put(transaction, global);
        }
      }
    } finally {
      tileSets.close();
    }
  }
}

相关文章