cn.chenlichao.wmi4j
类 SWbemMethodSet

java.lang.Object
  继承者 cn.chenlichao.wmi4j.SWbemMethodSet

public class SWbemMethodSet
extends Object

An SWbemMethodSet object is a collection of SWbemMethod objects. Items are retrieved using the item(String, Integer) method.

Note: In this version of the API, write access to method information is not supported. If you want to define methods or modify existing method definitions, you can define the method changes in a MOF file and submit the changes using the MOF Compiler. Alternatively, use the WMI COM API.

Created by chenlichao on 14-7-26.


方法摘要
 int getCount()
          Get how many items are in this SWbemObjectSet collection.
 SWbemMethod item(String methodName)
          Use default parameters for item(String, Integer)
 SWbemMethod item(String methodName, Integer flags)
          Returns a named SWbemMethod object from the collection.
 Iterator<E> iterator()
          Create a iterator of this object set.
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

item

public SWbemMethod item(String methodName,
                        Integer flags)
                 throws WMIException
Returns a named SWbemMethod object from the collection.

参数:
methodName - Name of the method to retrieve.
flags - [Optional] Reserved and must be zero if specified.
返回:
A named SWbemMethod object from the collection.
抛出:
WMIException

item

public SWbemMethod item(String methodName)
                 throws WMIException
Use default parameters for item(String, Integer)

抛出:
WMIException

getCount

public int getCount()
             throws WMIException
Get how many items are in this SWbemObjectSet collection. This property is read-only.

One thing to be careful of when using Count is that WMI does not keep a running tally of the number of items in a collection. If you request Count for a collection, WMI cannot instantly respond with a number; instead, it must literally count the items, enumerating the entire collection. For a collection that has relatively few items, such as services, this enumeration likely takes less than a second. Counting the number of events in an event log collection, however, can take considerably longer.

And then suppose you want to display the property values for every event in the collection. If so, WMI will have to enumerate the entire collection a second time.

Note: If you attempt to get this property from an SWbemObjectSet object that is returned from a method where the specified flags are included the wbemFlagForwardOnly flag, you will get an wbemErrFailed error.

返回:
The count of items in this SWbemObjectSet collection.
抛出:
WMIException

iterator

public Iterator<E> iterator()
                                                                         throws WMIException
Create a iterator of this object set.

返回:
Iterator instance.
抛出:
WMIException


Copyright © 2014. All rights reserved.