1/*2* Licensed to the Apache Software Foundation (ASF) under one3* or more contributor license agreements. See the NOTICE file4* distributed with this work for additional information5* regarding copyright ownership. The ASF licenses this file6* to you under the Apache License, Version 2.0 (the7* "License"); you may not use this file except in compliance8* with the License. You may obtain a copy of the License at9*10* http://www.apache.org/licenses/LICENSE-2.011*12* Unless required by applicable law or agreed to in writing,13* software distributed under the License is distributed on an14* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15* KIND, either express or implied. See the License for the16* specific language governing permissions and limitations17* under the License.18*/19packageorg.apache.myfaces.trinidad.model; 20 21/**22* Defines a set of "local" APIs for a TreeModel.23* The "local" APIs allow a client to query the tree model and determine if a24* set of rows are locally available. "Locally available" can mean the25* model has the given set of rows in a local cache and can honor a fetch request26* efficiently (for example, without performing a SQL query).27*/28publicinterfaceTreeLocalRowKeyIndex 29 { 30/**31* Indicates whether data for a child model (children of the current node) is32* locally available. Locally available means no data fetch is required33* as a result of a call to <code>enterContainer</code>.34* @return true if child data is locally available35*/36publicbooleanisChildCollectionLocallyAvailable(); 37 38/**39* Indicates whether child data for the node with the given index is40* locally available.41* @param index row index to check42* @return true if child data is available, false otherwise43*/44publicbooleanisChildCollectionLocallyAvailable(intindex); 45 46/**47* Indicates whether child data for the node with the given row key is48* locally available.49* @param rowKey row key to check50* @return true if child data is available, false otherwise51*/52publicbooleanisChildCollectionLocallyAvailable(Object rowKey); 53 54/**55* Check if a range of rows is locally available starting from a row index. The range56* can include child nodes in any expanded nodes within the range.57* @param startIndex staring index for the range58* @param rowCount number of rows in the range59* @param disclosedRowKeys set of expanded nodes which may fall within the range to check for60* availability61* @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise62*/63publicbooleanareRowsLocallyAvailable(intstartIndex,introwCount, RowKeySet disclosedRowKeys); 64 65/**66* Check if a range of rows is locally available starting from a row key. The range67* can include child nodes in any expanded nodes within the range.68* @param startRowKey staring row key for the range69* @param rowCount number of rows in the range70* @param disclosedRowKeys set of expanded nodes which may fall within the range to check for71* availability72* @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise73*/74publicbooleanareRowsLocallyAvailable(Object startRowKey,introwCount, RowKeySet disclosedRowKeys); 75 76/**77* Check if a range of rows is locally available starting from current position. The range78* can include child nodes in any expanded nodes within the range.79* @param rowCount number of rows in the range80* @param disclosedRowKeys set of expanded nodes which may fall within the range to check for81* availability82* @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise83*/84publicbooleanareRowsLocallyAvailable(introwCount, RowKeySet disclosedRowKeys); 85 86 }