public boolean equals(Object other) { if (other == null) { return false; } if (!(other instanceof ChoiceAttributeType)) { return false; } ChoiceAttributeType att = (ChoiceAttributeType) other; if (name == null) { if (att.getName() != null) { return false; } } else if (!name.equals(att.getName())) { return false; } //hmmm... This makes the assumption that the order of the choices //matters - not sure if that's true. Though the order does matter a //a bit for our parse method, so this is probably right, since two //with different orders could have diff. behaviors for that method. if (!Arrays.equals(children, att.getAttributeTypes())) { return false; } return true; }
/** * DOCUMENT ME! * * @param copy */ public ChoiceAttributeType(ChoiceAttributeType copy) { nill = copy.isNillable(); min = copy.getMinOccurs(); max = copy.getMaxOccurs(); name = copy.getName(); this.children = copyChildren(copy.getAttributeTypes()); restriction = copy.getRestriction(); }
/** * DOCUMENT ME! * * @param copy */ public ChoiceAttributeType(ChoiceAttributeType copy) { super( copy.getType(), copy.getName(), copy.getMinOccurs(), copy.getMaxOccurs(), copy.isNillable(), copy.getDefaultValue() ); this.children = copyChildren(copy.getAttributeTypes()); }