Documentation of 'org.supercsv.cellprocessor.constraint.UniqueHashCode' Java class
UniqueHashCode
org.supercsv.cellprocessor.constraint

Class UniqueHashCode

  • All Implemented Interfaces:
    CellProcessor


    public class UniqueHashCode
    extends CellProcessorAdaptor
    Ensure that upon processing a CSV file (reading or writing), that values of the column are all unique. Comparison is based upon each elements hashCode() method and lookup takes O(1).

    Compared to Unique this processor is much more memory efficient as it only stores the set of encountered hashcodes rather than storing references to all encountered objects. The tradeoff being possible false positives.

    Prior to v1.50 this class was named Unique but has been renamed to clarify its inner workings.

    • Constructor Summary

      Constructors 
      Constructor and Description
      UniqueHashCode()
      Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique.
      UniqueHashCode(CellProcessor next)
      Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique, then calls the next processor in the chain.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object execute(java.lang.Object value, CsvContext context)
      This method is invoked by the framework when the processor needs to process data or check constraints.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • UniqueHashCode

        public UniqueHashCode()
        Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique.
      • UniqueHashCode

        public UniqueHashCode(CellProcessor next)
        Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique, then calls the next processor in the chain.
        Parameters:
        next - the next processor in the chain
        Throws:
        java.lang.NullPointerException - if next is null

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.