src/main/java/com/antbrains/wordseg/luceneanalyzer/AttributeSource.java
public final void addAttributeImpl(final AttributeImpl att) {
    final Class<? extends AttributeImpl> clazz = att.getClass();
    if (attributeImpls.containsKey(clazz))
      return;
    final LinkedList<WeakReference<Class<? extends Attribute>>> foundInterfaces = getAttributeInterfaces(clazz);

    // add all interfaces of this AttributeImpl to the maps
    for (WeakReference<Class<? extends Attribute>> curInterfaceRef : foundInterfaces) {
      final Class<? extends Attribute> curInterface = curInterfaceRef.get();
      assert (curInterface != null) : "We have a strong reference on the class holding the interfaces, so they should never get evicted";
      // Attribute is a superclass of this interface
      if (!attributes.containsKey(curInterface)) {
        // invalidate state to force recomputation in captureState()
        this.currentState[0] = null;
        attributes.put(curInterface, att);
        attributeImpls.put(clazz, att);
      }
    }
  }
/**
   * <b>Expert:</b> Adds a custom AttributeImpl instance with one or more Attribute interfaces.
   * <p>
   * <font color="red"><b>Please note:</b> It is not guaranteed, that <code>att</code> is added to
   * the <code>AttributeSource</code>, because the provided attributes may already exist. You should
   * always retrieve the wanted attributes using {@link #getAttribute} after adding with this method
   * and cast to your class. The recommended way to use custom implementations is using an
   * {@link AttributeFactory}. </font>
   * </p>
   */
Expert: Adds a custom AttributeImpl instance with one or more Attribute interfaces.

Please note: It is not guaranteed, that att is added to
the AttributeSource, because the provided attributes may already exist. You should
always retrieve the wanted attributes using  #getAttribute after adding with this method
and cast to your class. The recommended way to use custom implementations is using an
AttributeFactory.
Expert : Adds a custom AttributeImpl instance with one or more Attribute interfaces . Please note : It is not guaranteed that att is added to the AttributeSource because the provided attributes may already exist . You should always retrieve the wanted attributes using #getAttribute after adding with this method and cast to your class . The recommended way to use custom implementations is using an AttributeFactory .
public final void addAttributeImpl(final AttributeImpl att) {
    final Class<? extends AttributeImpl> clazz = att.getClass();
    if (attributeImpls.containsKey(clazz))
      return;
    final LinkedList<WeakReference<Class<? extends Attribute>>> foundInterfaces = getAttributeInterfaces(clazz);
    for (WeakReference<Class<? extends Attribute>> curInterfaceRef : foundInterfaces) {
      final Class<? extends Attribute> curInterface = curInterfaceRef.get();
      assert (curInterface != null) : "We have a strong reference on the class holding the interfaces, so they should never get evicted";
      if (!attributes.containsKey(curInterface)) {
        this.currentState[0] = null;
        attributes.put(curInterface, att);
        attributeImpls.put(clazz, att);
      }
    }
  }
public final void addAttributeImpl ( final AttributeImpl att ) { final Class < ? extends AttributeImpl > clazz = att . getClass ( ) ; if ( attributeImpls . containsKey ( clazz ) ) return ; final LinkedList < WeakReference < Class < ? extends Attribute > > > foundInterfaces = getAttributeInterfaces ( clazz ) ; for ( WeakReference < Class < ? extends Attribute > > curInterfaceRef : foundInterfaces ) { final Class < ? extends Attribute > curInterface = curInterfaceRef . get ( ) ; assert ( curInterface != null ) : "We have a strong reference on the class holding the interfaces, so they should never get evicted" ; if ( ! attributes . containsKey ( curInterface ) ) { this . currentState [ 0 ] = null ; attributes . put ( curInterface , att ) ; attributeImpls . put ( clazz , att ) ; } } }
<b>Expert:</b> Adds a custom AttributeImpl instance with one or more Attribute interfaces.
<b > Expert : < / b > Adds a custom AttributeImpl instance with one or more Attribute interfaces .
// add all interfaces of this AttributeImpl to the maps
 // Attribute is a superclass of this interface
 // invalidate state to force recomputation in captureState()
