|
Xindice API version 1.2m1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xindice.xml.dom.NodeImpl
NodeImpl implements the foundation of the Xindice compressed DOM.
| Field Summary | |
protected byte[] |
data
|
protected boolean |
dirty
|
static short |
DOCUMENT_POSITION_CONTAINED_BY
The node is contained by the reference node. |
static short |
DOCUMENT_POSITION_CONTAINS
The node contains the reference node. |
static short |
DOCUMENT_POSITION_DISCONNECTED
The two nodes are disconnected. |
static short |
DOCUMENT_POSITION_FOLLOWING
The node follows the reference node. |
static short |
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
The determination of preceding versus following is implementation-specific. |
static short |
DOCUMENT_POSITION_PRECEDING
The second node precedes the reference node. |
static org.w3c.dom.DOMException |
EX_DOMSTRING_SIZE
|
static org.w3c.dom.DOMException |
EX_HIERARCHY_REQUEST
|
static org.w3c.dom.DOMException |
EX_INDEX_SIZE
|
static org.w3c.dom.DOMException |
EX_INUSE_ATTRIBUTE
|
static org.w3c.dom.DOMException |
EX_INVALID_STATE
|
static org.w3c.dom.DOMException |
EX_NO_DATA_ALLOWED
|
static org.w3c.dom.DOMException |
EX_NO_MODIFICATION_ALLOWED
|
static org.w3c.dom.DOMException |
EX_NOT_FOUND
|
static org.w3c.dom.DOMException |
EX_WRONG_DOCUMENT
|
protected HashMap |
handlers
|
protected Object |
key
|
protected int |
len
|
protected boolean |
loaded
|
protected String |
nodeName
|
protected String |
nodeValue
|
protected String |
nsURI
|
static String |
OBJECT_HREF
|
static String |
OBJECT_NS
|
static String |
OBJECT_TYPE
|
protected org.w3c.dom.Document |
ownerDocument
|
protected NodeImpl |
parentNode
|
protected int |
pos
|
protected NodeSource |
source
|
static String |
TYPE_APPEND
|
static String |
TYPE_CONTENT
|
static String |
TYPE_INSERT
|
static String |
TYPE_REPLACE
|
protected HashMap |
userData
|
static String |
XMLNS_PREFIX
|
static String |
XMLNS_URI
|
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
| Constructor Summary | |
NodeImpl()
Create empty node |
|
NodeImpl(NodeImpl parent,
boolean dirty)
|
|
NodeImpl(NodeImpl parent,
byte[] data,
int pos,
int len)
Create node from compressed data |
|
| Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children of
this node. |
protected void |
checkLoaded()
|
void |
checkReadOnly()
|
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
protected org.w3c.dom.Node |
cloneNode(boolean deep,
boolean invokeHandler)
|
short |
compareDocumentPosition(org.w3c.dom.Node other)
Compares the reference node, i.e. |
void |
expandSource()
expandSource expands the source into the Node as a namespace and a set of attributes. |
org.w3c.dom.NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if it
is an Element) or null otherwise. |
String |
getBaseURI()
Not implemented yet. |
org.w3c.dom.NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
byte[] |
getDataBytes()
getDataBytes returns the byte array that defines this Node. |
int |
getDataLen()
getDataLen returns the length of the Node's definition in the byte array. |
int |
getDataPos()
getDataPos returns the offset into the Node definition's byte array that the Node starts at. |
Object |
getFeature(String feature,
String version)
|
org.w3c.dom.Node |
getFirstChild()
The first child of this node. |
org.w3c.dom.Node |
getLastChild()
The last child of this node. |
String |
getLocalName()
Returns the local part of the qualified name of this node. |
String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getNextSibling()
The node immediately following this node. |
protected org.w3c.dom.Node |
getNextSibling(org.w3c.dom.Node node)
|
String |
getNodeName()
The name of this node, depending on its type; see the table above. |
abstract short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
String |
getNodeValue()
The value of this node, depending on its type; see the table above. |
org.w3c.dom.Document |
getOwnerDocument()
The Document object associated with this node. |
org.w3c.dom.Node |
getParentNode()
The parent of this node. |
String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getPreviousSibling()
The node immediately preceding this node. |
protected org.w3c.dom.Node |
getPreviousSibling(org.w3c.dom.Node node)
|
NodeSource |
getSource()
getSource returns a source for this Node. |
short |
getSymbolID()
getSymbolID returns the Symbol ID for the current node. |
String |
getTextContent()
This method returns the text content of this node and its descendants. |
Object |
getUserData(String key)
This method allows to retreive a user object previously attached to a Node with setUserData. |
boolean |
hasAttributes()
|
boolean |
hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Inserts the node newChild before the existing child node
refChild. |
protected void |
invokeHandlers(short op,
org.w3c.dom.Node dst)
|
protected void |
invokeHandlers(short op,
org.w3c.dom.Node src,
org.w3c.dom.Node dst)
Invoke user data handlers with provided parameters. |
boolean |
isDefaultNamespace(String namespaceURI)
|
boolean |
isDefined()
|
boolean |
isDirty()
isDirty returns whether or not the current Node (or any of its children) have been modified since being loaded. |
boolean |
isEqualNode(org.w3c.dom.Node other)
Tests whether two nodes are equal. |
boolean |
isLoaded()
isLoaded returns whether or not the Node's definition has been loaded. |
boolean |
isSameNode(org.w3c.dom.Node other)
Returns whether this node is the same node as the given one. |
boolean |
isSupported(String feature,
String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
void |
load()
load forces the Node to be graphed for this level. |
String |
lookupDefaultNamespaceURI()
getDefaultNamespaceURI returns the default Namespace URI in this scope. |
String |
lookupNamespaceURI(String prefix)
Look up the namespace URI associated to the given prefix. |
String |
lookupPrefix(String namespaceURI)
Look up the prefix associated to the given namespace URI, starting from this node. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"normal" form where only markup (e.g., tags, comments, processing
instructions, CDATA sections, and entity references) separates
Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the child node indicated by oldChild from the list
of children, and returns it. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces the child node oldChild with newChild
in the list of children, and returns the oldChild node. |
void |
setDataBytes(byte[] data)
setDataBytes sets the byte array that defines this Node. |
void |
setDataBytes(byte[] data,
int pos,
int len)
setDataBytes sets the definition and positional information for the Node. |
void |
setDataLen(int len)
setDataLen sets the length of the Node's definition in the byte array. |
void |
setDataPos(int pos)
setDataPos sets the offset into the Node definition's byte array that the Node starts at. |
void |
setDirty()
|
void |
setNodeName(String nodeName)
|
void |
setNodeValue(String nodeValue)
The value of this node, depending on its type; see the table above. |
void |
setParentNode(NodeImpl parentNode)
|
void |
setPrefix(String prefix)
The namespace prefix of this node, or null if it is
unspecified. |
void |
setSource(NodeSource source)
setSource sets a source for this Node. |
void |
setTextContent(String textContent)
This method changes the text content of this node. |
Object |
setUserData(String key,
Object data,
org.w3c.dom.UserDataHandler handler)
This method allows to attach a user object to a Node. |
String |
toString()
Converts this node into its textual representation. |
void |
unload()
unload forces the Node to be unloaded for this level. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String XMLNS_PREFIX
public static final String OBJECT_NS
public static final String OBJECT_HREF
public static final String OBJECT_TYPE
public static final String TYPE_CONTENT
public static final String TYPE_REPLACE
public static final String TYPE_INSERT
public static final String TYPE_APPEND
public static final String XMLNS_URI
public static final org.w3c.dom.DOMException EX_NO_MODIFICATION_ALLOWED
public static final org.w3c.dom.DOMException EX_INUSE_ATTRIBUTE
public static final org.w3c.dom.DOMException EX_WRONG_DOCUMENT
public static final org.w3c.dom.DOMException EX_NOT_FOUND
public static final org.w3c.dom.DOMException EX_HIERARCHY_REQUEST
public static final org.w3c.dom.DOMException EX_NO_DATA_ALLOWED
public static final org.w3c.dom.DOMException EX_INVALID_STATE
public static final org.w3c.dom.DOMException EX_DOMSTRING_SIZE
public static final org.w3c.dom.DOMException EX_INDEX_SIZE
public static final short DOCUMENT_POSITION_DISCONNECTED
public static final short DOCUMENT_POSITION_PRECEDING
public static final short DOCUMENT_POSITION_FOLLOWING
public static final short DOCUMENT_POSITION_CONTAINS
public static final short DOCUMENT_POSITION_CONTAINED_BY
public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
protected NodeSource source
protected byte[] data
protected int pos
protected int len
protected boolean loaded
protected boolean dirty
protected NodeImpl parentNode
protected String nodeName
protected String nodeValue
protected org.w3c.dom.Document ownerDocument
protected String nsURI
protected HashMap userData
protected HashMap handlers
protected Object key
| Constructor Detail |
public NodeImpl()
public NodeImpl(NodeImpl parent,
byte[] data,
int pos,
int len)
parent - the parent nodedata - compressed document data byte arraypos - offset in the data byte arraylen - length of node's data
public NodeImpl(NodeImpl parent,
boolean dirty)
| Method Detail |
public final boolean isLoaded()
CompressedNode
isLoaded in interface CompressedNodeprotected void checkLoaded()
public void load()
CompressedNode
load in interface CompressedNodepublic void unload()
CompressedNode
unload in interface CompressedNodepublic short getSymbolID()
CompressedNode
getSymbolID in interface CompressedNode
public final void checkReadOnly()
throws org.w3c.dom.DOMException
org.w3c.dom.DOMExceptionpublic final boolean isDefined()
public final boolean isDirty()
CompressedNode
isDirty in interface CompressedNodepublic final void setDirty()
public byte[] getDataBytes()
CompressedNode
getDataBytes in interface CompressedNode
public void setDataBytes(byte[] data,
int pos,
int len)
CompressedNode
setDataBytes in interface CompressedNodedata - The Node definition's byte arraypos - The Node's positionlen - The Node's lengthpublic void setDataBytes(byte[] data)
CompressedNode
setDataBytes in interface CompressedNodedata - The Node definition's byte arraypublic int getDataPos()
CompressedNode
getDataPos in interface CompressedNodepublic void setDataPos(int pos)
CompressedNode
setDataPos in interface CompressedNodepos - The Node's positionpublic int getDataLen()
CompressedNode
getDataLen in interface CompressedNodepublic void setDataLen(int len)
CompressedNode
setDataLen in interface CompressedNodelen - The Node's lengthpublic final void setNodeName(String nodeName)
public final void setParentNode(NodeImpl parentNode)
protected org.w3c.dom.Node getPreviousSibling(org.w3c.dom.Node node)
protected org.w3c.dom.Node getNextSibling(org.w3c.dom.Node node)
public final void setSource(NodeSource source)
DBNode
setSource in interface DBNodesource - The Document sourcepublic final NodeSource getSource()
DBNode
getSource in interface DBNodepublic void expandSource()
DBNode
expandSource in interface DBNodepublic abstract short getNodeType()
getNodeType in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getLastChild()
null.
getLastChild in interface org.w3c.dom.Nodepublic final org.w3c.dom.Node getPreviousSibling()
null.
getPreviousSibling in interface org.w3c.dom.Nodepublic final org.w3c.dom.Node getNextSibling()
null.
getNextSibling in interface org.w3c.dom.Nodepublic org.w3c.dom.NamedNodeMap getAttributes()
NamedNodeMap containing the attributes of this node (if it
is an Element) or null otherwise.
getAttributes in interface org.w3c.dom.Nodepublic boolean hasAttributes()
hasAttributes in interface org.w3c.dom.Nodepublic final org.w3c.dom.Document getOwnerDocument()
Document object associated with this node. This is also
the Document object used to create new nodes. When this
node is a Document this is null.
getOwnerDocument in interface org.w3c.dom.Node
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
throws org.w3c.dom.DOMException
newChild before the existing child node
refChild. If refChild is null,
insert newChild at the end of the list of children.
newChild is a DocumentFragment object,
all of its children are inserted, in the same order, before
refChild. If the newChild is already in the
tree, it is first removed.
insertBefore in interface org.w3c.dom.NodenewChild - The node to insert.refChild - The reference node, i.e., the node before which the new
node must be inserted.
org.w3c.dom.DOMException - newChild node, or if
the node to insert is one of this node's ancestors.
newChild was created
from a different document than the one that created this node.
refChild is not a child of
this node.
public org.w3c.dom.NodeList getChildNodes()
NodeList that contains all children of this node. If there
are no children, this is a NodeList containing no nodes.
The content of the returned NodeList is "live" in the sense
that, for instance, changes to the children of the node object that
it was created from are immediately reflected in the nodes returned by
the NodeList accessors; it is not a static snapshot of the
content of the node. This is true for every NodeList,
including the ones returned by the getElementsByTagName
method.
getChildNodes in interface org.w3c.dom.Node
public void setNodeValue(String nodeValue)
throws org.w3c.dom.DOMException
null , setting it has no effect.
setNodeValue in interface org.w3c.dom.Nodeorg.w3c.dom.DOMException - DOMString variable on the implementation
platform.
public final org.w3c.dom.Node getParentNode()
Document,
DocumentFragment, and Attr may have a parent.
However, if a node has just been created and not yet added to the tree,
or if it has been removed from the tree, this is null.
getParentNode in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getFirstChild()
null.
getFirstChild in interface org.w3c.dom.Nodepublic String getNodeName()
getNodeName in interface org.w3c.dom.Node
public String getNodeValue()
throws org.w3c.dom.DOMException
getNodeValue in interface org.w3c.dom.Nodeorg.w3c.dom.DOMException - DOMString variable on the implementation
platform.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild with newChild
in the list of children, and returns the oldChild node. If
the newChild is already in the tree, it is first removed.
replaceChild in interface org.w3c.dom.NodenewChild - The new node to put in the child list.oldChild - The node being replaced in the list.
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild node, or it
the node to put in is one of this node's ancestors.
newChild was created
from a different document than the one that created this node.
oldChild is not a child of
this node.
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild from the list
of children, and returns it.
removeChild in interface org.w3c.dom.NodeoldChild - The node being removed.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldChild is not a child of
this node.
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
throws org.w3c.dom.DOMException
newChild to the end of the list of children of
this node. If the newChild is already in the tree, it is
first removed.
appendChild in interface org.w3c.dom.NodenewChild - The node to add.If it is a DocumentFragment
object, the entire contents of the document fragment are moved into
the child list of this node
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild node, or if
the node to append is one of this node's ancestors.
newChild was created
from a different document than the one that created this node.
public boolean hasChildNodes()
hasChildNodes in interface org.w3c.dom.Nodetrue if the node has any children,
false if the node has no children.public final org.w3c.dom.Node cloneNode(boolean deep)
parentNode returns null.).
Element copies all attributes and their
values, including those generated by the XML processor to represent
defaulted attributes, but this method does not copy any text it contains
unless it is a deep clone, since the text is contained in a child
Text node. Cloning any other type of node simply returns a
copy of this node.
cloneNode in interface org.w3c.dom.Nodedeep - If true, recursively clone the subtree under the
specified node; if false, clone only the node itself (and
its attributes, if it is an Element).
protected final org.w3c.dom.Node cloneNode(boolean deep,
boolean invokeHandler)
public void normalize()
Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"normal" form where only markup (e.g., tags, comments, processing
instructions, CDATA sections, and entity references) separates
Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. This can be
used to ensure that the DOM view of a document is the same as if it
were saved and re-loaded, and is useful when operations (such as
XPointer lookups) that depend on a particular document tree structure
are to be used. In cases where the document contains
CDATASections , the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
Text nodes and CDATASection nodes.
normalize in interface org.w3c.dom.Node
public final boolean isSupported(String feature,
String version)
isSupported in interface org.w3c.dom.Nodefeature - The name of the feature to test. This is the same name
which can be passed to the method hasFeature on
DOMImplementation .version - This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true .
true if the specified feature is supported
on this node, false otherwise.public final String getNamespaceURI()
null if it is
unspecified.
ELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null .
Per the Namespaces in XML Specification an attribute does not
inherit its namespace from the element it is attached to. If an
attribute is not explicitly given a namespace, it simply has no
namespace.
getNamespaceURI in interface org.w3c.dom.Nodepublic final String getPrefix()
null if it is
unspecified.
nodeName attribute, which holds the qualified name , as
well as the tagName and name attributes of
the Element and Attr interfaces, when
applicable.
namespaceURI and localName do not change.
getPrefix in interface org.w3c.dom.Nodeorg.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
illegal character.
prefix is
malformed, if the namespaceURI of this node is
null , if the specified prefix is "xml" and the
namespaceURI of this node is different from
"http://www.w3.org/XML/1998/namespace", if this node is an attribute
and the specified prefix is "xmlns" and the namespaceURI
of this node is different from "http://www.w3.org/2000/xmlns/", or
if this node is an attribute and the qualifiedName of
this node is "xmlns" .public final void setPrefix(String prefix)
null if it is
unspecified.
nodeName attribute, which holds the qualified name , as
well as the tagName and name attributes of
the Element and Attr interfaces, when
applicable.
namespaceURI and localName do not change.
setPrefix in interface org.w3c.dom.Nodeorg.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
illegal character.
prefix is
malformed, if the namespaceURI of this node is
null , if the specified prefix is "xml" and the
namespaceURI of this node is different from
"http://www.w3.org/XML/1998/namespace", if this node is an attribute
and the specified prefix is "xmlns" and the namespaceURI
of this node is different from "http://www.w3.org/2000/xmlns/", or
if this node is an attribute and the qualifiedName of
this node is "xmlns" .public final String getLocalName()
createElement from the Document interface,
it is null .
getLocalName in interface org.w3c.dom.Nodepublic final String lookupDefaultNamespaceURI()
public final boolean isSameNode(org.w3c.dom.Node other)
other - The node to test against.
true if the nodes are the same,
false otherwise.public final String lookupPrefix(String namespaceURI)
namespaceURI - The namespace URI to look for.
null
if none is found.public final String lookupNamespaceURI(String prefix)
prefix - The prefix to look for.
null if
none is found.
public final Object setUserData(String key,
Object data,
org.w3c.dom.UserDataHandler handler)
getUserData.Is this really worth
it?Could we live without a key?What happens if the node is cloned,
imported, adopted? Should some event mechanism be specified to notify
the application?What happens if the node is cloned?What should Object
be mapped to in ECMAScript? For IDL we need to define this type
somehow.
data - The piece of data to attach to this node.key - The key to associate this data to.handler - user data handler
null.public final Object getUserData(String key)
setUserData.
key - The key to look for.
null.public String getBaseURI()
public String getTextContent()
| Node type | Content |
|---|---|
| ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE | concatenation of the textContent attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the node has no children. |
| TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE | nodeValue |
| DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE | null |
public void setTextContent(String textContent)
throws org.w3c.dom.DOMException
textContent - new text content
org.w3c.dom.DOMException - - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonlypublic boolean isEqualNode(org.w3c.dom.Node other)
Node.isSameNode(). All nodes that are the same will also be
equal, though the reverse may not be true.
NamedNodeMaps are equal. This is: they are both null,
or they have the same length and for each node that exists in one map there
is a node that exists in the other map and is equal, although not
necessarily at the same index.NamedNodeMaps are equal.NamedNodeMaps are equal.
other - Node to test againts
public Object getFeature(String feature,
String version)
feature - feature nameversion - feature version
public boolean isDefaultNamespace(String namespaceURI)
namespaceURI - namespace URI to check
public short compareDocumentPosition(org.w3c.dom.Node other)
throws org.w3c.dom.DOMException
other - The node to compare against the reference node.
org.w3c.dom.DOMException - NOT_SUPPORTED_ERR: when the compared nodes are
from different DOM implementations that do not coordinate to return
consistent implementation-specific results.
protected void invokeHandlers(short op,
org.w3c.dom.Node src,
org.w3c.dom.Node dst)
op - operation codesrc - source nodedst - destination node
protected void invokeHandlers(short op,
org.w3c.dom.Node dst)
public String toString()
|
Xindice API version 1.2m1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||