public GIterator(GContainer container, int direction) {
		switch (direction) {
		  case GContainer.FRONT_TO_BACK: case GContainer.BACK_TO_FRONT:
			dir = direction;
			break;
		  default:
			throw new ErrorException("Illegal direction for iterator");
		}
		cont = container;
		index = 0;
		nElements = container.getElementCount();
	}