|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.TagInputStream
This class is a Stream able to deal with individual tags and groups of them. It has a Vector with the tags and a table with pairs-name index to locate them in the Vectors table more quickly.
Field Summary | |
protected java.io.BufferedReader |
bufferedReader
|
protected static int |
DEFAULT_TAG_SIZE
|
protected static int |
DEFAULT_TAG_SIZE_INCREMENT
|
java.io.InputStream |
inputStream
|
java.lang.String |
sgmlFile
|
Hashtable |
tagIndexes
|
Constructor Summary | |
TagInputStream()
This constructor creates a TagInputStream object. |
|
TagInputStream(java.io.BufferedInputStream aIniStream,
java.lang.String kindOfFile)
This constructor creates a TagInputStream object to read from aIniStream. |
|
TagInputStream(java.lang.String fileName,
java.lang.String kindOfFile)
This constructor creates a TagInputStream object to read from the specified file. |
|
TagInputStream(java.net.URL aURL,
java.lang.String kindOfFile)
This constructor creates a TagInputStream object to read from the specified file. |
|
TagInputStream(java.util.zip.ZipInputStream zip,
java.lang.String fileName,
java.lang.String kindOfFile)
This constructor creates a TagInputStream object to read from the specified zip file. |
Method Summary | |
void |
close()
Closes the stream thereby releasing the file. |
void |
createComposedTag(Tag aTag,
java.lang.String fileTitle,
ProgressIndicator pi,
boolean isXmlFile)
Adds the subtags to aTag to create a composed tag. |
Tag |
first()
Returns the first tag in the stream. |
java.util.Date |
getDateCreationFile()
Returns the date the SGML file corresponding to this TagInputStream was created or last modified. |
Externalizer |
getExternalizer()
Returns the Externalizer of this stream. |
java.io.InputStream |
getInputStream()
Returns the inputStream. |
java.lang.String |
getKindOfFile()
Gets the kind of file to read |
java.lang.String |
getSgmlFile()
Returns the name of the SGML file that this stream reads. |
java.lang.String |
getSgmlFileTitle(java.lang.String aSgmlFile)
Returns the title (name) of the SGML file (without its path) |
Tag |
getTag(int anInt)
Returns a Tag in a position. |
Hashtable |
getTagIndexes()
Returns the positions of the tags in the file (option file) or the tags themselves (option memory). |
Vector |
getTags()
Returns the tags. |
protected java.lang.Object[] |
getTagString(int aPosition)
Reads a tag in the file starting in the position aPosition |
void |
initialize(java.io.BufferedInputStream aIniStream,
java.lang.String kindOfFile)
Initializes the stream reading from the URL. |
void |
initialize(java.lang.String fileName,
java.lang.String kindOfFile)
Initializes the stream that reads the specified file. |
void |
initialize(java.net.URL aURL,
java.lang.String kindOfFile)
Initializes the stream reading from the URL. |
void |
initialize(java.util.zip.ZipInputStream zip,
java.lang.String fileName,
java.lang.String kindOfFile)
Initializes the stream that reads the specified zip file. |
boolean |
isDecorator(Tag aTag)
Returns true if aTag is a decorator. |
boolean |
isSimpleTag(Tag aTag)
Returns true if aTag is a simple tag. |
Tag |
last()
Returns the last tag. |
int |
read()
Reads a character from the bufferedReader and returns it as an int. |
java.lang.Object |
readObject(int index)
Returns the tag (casted to an Object) at the given index. |
Tag |
readTag(int index)
Returns the Tag at the specified index. |
void |
removeTagWithId(java.lang.String tagId)
Removes the tag with id tagId from this TagInputStream. |
void |
reset(java.lang.String tagId,
Tag newTagState)
Sets the attributes of the tag with id tagId with the attributes of the tag passed by parameter. |
protected void |
setDate(java.lang.String fileName)
Sets the date the SGML file corresponding to this TagInputStream was created. |
protected void |
setDate(java.net.URLConnection url)
Sets the date the URL corresponding to this TagInputStream was created. |
protected void |
setDate(java.util.zip.ZipEntry entry)
Sets the date the zip file corresponding to this TagInputStream was created. |
void |
setExternalizer(Externalizer aExternalizer)
Sets the externalizer. |
void |
setKindOfFile(java.lang.String aKindOfFile)
Sets the kind of file to read |
void |
setSgmlFile(java.lang.String aFileName)
Sets the SGML file. |
void |
setTagIndexes(Hashtable aHashtable)
Sets the indexes of the tags in the file (option file). |
void |
setTags(Vector aVector)
Sets the tags. |
void |
skip(long aLong)
This method skips aLong amount of characters in the stream |
Tag |
tagWithId(java.lang.String aString)
Returns the tag with the specified ID. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.io.InputStream inputStream
public java.lang.String sgmlFile
public Hashtable tagIndexes
protected static final int DEFAULT_TAG_SIZE
protected static final int DEFAULT_TAG_SIZE_INCREMENT
protected java.io.BufferedReader bufferedReader
Constructor Detail |
public TagInputStream()
public TagInputStream(java.io.BufferedInputStream aIniStream, java.lang.String kindOfFile) throws java.io.IOException
fileName
- java.lang.StringkindOfFile
- java.lang.Stringpublic TagInputStream(java.lang.String fileName, java.lang.String kindOfFile) throws java.io.IOException
fileName
- java.lang.StringkindOfFile
- java.lang.Stringpublic TagInputStream(java.net.URL aURL, java.lang.String kindOfFile) throws java.io.IOException
aURL
- java.net.URLkindOfFile
- java.lang.Stringpublic TagInputStream(java.util.zip.ZipInputStream zip, java.lang.String fileName, java.lang.String kindOfFile) throws java.io.IOException
zip
- ZipInputStreamfileName
- java.lang.StringkindOfFile
- java.lang.StringMethod Detail |
public void close() throws java.io.IOException
public void createComposedTag(Tag aTag, java.lang.String fileTitle, ProgressIndicator pi, boolean isXmlFile) throws java.io.IOException
Tag
- aTag the tag that has to turn into a composed tagString
- fileTitle the file name without its path.ProgressIndicator
- pi.public Tag first() throws java.io.IOException
public java.util.Date getDateCreationFile()
public Externalizer getExternalizer()
public java.io.InputStream getInputStream()
public java.lang.String getKindOfFile()
public java.lang.String getSgmlFile()
public java.lang.String getSgmlFileTitle(java.lang.String aSgmlFile)
aSgmlFile
- java.lang.Stringpublic Tag getTag(int anInt) throws java.io.IOException
anInt
- intpublic Hashtable getTagIndexes()
public Vector getTags()
protected java.lang.Object[] getTagString(int aPosition) throws java.io.IOException
public void initialize(java.io.BufferedInputStream aIniStream, java.lang.String kindOfFile) throws java.io.IOException
aURL
- java.net.URLkindOfFile
- java.lang.Stringpublic void initialize(java.lang.String fileName, java.lang.String kindOfFile) throws java.io.IOException
fileName
- java.lang.StringkindOfFile
- java.lang.Stringpublic void initialize(java.net.URL aURL, java.lang.String kindOfFile) throws java.io.IOException
aURL
- java.net.URLkindOfFile
- java.lang.Stringpublic void initialize(java.util.zip.ZipInputStream zip, java.lang.String fileName, java.lang.String kindOfFile) throws java.io.IOException
zip
- java.util.zip.ZipInputStreamfileName
- java.lang.StringkindOfFile
- java.lang.Stringpublic boolean isDecorator(Tag aTag)
aTag
- com.ibm.dse.base.Tagpublic boolean isSimpleTag(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.TagisInitializationFile
- booleanpublic Tag last() throws java.io.IOException
public int read() throws java.io.IOException
public java.lang.Object readObject(int index) throws java.io.IOException
index
- intpublic Tag readTag(int index)
index
- intpublic void removeTagWithId(java.lang.String tagId) throws java.io.IOException
tagId
- java.lang.Stringpublic void reset(java.lang.String tagId, Tag newTagState)
tagId
- java.lang.String The id of the tag to change.tag
- com.ibm.dse.base.Tag The new value for the tag with id tagId.protected void setDate(java.lang.String fileName)
fleName
- java.lang.Stringprotected void setDate(java.net.URLConnection url)
url
- java.net.URLConnectionprotected void setDate(java.util.zip.ZipEntry entry)
entry
- ZipEntrypublic void setExternalizer(Externalizer aExternalizer)
aExternalizer
- Externalizerpublic void setKindOfFile(java.lang.String aKindOfFile)
aKindOfFile
- java.lang.Stringpublic void setSgmlFile(java.lang.String aFileName)
aFileName
- java.lang.Stringpublic void setTagIndexes(Hashtable aHashtable)
aVector
- Vectorpublic void setTags(Vector aVector)
aVector
- Vectorpublic void skip(long aLong) throws java.io.IOException
public Tag tagWithId(java.lang.String aString) throws java.io.IOException
aString
- java.lang.String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |