1 19 20 package org.netbeans.core.windows; 21 22 27 public class SplitConstraint { 28 29 30 public final int orientation; 31 32 33 public final int index; 34 35 37 public final double splitWeight; 38 39 40 public SplitConstraint(int orientation, int index, double splitWeight) { 41 this.orientation = orientation; 42 this.index = index; 43 this.splitWeight = splitWeight; 44 } 45 46 public String toString() { 47 String o; 48 if(orientation == Constants.VERTICAL) { 49 o = "V"; } else if(orientation == Constants.HORIZONTAL) { 51 o = "H"; } else { 53 o = String.valueOf(orientation); 54 } 55 56 return "[" + o + ", " + index + ", " + splitWeight + "]"; } 58 59 public boolean equals(Object obj) { 60 if (this == obj) { 61 return true; 62 } 63 if (obj instanceof SplitConstraint) { 64 SplitConstraint item = (SplitConstraint)obj; 65 if (orientation == item.orientation 66 && index == item.index 67 && splitWeight == item.splitWeight) { 68 return true; 69 } 70 } 71 return false; 72 } 73 74 public int hashCode() { 75 int hash = 17; 76 hash = 37 * hash + orientation; 77 hash = 37 * hash + index; 78 long l = Double.doubleToLongBits(splitWeight); 79 hash = 37 * hash + (int) (l ^ (l >>> 32)); 80 return hash; 81 } 82 83 } 84 85 | Popular Tags |