|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkorat.finitization.impl.FieldDomain
korat.finitization.impl.ObjSet
public class ObjSet
| Nested Class Summary | |
|---|---|
(package private) static class |
ObjSet.CacheElement
|
| Field Summary | |
|---|---|
private List<ObjSet.CacheElement> |
cache
|
protected List<ClassDomain> |
domains
|
private boolean |
isCacheValid
|
private boolean |
nullAllowed
|
| Fields inherited from class korat.finitization.impl.FieldDomain |
|---|
classOfField |
| Constructor Summary | |
|---|---|
ObjSet(Class classOfField)
|
|
ObjSet(String classOfFieldName)
|
|
| 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. |
ClassDomain |
getClassDomain(int classDomainIndex)
Returns the class domain for the given index primitive types should return null. |
ClassDomain |
getClassDomainFor(int objectIndex)
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following
class domain. |
int |
getClassDomainIndexFor(int objectIndex)
Given the index of object in this field domain, returns index of that object in its class domain. |
List<IClassDomain> |
getClassDomains()
Returns the list of all class domains |
int |
getIndexOfFirstObjectInNextClassDomain(int objectIndex)
|
ClassDomain |
getNextClassDomainFor(int objectIndex)
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following
class domain. |
int |
getNumberOfElements()
Number of all elements in this field domain. |
int |
getNumOfClassDomains()
Number of class domains contained in this field domain. |
Object |
getObject(int objectIndex)
Returns object with the given index in entire ObjSet. |
Object[] |
getObjectsOfClass(Class cls)
Returns instances (direct or indirect) of the given class in entire IObjSet |
Object[] |
getObjectsOfClass(int classDomainIndex)
Returns instances of the class domain with the given index in this ObjSet. |
int |
getSizeOfClassDomain(int classDomainIndex)
Number of object in the class domain which is at a classDomainIndex position in the list of all class domains
within this field domain. |
boolean |
isArrayType()
Does this field domain represent array type. |
boolean |
isNullAllowed()
Is null allowed or not. |
boolean |
isPrimitiveType()
Does this field domain represent primitive type. |
boolean |
removeClassDomain(IClassDomain domain)
Removes class domain from this IObjSet |
ClassDomain |
removeClassDomain(int index)
Removes class domain from IObjSet |
void |
setNullAllowed(boolean allowed)
Sets whether null is allowed or not. |
private void |
updateCache()
|
| Methods inherited from class korat.finitization.impl.FieldDomain |
|---|
checkClassDomainIndex, checkObjectIndex, getClassOfField |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface korat.finitization.IFieldDomain |
|---|
getClassOfField |
| Field Detail |
|---|
private List<ObjSet.CacheElement> cache
private boolean isCacheValid
protected List<ClassDomain> domains
private boolean nullAllowed
| Constructor Detail |
|---|
ObjSet(Class classOfField)
ObjSet(String classOfFieldName) throws ClassNotFoundException
ClassNotFoundException| Method Detail |
|---|
private void updateCache()
public boolean addClassDomain(IClassDomain domain)
IObjSetclassOfObjects of the given
IClassDomain must be assignable to the
classOfField of this IObjSet.
addClassDomain in interface IObjSetdomain - Class domain
IllegalArgumentException - -
if this field is not assignable from the given class domainIFieldDomain.getClassOfField(),
IClassDomain.getClassOfObjects(),
IFieldDomain,
IClassDomainpublic boolean removeClassDomain(IClassDomain domain)
IObjSetIObjSet
removeClassDomain in interface IObjSetdomain - Class domain to be removed
true if domain existed in this field
domainpublic ClassDomain removeClassDomain(int index)
IObjSetIObjSet
removeClassDomain in interface IObjSetindex - index of class domain to be removed. If index is out of
bounds, should return null instead of throwing
an exception
IObjSet.removeClassDomain(IClassDomain)public List<IClassDomain> getClassDomains()
IObjSet
getClassDomains in interface IObjSetpublic ClassDomain getClassDomain(int classDomainIndex)
FieldDomainnull.
getClassDomain in class FieldDomainclassDomainIndex - -
the index of the class domain
public ClassDomain getClassDomainFor(int objectIndex)
FieldDomaingetClassDomainFor(objectIndex) and returns the following
class domain.
Primitive types should return null.
getClassDomainFor in class FieldDomainobjectIndex - -
the index of the given object
public ClassDomain getNextClassDomainFor(int objectIndex)
FieldDomaingetClassDomainFor(objectIndex) and returns the following
class domain.
Primitive typess should return null.
getNextClassDomainFor in class FieldDomainobjectIndex - -
the index of the given object
public int getNumOfClassDomains()
FieldDomain1.
getNumOfClassDomains in interface IFieldDomaingetNumOfClassDomains in class FieldDomainIPrimitiveTypeSetpublic int getSizeOfClassDomain(int classDomainIndex)
FieldDomainclassDomainIndex position in the list of all class domains
within this field domain.
Primitive types should return -1 if
classDomainIndex is different than 0, or
getNumberOfElements() else.
getSizeOfClassDomain in class FieldDomainclassDomainIndex - -
class domain index
classDomainIndex
public int getNumberOfElements()
FieldDomain
getNumberOfElements in interface IFieldDomaingetNumberOfElements in class FieldDomainpublic boolean isPrimitiveType()
IFieldDomain
isPrimitiveType in interface IFieldDomaintrue for primitive data types and strings,
false otherwisepublic boolean isArrayType()
IFieldDomain
isArrayType in interface IFieldDomaintrue if class of this FieldDomain is array,
false otherwisepublic Object[] getAllObjects()
IObjSetIObjSet.Those are all
objects that can be assigned to the field that this
IFieldDomain is assigned to.
getAllObjects in interface IObjSetpublic Object[] getObjectsOfClass(Class cls)
IObjSetIObjSet
getObjectsOfClass in interface IObjSetcls - base class
IObjSet.getAllObjects()public Object[] getObjectsOfClass(int classDomainIndex)
ObjSet.
classDomainIndex - index of the class domain within this field domain
getObjectsOfClass(Class),
getObject(int),
getAllObjects()public Object getObject(int objectIndex)
ObjSet.
objectIndex - -
zero based index of the object in this field domain
isNullAllowed evaluates to
true, the zero-index object in the
ObjSet is always null. Also
returns null if index is out of bounds.getAllObjects(),
getObjectsOfClass(Class),
getObjectsOfClass(int)public void setNullAllowed(boolean allowed)
IObjSetnull is allowed or not. By default
null is not allowed.
setNullAllowed in interface IObjSetallowed - whether null value is allowed.IObjSet.isNullAllowed()public boolean isNullAllowed()
IObjSet
isNullAllowed in interface IObjSetIObjSet.isNullAllowed()public int getIndexOfFirstObjectInNextClassDomain(int objectIndex)
getIndexOfFirstObjectInNextClassDomain in class FieldDomainpublic int getClassDomainIndexFor(int objectIndex)
FieldDomainobjectIndex because primitive type field domains
conceptually contain exactly one class domain.
getClassDomainIndexFor in class FieldDomainobjectIndex - -
index of object in the field domain
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||