1 4 package gnu.lists; 5 6 10 11 public abstract class ExtSequence extends AbstractSequence 12 { 13 public int copyPos (int ipos) 14 { 15 if (ipos <= 0) 16 return ipos; 17 return PositionManager.manager.register(PositionManager.getPositionObject(ipos).copy()); 18 } 19 20 protected void releasePos(int ipos) 21 { 22 if (ipos > 0) 23 PositionManager.manager.release(ipos); 24 } 25 26 protected boolean isAfterPos (int ipos) 27 { 28 if (ipos <= 0) 29 return ipos < 0; 30 return (PositionManager.getPositionObject(ipos).ipos & 1) != 0; 31 } 32 33 protected int nextIndex(int ipos) 34 { 35 return ipos == -1 ? size() : ipos == 0 ? 0 36 : PositionManager.getPositionObject(ipos).nextIndex(); 37 } 38 } 39 | Popular Tags |