|
@@ -173,7 +173,7 @@ |
173 |
173 |
|
@Override |
174 |
174 |
|
public String toString() |
175 |
175 |
|
{ |
176 |
|
- |
StringBuilder sb = new StringBuilder(); |
|
176 |
+ |
StringBuilder sb = new StringBuilder( "DrillDownSet:\n" ); |
177 |
177 |
|
add( sb, "Home", mHomeSet ); |
178 |
178 |
|
if ( mSomethingBetweenHomeAndPreviousSets ) |
179 |
179 |
|
{ |
|
@@ -188,11 +188,7 @@ |
188 |
188 |
|
{ |
189 |
189 |
|
if ( pSet != null ) |
190 |
190 |
|
{ |
191 |
|
- |
if ( pSb.length() != 0 ) |
192 |
|
- |
{ |
193 |
|
- |
pSb.append( '\n' ); |
194 |
|
- |
} |
195 |
|
- |
pSb.append( pWhat ).append( ": " ).append( pSet ); |
|
191 |
+ |
pSb.append( '\n' ).append( pWhat ).append( ": " ).append( pSet ); |
196 |
192 |
|
} |
197 |
193 |
|
} |
198 |
194 |
|
|
|
@@ -495,13 +491,15 @@ |
495 |
491 |
|
{ |
496 |
492 |
|
Between<T> zSelectedBetween = getCurrentSelectedBetween( pSelectedBetweens, 0 ); |
497 |
493 |
|
|
|
494 |
+ |
int zInjectInsToAdd = mInjectIns.size() - 1; |
|
495 |
+ |
int zAvailableBetweenBuckets = (pCount - 3) / 2; |
|
496 |
+ |
|
|
497 |
+ |
System.out.println( "buildHomeViewSett( " + zSelectedBetween + " ): " + // |
|
498 |
+ |
pCount + " ( " + mInjectIns.size() + " ) " + zInjectInsToAdd + " | " + zAvailableBetweenBuckets ); |
|
499 |
+ |
|
498 |
500 |
|
ArrayList<ViewEntry> zEntries = new ArrayList<ViewEntry>( pCount ); |
499 |
501 |
|
pViewSets.add( new ViewSet( zEntries ) ); |
500 |
502 |
|
|
501 |
|
- |
// System.out.println( "buildHomeViewSet ( " + mInjectIns.size() + " -> " + pCount + " ):" ); |
502 |
|
- |
int zInjectInsToAdd = mInjectIns.size() - 1; |
503 |
|
- |
int zAvailableHomeBetweenBuckets = (pCount - 3) / 2; |
504 |
|
- |
|
505 |
503 |
|
int zCurrNdx = 0; |
506 |
504 |
|
int zThru = mInjectIns.size() - 1; |
507 |
505 |
|
T zCurrT = mInjectIns.get( zCurrNdx ); |
|
@@ -512,19 +510,19 @@ |
512 |
510 |
|
int zLastNdx = zCurrNdx; |
513 |
511 |
|
T zLastT = zCurrT; |
514 |
512 |
|
zEntries.add( Reference.create( mSynopsisLines, mInjectIns.get( zCurrNdx ) ) ); |
515 |
|
- |
int zHowMany = zInjectInsToAdd / zAvailableHomeBetweenBuckets; |
516 |
|
- |
// System.out.print( " zInjectInsToAdd / zAvailableHomeBetweenBuckets ==> " + zInjectInsToAdd + " / " + zAvailableHomeBetweenBuckets + " = " + (zInjectInsToAdd / zAvailableHomeBetweenBuckets) ); |
|
513 |
+ |
int zHowMany = zInjectInsToAdd / zAvailableBetweenBuckets; |
|
514 |
+ |
System.out.print( " zInjectInsToAdd / zAvailableBetweenBuckets ==> " + zInjectInsToAdd + " / " + zAvailableBetweenBuckets + " = " + zHowMany ); |
517 |
515 |
|
zInjectInsToAdd -= zHowMany; |
518 |
516 |
|
zCurrNdx += zHowMany; |
519 |
517 |
|
zCurrT = mInjectIns.get( zCurrNdx ); |
520 |
518 |
|
if ( zHowMany == 1 ) |
521 |
519 |
|
{ |
522 |
|
- |
// System.out.println( " Add There 1" ); |
|
520 |
+ |
System.out.println( " Add There 1" ); |
523 |
521 |
|
zEntries.add( There.create( zLastT, zCurrT ) ); |
524 |
522 |
|
} |
525 |
523 |
|
else |
526 |
524 |
|
{ |
527 |
|
- |
// System.out.println( " Add Between " + zHowMany ); |
|
525 |
+ |
System.out.println( " Add Between " + zHowMany ); |
528 |
526 |
|
if ( isSelected( zSelectedBetween, zLastT, zCurrT ) ) |
529 |
527 |
|
{ |
530 |
528 |
|
zEntries.add( zSelectedBetween ); |
|
@@ -535,7 +533,7 @@ |
535 |
533 |
|
zEntries.add( Between.create( false, zLastT, zCurrT ) ); |
536 |
534 |
|
} |
537 |
535 |
|
} |
538 |
|
- |
zAvailableHomeBetweenBuckets--; |
|
536 |
+ |
zAvailableBetweenBuckets--; |
539 |
537 |
|
} |
540 |
538 |
|
|
541 |
539 |
|
zEntries.add( Reference.create( mSynopsisLines, zCurrT ) ); |
|
@@ -546,6 +544,50 @@ |
546 |
544 |
|
{ |
547 |
545 |
|
Between<T> zSelectedBetween = getCurrentSelectedBetween( pSelectedBetweens, pCurrentIndex ); |
548 |
546 |
|
|
549 |
|
- |
System.out.println( "buildSubsequentViewSet: " + pCurrentIndex + " => " + zSelectedBetween ); |
|
547 |
+ |
int zInjectInsToAdd = zLowerNdx - zUpperNdx; |
|
548 |
+ |
int zAvailableBetweenBuckets = pCount / 2; |
|
549 |
+ |
|
|
550 |
+ |
System.out.println( " buildSubsequentViewSet( " + pCurrentIndex + " => " + zSelectedBetween + " ): " + // |
|
551 |
+ |
pCount + " ( " + zLowerNdx + ", " + zUpperNdx + " ) " + zInjectInsToAdd + " | " + zAvailableBetweenBuckets ); |
|
552 |
+ |
|
|
553 |
+ |
ArrayList<ViewEntry> zEntries = new ArrayList<ViewEntry>( pCount ); |
|
554 |
+ |
pViewSets.add( new ViewSet( zEntries ) ); |
|
555 |
+ |
|
|
556 |
+ |
int zCurrNdx = zUpperNdx; |
|
557 |
+ |
int zThru = zLowerNdx - 1; |
|
558 |
+ |
T zCurrT = mInjectIns.get( zCurrNdx ); |
|
559 |
+ |
|
|
560 |
+ |
while ( zCurrNdx < zThru ) |
|
561 |
+ |
{ |
|
562 |
+ |
int zLastNdx = zCurrNdx; |
|
563 |
+ |
T zLastT = zCurrT; |
|
564 |
+ |
zEntries.add( Reference.create( mSynopsisLines, mInjectIns.get( zCurrNdx ) ) ); |
|
565 |
+ |
int zHowMany = zInjectInsToAdd / zAvailableBetweenBuckets; |
|
566 |
+ |
System.out.print( " zInjectInsToAdd / zAvailableBetweenBuckets ==> " + zInjectInsToAdd + " / " + zAvailableBetweenBuckets + " = " + zHowMany ); |
|
567 |
+ |
zInjectInsToAdd -= zHowMany; |
|
568 |
+ |
zCurrNdx += zHowMany; |
|
569 |
+ |
zCurrT = mInjectIns.get( zCurrNdx ); |
|
570 |
+ |
if ( zHowMany == 1 ) |
|
571 |
+ |
{ |
|
572 |
+ |
System.out.println( " Add There 1" ); |
|
573 |
+ |
zEntries.add( There.create( zLastT, zCurrT ) ); |
|
574 |
+ |
} |
|
575 |
+ |
else |
|
576 |
+ |
{ |
|
577 |
+ |
System.out.println( " Add Between " + zHowMany ); |
|
578 |
+ |
if ( isSelected( zSelectedBetween, zLastT, zCurrT ) ) |
|
579 |
+ |
{ |
|
580 |
+ |
zEntries.add( zSelectedBetween ); |
|
581 |
+ |
buildSubsequentViewSet( pViewSets, pCount, zLastNdx, zCurrNdx, pSelectedBetweens, pCurrentIndex + 1 ); |
|
582 |
+ |
} |
|
583 |
+ |
else |
|
584 |
+ |
{ |
|
585 |
+ |
zEntries.add( Between.create( false, zLastT, zCurrT ) ); |
|
586 |
+ |
} |
|
587 |
+ |
} |
|
588 |
+ |
zAvailableBetweenBuckets--; |
|
589 |
+ |
} |
|
590 |
+ |
|
|
591 |
+ |
zEntries.add( Reference.create( mSynopsisLines, zCurrT ) ); |
550 |
592 |
|
} |
551 |
593 |
|
} |