01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.xml.xpath.ext;
21:
22: import java.util.List;
23:
24: /**
25: *
26: * @author radval
27: *
28: */
29: public interface XPathOperationOrFuntion<NameType> extends
30: XPathExpression {
31:
32: /**
33: * Gets the name of the function.
34: * @return the function name
35: */
36: NameType getName();
37:
38: /**
39: * Gets the list of child expressions.
40: * @return a collection of child expressions
41: */
42: List<XPathExpression> getChildren();
43:
44: /**
45: * Gets the number of children expressions.
46: * @return the count of children expressions
47: */
48: int getChildCount();
49:
50: /**
51: * Gets the child expression at the specified location.
52: * @param index the index of the child to get
53: * @return the child
54: * @throws IndexOutOfBoundsException if index is out of bounds
55: */
56: XPathExpression getChild(int index)
57: throws IndexOutOfBoundsException;
58:
59: /**
60: * Adds a child expression.
61: * @param child to be added
62: */
63: void addChild(XPathExpression child);
64:
65: void insertChild(int index, XPathExpression child);
66:
67: /**
68: * Adds the specified count of new childern. All children are
69: * the core function stub().
70: *
71: * @param count
72: */
73: void populateWithStub(int count);
74:
75: /**
76: * Removes a child expression.
77: * @param child to be removed
78: * @return <code>true</code> if the child was found and removed
79: */
80: boolean removeChild(XPathExpression child);
81:
82: /**
83: * Removes all the child expressions.
84: */
85: void clearChildren();
86:
87: }
|