Created
August 28, 2019 18:22
-
-
Save saiema/8c49bc17e3f257f77cbc5d9d138e081a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IFinitization finStackAr(int size) { | |
return finStackAr(0, size, 0, size); | |
} | |
public static IFinitization finStackAr(int minSize, int maxSize, int valuesMin, int valuesMax) { | |
IFinitization f = FinitizationFactory.create(StackAr.class); | |
int stackMin = 0; | |
int stackMax = maxSize + 1; | |
IIntSet sizes = f.createIntSet(minSize, maxSize); | |
IClassDomain integersCD = f.createClassDomain(Integer.class); | |
for (int v = valuesMin; v <= valuesMax; v++) { | |
integersCD.addObject(new Integer(v)); | |
} | |
IObjSet values = f.createObjSet(Integer.class); | |
values.setNullAllowed(true); | |
values.addClassDomain(integersCD); | |
IArraySet arrays = f.createArraySet(Object[].class, sizes, values, 1); | |
IIntSet topOfStackValues = f.createIntSet(stackMin, stackMax); | |
f.set("theArray", arrays); | |
f.set("topOfStack", topOfStackValues); | |
return f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment