Class Card


  • public class Card
    extends java.lang.Object
    Card information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String col
      Attribute for slot col.
      protected java.lang.String type
      Attribute for slot type.
      protected int val
      Attribute for slot val.
    • Constructor Summary

      Constructors 
      Constructor Description
      Card()
      Default Constructor.
      Card​(Card proto)
      Clone Constructor.
      Card​(java.lang.String type, java.lang.String color, int value)
      Default Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Get a clone of this Card.
      boolean equals​(java.lang.Object obj)
      Test the equality of this Card and an object obj.
      java.lang.String getColor()
      Get the col of this Card.
      java.lang.String getType()
      Get the type of this Card.
      int getValue()
      Get the val of this Card.
      int hashCode()  
      void setColor​(java.lang.String col)
      Set the col of this Card.
      void setType​(java.lang.String type)
      Set the type of this Card.
      void setValue​(int val)
      Set the val of this Card.
      java.lang.String toString()
      Get a string representation of this Card.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • col

        protected java.lang.String col
        Attribute for slot col.
      • type

        protected java.lang.String type
        Attribute for slot type.
      • val

        protected int val
        Attribute for slot val.
    • Constructor Detail

      • Card

        public Card()
        Default Constructor. Card.
      • Card

        public Card​(java.lang.String type,
                    java.lang.String color,
                    int value)
        Default Constructor. Card.
      • Card

        public Card​(Card proto)
        Clone Constructor. Card.proto to this instance.
        Parameters:
        proto - The prototype instance.
    • Method Detail

      • getColor

        public java.lang.String getColor()
        Get the col of this Card.
        Returns:
        col
      • setColor

        public void setColor​(java.lang.String col)
        Set the col of this Card.
        Parameters:
        col - the value to be set
      • getType

        public java.lang.String getType()
        Get the type of this Card.
        Returns:
        type
      • setType

        public void setType​(java.lang.String type)
        Set the type of this Card.
        Parameters:
        type - the value to be set
      • getValue

        public int getValue()
        Get the val of this Card.
        Returns:
        val
      • setValue

        public void setValue​(int val)
        Set the val of this Card.
        Parameters:
        val - the value to be set
      • toString

        public java.lang.String toString()
        Get a string representation of this Card.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
      • clone

        public java.lang.Object clone()
        Get a clone of this Card.
        Overrides:
        clone in class java.lang.Object
        Returns:
        a shalow copy of this instance.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test the equality of this Card and an object obj.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object this test will be performed with
        Returns:
        false if obj is not of Card class, true if all attributes are equal.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object