@Test public void testAdd() throws TTException { final ExpressionSingle builder = new ExpressionSingle(holder.getNRtx()); AbsAxis self = new SelfAxis(holder.getNRtx()); builder.add(self); assertEquals(builder.getExpr(), self); AbsAxis axis1 = new SelfAxis(holder.getNRtx()); AbsAxis axis2 = new SelfAxis(holder.getNRtx()); builder.add(axis1); builder.add(axis2); assertTrue(builder.getExpr() instanceof NestedAxis); }
public void add(final AbsAxis mAx) { AbsAxis axis = mAx; if (isDupOrd(axis)) { axis = new DupFilterAxis(mRtx, axis); DupState.nodup = true; } switch (mNumber) { case 0: mFirstAxis = axis; mNumber++; break; case 1: mExpr = new NestedAxis(mFirstAxis, axis, mRtx); mNumber++; break; default: final AbsAxis cache = mExpr; mExpr = new NestedAxis(cache, axis, mRtx); } }
ExpressionSingle { public void add(final AbsAxis mAx) { AbsAxis axis = mAx; if (isDupOrd(axis)) { axis = new DupFilterAxis(mRtx, axis); DupState.nodup = true; } switch (mNumber) { case 0: mFirstAxis = axis; mNumber++; break; case 1: mExpr = new NestedAxis(mFirstAxis, axis, mRtx); mNumber++; break; default: final AbsAxis cache = mExpr; mExpr = new NestedAxis(cache, axis, mRtx); } } }
ExpressionSingle { public void add(final AbsAxis mAx) { AbsAxis axis = mAx; if (isDupOrd(axis)) { axis = new DupFilterAxis(mRtx, axis); DupState.nodup = true; } switch (mNumber) { case 0: mFirstAxis = axis; mNumber++; break; case 1: mExpr = new NestedAxis(mFirstAxis, axis, mRtx); mNumber++; break; default: final AbsAxis cache = mExpr; mExpr = new NestedAxis(cache, axis, mRtx); } } ExpressionSingle(final INodeReadTrx pRtx); }
ExpressionSingle { public void add(final AbsAxis mAx) { AbsAxis axis = mAx; if (isDupOrd(axis)) { axis = new DupFilterAxis(mRtx, axis); DupState.nodup = true; } switch (mNumber) { case 0: mFirstAxis = axis; mNumber++; break; case 1: mExpr = new NestedAxis(mFirstAxis, axis, mRtx); mNumber++; break; default: final AbsAxis cache = mExpr; mExpr = new NestedAxis(cache, axis, mRtx); } } ExpressionSingle(final INodeReadTrx pRtx); void add(final AbsAxis mAx); AbsAxis getExpr(); int getSize(); boolean isDupOrd(final AbsAxis ax); boolean isOrdered(); }
ExpressionSingle { public void add(final AbsAxis mAx) { AbsAxis axis = mAx; if (isDupOrd(axis)) { axis = new DupFilterAxis(mRtx, axis); DupState.nodup = true; } switch (mNumber) { case 0: mFirstAxis = axis; mNumber++; break; case 1: mExpr = new NestedAxis(mFirstAxis, axis, mRtx); mNumber++; break; default: final AbsAxis cache = mExpr; mExpr = new NestedAxis(cache, axis, mRtx); } } ExpressionSingle(final INodeReadTrx pRtx); void add(final AbsAxis mAx); AbsAxis getExpr(); int getSize(); boolean isDupOrd(final AbsAxis ax); boolean isOrdered();  }