com.sapportals.wcm.rfadapter

Class ResultList

java.lang.Object
  extended bycom.sapportals.wcm.rfadapter.ResultList

public final class ResultList
extends Object

a simple container that only allows to add, not to remove instances of the Result class. It holds a global list containing all instances as well as seperate lists only holding instances of a ceratin Status category. See class Status for available categories. This container should be used, when operations of the rfadapter package are used for a list of IResources in a single transaction (e.g. the user selected a list of resources for a copy operation). The loop calling the rfadpter-operations can add all returned Result instances to this container.


Constructor Summary
ResultList()
          simple standard public constructor
 
Method Summary
 void add(Result result)
          adds the given instance to the list of all results.
 Result get(int index)
           
 Status getStatus()
           
 int size()
           
 ResultList sublist(Status status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultList

public ResultList()
simple standard public constructor

Method Detail

add

public void add(Result result)
adds the given instance to the list of all results. Depending on the Status of the result, it is also added to the according list that only contains results of this status-category. As the Result class will never return null for its status, each result will be placed in one of the categories available. So the addition of the entries in each of the sublists will yield the same number of elements as the total list of elements.

Parameters:
result - the instance to add. If the parameter is null, it will not be added

getStatus

public Status getStatus()
Returns:
the "worst" status of any result that has been added. The Status.NONE is not considered here. If the list of a status contains at least one element, this status determines the status of this ResultList instance. If the list of this status does not hold any elements the next status will be considered. The order of asking the lists is determined by the severity of the status.

get

public Result get(int index)
Parameters:
index - the position of the Result instance to retrieve
Returns:
the Result at the given position

size

public int size()
Returns:
the number of the Result instances stored in this container

sublist

public ResultList sublist(Status status)
Parameters:
status - the status to retrieve the Results of. Must not be null
Returns:
a new ResultList instance that only holds Result instances of the given status category. If the current instance does not hold any instances of the Result class with this severity, the returned list will also hold no instances. The number of elements in the total list of the returned ResultList will naturally match the number of elements in its sublist of the given status category


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.