org.eclipse.emf.ecore.xmi.impl
Class StringSegment

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byorg.eclipse.emf.common.util.BasicEList
              extended byorg.eclipse.emf.ecore.xmi.impl.StringSegment
All Implemented Interfaces:
Cloneable, Collection, EList, List, RandomAccess, Serializable
Direct Known Subclasses:
XMLString

public class StringSegment
extends BasicEList

A String Buffer that never reallocates

See Also:
Serialized Form

Nested Class Summary
protected static class StringSegment.Element
           
protected  class StringSegment.SegmentIterator
           
 
Nested classes inherited from class org.eclipse.emf.common.util.BasicEList
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator, BasicEList.EListIterator, BasicEList.FastCompare, BasicEList.NonResolvingEIterator, BasicEList.NonResolvingEListIterator, BasicEList.UnmodifiableEList
 
Field Summary
protected  char[] buffer
           
protected static int BUFFER_SIZE
           
protected  int bufferPosition
           
protected  StringSegment.Element cursor
           
protected  int cursorIndex
           
protected static int ELEMENT_SIZE
           
protected  String lineSeparator
           
protected static int LIST_SIZE
           
protected  byte[] outputbytes
           
protected  char[] outputchars
           
protected  int segmentCapacity
           
protected  Writer temporaryFile
           
protected  String temporaryFileName
           
 
Fields inherited from class org.eclipse.emf.common.util.BasicEList
data, size
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
StringSegment()
           
StringSegment(int minimumCapacity)
           
StringSegment(int minimumCapacity, int segmentCapacity)
           
StringSegment(String temporaryFileName)
           
 
Method Summary
 void add(String newString)
           
 void addLine()
           
 int getChars(char[] destination, int position)
           
 int getLength()
           
 String getTemporaryFileName()
           
 Iterator iterator()
          Returns an iterator.
 ListIterator listIterator()
          Returns a list iterator.
 Object mark()
           
protected  Object[] newData(int capacity)
          Returns new allocated data storage.
 void reset()
           
 void resetToMark(Object mark)
           
 void setTemporaryFileName(String tempFile)
           
 void write(OutputStreamWriter os, int flushThreshold)
          Deprecated. since 2.2 - Instead use #write(Writer, int)
 void write(Writer os, int flushThreshold)
           
 void writeAscii(OutputStream os, int flushThreshold)
           
 
Methods inherited from class org.eclipse.emf.common.util.BasicEList
add, add, addAll, addAll, addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, assign, basicGet, basicIterator, basicList, basicListIterator, basicListIterator, canContainNull, clear, clone, contains, containsAll, data, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, get, getDuplicates, getNonDuplicates, grow, hashCode, indexOf, isEmpty, isUnique, lastIndexOf, listIterator, move, move, remove, remove, removeAll, resolve, retainAll, set, setData, setUnique, shrink, size, toArray, toArray, toString, useEquals, validate
 
Methods inherited from class java.util.AbstractList
removeRange, subList
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
subList
 

Field Detail

LIST_SIZE

protected static final int LIST_SIZE
See Also:
Constant Field Values

ELEMENT_SIZE

protected static final int ELEMENT_SIZE
See Also:
Constant Field Values

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values

segmentCapacity

protected int segmentCapacity

outputbytes

protected byte[] outputbytes

outputchars

protected char[] outputchars

buffer

protected char[] buffer

cursor

protected StringSegment.Element cursor

cursorIndex

protected int cursorIndex

lineSeparator

protected String lineSeparator

temporaryFileName

protected String temporaryFileName

temporaryFile

protected Writer temporaryFile

bufferPosition

protected int bufferPosition
Constructor Detail

StringSegment

public StringSegment()

StringSegment

public StringSegment(int minimumCapacity)

StringSegment

public StringSegment(int minimumCapacity,
                     int segmentCapacity)

StringSegment

public StringSegment(String temporaryFileName)
Method Detail

setTemporaryFileName

public void setTemporaryFileName(String tempFile)

getTemporaryFileName

public String getTemporaryFileName()

newData

protected Object[] newData(int capacity)
Description copied from class: BasicEList
Returns new allocated data storage. Clients may override this to create typed storage. The cost of type checking via a typed array is negligable.

Overrides:
newData in class BasicEList
Returns:
new data storage.

reset

public void reset()

add

public void add(String newString)

addLine

public void addLine()

mark

public Object mark()

resetToMark

public void resetToMark(Object mark)

getLength

public int getLength()

getChars

public int getChars(char[] destination,
                    int position)

writeAscii

public void writeAscii(OutputStream os,
                       int flushThreshold)
                throws IOException
Throws:
IOException

write

public void write(OutputStreamWriter os,
                  int flushThreshold)
           throws IOException
Deprecated. since 2.2 - Instead use #write(Writer, int)

Parameters:
os -
flushThreshold -
Throws:
IOException

write

public void write(Writer os,
                  int flushThreshold)
           throws IOException
Throws:
IOException

iterator

public Iterator iterator()
Description copied from class: BasicEList
Returns an iterator. This implementation allocates a BasicEList.EIterator.

Specified by:
iterator in interface List
Overrides:
iterator in class BasicEList
Returns:
an iterator.
See Also:
BasicEList.EIterator

listIterator

public ListIterator listIterator()
Description copied from class: BasicEList
Returns a list iterator. This implementation allocates a BasicEList.EListIterator.

Specified by:
listIterator in interface List
Overrides:
listIterator in class BasicEList
Returns:
a list iterator.
See Also:
BasicEList.EListIterator

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.