| Class REXML::Parent |
|
A parent has children, and has methods for accessing them. The Parent class is never encountered except as the superclass for some other object.
親は子と子にアクセスするためのメソッドを持っています。Parentクラス は、いくつかの他のスーパークラスのオブジェクト以外を除いては、決し て衝突しません。
| Methods |
| Included modules |
| Public Class methods |
| new(parent=nil) |
Constructor
@param parent if supplied, will be set as the parent of this object
コンストラクタ。
@もし与えられていれば、パラメータparentはこのオブジェクトの親と して登録されるでしょう。
| Public Instance methods |
| add( object ) |
| unshift( object ) |
| delete( object ) |
| each(&block) |
| delete_if( &block ) |
| delete_at( index ) |
| each_index( &block ) |
| []( index ) |
Fetches a child at a given index
@param index the Integer index of the child to fetch
与えられたindexの子を取って来ます。
@パラメータindexは子を取って来るためのIntegerの添字です。
| []=( *args ) |
Set an index entry. See Array.[]=
@param index the index of the element to set
@param opt either the object to set, or an Integer length
@param child if opt is an Integer, this is the child to set
@return the parent (self)
indexの項目を設定します。Array.[]=をみて下さい。
@パラメータindexは要素の添字を設定します。
@パラメータoptは設定するためのオブジェクトか、Integerで表される 長さです。
@もしoptがIntegerならば、パラメータchildはchildを設定します。
@parent(自分自身)を返します。
| insert_before( child1, child2 ) |
Inserts an child before another child
@param child1 this is either an xpath or an Element. If an Element, child2 will be inserted before child1 in the child list of the parent. If an xpath, child2 will be inserted before the first child to match the xpath.
@param child2 the child to insert
@return the parent (self)
他の子の前に子を挿入します。
@パラメータchild1はxpathまたはElementです。もし、Elementなら、 child2は親の子のリストの中でchild1の前に挿入されるでしょう。もし、 xpathなら、child2はxpathで最初にマッチした子どもの前に挿入される でしょう。
@パラメータchild2は挿入する子です。
@親(自分自身)を返します。
| insert_after( child1, child2 ) |
Inserts an child after another child
@param child1 this is either an xpath or an Element. If an Element, child2 will be inserted after child1 in the child list of the parent. If an xpath, child2 will be inserted after the first child to match the xpath.
@param child2 the child to insert
@return the parent (self)
他の子の後に子を挿入します。
@パラメータchild1はXPathまたはElementです。もし、Elementなら、 child2は親の子のリストの中でchild1の後に挿入されるでしょう。もし、 xpathなら、child2はxpathで最初にマッチした子どもの後に挿入される でしょう。
@パラメータchild2は挿入する子です。
@親(自分自身)を返します。
| to_a() |
| index( child ) |
Fetches the index of a given child
@param child the child to get the index of
@return the index of the child, or nil if the object is not a child of this parent.
与えられた子の添字を取って来ます。
@パラメータchildは添字を取って来るための子です。
@childの添字を返します。もし、親にchildが無かったらnilを返します。
| size() |
@return the number of children of this parent
@親の子の数を返します。
| replace_child( to_replace, replacement ) |
Replaces one child with another, making sure the nodelist is correct
@param to_replace the child to replace (must be a Child)
@param replacement the child to insert into the nodelist (must be a Child)
ノードリストが正しいことを確かめながら、ある子を他の子に置き換え ます。
@パラメータto_replaceは置き換える子です(Childで無ければいけませ ん)。
@パラメータreplacementはノードリストに挿入する子です(Childで無け ればいけません)。
| deep_clone() |