示例#1
0
  /** @param args */
  public static void main(String[] args) {

    ShapeCache.loadCache();

    Shape clonedShape = ShapeCache.getShape("1");
    System.out.println("Shape : " + clonedShape.getType());

    System.out.println(clonedShape.hashCode());

    clonedShape = ShapeCache.getShape("2");
    System.out.println("Shape : " + clonedShape.getType());

    System.out.println(clonedShape.hashCode());

    clonedShape = ShapeCache.getShape("3");
    System.out.println("Shape : " + clonedShape.getType());

    System.out.println(clonedShape.hashCode());
  }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = super.hashCode();
   long temp;
   temp = Double.doubleToLongBits(rotation);
   result = ((prime * result) + ((int) (temp ^ (temp >>> (32)))));
   result = ((prime * result) + ((viewVolume == null) ? 0 : viewVolume.hashCode()));
   result = ((prime * result) + ((imagePyramid == null) ? 0 : imagePyramid.hashCode()));
   result = ((prime * result) + ((point == null) ? 0 : point.hashCode()));
   result = ((prime * result) + ((shape == null) ? 0 : shape.hashCode()));
   result =
       ((prime * result)
           + ((photoOverlaySimpleExtension == null) ? 0 : photoOverlaySimpleExtension.hashCode()));
   result =
       ((prime * result)
           + ((photoOverlayObjectExtension == null) ? 0 : photoOverlayObjectExtension.hashCode()));
   return result;
 }