package net.miginfocom.layout;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectStreamException;

final class ResizeConstraint implements Externalizable {
   static final Float WEIGHT_100 = new Float(100.0F);
   Float grow = null;
   int growPrio = 100;
   Float shrink;
   int shrinkPrio;

   public ResizeConstraint() {
      this.shrink = WEIGHT_100;
      this.shrinkPrio = 100;
   }

   ResizeConstraint(int var1, Float var2, int var3, Float var4) {
      this.shrink = WEIGHT_100;
      this.shrinkPrio = 100;
      this.shrinkPrio = var1;
      this.shrink = var2;
      this.growPrio = var3;
      this.grow = var4;
   }

   private Object readResolve() throws ObjectStreamException {
      return LayoutUtil.getSerializedObject(this);
   }

   public void readExternal(ObjectInput var1) throws IOException, ClassNotFoundException {
      LayoutUtil.setSerializedObject(this, LayoutUtil.readAsXML(var1));
   }

   public void writeExternal(ObjectOutput var1) throws IOException {
      if (this.getClass() == ResizeConstraint.class) {
         LayoutUtil.writeAsXML(var1, this);
      }

   }
}
