ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/util/CacheObject.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/util/CacheObject.java
Status
scanned
Type
file
Name
CacheObject.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
2031 (2.0 KB)
MD5
63decf457d9e71a660f10213f9fc815e
SHA1
308b84590edb8bd32543ccfa914b95fd4d1a6a44
SHA256
1081ec91ec7f035f7c1922a817374f5432cd43040032734797d17ca2c789bac4
SHA512

      
    
SHA1_git
70c82f8b2d63829e22daa5257574f0c2c5015561
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
CacheObject.java | 2.0 KB |

/* * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.util; import org.h2.message.DbException; /** * The base object for all cached objects. */ public abstract class CacheObject implements Comparable<CacheObject> { /** * The previous element in the LRU linked list. If the previous element is * the head, then this element is the most recently used object. */ public CacheObject cachePrevious; /** * The next element in the LRU linked list. If the next element is the head, * then this element is the least recently used object. */ public CacheObject cacheNext; /** * The next element in the hash chain. */ public CacheObject cacheChained; private int pos; private boolean changed; /** * Check if the object can be removed from the cache. * For example pinned objects can not be removed. * * @return true if it can be removed */ public abstract boolean canRemove(); /** * Get the estimated used memory. * * @return number of words (one word is 4 bytes) */ public abstract int getMemory(); public void setPos(int pos) { if (cachePrevious != null || cacheNext != null || cacheChained != null) { throw DbException.getInternalError("setPos too late"); } this.pos = pos; } public int getPos() { return pos; } /** * Check if this cache object has been changed and thus needs to be written * back to the storage. * * @return if it has been changed */ public boolean isChanged() { return changed; } public void setChanged(boolean b) { changed = b; } @Override public int compareTo(CacheObject other) { return Integer.compare(getPos(), other.getPos()); } public boolean isStream() { return false; } }
Detected license expression
mpl-2.0 AND epl-1.0
Detected license expression (SPDX)
MPL-2.0 AND EPL-1.0
Percentage of license text
3.73
Copyrights
- end_line: 2
  copyright: Copyright 2004-2023 H2 Group. Multiple-Licensed
  start_line: 2
Holders
- holder: H2 Group. Multiple-Licensed
  end_line: 2
  start_line: 2
Authors

      
    
License detections License expression License expression SPDX
mpl_2_0_and_epl_1_0-796bf8d7-f485-3520-923d-e6a4b1ecd2f3 mpl-2.0 AND epl-1.0 MPL-2.0 AND EPL-1.0
URL Start line End line
https://h2database.com/html/license.html 3 3
Package URL License Primary language
pkg:osgi/com.h2database.source@2.2.220