Java Doc for AbstractSequence.java in  » Scripting » Nice » gnu » lists » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » Nice » gnu.lists 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gnu.lists.AbstractSequence

All known Subclasses:   gnu.lists.SubSequence,  gnu.lists.TreeList,  gnu.lists.LList,  gnu.lists.SimpleVector,
AbstractSequence
abstract public class AbstractSequence (Code)
An AbstractSequence is used to implement Sequences, and almost all classes that extend AbstractSequence will implement Sequence. However, AbstractSequence itself does not implement Sequence. This is so we can use AbstractSequence to implement classes that are "sequence-like" (such as multi-dimesnional arrays) but are not Sequences. Additionally, a sequence may have zero or more attributes, which are name-value pairs. A sequence may also have a named "type". These extensions are to support XML functionality - it might be cleaner to moe them to a sub-class of Sequence or some interface. Many of the protected methods in Sequence (such as nextIndex) are only intended to be called from SeqPosition or TreePosition, see those.
author:
   Per Bothner




Method Summary
protected  voidadd(PositionContainer posSet, int posNumber, Object value)
    
public  booleanadd(Object o)
     See java.util.Collection.
public  voidadd(int index, Object o)
     See java.util.List.
public  booleanaddAll(Collection c)
     See java.util.Collection.
public  booleanaddAll(int index, Collection c)
     See java.util.Collection.
public  voidclear()
    
public  intcompare(int ipos1, Object xpos1, int ipos2, Object xpos2)
     Compare two positions, and indicate their relative order.
final public  intcompare(SeqPosition i1, SeqPosition i2)
    
protected  voidconsume(int iposStart, Object xposStart, int iposEnd, Object xposEnd, Consumer out)
    
public  voidconsume(Consumer out)
    
public  booleanconsumeNext(int ipos, Object xpos, Consumer out)
     Copy an element specified by a position pair to a Consumer. if hasNext(ipos, xpos).
public  booleancontains(Object o)
     See java.util.List.
public  booleancontainsAll(Collection c)
     See java.util.List.
public  voidcopyPosition(int ipos, Object xpos, PositionContainer posSet, int posNumber)
     Make a copy of a position pair. For simple positions this is a simple copy (assignment). However, if the positions are magic cookies that are actively managed by the sequence (as opposed to for example a simple index), then making a copy may need to increment a reference count, or maybe allocate a new position pair.
public  Enumerationelements()
    
public  booleanequals(int ipos1, Object xpos1, int ipos2, Object xpos2)
     Compare two positions, and indicate if the are the same position.
public  booleanequals(Object o)
    
public  voidfill(Object value)
    
public  voidfill(int fromIndex, int toIndex, Object value)
    
protected  intfromEndIndex(int ipos, Object xpos)
    
abstract public  Objectget(int index)
     See java.util.List.
public  Objectget(int[] indexes)
    
public  ObjectgetAttribute(int index)
    
public  intgetAttributeLength()
    
protected  intgetContainingSequenceSize(int ipos, Object xpos)
     Get the size of the (sub-) sequence containing a given position.
public  intgetEffectiveIndex(int[] indexes)
    
protected  intgetIndexDifference(int ipos1, Object xpos1, int ipos0, Object xpos0)
     Get offset of (ipos1,xpos1) relative to (ipos0,xpos0).
public  SeqPositiongetIterator()
    
protected  ObjectgetNext(int ipos, Object xpos)
     Get the element following the specified position.
Parameters:
  ipos - integer part of the specified position.
Parameters:
  xpos - Object part of the specified position.
public  intgetNextKind(int ipos, Object xpos)
    
public  StringgetNextTypeName(int ipos, Object xpos)
    
public  ObjectgetNextTypeObject(int ipos, Object xpos)
    
protected  ObjectgetPrevious(int ipos, Object xpos)
     Get the element before the specified position.
Parameters:
  ipos - integer part of the specified position.
Parameters:
  xpos - Object part of the specified position.
protected  booleangotoAttributesStart(TreePosition pos)
    
public  booleangotoChildrenStart(TreePosition pos)
     Set position before first child (of the element following position).
public  booleangotoNext(PositionContainer posSet, int posNumber)
     Move forward one element position.
public  booleangotoNext(SeqPosition pos)
     Potential optimization.
protected  booleangotoParent(TreePosition pos)
    
protected  booleangotoPrevious(PositionContainer posSet, int posNumber)
     Move backwards one element.
protected  booleanhasNext(int ipos, Object xpos)
     Called by SeqPosition.hasNext.
protected  booleanhasPrevious(int ipos, Object xpos)
     Called by SeqPosition.hasPrevious.
public  inthashCode()
    
public  intindexOf(Object o)
     See java.util.List.
protected  booleanisAfter(int ipos, Object xpos)
     Does the position pair have the "isAfter" property? I.e.
public  booleanisEmpty()
    
public  Iteratoriterator()
    
public  intlastIndexOf(Object o)
     See java.util.List.
public  ListIteratorlistIterator()
    
public  ListIteratorlistIterator(int index)
    
public  voidmakeEndPosition(SeqPosition pos)
     Set a position to the end of this sequence.
protected  voidmakeEndPosition(PositionContainer poses, int positionNumber)
    
final protected  voidmakePosition(int index, SeqPosition pos)
    
public  voidmakePosition(int index, boolean isAfter, SeqPosition pos)
     Generate a position at a given index.
abstract protected  voidmakePosition(int index, boolean isAfter, PositionContainer posSet, int posNumber)
     Generate a position at a given index.
Parameters:
  index - offset from beginning of desired position
Parameters:
  isAfter - should the position have the isAfter property
Parameters:
  posSet - where to store the generated position
Parameters:
  posNumber - index in posSet for the generated position.
protected  voidmakeRelativePosition(int istart, Object xstart, int offset, boolean isAfter, PositionContainer posSet, int posNumber)
     Generate a position relative to an existing position.
Parameters:
  istart - int part of initial position
Parameters:
  xstart - object part of initial position
Parameters:
  offset - offset from (istart,xstart) of desired position
Parameters:
  isAfter - should the position have the isAFter property
Parameters:
  posSet - where to store the generated position
Parameters:
  positionNumber - index in posSet for the generated position.
public  voidmakeStartPosition(SeqPosition pos)
    
protected  voidmakeStartPosition(PositionContainer poses, int positionNumber)
     Set a position to the start of this sequence.
protected  intnextIndex(int ipos, Object xpos)
     Get the offset from the beginning corresponding to a position pair.
final public  intnextIndex(SeqPosition pos)
    
public  intrank()
    
protected  voidreleasePosition(int ipos, Object xpos)
     Reclaim any resources used by the given position pair.
final protected  voidreleasePosition(SeqPosition pos)
    
protected  voidreleasePosition(PositionContainer posSet, int posNumber)
    
protected  voidremove(int ipos, Object xpos, int count)
     Remove one or more elements.
Parameters:
  ipos - integer part of position where elements should be removed
Parameters:
  xpos - object part of position where elements should be removed
Parameters:
  count - if non-negative, remove that number of elementsfollowing (poses, posNumber); if negative the negative of the numberof elements to remove before (poses, posNumber).
protected  voidremove(int ipos0, Object xpos0, int ipos1, Object xpos1)
     Remove a range where each end-point is a position in a container.
public  Objectremove(int index)
    
public  booleanremove(Object o)
    
public  booleanremoveAll(Collection c)
    
public  booleanretainAll(Collection c)
    
public  Objectset(int[] indexes, Object value)
    
public  Objectset(int index, Object element)
    
protected  voidsetNext(int ipos, Object xpos, Object value)
    
protected  voidsetPrevious(int ipos, Object xpos, Object value)
    
abstract public  intsize()
     See java.util.List.
public  ListsubList(int fromIx, int toIx)
    
public  SequencesubSequence(SeqPosition start, SeqPosition end)
    
protected  SequencesubSequence(int ipos0, Object xpos0, int ipos1, Object xpos1)
    
public  Object[]toArray()
    
public  Object[]toArray(Object[] arr)
    
protected  RuntimeExceptionunsupported(String text)
    



Method Detail
add
protected void add(PositionContainer posSet, int posNumber, Object value)(Code)



add
public boolean add(Object o)(Code)
See java.util.Collection.



add
public void add(int index, Object o)(Code)
See java.util.List.



addAll
public boolean addAll(Collection c)(Code)
See java.util.Collection.



addAll
public boolean addAll(int index, Collection c)(Code)
See java.util.Collection.



clear
public void clear()(Code)



compare
public int compare(int ipos1, Object xpos1, int ipos2, Object xpos2)(Code)
Compare two positions, and indicate their relative order.



compare
final public int compare(SeqPosition i1, SeqPosition i2)(Code)



consume
protected void consume(int iposStart, Object xposStart, int iposEnd, Object xposEnd, Consumer out)(Code)



consume
public void consume(Consumer out)(Code)



consumeNext
public boolean consumeNext(int ipos, Object xpos, Consumer out)(Code)
Copy an element specified by a position pair to a Consumer. if hasNext(ipos, xpos).



contains
public boolean contains(Object o)(Code)
See java.util.List.



containsAll
public boolean containsAll(Collection c)(Code)
See java.util.List.



copyPosition
public void copyPosition(int ipos, Object xpos, PositionContainer posSet, int posNumber)(Code)
Make a copy of a position pair. For simple positions this is a simple copy (assignment). However, if the positions are magic cookies that are actively managed by the sequence (as opposed to for example a simple index), then making a copy may need to increment a reference count, or maybe allocate a new position pair. In any case, the new pair is initialized to the same offset (and isAfter property) as the original.
Parameters:
  ipos - integer part of the position being copied.
Parameters:
  xpos - Object part of the position being copied.
Parameters:
  posSet - where to put the new copy
Parameters:
  posNumber - which psoition in posSet that gets the copy.



elements
public Enumeration elements()(Code)



equals
public boolean equals(int ipos1, Object xpos1, int ipos2, Object xpos2)(Code)
Compare two positions, and indicate if the are the same position.



equals
public boolean equals(Object o)(Code)



fill
public void fill(Object value)(Code)



fill
public void fill(int fromIndex, int toIndex, Object value)(Code)



fromEndIndex
protected int fromEndIndex(int ipos, Object xpos)(Code)



get
abstract public Object get(int index)(Code)
See java.util.List.



get
public Object get(int[] indexes)(Code)



getAttribute
public Object getAttribute(int index)(Code)



getAttributeLength
public int getAttributeLength()(Code)



getContainingSequenceSize
protected int getContainingSequenceSize(int ipos, Object xpos)(Code)
Get the size of the (sub-) sequence containing a given position. Normally the same as size(), but may be different if this Sequence is a tree and the position points at an interior node.



getEffectiveIndex
public int getEffectiveIndex(int[] indexes)(Code)



getIndexDifference
protected int getIndexDifference(int ipos1, Object xpos1, int ipos0, Object xpos0)(Code)
Get offset of (ipos1,xpos1) relative to (ipos0,xpos0).



getIterator
public SeqPosition getIterator()(Code)



getNext
protected Object getNext(int ipos, Object xpos)(Code)
Get the element following the specified position.
Parameters:
  ipos - integer part of the specified position.
Parameters:
  xpos - Object part of the specified position. the following element, or eofValue if there is none.Called by SeqPosition.getNext.



getNextKind
public int getNextKind(int ipos, Object xpos)(Code)



getNextTypeName
public String getNextTypeName(int ipos, Object xpos)(Code)



getNextTypeObject
public Object getNextTypeObject(int ipos, Object xpos)(Code)



getPrevious
protected Object getPrevious(int ipos, Object xpos)(Code)
Get the element before the specified position.
Parameters:
  ipos - integer part of the specified position.
Parameters:
  xpos - Object part of the specified position. the following element, or eofValue if there is none.Called by SeqPosition.getNext.



gotoAttributesStart
protected boolean gotoAttributesStart(TreePosition pos)(Code)



gotoChildrenStart
public boolean gotoChildrenStart(TreePosition pos)(Code)
Set position before first child (of the element following position). true if there is a child sequence (which might be empty);false if current position is end of sequence or following elementis atomic (cannot have children).



gotoNext
public boolean gotoNext(PositionContainer posSet, int posNumber)(Code)
Move forward one element position. true unless at end of sequence.



gotoNext
public boolean gotoNext(SeqPosition pos)(Code)
Potential optimization.



gotoParent
protected boolean gotoParent(TreePosition pos)(Code)



gotoPrevious
protected boolean gotoPrevious(PositionContainer posSet, int posNumber)(Code)
Move backwards one element. false iff already at beginning.



hasNext
protected boolean hasNext(int ipos, Object xpos)(Code)
Called by SeqPosition.hasNext.



hasPrevious
protected boolean hasPrevious(int ipos, Object xpos)(Code)
Called by SeqPosition.hasPrevious.



hashCode
public int hashCode()(Code)



indexOf
public int indexOf(Object o)(Code)
See java.util.List.



isAfter
protected boolean isAfter(int ipos, Object xpos)(Code)
Does the position pair have the "isAfter" property? I.e. if something is inserted at the position, will the iterator end up being after the new data?



isEmpty
public boolean isEmpty()(Code)



iterator
public Iterator iterator()(Code)



lastIndexOf
public int lastIndexOf(Object o)(Code)
See java.util.List.



listIterator
public ListIterator listIterator()(Code)



listIterator
public ListIterator listIterator(int index)(Code)



makeEndPosition
public void makeEndPosition(SeqPosition pos)(Code)
Set a position to the end of this sequence.



makeEndPosition
protected void makeEndPosition(PositionContainer poses, int positionNumber)(Code)



makePosition
final protected void makePosition(int index, SeqPosition pos)(Code)



makePosition
public void makePosition(int index, boolean isAfter, SeqPosition pos)(Code)
Generate a position at a given index.
Parameters:
  index - offset from beginning of desired position
Parameters:
  isAfter - should the position have the isAfter property
Parameters:
  pos - where to store the generated positionThis old position should be already released, if needed.
exception:
  IndexOutOfBoundsException - if index is out of bounds



makePosition
abstract protected void makePosition(int index, boolean isAfter, PositionContainer posSet, int posNumber)(Code)
Generate a position at a given index.
Parameters:
  index - offset from beginning of desired position
Parameters:
  isAfter - should the position have the isAfter property
Parameters:
  posSet - where to store the generated position
Parameters:
  posNumber - index in posSet for the generated position. Any oldposition there should be alread released, if needed.
exception:
  IndexOutOfBoundsException - if index is out of bounds



makeRelativePosition
protected void makeRelativePosition(int istart, Object xstart, int offset, boolean isAfter, PositionContainer posSet, int posNumber)(Code)
Generate a position relative to an existing position.
Parameters:
  istart - int part of initial position
Parameters:
  xstart - object part of initial position
Parameters:
  offset - offset from (istart,xstart) of desired position
Parameters:
  isAfter - should the position have the isAFter property
Parameters:
  posSet - where to store the generated position
Parameters:
  positionNumber - index in posSet for the generated position. Anyold position there should be alread released, if needed.
exception:
  IndexOutOfBoundsException - if resulting index is out of bounds



makeStartPosition
public void makeStartPosition(SeqPosition pos)(Code)



makeStartPosition
protected void makeStartPosition(PositionContainer poses, int positionNumber)(Code)
Set a position to the start of this sequence.



nextIndex
protected int nextIndex(int ipos, Object xpos)(Code)
Get the offset from the beginning corresponding to a position pair. Note default implementation only works for array-like sequences!



nextIndex
final public int nextIndex(SeqPosition pos)(Code)



rank
public int rank()(Code)



releasePosition
protected void releasePosition(int ipos, Object xpos)(Code)
Reclaim any resources used by the given position pair.
Parameters:
  ipos - integer part of the position being free'd.
Parameters:
  xpos - Object part of the position being free'd.



releasePosition
final protected void releasePosition(SeqPosition pos)(Code)



releasePosition
protected void releasePosition(PositionContainer posSet, int posNumber)(Code)



remove
protected void remove(int ipos, Object xpos, int count)(Code)
Remove one or more elements.
Parameters:
  ipos - integer part of position where elements should be removed
Parameters:
  xpos - object part of position where elements should be removed
Parameters:
  count - if non-negative, remove that number of elementsfollowing (poses, posNumber); if negative the negative of the numberof elements to remove before (poses, posNumber). number of elements actually removed (non-negative)
exception:
  java.lang.IndexOutOfBoundsException - if (count >= 0 ? (index < 0 || index + count > size()): (index + count < 0 || index > size())),where index == nextIndex(ipos, xpos).



remove
protected void remove(int ipos0, Object xpos0, int ipos1, Object xpos1)(Code)
Remove a range where each end-point is a position in a container.
Parameters:
  ipos0 - integer part of start of range
Parameters:
  xpos0 - object part of start of range
Parameters:
  ipos1 - integer part of end of range
Parameters:
  xpos1 - object part of end of range
exception:
  java.lang.IndexOutOfBoundsException - if nextIndex(ipos0, xpos0) > nextIndex(ipos1, xpos1)|| nextIndex(ipos0, xpos0) < 0 || nextIndex(ipos1, xpos1) > size()



remove
public Object remove(int index)(Code)



remove
public boolean remove(Object o)(Code)



removeAll
public boolean removeAll(Collection c)(Code)



retainAll
public boolean retainAll(Collection c)(Code)



set
public Object set(int[] indexes, Object value)(Code)



set
public Object set(int index, Object element)(Code)



setNext
protected void setNext(int ipos, Object xpos, Object value)(Code)



setPrevious
protected void setPrevious(int ipos, Object xpos, Object value)(Code)



size
abstract public int size()(Code)
See java.util.List.



subList
public List subList(int fromIx, int toIx)(Code)



subSequence
public Sequence subSequence(SeqPosition start, SeqPosition end)(Code)



subSequence
protected Sequence subSequence(int ipos0, Object xpos0, int ipos1, Object xpos1)(Code)



toArray
public Object[] toArray()(Code)



toArray
public Object[] toArray(Object[] arr)(Code)



unsupported
protected RuntimeException unsupported(String text)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.