org.apache.xmlgraphics.image.loader.cache

## Class DefaultExpirationPolicy

- java.lang.Object
- - org.apache.xmlgraphics.image.loader.cache.DefaultExpirationPolicy

- All Implemented Interfaces:
    ExpirationPolicy

      public class DefaultExpirationPolicy
      extends java.lang.Object
      implements ExpirationPolicy

  Implements the default expiration policy for the image cache.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `EXPIRATION_IMMEDIATE`
    `static int` | `EXPIRATION_NEVER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultExpirationPolicy()` Creates a new policy with default settings (expiration in 60 seconds).
    `DefaultExpirationPolicy(int expirationAfter)` Creates a new policy.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isExpired(org.apache.xmlgraphics.image.loader.cache.TimeStampProvider provider, long timestamp)` Indicates whether a cache entry is expired given its creation time stamp.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EXPIRATION_IMMEDIATE

          public static final int EXPIRATION_IMMEDIATE

      See Also:
        Constant Field Values

    - #### EXPIRATION_NEVER

          public static final int EXPIRATION_NEVER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultExpirationPolicy

          public DefaultExpirationPolicy()

      Creates a new policy with default settings (expiration in 60 seconds).

    - #### DefaultExpirationPolicy

          public DefaultExpirationPolicy(int expirationAfter)

      Creates a new policy.
      Parameters:
        `expirationAfter` - the expiration in seconds (a negative value means: never expire)

  - ### Method Detail

    - #### isExpired

          public boolean isExpired(org.apache.xmlgraphics.image.loader.cache.TimeStampProvider provider,
                                   long timestamp)

      Indicates whether a cache entry is expired given its creation time stamp.
      Specified by:
        `isExpired` in interface `ExpirationPolicy`
      Parameters:
        `provider` - the provider for new time stamps
        `timestamp` - the creation time stamp (the semantics of `System.currentTimeMillis()` apply)
      Returns:
        true if the entry is to be considered expired, false if not

Copyright 1999-2021 The Apache Software Foundation. All Rights Reserved.