|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.chenlichao.wmi4j.SWbemPropertySet
public class SWbemPropertySet
An SWbemPropertySet object is a collection of SWbemProperty objects.
You can add items to the collection using the add() method,
retrieve items from the collection using the item() method,
and remove items from the collection using the remove() method.
Created by chenlichao on 14-7-26.
| 方法摘要 | |
|---|---|
SWbemProperty |
add(String name,
WbemCimTypeEnum cimType)
Use default parameters for add(String, cn.chenlichao.wmi4j.consts.WbemCimTypeEnum, Boolean, Integer) |
SWbemProperty |
add(String name,
WbemCimTypeEnum cimType,
Boolean isArray,
Integer flags)
Adds an SWbemProperty object to this collection. |
int |
getCount()
Get how many items are in this SWbemObjectSet collection. |
SWbemProperty |
item(String name)
Use default parameters for item(String, Integer) |
SWbemProperty |
item(String name,
Integer flags)
Gets a named SWbemProperty from the collection. |
Iterator<E> |
iterator()
Create a iterator of this object set. |
void |
remove(String name)
Use default parameters for remove(String, Integer) |
void |
remove(String name,
Integer flags)
Delete a property from the collection. |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public SWbemProperty add(String name,
WbemCimTypeEnum cimType,
Boolean isArray,
Integer flags)
throws WMIException
SWbemProperty object to this collection.
If a property with the same name already exists in the collection, its contents are replaced with the new definition.
Note: The value of the added property is NULL (unassigned) after this operation.
To set or change the value of a WMI property, you must set the value property of the returned SWbemProperty object.
name - Name of the new property.cimType - An integer that represents the CIMType qualifier of the new property. See WbemCimTypeEnumisArray - [Optional] Specifies whether the property is an array type. The default value for this parameter is FALSE.flags - [Optional] Reserved and must be zero if specified.
SWbemProperty object that represents the new property.
Otherwise, a null object is returned.
WMIException
public SWbemProperty add(String name,
WbemCimTypeEnum cimType)
throws WMIException
add(String, cn.chenlichao.wmi4j.consts.WbemCimTypeEnum, Boolean, Integer)
WMIException
public SWbemProperty item(String name,
Integer flags)
throws WMIException
SWbemProperty from the collection. This is the default method for this object.
name - Name of the property to retrieve.flags - [Optional] Reserved and must be zero if specified.
SWbemProperty object is returned.
WMIException
public SWbemProperty item(String name)
throws WMIException
item(String, Integer)
WMIException
public void remove(String name,
Integer flags)
throws WMIException
name - Name of the property to remove.flags - [Optional] Reserved and must be zero if specified.
WMIException
public void remove(String name)
throws WMIException
remove(String, Integer)
WMIException
public int getCount()
throws WMIException
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.
WMIException
public Iterator<E> iterator()
throws WMIException
WMIException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||