Android Open Source - HorizontalImageScroller-Modified Image Url Request Cache Key






From Project

Back to project page HorizontalImageScroller-Modified.

License

The source code is released under:

Apache License

If you think the Android project HorizontalImageScroller-Modified listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
Copyright 2012 Two Toasters, LLC//from   w  w w  . j  a  va  2s  .c o  m

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
package com.twotoasters.android.horizontalimagescroller.io;

public class ImageUrlRequestCacheKey {

  final private String _url;
  final private String _username;
  final private String _password;
  final private int _width;
  final private int _height;
  
  public ImageUrlRequestCacheKey(final String url, final String username, final String password, final int width, final int height) {
    _url = url;
    _username = username;
    _password = password;
    _width = width;
    _height = height;
  }

  public String getUrl() {
    return _url;
  }

  public String getUsername() {
    return _username;
  }

  public String getPassword() {
    return _password;
  }  
  
  public int getWidth() {
    return _width;
  }
  
  public int getHeight() {
    return _height;
  }

  @Override
  public String toString() {
    return "ImageUrlRequestCacheKey [_url=" + _url + ", _username=" + _username + ", _password=" + _password + ", _width=" + _width + ", _height="
        + _height + "]";
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + _height;
    result = prime * result + ((_password == null) ? 0 : _password.hashCode());
    result = prime * result + ((_url == null) ? 0 : _url.hashCode());
    result = prime * result + ((_username == null) ? 0 : _username.hashCode());
    result = prime * result + _width;
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if(this == obj)
      return true;
    if(obj == null)
      return false;
    if(getClass() != obj.getClass())
      return false;
    ImageUrlRequestCacheKey other = (ImageUrlRequestCacheKey)obj;
    if(_height != other._height)
      return false;
    if(_password == null) {
      if(other._password != null)
        return false;
    } else if(!_password.equals(other._password))
      return false;
    if(_url == null) {
      if(other._url != null)
        return false;
    } else if(!_url.equals(other._url))
      return false;
    if(_username == null) {
      if(other._username != null)
        return false;
    } else if(!_username.equals(other._username))
      return false;
    if(_width != other._width)
      return false;
    return true;
  }
  
}




Java Source Code List

com.twotoasters.android.horizontalimagescroller.image.BitmapHelper.java
com.twotoasters.android.horizontalimagescroller.image.ImageToLoadDrawableResource.java
com.twotoasters.android.horizontalimagescroller.image.ImageToLoadSD.java
com.twotoasters.android.horizontalimagescroller.image.ImageToLoadUrl.java
com.twotoasters.android.horizontalimagescroller.image.ImageToLoad.java
com.twotoasters.android.horizontalimagescroller.image.OnImageLoadedListener.java
com.twotoasters.android.horizontalimagescroller.io.ExternalStorageHelper.java
com.twotoasters.android.horizontalimagescroller.io.FlushedInputStream.java
com.twotoasters.android.horizontalimagescroller.io.ImageCacheManager.java
com.twotoasters.android.horizontalimagescroller.io.ImageUrlRequestCacheKey.java
com.twotoasters.android.horizontalimagescroller.io.ImageUrlRequest.java
com.twotoasters.android.horizontalimagescroller.io.MemoryCache.java
com.twotoasters.android.horizontalimagescroller.sample.MainActivity.java
com.twotoasters.android.horizontalimagescroller.widget.HorizontalImageScrollerAdapter.java
com.twotoasters.android.horizontalimagescroller.widget.HorizontalImageScroller.java
com.twotoasters.android.horizontalimagescroller.widget.HorizontalListView.java
com.twotoasters.android.horizontalimagescroller.widget.SelectionToggleOnItemClickListener.java
com.twotoasters.android.horizontalimagescroller.widget.VerticalScrollView.java