|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.param.constraint.AbstractParameterConstraint<Location>
org.opensha.commons.param.constraint.impl.LocationConstraint
public class LocationConstraint
Title: LocationConstraint
Description: This constraint contains a list of possible allowed location values. These can typically be presented in a GUI picklist. This is the same fucntionality for all StringConstraint.
| Field Summary | |
|---|---|
protected static String |
C
Class name for debugging. |
protected static boolean |
D
If true print out debug statements. |
| Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint |
|---|
editable, name, nullAllowed |
| Constructor Summary | |
|---|---|
LocationConstraint()
No-Arg constructor for the LocationConstraint object. |
|
LocationConstraint(List<Location> locations)
Constructor for the LocationConstraint object. |
|
| Method Summary | |
|---|---|
void |
addLocation(Location loc)
Adds a Location to the list of allowed values, if this constraint is editable. |
Object |
clone()
Returns a copy so you can't edit or damage the origial. |
boolean |
containsLocation(Location loc)
Returns true if the location is in the allowed list, false otherwise |
List<Location> |
getAllowedLocations()
Returns a cloned ArrayList of the allowed Locations. |
List<Location> |
getAllowedValues()
Returns a cloned ArrayList of the allowed Locations. |
boolean |
isAllowed(Location loc)
Determine if the new value being set is allowed. |
ListIterator |
listIterator()
Returns an Iterator over allowed values. |
void |
removeLocation(Location loc)
Removes a Location from the list of allowed values, if this constraint is editable. |
void |
setLocations(List<Location> locations)
Sets all allowed locations via a ArrayList, which is copied into this object's internal storage structure. |
int |
size()
Returns number of allowed values. |
String |
toString()
Prints out the current state of this parameter, i.e. |
| Methods inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint |
|---|
checkEditable, getName, isEditable, isNullAllowed, setName, setNonEditable, setNullAllowed |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opensha.commons.param.constraint.ParameterConstraint |
|---|
getName, isEditable, isNullAllowed, setName, setNonEditable, setNullAllowed |
| Field Detail |
|---|
protected static final String C
protected static final boolean D
| Constructor Detail |
|---|
public LocationConstraint()
public LocationConstraint(List<Location> locations)
throws ConstraintException
locations - ArrayList of allowed locations
ConstraintException - Thrown if the passed in vector size is 0| Method Detail |
|---|
public void setLocations(List<Location> locations)
throws ConstraintException,
EditableException
locations - ArrayList of allowed locations
ConstraintException - Thrown if the passed in vector size is 0
EditableExceptionpublic List<Location> getAllowedLocations()
public List<Location> getAllowedValues()
getAllowedValues in interface DiscreteParameterConstraint<Location>public boolean isAllowed(Location loc)
isAllowed in interface ParameterConstraint<Location>obj - Object to check if allowed Location
public ListIterator listIterator()
listIterator in interface DiscreteParameterConstraint<Location>
public void addLocation(Location loc)
throws EditableException
EditableException
public void removeLocation(Location loc)
throws EditableException
EditableExceptionpublic boolean containsLocation(Location loc)
public int size()
size in interface DiscreteParameterConstraint<Location>public String toString()
toString in class Objectpublic Object clone()
clone in interface ParameterConstraint<Location>clone in class AbstractParameterConstraint<Location>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||