|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.brains2b.thex.BinaryElement
public class BinaryElement
Element for BinaryDocument
This element can be used both to contain other elements a contain the data itself
getState() determines where the actual content of this Element is kept
| Constructor Summary | |
|---|---|
BinaryElement(javax.swing.text.Document document,
javax.swing.text.AttributeSet attributes,
byte[] b)
Constructor |
|
BinaryElement(javax.swing.text.Document document,
javax.swing.text.AttributeSet attributes,
int length)
Constructor |
|
| Method Summary | |
|---|---|
void |
addElement(BinaryElement element)
add an Element to this BinaryElement |
javax.swing.text.AttributeSet |
getAttributes()
|
byte[] |
getBytes()
get the content for this Element |
javax.swing.text.Document |
getDocument()
|
javax.swing.text.Element |
getElement(int index)
|
int |
getElementCount()
|
int |
getElementIndex(int offset)
|
int |
getEndOffset()
|
java.lang.String |
getName()
|
javax.swing.text.Element |
getParentElement()
|
int |
getStartOffset()
|
int |
getState()
get the state for this Element |
boolean |
isLeaf()
|
void |
setBytes(byte[] bytes)
set the content for this Element |
void |
setBytes(byte[] bytes,
int offset,
int length)
set the content for this Element |
void |
setLength(int length)
set the length for this Element |
void |
setState(int state)
set the state for this Element |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryElement(javax.swing.text.Document document,
javax.swing.text.AttributeSet attributes,
int length)
document - BinaryDocument, the document that contains this Elementattributes - AttributeSet currently unusedlength - int length of this Element
public BinaryElement(javax.swing.text.Document document,
javax.swing.text.AttributeSet attributes,
byte[] b)
document - BinaryDocument, the document that contains this Elementattributes - AttributeSet currently unusedb - byte[] the content for this Element| Method Detail |
|---|
public javax.swing.text.AttributeSet getAttributes()
getAttributes in interface javax.swing.text.Elementpublic javax.swing.text.Document getDocument()
getDocument in interface javax.swing.text.Elementpublic javax.swing.text.Element getElement(int index)
getElement in interface javax.swing.text.Elementpublic int getElementCount()
getElementCount in interface javax.swing.text.Elementpublic int getElementIndex(int offset)
getElementIndex in interface javax.swing.text.Elementpublic int getEndOffset()
getEndOffset in interface javax.swing.text.Elementpublic java.lang.String getName()
getName in interface javax.swing.text.Elementpublic javax.swing.text.Element getParentElement()
getParentElement in interface javax.swing.text.Elementpublic int getStartOffset()
getStartOffset in interface javax.swing.text.Elementpublic boolean isLeaf()
isLeaf in interface javax.swing.text.Elementpublic void addElement(BinaryElement element)
element - BinaryElementpublic void setLength(int length)
length - int the length for this Elementpublic int getState()
BinaryIOKit.ELEMENT_ALTER|BinaryIOKit.ELEMENT_OLD|BinaryIOKit.ELEMENT_MEMORY)public void setState(int state)
state - int either (BinaryIOKit.ELEMENT_ALTER|BinaryIOKit.ELEMENT_OLD|BinaryIOKit.ELEMENT_MEMORY)public byte[] getBytes()
EMPTY is returnedpublic void setBytes(byte[] bytes)
bytes - byte[]
public void setBytes(byte[] bytes,
int offset,
int length)
bytes - byte[]offset - int start of the byte[] to set as contentlength - int length of the byte[] to set as content
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||