Void

Void #

The Void class can be used to explicitly specify values that should be unspecified. In some situations, it is important to express such a property, e.g., during the definition of a query. If users can specify that a certain value should not be defined in the case, they can express it with a Void object as an instance of the void class. With sub classes of void, it is possible to specify, why an attribute is not defined.

To create an object of the Void system class, one of the following lines of code:

VoidObject voidObject = VoidClass.newVoidObject();
VoidObject voidObject = (VoidObject) ModelFactory.getDefaultModel().createObject(VoidClass.CLASS_NAME);

To define a subclass, that extends the void class, the following code can be used in the model.xml file:

<VoidClass name="customVoidClass"/>

To create this class during runtime, the following code has to be used:

VoidClass voidClass = (VoidClass) ModelFactory.getDefaultModel().getClass(VoidClass.CLASS_NAME);
VoidClass customVoidClass = (VoidClass) voidClass.createSubclass("customVoidClass");
voidClass.finishEditing();

Here, the object voidClass is necessary to access the Void class and to create a subclass of it. The command createSubclass adds the class to the model of ProCAKE.

An object of customVoidClass can be created as follows:

VoidObject voidObject = (VoidObject) ModelFactory.getDefaultModel().createObject("customVoidClass");