1 24 package org.objectweb.jalisto.se.impl; 25 26 import java.io.Serializable ; 27 28 public class InFileAddress implements Serializable { 29 30 public InFileAddress(String address) { 31 this.address = address; 32 index = 0; 33 fileIndex = 0; 34 } 35 36 public String getAddress() { 37 return address; 38 } 39 40 public InFileAddress getClone() { 41 InFileAddress result = new InFileAddress(address); 42 result.setIndex(index); 43 result.setFileIndex(fileIndex); 44 return result; 45 } 46 47 public void setAddress(String address) { 48 this.address = address; 49 } 50 51 public void setFileIndex(int fileIndex) { 52 this.fileIndex = fileIndex; 53 } 54 55 public int getFileIndex() { 56 return fileIndex; 57 } 58 59 public void setIndex(int index) { 60 this.index = index; 61 } 62 63 public int getIndex() { 64 return index; 65 } 66 67 public void incrementeFileIndex() { 68 index++; 69 } 70 71 public boolean equals(Object obj) { 72 try { 73 InFileAddress candidate = (InFileAddress) obj; 74 return ((candidate.address.equals(this.address)) && (candidate.index == this.index)); 75 } catch (Exception e) { 76 } 77 return false; 78 } 79 80 public int hashCode() { 81 return ((index * 100000) + address.hashCode()); 82 } 83 84 public String toString() { 85 return "ifa(" + String.valueOf(address) + "," + String.valueOf(fileIndex) + "," + String.valueOf(index) + ")"; 86 } 87 88 89 private String address; 91 private int fileIndex; 93 private int index; 95 96 97 static final long serialVersionUID = -7589377069064761459L; 98 } 99 | Popular Tags |