Example #1
0
  // Serializable//
  // NOTE: they must be declared as private
  private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
    s.defaultWriteObject();

    boolean written = false;
    if (_sortAsc instanceof ListitemComparator) {
      final ListitemComparator c = (ListitemComparator) _sortAsc;
      if (c.getListheader() == this && c.isAscending()) {
        s.writeBoolean(true);
        s.writeBoolean(c.shallIgnoreCase());
        s.writeBoolean(c.byValue());
        written = true;
      }
    }
    if (!written) {
      s.writeBoolean(false);
      s.writeObject(_sortAsc);
    }

    written = false;
    if (_sortDsc instanceof ListitemComparator) {
      final ListitemComparator c = (ListitemComparator) _sortDsc;
      if (c.getListheader() == this && !c.isAscending()) {
        s.writeBoolean(true);
        s.writeBoolean(c.shallIgnoreCase());
        s.writeBoolean(c.byValue());
        written = true;
      }
    }
    if (!written) {
      s.writeBoolean(false);
      s.writeObject(_sortDsc);
    }
  }
Example #2
0
 private void fixClone() {
   if (_sortAsc instanceof ListitemComparator) {
     final ListitemComparator c = (ListitemComparator) _sortAsc;
     if (c.getListheader() == this && c.isAscending())
       _sortAsc = new ListitemComparator(this, true, c.shallIgnoreCase());
   }
   if (_sortDsc instanceof ListitemComparator) {
     final ListitemComparator c = (ListitemComparator) _sortDsc;
     if (c.getListheader() == this && !c.isAscending())
       _sortDsc = new ListitemComparator(this, false, c.shallIgnoreCase());
   }
 }