public long getVersion( final ResourceKey key ) { if ( key.equals( this.key ) ) { return version; } // -1 is the placeholder for: not known. return -1; }
public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final ResourceFontDataInputSource that = (ResourceFontDataInputSource) o; if ( !loader.equals( that.loader ) ) { return false; } if ( !source.equals( that.source ) ) { return false; } return true; }
public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final CompoundCacheKey that = (CompoundCacheKey) o; if ( !target.equals( that.target ) ) { return false; } if ( !key.equals( that.key ) ) { return false; } return true; }
/** * Checks, whether this resource loader implementation was responsible for creating this key. * * @param key the key that should be tested. * @return true, if the key is supported. */ public boolean isSupportedKey( final ResourceKey key ) { if ( key == null ) { throw new NullPointerException(); } if ( bundleKey.equals( key ) ) { return true; } if ( bundleKey.equals( key.getParent() ) ) { return true; } return false; }
/** * Tries to load the bundle. If the key does not point to a usable resource-bundle, this method returns null. The * Exception is only thrown if the bundle is not readable because of IO-Errors. * <p/> * A resource-bundle loader should only load the bundle for the key itself, never for any of the derived subkeys. It * is the ResourceManager's responsibility to search the key's hierachy for the correct key. * * @param key the resource key pointing to the bundle. * @return the loaded bundle or null, if the resource was not understood. * @throws ResourceLoadingException if something goes wrong. */ public ResourceBundleData loadBundle( final ResourceManager resourceManager, final ResourceKey key ) throws ResourceLoadingException { if ( key == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } if ( bundleKey.equals( key ) == false ) { return null; } return new RepositoryResourceBundleData( bundleKey, repository, mainKey, false ); }
public ResourceDataCacheEntry get( final ResourceKey key ) { if ( lastEntry != null ) { final ResourceDataCacheEntry entry = (ResourceDataCacheEntry) lastEntry.get(); if ( entry != null && key.equals( entry.getData().getKey() ) ) { return entry; } lastEntry = null; } return null; }
public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final ZipEntryKey that = (ZipEntryKey) o; if ( !entryName.equals( that.entryName ) ) { return false; } if ( !zipFile.getKey().equals( that.zipFile.getKey() ) ) { return false; } return true; }
public ResourceBundleDataCacheEntry get( final ResourceKey key ) { if ( lastEntry != null ) { final ResourceBundleDataCacheEntry entry = (ResourceBundleDataCacheEntry) lastEntry; if ( key.equals( entry.getData().getBundleKey() ) ) { return entry; } lastEntry = null; } return null; }
public boolean isEmbeddedKey( final ResourceKey resourceKey ) { return ( resourceKey != null && getBundleMainKey().getParent().equals( resourceKey.getParent() ) ); } }
public static boolean isEmbeddedKey( final MasterReport report, final ResourceKey resourceKey ) { final ResourceKey contentBase = report.getContentBase(); if ( contentBase == null ) { return false; } ResourceKey bundleKey = contentBase.getParent(); while ( bundleKey != null ) { if ( bundleKey.equals( resourceKey.getParent() ) ) { return true; } bundleKey = bundleKey.getParent(); } return false; }