for( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
if( userClass instanceof UserClass.Name ||
userClass instanceof UserClass.ThisEntry )
{
filteredTuples.add( tuple );
break;
}
}
}
if( filteredTuples.size() > 0 )
{
return filteredTuples;
}
// Otherwise if there are any tuples matching UserGroup,
// discard all other tuples.
for( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
if( userClass instanceof UserClass.UserGroup )
{
filteredTuples.add( tuple );
break;
}
}
}
if( filteredTuples.size() > 0 )
{
return filteredTuples;
}
// Otherwise if there are any tuples matching subtree,
// discard all other tuples.
for( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
if( userClass instanceof UserClass.Subtree )
{
filteredTuples.add( tuple );
break;
}