package com.bio4j.angulillos;

interface HasFromArity { Arity fromArity(); }
interface HasToArity   { Arity   toArity(); }

/* ### Arities */
public enum Arity {

  One,        // Exactly one: X
  AtMostOne,  // One or none: Optional[X]
  AtLeastOne, // Non-empty list: NEList[X]
  Any;        // Usual list: List[X]


  /* #### In-arities */
  public interface FromAtLeastOne extends HasFromArity { default Arity fromArity() { return Arity.One; } }
  public interface FromOne        extends HasFromArity { default Arity fromArity() { return Arity.AtMostOne; } }
  public interface FromAtMostOne  extends HasFromArity { default Arity fromArity() { return Arity.AtLeastOne; } }
  public interface FromAny        extends HasFromArity { default Arity fromArity() { return Arity.Any; } }

  /* #### Out-arities */
  public interface ToAtLeastOne extends HasToArity { default Arity toArity() { return Arity.One; } }
  public interface ToOne        extends HasToArity { default Arity toArity() { return Arity.AtMostOne; } }
  public interface ToAtMostOne  extends HasToArity { default Arity toArity() { return Arity.AtLeastOne; } }
  public interface ToAny        extends HasToArity { default Arity toArity() { return Arity.Any; } }
}

@@ -311,17 +311,16 @@
 ist%5BX%5D%0A%0A
-%0A
   /* ###
@@ -368,32 +368,41 @@
 LeastOne extends
+ FromAny,
  HasFromArity %7B 
@@ -484,32 +484,63 @@
 e        extends
+ FromAtLeastOne, FromAtMostOne,
  HasFromArity %7B 
@@ -628,32 +628,41 @@
 MostOne  extends
+ FromAny,
  HasFromArity %7B 
@@ -882,32 +882,39 @@
 LeastOne extends
+ ToAny,
  HasToArity %7B de
@@ -990,32 +990,59 @@
 e        extends
+ ToAtLeastOne, ToAtMostOne,
  HasToArity %7B de
@@ -1124,32 +1124,39 @@
 MostOne  extends
+ ToAny,
  HasToArity %7B de

make Arity interface hierarchy match their view as predicates