net.sf.magicproject.deckbuilder
Class DeckConstraint

java.lang.Object
  extended by net.sf.magicproject.deckbuilder.DeckConstraint
All Implemented Interfaces:
java.lang.Comparable<DeckConstraint>

public class DeckConstraint
extends java.lang.Object
implements java.lang.Comparable<DeckConstraint>

Since:
0.94
Author:
Fabrice Daugan

Constructor Summary
DeckConstraint(java.lang.String name, Test constraint)
          Create a new instance of this class.
 
Method Summary
 int compareTo(DeckConstraint o)
           
 Test getConstraint()
          Return the constraint.
 java.lang.String getConstraintLocalName()
          Return the translated constraint's name.
 java.lang.String getName()
          Return the constraint name.
 java.lang.String toString()
           
 java.util.List<java.lang.String> validate(Deck deck)
          Validate the given deck.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeckConstraint

public DeckConstraint(java.lang.String name,
                      Test constraint)
Create a new instance of this class.

Parameters:
constraint - the constraint validation test.
name - the constraint key name.
Method Detail

getConstraintLocalName

public java.lang.String getConstraintLocalName()
Return the translated constraint's name.

Returns:
the translated constraint's name.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
Return the constraint name.

Returns:
the constraint name.
See Also:
getConstraintLocalName()

getConstraint

public Test getConstraint()
Return the constraint.

Returns:
the constraint.

validate

public java.util.List<java.lang.String> validate(Deck deck)
Validate the given deck.

Parameters:
deck - the given deck.
Returns:
a list of errors.

compareTo

public int compareTo(DeckConstraint o)
Specified by:
compareTo in interface java.lang.Comparable<DeckConstraint>


Copyright © 2003-2007 Magic-Project. All Rights Reserved.