Package gprover
Class Cons
- java.lang.Object
-
- gprover.Cons
-
public class Cons extends java.lang.ObjectThe 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd_pt(int n)Adds a point to the construction.voidadd_pt(int n, int id)Adds a point to the construction at the specified index.voidadd_pt(java.lang.Object s)Adds a point object to the construction.voidadd_pt(java.lang.Object s, int id)Adds a point object to the construction at the specified index.booleancontains(int pt)Checks if the construction contains the specified point.static Conscopy(Cons c)Copies the specified Cons object.intgetId()Gets the unique identifier of the construction.intgetLastPt()Gets the last point in the construction.intgetLessPt(int n)Gets the point less than the specified point in the construction.java.lang.StringgetPrintText(boolean isSelected)Gets the print text of the construction.java.lang.ObjectgetPTN(int n)Gets the point object at the specified index.booleanis_conc()Checks if the construction is a conclusion.booleanisEqual(Cons c)Checks if the construction is equal to another construction.voidreorder()Reorders the points in the construction based on the type.voidreorder1(int m, int n)Reorders two points in the construction.voidreorder2()Reorders the points in the construction for specific types.voidreplace(int a, int b)Replaces the specified point with another point in the construction.voidrevalidate()Revalidates the construction.voidset_conc(boolean r)Sets the conclusion flag of the construction.voidsetId(int id)Sets the unique identifier of the construction.voidsetText(java.lang.String s)Sets the string description of the construction.java.lang.StringtoDDString()Returns a detailed string representation of the construction without trimming.java.lang.StringtoDString()Returns a detailed string representation of the construction.java.lang.StringtoSString()Returns a short string representation of the construction.java.lang.StringtoString()Returns a string representation of the construction.java.lang.StringtoStringEx()Returns an extended string representation of the construction.java.lang.Stringtrim(java.lang.String st)Trims the string to the default length.java.lang.Stringtrim(java.lang.String st, int len)Trims the string to the specified length.
-
-
-
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 constructionlen- 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 addid- 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 addid- the index to add the point object at
-
toString
public java.lang.String toString()
Returns a string representation of the construction.- Overrides:
toStringin classjava.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 trimlen- 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 replaceb- 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 indexn- 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
-
-