korat.finitization
Interface IObjSet

All Superinterfaces:
IFieldDomain
All Known Implementing Classes:
ObjSet

public interface IObjSet
extends IFieldDomain

Interface that represents Field domains for reference types.

IObjSet contains an ordered list of class domains (IClassDomain). Ordering of objects within a class domain must be preserved in each IObjSet.

Author:
korat.team
See Also:
IClassDomain

Method Summary
 boolean addClassDomain(IClassDomain domain)
          Adds new class domain.
 Object[] getAllObjects()
          Returns all objest in entire IObjSet.Those are all objects that can be assigned to the field that this IFieldDomain is assigned to.
 List<IClassDomain> getClassDomains()
          Returns the list of all class domains
 Object[] getObjectsOfClass(Class cls)
          Returns instances (direct or indirect) of the given class in entire IObjSet
 boolean isNullAllowed()
          Is null allowed or not.
 boolean removeClassDomain(IClassDomain domain)
          Removes class domain from this IObjSet
 IClassDomain removeClassDomain(int index)
          Removes class domain from IObjSet
 void setNullAllowed(boolean allowed)
          Sets whether null is allowed or not.
 
Methods inherited from interface korat.finitization.IFieldDomain
getClassOfField, getNumberOfElements, getNumOfClassDomains, isArrayType, isPrimitiveType
 

Method Detail

addClassDomain

boolean addClassDomain(IClassDomain domain)
Adds new class domain. classOfObjects of the given IClassDomain must be assignable to the classOfField of this IObjSet.

Parameters:
domain - Class domain
Returns:
if class domain is already added, return false else return true
See Also:
IFieldDomain.getClassOfField(), IClassDomain.getClassOfObjects(), IFieldDomain, IClassDomain

removeClassDomain

boolean removeClassDomain(IClassDomain domain)
Removes class domain from this IObjSet

Parameters:
domain - Class domain to be removed
Returns:
returns true if domain existed in this field domain

removeClassDomain

IClassDomain removeClassDomain(int index)
Removes class domain from IObjSet

Parameters:
index - index of class domain to be removed. If index is out of bounds, should return null instead of throwing an exception
Returns:
removed class domain
See Also:
removeClassDomain(IClassDomain)

getClassDomains

List<IClassDomain> getClassDomains()
Returns the list of all class domains

Returns:
list of all class domains

getAllObjects

Object[] getAllObjects()
Returns all objest in entire IObjSet.Those are all objects that can be assigned to the field that this IFieldDomain is assigned to.

Returns:
all objects in this field domain.

getObjectsOfClass

Object[] getObjectsOfClass(Class cls)
Returns instances (direct or indirect) of the given class in entire IObjSet

Parameters:
cls - base class
Returns:
objects of this field domain which are instances (direct or indirect) of the given class. If there are no such objects, returns zero-size array
See Also:
getAllObjects()

setNullAllowed

void setNullAllowed(boolean allowed)
Sets whether null is allowed or not. By default null is not allowed.

Parameters:
allowed - whether null value is allowed.
See Also:
isNullAllowed()

isNullAllowed

boolean isNullAllowed()
Is null allowed or not.

Returns:
is null allowed
See Also:
isNullAllowed()