View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.asn1.ber ;
18  
19  import java.nio.ByteBuffer;
20  import java.util.List;
21  
22  
23  /***
24   * A mutable TupleNode used for building TLV Tuple trees.
25   *
26   * @author <a href="mailto:dev@directory.apache.org">
27   * Apache Directory Project</a>
28   * @version $Rev: 157644 $
29   */
30  public interface MutableTupleNode extends TupleNode
31  {
32      /***
33       * Adds child to the receiver at index.
34       * 
35       * @param child the child to add 
36       * @param index the index at which to insert the child
37       */
38      void insert( MutableTupleNode child, int index ) ; 
39                
40      /***
41       * Removes the child at index from the receiver.
42       * 
43       * @param index the index at which to remove the child
44       */
45      void remove( int index ) ;
46                
47      /***
48       * Removes node from the receiver. 
49       * 
50       * @param node the node to remove
51       */
52       void remove( MutableTupleNode node ) ; 
53                
54       /***
55        * Removes the receiver from its parent.
56        */
57       void removeFromParent() ; 
58                 
59       /***
60        * Sets the parent of the receiver to newParent.
61        * 
62        * @param newParent the new parent to set
63        */
64       void setParent( MutableTupleNode newParent ) ; 
65                
66      /***
67       * Resets the Tuple of the receiver object.  Also clears the value chunk 
68       * buffers accumulated for the previous tuple if any.
69       * 
70       * @param t the tuple to set for this node
71       */
72      void setTuple( Tuple t ) ;  
73       
74      /***
75       * Resets the Tuple of the receiver object.  Also clears the value chunk 
76       * buffers accumulated for the previous tuple if any.
77       * 
78       * @param t the tuple to set for this node
79       * @param valueChunks the list of value chunk buffers
80       */
81      void setTuple( Tuple t, List valueChunks ) ;  
82       
83       /***
84        * Adds a buffer containing the entire buffer or a chunked peice of it.
85        *
86        * @param valueChunk a chunk of the value as a byte buffer
87        */
88       void addValueChunk( ByteBuffer valueChunk ) ;
89  }