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

Class Unique

  • All Implemented Interfaces:
    CellProcessor


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

    Compared to UniqueHashCode this processor potentially uses more memory, as it stores references to each encountered object rather than just their hashcodes. On reading huge files this can be a real memory-hazard, however, it ensures a true uniqueness check.

    Since:
    1.50
    • Constructor Summary

      Constructors 
      Constructor and Description
      Unique()
      Constructs a new Unique processor, which ensures that all rows in a column are unique.
      Unique(CellProcessor next)
      Constructs a new Unique 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

      • Unique

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

        public Unique(CellProcessor next)
        Constructs a new Unique 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.