Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ArrayWrapper.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import gov.nasa.arc.ase.jpf.*;
00004 import java.util.Arrays;
00005 
00006 public class ArrayWrapper {
00007   private int[] data;
00008   private int hashcode;
00009 
00010   public ArrayWrapper(int[] d, int h) {
00011     data = d;
00012     hashcode = h;
00013   }  
00014   public boolean equals(Object o) {
00015     return Arrays.equals(data, ((ArrayWrapper)o).data);
00016   }  
00017   public int[] getData() {
00018     return data;
00019   }  
00020   public int hashCode() {
00021     return hashcode;
00022   }  
00023   public int size() {
00024     return data.length * 4;
00025   }  
00026   public String toString() {
00027     StringBuffer s = new StringBuffer();
00028     int sz = data.length;
00029 
00030     s.append("data[");
00031     s.append(sz);
00032     s.append("] = { ");
00033     for(int i = 0; i < sz; i++) {
00034       if(i != 0) s.append(", ");
00035       s.append(data[i]);
00036     }
00037     s.append(" }");
00038 
00039     return s.toString();
00040   }  
00041 }

Generated at Thu Feb 7 06:39:38 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001