/** * Sets the methods supported defined by this AllowHeader. * * @param methods - the Iterator of Strings defining the methods supported * <p>in this AllowHeader * @throws ParseException which signals that an error has been reached * <p>unexpectedly while parsing the Strings defining the methods supported. */ public void setMethods(List<String> methods) throws ParseException { ListIterator<String> it = methods.listIterator(); while (it.hasNext()) { Allow allow = new Allow(); allow.setMethod((String) it.next()); this.add(allow); } }
/** Order is important when comparing route lists. */ public boolean equals(Object other) { if (!(other instanceof RouteList)) return false; RouteList that = (RouteList) other; if (this.size() != that.size()) return false; ListIterator<Route> it = this.listIterator(); ListIterator<Route> it1 = that.listIterator(); while (it.hasNext()) { Route route = (Route) it.next(); Route route1 = (Route) it1.next(); if (!route.equals(route1)) return false; } return true; }