Package ch.rabanti.picoxlsx4j.style
Class AbstractStyle
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.style.AbstractStyle
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractStyle>
public abstract class AbstractStyle extends java.lang.Object implements java.lang.Comparable<AbstractStyle>
Class represents an abstract style component
-
-
Constructor Summary
Constructors Constructor Description AbstractStyle()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static voidcastValue(java.lang.Object o, java.lang.StringBuilder sb, java.lang.Character delimiter)Method to cast values of the components to string values for the hash calculationintcompareTo(AbstractStyle o)Method to compare two objects for sorting purposeabstract AbstractStylecopy()Abstract method to copy a component (dereferencing)(package private) <T extends AbstractStyle>
voidcopyFields(T source, T reference)Internal method to copy altered fields from a source object.booleanequals(AbstractStyle other)Method to compare two objects for sorting purposejava.lang.IntegergetInternalID()Gets the internal ID for sorting purpose in the Excel style documentvoidsetInternalID(java.lang.Integer internalID)Sets the internal ID for sorting purpose in the Excel style document
-
-
-
Method Detail
-
getInternalID
public java.lang.Integer getInternalID()
Gets the internal ID for sorting purpose in the Excel style document- Returns:
- Internal ID (can be null for random order)
-
setInternalID
public void setInternalID(java.lang.Integer internalID)
Sets the internal ID for sorting purpose in the Excel style document- Parameters:
internalID- Internal ID (can be null for random order)
-
copy
public abstract AbstractStyle copy()
Abstract method to copy a component (dereferencing)- Returns:
- Returns a copied component
-
equals
public boolean equals(AbstractStyle other)
Method to compare two objects for sorting purpose- Parameters:
other- Other object to compare with this object- Returns:
- True if both objects are equal, otherwise false
-
compareTo
public int compareTo(AbstractStyle o)
Method to compare two objects for sorting purpose- Specified by:
compareToin interfacejava.lang.Comparable<AbstractStyle>- Parameters:
o- Other object to compare with this object- Returns:
- -1 if the other object is bigger. 0 if both objects are equal. 1 if the other object is smaller.
-
castValue
static void castValue(java.lang.Object o, java.lang.StringBuilder sb, java.lang.Character delimiter)Method to cast values of the components to string values for the hash calculation- Parameters:
o- Value to castsb- StringBuilder reference to put the casted object indelimiter- Delimiter character to append after the casted value
-
copyFields
<T extends AbstractStyle> void copyFields(T source, T reference)
Internal method to copy altered fields from a source object. The decision whether a field is copied is dependent on a untouched reference object- Type Parameters:
T- Reference object to decide whether the fields from the source objects are altered or not- Parameters:
source- Style or sub-class of Style that extends AbstractStylereference- Source object with properties to copy
-
-