antsnest.datastructure
Class Condition

java.lang.Object
  extended by antsnest.datastructure.Condition
All Implemented Interfaces:
Serializable

public class Condition
extends Object
implements Serializable

Represents a condition based on nested element prescence or attribute values

Author:
Chris Clohosy
See Also:
Serialized Form

Constructor Summary
Condition(String entityName, boolean nestedElement)
          Constructs a new condition
 
Method Summary
 void checkIfMet(ChangeEvent event)
          Checks whether this condition has been met
 boolean equals(Object obj)
          Whether this condition is the same as another
 String getEntityName()
          Gets the name of the entity being queried
 boolean getMustNotHaveValue()
          Gets whether the condition is an attribute not having a value
 String getRequiredValue()
          Gets the value an attribute must have to satisfy this condition
 boolean isNestedElement()
          Gets whether the entity being queried is a nested element
 void setMustNotHaveValue(boolean mustNotHaveValue)
          Sets whether the condition is an attribute not having a value
 void setRequiredValue(String requiredValue)
          Sets the value an attribute must have to satisfy this condition
 boolean wasMet()
          Gets whether this condition was met on the last check
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Condition

public Condition(String entityName,
                 boolean nestedElement)
Constructs a new condition

Parameters:
entityName - the name of the entity being queried
nestedElement - whether the entity is a nested element
Method Detail

getEntityName

public String getEntityName()
Gets the name of the entity being queried

Returns:
a String, the entity name

isNestedElement

public boolean isNestedElement()
Gets whether the entity being queried is a nested element

Returns:
a boolean, whether the entity is a nested element

getMustNotHaveValue

public boolean getMustNotHaveValue()
Gets whether the condition is an attribute not having a value

Returns:
a boolean, whether the condition is so

setMustNotHaveValue

public void setMustNotHaveValue(boolean mustNotHaveValue)
Sets whether the condition is an attribute not having a value

Parameters:
mustNotHaveValue - whether the condition is so

getRequiredValue

public String getRequiredValue()
Gets the value an attribute must have to satisfy this condition

Returns:
a String, the value

setRequiredValue

public void setRequiredValue(String requiredValue)
Sets the value an attribute must have to satisfy this condition

Parameters:
requiredValue - the value

wasMet

public boolean wasMet()
Gets whether this condition was met on the last check

Returns:
a boolean, whether it was met

checkIfMet

public void checkIfMet(ChangeEvent event)
Checks whether this condition has been met

Parameters:
event - an event encapsulating a change in the build file structure

equals

public boolean equals(Object obj)
Whether this condition is the same as another

Overrides:
equals in class Object
Parameters:
obj - the other object to compare to
Returns:
a boolean, whether they are the same