Java Doc for AbstractSequence.java in  » Scripting » Kawa » 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 » Kawa » gnu.lists 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gnu.lists.AbstractSequence

All known Subclasses:   gnu.lists.GeneralArray,  gnu.lists.ExtSequence,  gnu.lists.TreeList,  gnu.jemacs.buffer.Buffer,  gnu.lists.SubSequence,  gnu.lists.SimpleVector,  gnu.lists.GapVector,
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
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.
protected  intaddPos(int ipos, Object value)
     Add a value at a specified Pos.
public  voidclear()
    
public  intcompare(int ipos1, int ipos2)
     Compare two positions, and indicate their relative order.
final public  intcompare(SeqPosition i1, SeqPosition i2)
    
public static  intcompare(AbstractSequence seq1, int pos1, AbstractSequence seq2, int pos2)
     This is used for the XML concept of "document order".
public  voidconsume(Consumer out)
    
public  booleanconsumeNext(int ipos, Consumer out)
     Copy an element specified by a position pair to a Consumer. if hasNext(ipos).
public  voidconsumePosRange(int iposStart, int iposEnd, Consumer out)
    
public  booleancontains(Object o)
     See java.util.List.
public  booleancontainsAll(Collection c)
     See java.util.List.
public  intcopyPos(int ipos)
     Make a copy of a position int. For simple positions returns the argument. 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 cookie.
abstract public  intcreatePos(int index, boolean isAfter)
     Generate a position at a given index.
public  intcreateRelativePos(int pos, int delta, boolean isAfter)
    
final public  Enumerationelements()
    
public  intendPos()
    
public  booleanequals(int ipos1, int ipos2)
     Compare two positions, and indicate if they are the same position.
public  booleanequals(Object o)
    
public  voidfill(Object value)
    
public  voidfill(int fromIndex, int toIndex, Object value)
    
public  voidfillPosRange(int fromPos, int toPos, Object value)
    
public  intfirstAttributePos(int ipos)
     Like firstChildPos. Problem: Should this stop before we get to children? I think so, but that requires changes to TreeList.
public  intfirstChildPos(int ipos)
     Get position before first child (of the element following position).
Parameters:
  ipos - parent position.
public  intfirstChildPos(int ipos, ItemPredicate predicate)
    
protected  intfromEndIndex(int ipos)
    
abstract public  Objectget(int index)
     See java.util.List.
public  Objectget(int[] indexes)
    
public  ObjectgetAttribute(int index)
    
public  intgetAttributeLength()
    
protected  intgetContainingSequenceSize(int ipos)
     Get the size of the (sub-) sequence containing a given position.
public  intgetEffectiveIndex(int[] indexes)
    
protected  intgetIndexDifference(int ipos1, int ipos0)
     Get offset of (ipos1) relative to (ipos0).
final public  SeqPositiongetIterator()
    
public  SeqPositiongetIterator(int index)
    
public  SeqPositiongetIteratorAtPos(int ipos)
    
public  intgetLowBound(int dim)
    
public  intgetNextKind(int ipos)
    
public  StringgetNextTypeName(int ipos)
    
public  ObjectgetNextTypeObject(int ipos)
    
public  ObjectgetPosNext(int ipos)
     Get the element following the specified position.
Parameters:
  ipos - the specified position.
public  ObjectgetPosPrevious(int ipos)
     Get the element before the specified position.
Parameters:
  ipos - the specified position.
public  intgetSize(int dim)
    
protected  booleangotoAttributesStart(TreePosition pos)
    
final public  booleangotoChildrenStart(TreePosition pos)
     Set position before first child (of the element following position).
protected  booleangotoParent(TreePosition pos)
    
public  booleanhasNext(int ipos)
    
protected  booleanhasPrevious(int ipos)
     Called by SeqPosition.hasPrevious.
public  inthashCode()
    
public  intindexOf(Object o)
     See java.util.List.
protected  booleanisAfterPos(int ipos)
     Tests whether the position has the "isAfter" property. I.e.
public  booleanisEmpty()
    
final public  Iteratoriterator()
    
public  intlastIndexOf(Object o)
     See java.util.List.
final public  ListIteratorlistIterator()
    
final public  ListIteratorlistIterator(int index)
    
protected  intnextIndex(int ipos)
     Get the offset from the beginning corresponding to a position cookie.
final public  intnextIndex(SeqPosition pos)
    
public  intnextMatching(int startPos, ItemPredicate type, int endPos, boolean descend)
     Get next matching child or descendent (ignoring attributes).
Parameters:
  startPos - starting position
Parameters:
  type - a test (predicate) to apply to selected elements
Parameters:
  endPos - stop before endPos
Parameters:
  descend - if true do depth-first traversal.
public  intnextPos(int ipos)
     Return the next position following the argument.
public  intparentPos(int ipos)
     Get position of parent.
Parameters:
  ipos - child position.
public  intpreviousPos(int ipos)
     Return the previous position following the argument.
public  intrank()
    
protected  voidreleasePos(int ipos)
     Reclaim any resources used by the given position int.
public  Objectremove(int index)
    
public  booleanremove(Object o)
    
public  booleanremoveAll(Collection c)
    
public  voidremovePos(int ipos, int count)
     Remove one or more elements.
protected  voidremovePosRange(int ipos0, int ipos1)
     Remove a range where each end-point is a position in a container.
public  booleanretainAll(Collection c)
    
public  Objectset(int[] indexes, Object value)
    
public  Objectset(int index, Object element)
    
protected  voidsetPosNext(int ipos, Object value)
    
protected  voidsetPosPrevious(int ipos, Object value)
    
abstract public  intsize()
     See java.util.List.
public  intstableCompare(AbstractSequence other)
     This is used for the XML concept of "document order".
public  intstartPos()
    
public  ListsubList(int fromIx, int toIx)
    
public  SequencesubSequence(SeqPosition start, SeqPosition end)
    
protected  SequencesubSequencePos(int ipos0, int ipos1)
    
public  Object[]toArray()
    
public  Object[]toArray(Object[] arr)
    
public  voidtoString(String sep, StringBuffer sbuf)
    
public  StringtoString()
    
protected  RuntimeExceptionunsupported(String text)
    
public static  RuntimeExceptionunsupportedException(String text)
    



Method Detail
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.



addPos
protected int addPos(int ipos, Object value)(Code)
Add a value at a specified Pos. the updated Pos, which is after the inserted value..



clear
public void clear()(Code)



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



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



compare
public static int compare(AbstractSequence seq1, int pos1, AbstractSequence seq2, int pos2)(Code)
This is used for the XML concept of "document order". It is overridden in gnu.xml.NodeTree for a more robust implementation.



consume
public void consume(Consumer out)(Code)



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



consumePosRange
public void consumePosRange(int iposStart, int iposEnd, Consumer out)(Code)



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



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



copyPos
public int copyPos(int ipos)(Code)
Make a copy of a position int. For simple positions returns the argument. 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 cookie. In any case, the new position is initialized to the same offset (and isAfter property) as the original.
Parameters:
  ipos - the position being copied. the new position



createPos
abstract public int createPos(int index, boolean isAfter)(Code)
Generate a position at a given index. The result is a position cookie that must be free'd with releasePos.
Parameters:
  index - offset from beginning of desired position
Parameters:
  isAfter - should the position have the isAfter property
exception:
  IndexOutOfBoundsException - if index is out of bounds



createRelativePos
public int createRelativePos(int pos, int delta, boolean isAfter)(Code)



elements
final public Enumeration elements()(Code)



endPos
public int endPos()(Code)



equals
public boolean equals(int ipos1, int ipos2)(Code)
Compare two positions, and indicate if they 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)



fillPosRange
public void fillPosRange(int fromPos, int toPos, Object value)(Code)



firstAttributePos
public int firstAttributePos(int ipos)(Code)
Like firstChildPos. Problem: Should this stop before we get to children? I think so, but that requires changes to TreeList.



firstChildPos
public int firstChildPos(int ipos)(Code)
Get position before first child (of the element following position).
Parameters:
  ipos - parent position. It is not released by this method. non-zero position cookie if there is a child sequence(which might be empty); zero if current position is end of sequenceor following element is atomic (cannot have children).



firstChildPos
public int firstChildPos(int ipos, ItemPredicate predicate)(Code)



fromEndIndex
protected int fromEndIndex(int ipos)(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)(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, int ipos0)(Code)
Get offset of (ipos1) relative to (ipos0).



getIterator
final public SeqPosition getIterator()(Code)



getIterator
public SeqPosition getIterator(int index)(Code)



getIteratorAtPos
public SeqPosition getIteratorAtPos(int ipos)(Code)



getLowBound
public int getLowBound(int dim)(Code)



getNextKind
public int getNextKind(int ipos)(Code)



getNextTypeName
public String getNextTypeName(int ipos)(Code)



getNextTypeObject
public Object getNextTypeObject(int ipos)(Code)



getPosNext
public Object getPosNext(int ipos)(Code)
Get the element following the specified position.
Parameters:
  ipos - the specified position. the following element, or eofValue if there is none.Called by SeqPosition.getNext.



getPosPrevious
public Object getPosPrevious(int ipos)(Code)
Get the element before the specified position.
Parameters:
  ipos - the specified position. the following element, or eofValue if there is none.



getSize
public int getSize(int dim)(Code)



gotoAttributesStart
protected boolean gotoAttributesStart(TreePosition pos)(Code)



gotoChildrenStart
final 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).



gotoParent
protected boolean gotoParent(TreePosition pos)(Code)



hasNext
public boolean hasNext(int ipos)(Code)



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



hashCode
public int hashCode()(Code)



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



isAfterPos
protected boolean isAfterPos(int ipos)(Code)
Tests whether the position has 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
final public Iterator iterator()(Code)



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



listIterator
final public ListIterator listIterator()(Code)



listIterator
final public ListIterator listIterator(int index)(Code)



nextIndex
protected int nextIndex(int ipos)(Code)
Get the offset from the beginning corresponding to a position cookie.



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



nextMatching
public int nextMatching(int startPos, ItemPredicate type, int endPos, boolean descend)(Code)
Get next matching child or descendent (ignoring attributes).
Parameters:
  startPos - starting position
Parameters:
  type - a test (predicate) to apply to selected elements
Parameters:
  endPos - stop before endPos
Parameters:
  descend - if true do depth-first traversal. poistion of next match or 0 if none found



nextPos
public int nextPos(int ipos)(Code)
Return the next position following the argument. The new position has the isAfter property. The argument is implicitly released (as in releasePos). Returns 0 if we are already at end of file.



parentPos
public int parentPos(int ipos)(Code)
Get position of parent.
Parameters:
  ipos - child position. It is not released by this method. the p os of the parent, or endPos() is there is no known parent.



previousPos
public int previousPos(int ipos)(Code)
Return the previous position following the argument. The new position has the isBefore property. The argument is implicitly released (as in releasePos). Returns -1 if we are already at beginning of file.



rank
public int rank()(Code)



releasePos
protected void releasePos(int ipos)(Code)
Reclaim any resources used by the given position int.
Parameters:
  ipos - the Pos being free'd.



remove
public Object remove(int index)(Code)



remove
public boolean remove(Object o)(Code)



removeAll
public boolean removeAll(Collection c)(Code)



removePos
public void removePos(int ipos, int count)(Code)
Remove one or more elements.
Parameters:
  ipos - 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).
exception:
  java.lang.IndexOutOfBoundsException - if (count >= 0 ? (index < 0 || index + count > size()): (index + count < 0 || index > size())),where index == nextIndex(ipos, xpos).



removePosRange
protected void removePosRange(int ipos0, int ipos1)(Code)
Remove a range where each end-point is a position in a container.
Parameters:
  ipos0 - start of range, as a poistion
Parameters:
  ipos1 - end of range
exception:
  java.lang.IndexOutOfBoundsException - if nextIndex(ipos0) > nextIndex(ipos1)|| nextIndex(ipos0) < 0 || nextIndex(ipos1) > size()



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)



setPosNext
protected void setPosNext(int ipos, Object value)(Code)



setPosPrevious
protected void setPosPrevious(int ipos, Object value)(Code)



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



stableCompare
public int stableCompare(AbstractSequence other)(Code)
This is used for the XML concept of "document order".



startPos
public int startPos()(Code)



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



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



subSequencePos
protected Sequence subSequencePos(int ipos0, int ipos1)(Code)



toArray
public Object[] toArray()(Code)



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



toString
public void toString(String sep, StringBuffer sbuf)(Code)



toString
public String toString()(Code)



unsupported
protected RuntimeException unsupported(String text)(Code)



unsupportedException
public static RuntimeException unsupportedException(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.