| | DivergentList<String> prevList = listElementNamesPrev(); |
| | |
| | + if( hasEllipsesPath() ) { |
| | + System.out.printf( "ELLIPSES: %s%n", thisList.toString() ); |
| | + System.out.printf( "ELLIPSES PREV: %s%n", prevList.toString() ); |
| | + } |
| | + |
| | + if( hasEllipsesPath() && prevList.size() > 0 ) { |
| | + thisList.addAll( 0, prevList.subList( 0, prevList.size() - 1 ) ); |
| | + System.out.println( "thisList: " + thisList.toString() ); |
| | + } |
| | + |
| | // If there are no common elements with the previous list, then this is |
| | // an entirely new list of elements. This logic is tricky: |
 |
| | */ |
| | private DivergentList<String> listElementNamesNext() { |
| | - return listElementNames( getNextContext() ); |
| | + DivergentList<String> prev = listElementNames( getNextContext() ); |
| | + |
| | + if( hasEllipsesPath() ) { |
| | + System.out.printf( "Prev: %s%n", prev.toString() ); |
| | + } |
| | + |
| | + return prev; |
| | } |
| | |
 |
| | |
| | return set; |
| | + } |
| | + |
| | + protected boolean hasEllipsesPath() { |
| | + return ellipsesPath() != null; |
| | } |
| | |
| | /** |
| | * Returns the list of elements associated with this context. This |
| | * is used to obtain the list of element names for the divergent lists. |
| | * |
| | * @return The list of ElementContext instances that contain element names. |
| | */ |
| | protected List<QueryParser.ElementContext> element() { |
| | - return elementPath().element(); |
| | + return (hasEllipsesPath() ? |
| | + ellipsesPath().elementPath() : |
| | + elementPath()).element(); |
| | } |
| | |
| | /** |
| | * Helper method. |
| | * |
| | - * @return The element path containing ElementContext instances having |
| | + * @return The element path containing ElementPathContext instances having |
| | * element names. |
| | */ |
| | protected QueryParser.ElementPathContext elementPath() { |
| | return path().elementPath(); |
| | + } |
| | + |
| | + /** |
| | + * Helper method. |
| | + * |
| | + * @return The element path containing EllipsesPathContext instances having |
| | + * an ellipses prefix and element names. |
| | + */ |
| | + protected QueryParser.EllipsesPathContext ellipsesPath() { |
| | + return path().ellipsesPath(); |
| | } |
| | |