public boolean equals(Object o) { if (o instanceof CSLUntilNode) { CSLUntilNode node = (CSLUntilNode) o; return property1.equals(node.property1) && property2.equals(node.property2) && timeBound.equals(node.timeBound); } return false; }
public CSLAbstractPathProperty replace(CSLAbstractProperty object1, CSLAbstractProperty object2) { if (this == object1 && object2 instanceof CSLAbstractPathProperty) { return (CSLAbstractPathProperty) object2; } else { property1 = property1.replace(object1, object2); property2 = property2.replace(object1, object2); timeBound = timeBound.replace(object1, object2); return this; } }
public StringPosition[] getChildren() { int start1 = property1.isSimple() ? 0 : 1; int end1 = start1 + property1.toString().length(); StringPosition position1 = new StringPosition(start1, end1, property1); int start2 = end1 + 2 + (property1.isSimple() ? 0 : 1); StringPosition[] intervalChildren = timeBound.getChildren(); int end2 = start2 + timeBound.toString().length(); int start3 = end2 + 1 + (property2.isSimple() ? 0 : 1); int end3 = start3 + property2.toString().length(); StringPosition position3 = new StringPosition(start3, end3, property2); StringPosition[] children = new StringPosition[2 + intervalChildren.length]; children[0] = position1; for (int i = 0; i < intervalChildren.length; i++) { children[i + 1] = intervalChildren[i].addOffset(start2); } children[intervalChildren.length + 1] = position3; return children; }
public int hashCode() { return property1.hashCode() + property2.hashCode() + timeBound.hashCode() + 11; }
public CSLAbstractPathProperty copy() { return new CSLUntilNode(property1.copy(), property2.copy(), timeBound.copy()); }
public String toString() { String s1 = property1.isSimple() ? property1.toString() : "(" + property1.toString() + ")"; String s2 = property2.isSimple() ? property2.toString() : "(" + property2.toString() + ")"; return s1 + " U" + timeBound.toString() + " " + s2; }