Tabnine Logo
AttributeImpl.copyTo
Code IndexAdd Tabnine to your IDE (free)

How to use
copyTo
method
in
org.apache.lucene.util.AttributeImpl

Best Java code snippets using org.apache.lucene.util.AttributeImpl.copyTo (Showing top 10 results out of 315)

origin: org.apache.lucene/lucene-core

/**
 * Copies the contents of this {@code AttributeSource} to the given target {@code AttributeSource}.
 * The given instance has to provide all {@link Attribute}s this instance contains. 
 * The actual attribute implementations must be identical in both {@code AttributeSource} instances;
 * ideally both AttributeSource instances should use the same {@link AttributeFactory}.
 * You can use this method as a replacement for {@link #restoreState}, if you use
 * {@link #cloneAttributes} instead of {@link #captureState}.
 */
public final void copyTo(AttributeSource target) {
 for (State state = getCurrentState(); state != null; state = state.next) {
  final AttributeImpl targetImpl = target.attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("This AttributeSource contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in the target");
  }
  state.attribute.copyTo(targetImpl);
 }
}
origin: org.apache.lucene/lucene-core

/**
 * Restores this state by copying the values of all attribute implementations
 * that this state contains into the attributes implementations of the targetStream.
 * The targetStream must contain a corresponding instance for each argument
 * contained in this state (e.g. it is not possible to restore the state of
 * an AttributeSource containing a TermAttribute into a AttributeSource using
 * a Token instance as implementation).
 * <p>
 * Note that this method does not affect attributes of the targetStream
 * that are not contained in this state. In other words, if for example
 * the targetStream contains an OffsetAttribute, but this state doesn't, then
 * the value of the OffsetAttribute remains unchanged. It might be desirable to
 * reset its value to the default, in which case the caller should first
 * call {@link TokenStream#clearAttributes()} on the targetStream.   
 */
public final void restoreState(State state) {
 if (state == null)  return;
 
 do {
  AttributeImpl targetImpl = attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("State contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in in this AttributeSource");
  }
  state.attribute.copyTo(targetImpl);
  state = state.next;
 } while (state != null);
}
origin: harbby/presto-connectors

/**
 * Restores this state by copying the values of all attribute implementations
 * that this state contains into the attributes implementations of the targetStream.
 * The targetStream must contain a corresponding instance for each argument
 * contained in this state (e.g. it is not possible to restore the state of
 * an AttributeSource containing a TermAttribute into a AttributeSource using
 * a Token instance as implementation).
 * <p>
 * Note that this method does not affect attributes of the targetStream
 * that are not contained in this state. In other words, if for example
 * the targetStream contains an OffsetAttribute, but this state doesn't, then
 * the value of the OffsetAttribute remains unchanged. It might be desirable to
 * reset its value to the default, in which case the caller should first
 * call {@link TokenStream#clearAttributes()} on the targetStream.   
 */
public final void restoreState(State state) {
 if (state == null)  return;
 
 do {
  AttributeImpl targetImpl = attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("State contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in in this AttributeSource");
  }
  state.attribute.copyTo(targetImpl);
  state = state.next;
 } while (state != null);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Restores this state by copying the values of all attribute implementations
 * that this state contains into the attributes implementations of the targetStream.
 * The targetStream must contain a corresponding instance for each argument
 * contained in this state (e.g. it is not possible to restore the state of
 * an AttributeSource containing a TermAttribute into a AttributeSource using
 * a Token instance as implementation).
 * <p>
 * Note that this method does not affect attributes of the targetStream
 * that are not contained in this state. In other words, if for example
 * the targetStream contains an OffsetAttribute, but this state doesn't, then
 * the value of the OffsetAttribute remains unchanged. It might be desirable to
 * reset its value to the default, in which case the caller should first
 * call {@link TokenStream#clearAttributes()} on the targetStream.   
 */
public final void restoreState(State state) {
 if (state == null)  return;
 
 do {
  AttributeImpl targetImpl = attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("State contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in in this AttributeSource");
  }
  state.attribute.copyTo(targetImpl);
  state = state.next;
 } while (state != null);
}
origin: gncloud/fastcatsearch

/**
 * Copies the contents of this {@code AttributeSource} to the given target {@code AttributeSource}.
 * The given instance has to provide all {@link Attribute}s this instance contains. 
 * The actual attribute implementations must be identical in both {@code AttributeSource} instances;
 * ideally both AttributeSource instances should use the same {@link AttributeFactory}.
 * You can use this method as a replacement for {@link #restoreState}, if you use
 * {@link #cloneAttributes} instead of {@link #captureState}.
 */
public final void copyTo(AttributeSource target) {
 for (State state = getCurrentState(); state != null; state = state.next) {
  final AttributeImpl targetImpl = target.attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("This AttributeSource contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in the target");
  }
  state.attribute.copyTo(targetImpl);
 }
}
origin: org.infinispan/infinispan-embedded-query

/**
 * Restores this state by copying the values of all attribute implementations
 * that this state contains into the attributes implementations of the targetStream.
 * The targetStream must contain a corresponding instance for each argument
 * contained in this state (e.g. it is not possible to restore the state of
 * an AttributeSource containing a TermAttribute into a AttributeSource using
 * a Token instance as implementation).
 * <p>
 * Note that this method does not affect attributes of the targetStream
 * that are not contained in this state. In other words, if for example
 * the targetStream contains an OffsetAttribute, but this state doesn't, then
 * the value of the OffsetAttribute remains unchanged. It might be desirable to
 * reset its value to the default, in which case the caller should first
 * call {@link TokenStream#clearAttributes()} on the targetStream.   
 */
public final void restoreState(State state) {
 if (state == null)  return;
 
 do {
  AttributeImpl targetImpl = attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("State contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in in this AttributeSource");
  }
  state.attribute.copyTo(targetImpl);
  state = state.next;
 } while (state != null);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Copies the contents of this {@code AttributeSource} to the given target {@code AttributeSource}.
 * The given instance has to provide all {@link Attribute}s this instance contains. 
 * The actual attribute implementations must be identical in both {@code AttributeSource} instances;
 * ideally both AttributeSource instances should use the same {@link AttributeFactory}.
 * You can use this method as a replacement for {@link #restoreState}, if you use
 * {@link #cloneAttributes} instead of {@link #captureState}.
 */
public final void copyTo(AttributeSource target) {
 for (State state = getCurrentState(); state != null; state = state.next) {
  final AttributeImpl targetImpl = target.attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("This AttributeSource contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in the target");
  }
  state.attribute.copyTo(targetImpl);
 }
}
origin: org.infinispan/infinispan-embedded-query

/**
 * Copies the contents of this {@code AttributeSource} to the given target {@code AttributeSource}.
 * The given instance has to provide all {@link Attribute}s this instance contains. 
 * The actual attribute implementations must be identical in both {@code AttributeSource} instances;
 * ideally both AttributeSource instances should use the same {@link AttributeFactory}.
 * You can use this method as a replacement for {@link #restoreState}, if you use
 * {@link #cloneAttributes} instead of {@link #captureState}.
 */
public final void copyTo(AttributeSource target) {
 for (State state = getCurrentState(); state != null; state = state.next) {
  final AttributeImpl targetImpl = target.attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("This AttributeSource contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in the target");
  }
  state.attribute.copyTo(targetImpl);
 }
}
origin: gncloud/fastcatsearch

/**
 * Restores this state by copying the values of all attribute implementations
 * that this state contains into the attributes implementations of the targetStream.
 * The targetStream must contain a corresponding instance for each argument
 * contained in this state (e.g. it is not possible to restore the state of
 * an AttributeSource containing a TermAttribute into a AttributeSource using
 * a Token instance as implementation).
 * <p>
 * Note that this method does not affect attributes of the targetStream
 * that are not contained in this state. In other words, if for example
 * the targetStream contains an OffsetAttribute, but this state doesn't, then
 * the value of the OffsetAttribute remains unchanged. It might be desirable to
 * reset its value to the default, in which case the caller should first
 * call {@link TokenStream#clearAttributes()} on the targetStream.   
 */
public final void restoreState(State state) {
 if (state == null)  return;
 
 do {
  AttributeImpl targetImpl = attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("State contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in in this AttributeSource");
  }
  state.attribute.copyTo(targetImpl);
  state = state.next;
 } while (state != null);
}
origin: harbby/presto-connectors

/**
 * Copies the contents of this {@code AttributeSource} to the given target {@code AttributeSource}.
 * The given instance has to provide all {@link Attribute}s this instance contains. 
 * The actual attribute implementations must be identical in both {@code AttributeSource} instances;
 * ideally both AttributeSource instances should use the same {@link AttributeFactory}.
 * You can use this method as a replacement for {@link #restoreState}, if you use
 * {@link #cloneAttributes} instead of {@link #captureState}.
 */
public final void copyTo(AttributeSource target) {
 for (State state = getCurrentState(); state != null; state = state.next) {
  final AttributeImpl targetImpl = target.attributeImpls.get(state.attribute.getClass());
  if (targetImpl == null) {
   throw new IllegalArgumentException("This AttributeSource contains AttributeImpl of type " +
    state.attribute.getClass().getName() + " that is not in the target");
  }
  state.attribute.copyTo(targetImpl);
 }
}
org.apache.lucene.utilAttributeImplcopyTo

Javadoc

Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.

Popular methods of AttributeImpl

  • clear
    Clears the values in this AttributeImpl and resets it to its default value. If this implementation i
  • clone
    In most cases the clone is, and should be, deep in order to be able to properly capture the state of
  • reflectWith
    This method is for introspection of attributes, it should simply add the key/values this attribute h
  • end
    Clears the values in this AttributeImpl and resets it to its value at the end of the field. If this

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ImageIO (javax.imageio)
  • JButton (javax.swing)
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now