Package gprover

Class Cons


  • public class Cons
    extends java.lang.Object
    The Cons class represents a geometric construction in a proof. It includes properties for type, points, and descriptions, as well as methods for managing and retrieving information about the construction.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAXLEN
      The maximum length of the points array.
      int[] ps
      The array of point identifiers.
      java.lang.Object[] pss
      The array of point objects.
      int type
      The type of the construction.
    • Constructor Summary

      Constructors 
      Constructor Description
      Cons​(int t)
      Constructs a Cons object with the specified type.
      Cons​(int t, int len)
      Constructs a Cons object with the specified type and length.
      Cons​(Cons c)
      Constructs a Cons object by copying another Cons object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add_pt​(int n)
      Adds a point to the construction.
      void add_pt​(int n, int id)
      Adds a point to the construction at the specified index.
      void add_pt​(java.lang.Object s)
      Adds a point object to the construction.
      void add_pt​(java.lang.Object s, int id)
      Adds a point object to the construction at the specified index.
      boolean contains​(int pt)
      Checks if the construction contains the specified point.
      static Cons copy​(Cons c)
      Copies the specified Cons object.
      int getId()
      Gets the unique identifier of the construction.
      int getLastPt()
      Gets the last point in the construction.
      int getLessPt​(int n)
      Gets the point less than the specified point in the construction.
      java.lang.String getPrintText​(boolean isSelected)
      Gets the print text of the construction.
      java.lang.Object getPTN​(int n)
      Gets the point object at the specified index.
      boolean is_conc()
      Checks if the construction is a conclusion.
      boolean isEqual​(Cons c)
      Checks if the construction is equal to another construction.
      void reorder()
      Reorders the points in the construction based on the type.
      void reorder1​(int m, int n)
      Reorders two points in the construction.
      void reorder2()
      Reorders the points in the construction for specific types.
      void replace​(int a, int b)
      Replaces the specified point with another point in the construction.
      void revalidate()
      Revalidates the construction.
      void set_conc​(boolean r)
      Sets the conclusion flag of the construction.
      void setId​(int id)
      Sets the unique identifier of the construction.
      void setText​(java.lang.String s)
      Sets the string description of the construction.
      java.lang.String toDDString()
      Returns a detailed string representation of the construction without trimming.
      java.lang.String toDString()
      Returns a detailed string representation of the construction.
      java.lang.String toSString()
      Returns a short string representation of the construction.
      java.lang.String toString()
      Returns a string representation of the construction.
      java.lang.String toStringEx()
      Returns an extended string representation of the construction.
      java.lang.String trim​(java.lang.String st)
      Trims the string to the default length.
      java.lang.String trim​(java.lang.String st, int len)
      Trims the string to the specified length.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • MAXLEN

        public static final int MAXLEN
        The maximum length of the points array.
        See Also:
        Constant Field Values
      • type

        public int type
        The type of the construction.
      • ps

        public int[] ps
        The array of point identifiers.
      • pss

        public java.lang.Object[] pss
        The array of point objects.
    • Constructor Detail

      • Cons

        public Cons​(int t)
        Constructs a Cons object with the specified type.
        Parameters:
        t - the type of the construction
      • Cons

        public Cons​(Cons c)
        Constructs a Cons object by copying another Cons object.
        Parameters:
        c - the Cons object to copy
      • Cons

        public Cons​(int t,
                    int len)
        Constructs a Cons object with the specified type and length.
        Parameters:
        t - the type of the construction
        len - the length of the points array
    • Method Detail

      • setId

        public void setId​(int id)
        Sets the unique identifier of the construction.
        Parameters:
        id - the unique identifier to set
      • getId

        public int getId()
        Gets the unique identifier of the construction.
        Returns:
        the unique identifier of the construction
      • contains

        public boolean contains​(int pt)
        Checks if the construction contains the specified point.
        Parameters:
        pt - the point to check
        Returns:
        true if the construction contains the specified point, false otherwise
      • getLastPt

        public int getLastPt()
        Gets the last point in the construction.
        Returns:
        the last point in the construction
      • add_pt

        public void add_pt​(int n)
        Adds a point to the construction.
        Parameters:
        n - the point to add
      • add_pt

        public void add_pt​(java.lang.Object s)
        Adds a point object to the construction.
        Parameters:
        s - the point object to add
      • add_pt

        public void add_pt​(int n,
                           int id)
        Adds a point to the construction at the specified index.
        Parameters:
        n - the point to add
        id - the index to add the point at
      • add_pt

        public void add_pt​(java.lang.Object s,
                           int id)
        Adds a point object to the construction at the specified index.
        Parameters:
        s - the point object to add
        id - the index to add the point object at
      • toString

        public java.lang.String toString()
        Returns a string representation of the construction.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string description of the construction
      • toStringEx

        public java.lang.String toStringEx()
        Returns an extended string representation of the construction.
        Returns:
        the extended string description of the construction
      • setText

        public void setText​(java.lang.String s)
        Sets the string description of the construction.
        Parameters:
        s - the string description to set
      • getPrintText

        public java.lang.String getPrintText​(boolean isSelected)
        Gets the print text of the construction.
        Parameters:
        isSelected - the flag indicating if the construction is selected
        Returns:
        the print text of the construction
      • trim

        public java.lang.String trim​(java.lang.String st,
                                     int len)
        Trims the string to the specified length.
        Parameters:
        st - the string to trim
        len - the length to trim to
        Returns:
        the trimmed string
      • trim

        public java.lang.String trim​(java.lang.String st)
        Trims the string to the default length.
        Parameters:
        st - the string to trim
        Returns:
        the trimmed string
      • revalidate

        public void revalidate()
        Revalidates the construction.
      • set_conc

        public void set_conc​(boolean r)
        Sets the conclusion flag of the construction.
        Parameters:
        r - the conclusion flag to set
      • is_conc

        public boolean is_conc()
        Checks if the construction is a conclusion.
        Returns:
        true if the construction is a conclusion, false otherwise
      • getPTN

        public java.lang.Object getPTN​(int n)
        Gets the point object at the specified index.
        Parameters:
        n - the index to get the point object from
        Returns:
        the point object at the specified index
      • toSString

        public java.lang.String toSString()
        Returns a short string representation of the construction.
        Returns:
        the short string description of the construction
      • toDString

        public java.lang.String toDString()
        Returns a detailed string representation of the construction.
        Returns:
        the detailed string description of the construction
      • toDDString

        public java.lang.String toDDString()
        Returns a detailed string representation of the construction without trimming.
        Returns:
        the detailed string description of the construction without trimming
      • copy

        public static Cons copy​(Cons c)
        Copies the specified Cons object.
        Parameters:
        c - the Cons object to copy
        Returns:
        the copied Cons object
      • replace

        public void replace​(int a,
                            int b)
        Replaces the specified point with another point in the construction.
        Parameters:
        a - the point to replace
        b - the point to replace with
      • isEqual

        public boolean isEqual​(Cons c)
        Checks if the construction is equal to another construction.
        Parameters:
        c - the construction to compare
        Returns:
        true if the constructions are equal, false otherwise
      • reorder

        public void reorder()
        Reorders the points in the construction based on the type.
      • reorder1

        public void reorder1​(int m,
                             int n)
        Reorders two points in the construction.
        Parameters:
        m - the first point index
        n - the second point index
      • reorder2

        public void reorder2()
        Reorders the points in the construction for specific types.
      • getLessPt

        public int getLessPt​(int n)
        Gets the point less than the specified point in the construction.
        Parameters:
        n - the point to compare
        Returns:
        the point less than the specified point