本文整理汇总了Java中org.apache.commons.collections.iterators.FilterIterator类的典型用法代码示例。如果您正苦于以下问题:Java FilterIterator类的具体用法?Java FilterIterator怎么用?Java FilterIterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilterIterator类属于org.apache.commons.collections.iterators包,在下文中一共展示了FilterIterator类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getClustersStat
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
public static int getClustersStat(String clusters) {
Predicate predicate = new Predicate() {
public boolean evaluate(Object object) {
String clustersId = ((ClustersState) object).getClusters();
return clustersId.compareTo(clusters) == 0;
}
};
Iterator iterator = new FilterIterator(stateArray.iterator(), predicate);
ClustersState state = null;
while (iterator.hasNext()) {
state = (ClustersState) iterator.next();
break;
}
return (state != null) ? state.getState() : 0;
}
开发者ID:tang-jie,项目名称:AvatarMQ,代码行数:20,代码来源:ConsumerContext.java
示例2: selectByClusters
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
public static ConsumerClusters selectByClusters(String clusters) {
Predicate predicate = new Predicate() {
public boolean evaluate(Object object) {
String id = ((ClustersRelation) object).getId();
return id.compareTo(clusters) == 0;
}
};
Iterator iterator = new FilterIterator(relationArray.iterator(), predicate);
ClustersRelation relation = null;
while (iterator.hasNext()) {
relation = (ClustersRelation) iterator.next();
break;
}
return (relation != null) ? relation.getClusters() : null;
}
开发者ID:tang-jie,项目名称:AvatarMQ,代码行数:19,代码来源:ConsumerContext.java
示例3: getProceduralVisualChildInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
* return an iterator over visual children that haven't been marked described.
*/
// TODO visual children are marked described by the descriptor
// generator, so there is some order-of-codegen sensitivity
// here. It's the only such dependency, but at some point
// descriptor codegen and marking-of-isDescribed should be
// split apart.
public final Iterator getProceduralVisualChildInitializerIterator()
{
if (root instanceof MovieClip)
{
return new FilterIterator(((MovieClip)root).getChildInitializerIterator(), new Predicate()
{
public boolean evaluate(Object object)
{
ValueInitializer init = (ValueInitializer)object;
Object value = init.getValue();
return !(value instanceof Model) || (!((Model)value).isDescribed() && !((Model)value).isStateSpecific());
}
});
}
else
{
return Collections.EMPTY_LIST.iterator();
}
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:28,代码来源:MxmlDocument.java
示例4: getElementInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
* Note that we do *not* filter out bindings for element initializers.
*/
@SuppressWarnings("unchecked")
public final Iterator<ArrayElementInitializer> getElementInitializerIterator()
{
return new FilterIterator(list.iterator(), new Predicate()
{
public boolean evaluate(Object object)
{
return (! (((ArrayElementInitializer) object).getValue() instanceof Reparent));
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:15,代码来源:Array.java
示例5: getDeclarationIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
* NOTE: suppress declaration of inherited properties
*/
public final Iterator<PropertyDeclaration> getDeclarationIterator()
{
final Type superType = getSuperClass();
return new FilterIterator(declarations.values().iterator(), new Predicate()
{
public boolean evaluate(Object object)
{
return superType.getProperty(((PropertyDeclaration)object).getName()) == null;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:16,代码来源:MxmlDocument.java
示例6: getTopLevelDeclarationIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
private final Iterator<PropertyDeclaration> getTopLevelDeclarationIterator()
{
return new FilterIterator(declarations.values().iterator(), new Predicate()
{
public boolean evaluate(Object object)
{
return ((PropertyDeclaration)object).getTopLevel();
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:14,代码来源:MxmlDocument.java
示例7: getNonStagePropertyInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
public final Iterator<Initializer> getNonStagePropertyInitializerIterator()
{
return new FilterIterator(new IteratorChain(root.getPropertyInitializerIterator(false),
getTopLevelInitializerIterator()), new Predicate()
{
public boolean evaluate(Object object)
{
if (object instanceof NamedInitializer)
return (!StandardDefs.isStageProperty(((NamedInitializer)object).getName())) &&
(!((NamedInitializer)object).isDesignLayer());
return true;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:18,代码来源:MxmlDocument.java
示例8: getDesignLayerPropertyInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
public final Iterator<Initializer> getDesignLayerPropertyInitializerIterator()
{
return new FilterIterator(layerDeclarations.iterator(), new Predicate()
{
public boolean evaluate(Object object)
{
return object instanceof InitializedPropertyDeclaration;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:14,代码来源:MxmlDocument.java
示例9: getStagePropertyInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
public final Iterator<Initializer> getStagePropertyInitializerIterator()
{
return new FilterIterator(new IteratorChain(root.getPropertyInitializerIterator(false),
getTopLevelInitializerIterator()), new Predicate()
{
public boolean evaluate(Object object)
{
if (object instanceof NamedInitializer)
return StandardDefs.isStageProperty(((NamedInitializer)object).getName());
return false;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:17,代码来源:MxmlDocument.java
示例10: getTopLevelInitializerIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
public final Iterator<Initializer> getTopLevelInitializerIterator()
{
return new FilterIterator(getTopLevelDeclarationIterator(), new Predicate()
{
public boolean evaluate(Object object)
{
return object instanceof InitializedPropertyDeclaration;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:14,代码来源:MxmlDocument.java
示例11: bindingFilter
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
*
*/
@SuppressWarnings("unchecked")
protected Iterator<Initializer> bindingFilter(Iterator<? extends Initializer> iter, final boolean include)
{
return new FilterIterator(iter, new Predicate()
{
public boolean evaluate(Object object)
{
return (((Initializer) object).isBinding()) == include;
}
});
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:15,代码来源:Model.java
示例12: initialize
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
* Creates the FilterIterator that underlies this Iterator
*/
protected void initialize() {
if (!initialized) {
filteredBalances = new FilterIterator(balancesSource, new Predicate() {
public boolean evaluate(Object obj) {
return balancePredicate.select((Balance) obj);
}
});
initialized = true;
}
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:14,代码来源:FilteringBalanceIteratorImpl.java
示例13: filterIterator
import org.apache.commons.collections.iterators.FilterIterator; //导入依赖的package包/类
/**
* Returns an iterator with elements from an original <code>iterator</code> where the
* given <code>predicate</code> matches removed.
*
* @param <T>
* @param iterator
* @param predicate
* @return
*/
@SuppressWarnings("unchecked")
public static <T> Iterator<T> filterIterator(Iterator<? extends T> iterator,
final Predicate<? super T> predicate) {
return new FilterIterator(iterator, new org.apache.commons.collections.Predicate() {
public boolean evaluate(Object object) {
return predicate.evaluate((T) object);
}
});
}
开发者ID:hlta,项目名称:playweb,代码行数:20,代码来源:Iterators.java
注:本文中的org.apache.commons.collections.iterators.FilterIterator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论