|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgenopt.util.Assigner
public class Assigner
Object to substitute references to variables by its numerical values.
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
| Field Summary | |
|---|---|
private static java.lang.String |
LS
System dependent line separator |
| Constructor Summary | |
|---|---|
Assigner()
|
|
| Method Summary | |
|---|---|
static java.lang.String[] |
assign(java.lang.String[] keyWords,
java.lang.String[] values)
assigns to all keyWords its value by eliminating all references to a keyword with its value |
private static void |
checkValidInput(int[][] p)
checks for valid input syntax (cycles and references to itself are not allowed) |
private static boolean[] |
getAssigned(int[][] p)
gets an array which contains true at the i-th element if
the 0-th element of the i-th row of p is equal to -1 |
private static int[][] |
getReferences(java.lang.String[] keyWords,
java.lang.String[] values)
gets all references to a keyWords |
private static boolean |
isAllTrue(boolean[] b)
checks whether all values of b are true |
private static void |
updateValues(java.lang.String[] keyWords,
java.lang.String[] values,
int[][] p)
updates the values by eliminating the keyWord references |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String LS
| Constructor Detail |
|---|
public Assigner()
| Method Detail |
|---|
public static java.lang.String[] assign(java.lang.String[] keyWords,
java.lang.String[] values)
throws java.lang.IllegalArgumentException,
java.lang.RuntimeException
keyWords - the keyWordsvalues - the values of the keywords
java.lang.IllegalArgumentException
java.lang.RuntimeException
private static void checkValidInput(int[][] p)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if variables cannot be assigned or if a reference
to itself occurs
private static void updateValues(java.lang.String[] keyWords,
java.lang.String[] values,
int[][] p)
keyWords - the keyWordsvalues - the values of the keywordsp - NxN array which has a number in each element that points to the keyWord which
is referenced. If there is no reference, then the element is equal to -1private static boolean[] getAssigned(int[][] p)
true at the i-th element if
the 0-th element of the i-th row of p is equal to -1
p - NxN array which has a -1 as the first element of the i-th column
if there is no further assignement to the i-th variable
true at the i-th element if the i-th element
is not refered anywhere, falseotherwiseprivate static boolean isAllTrue(boolean[] b)
b are true
b - the array to be checked
true if all elements are true,
false otherwise
private static int[][] getReferences(java.lang.String[] keyWords,
java.lang.String[] values)
keyWords
keyWords - the keyWordsvalues - the values of the keywords
keyWords in values
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||