Tabnine Logo
Fifo.give
Code IndexAdd Tabnine to your IDE (free)

How to use
give
method
in
xapi.collect.api.Fifo

Best Java code snippets using xapi.collect.api.Fifo.give (Showing top 20 results out of 315)

origin: net.wetheinter/xapi-core-api

/**
 * Adds a callback that will be fired before the main and post callback stacks
 *
 * @param receiver - The receiver to add to pre-fire stack
 * @param top - true to unshift onto head, false to push onto tail
 */
public void addPre(ReceivesValue<T> receiver){
 assert receiver != null : "Do not send null receivers to "+this+"; (ReceivesMultiValue.addBefore) ";
 assert receiver != this : "Do not send a ReceivesMultiValue to itself.  Class: "+this+";";
 pre.give(receiver);
}
/**
origin: net.wetheinter/xapi-core-api

/**
 * Adds a callback that will be fired after the pre and main callback stacks
 *
 * @param receiver - The receiver to add to pre-fire stack
 * @param top - true to unshift onto head, false to push onto tail
 */
public void addPost(ReceivesValue<T> receiver){
 assert receiver != null : "Do not send null receivers to "+this+"; (ReceivesMultiValue.addAfter) ";
 assert receiver != this : "Do not send a ReceivesMultiValue to itself.  Class: "+this+";";
 post.give(receiver);
}
/**
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addInnerClasses(Iterable<IsClass> clses) {
 for (IsClass cls : clses) {
  innerClasses.give(cls);
 }
 return this;
}
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addMethods(Iterable<IsMethod> methods) {
 for (IsMethod method : methods)
  this.methods.give(method);
 return this;
}
protected AbstractClass setMethods(Iterable<IsMethod> methods) {
origin: net.wetheinter/xapi-core-reflect

@SuppressWarnings("unchecked")
protected Self addAnnotations(Iterable<IsAnnotation> annos) {
 for (IsAnnotation anno : annos)
  annotations.give(anno);
 return (Self)this;
}
@SuppressWarnings("unchecked")
origin: net.wetheinter/xapi-core-api

/**
 * Push a handler onto our callback stack
 *
 * @param handle - Handler to be called on remove
 * @return - this, for chaining
 */
public RemovesMultiHandlers addHandler(RemovalHandler handle){
 handles.give(handle);
 return this;
}
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addInterface(IsClass iface) {
 interfaces.give(iface);
 return this;
}
origin: net.wetheinter/xapi-core-reflect

@Override
protected AbstractClass addAnnotations(Iterable<IsAnnotation> annos) {
 for (IsAnnotation anno : annos)
  annotations.give(anno);
 return this;
}
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addMethod(IsMethod method) {
 this.methods.give(method);
 return this;
}
protected AbstractClass addMethods(Iterable<IsMethod> methods) {
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addFields(Iterable<IsField> fields) {
 for (IsField field : fields)
  this.fields.give(field);
 return this;
}
protected AbstractClass addField(IsField field) {
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addGenerics(Iterable<IsGeneric> generics) {
 for (IsGeneric generic : generics) {
  this.generics.give(generic);
 }
 return this;
}
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addInterfaces(Iterable<IsClass> ifaces) {
 for (IsClass iface : ifaces)
  interfaces.give(iface);
 return this;
}
origin: net.wetheinter/xapi-core-api

public void addThrowable(Throwable exception) {
 throwables.give(exception);
}
origin: net.wetheinter/xapi-core-reflect

protected AbstractClass addField(IsField field) {
 this.fields.give(field);
 return this;
}
origin: net.wetheinter/xapi-core-api

/**
 * Adds a receiver to the end of the callback array.
 *
 * @param receiver - A new receiver to add
 * @return true if the receiver was added to our callbacks; false if already present.
 */
public boolean addReceiver(ReceivesValue<T> receiver){
 assert receiver != null : "Do not send null receivers to "+this+"; (ReceivesMultiValue) ";
 assert receiver != this : "Do not send a ReceivesMultiValue to itself.  Class: "+this+";";
 if (handlers.contains(receiver))
  return false;
 handlers.give(receiver);
 return true;
}
origin: net.wetheinter/xapi-gwt-inject

protected final void accept(ReceivesValue<T> callback){
 if (callback!=null)
  pending().give(callback);
}
origin: net.wetheinter/xapi-core-api

public final void add(ProvidesValue<ReceivesValue<X>> provider){
 assert !providers.contains(provider) : new RuntimeException("You have sent the same provider instance to a DeferredMultiReceiver more than once: "+provider);
 providers.give(provider);
}
public final void add(final ReceivesValue<X> provider){
origin: net.wetheinter/xapi-core-io

public synchronized void forwardTo(LineReader callback) {
 X_Log.debug(getClass(),getClass().getName(),"forwardingTo", callback.getClass().getName(),":", callback);
 if (b != null) {// not null only after we have started streaming
  callback.onStart();
  for (String line : X_String.splitNewLine(b.toString())) {
   callback.onLine(line);
  }
 }
 delegates.give(callback);
 if (finished) {
  callback.onEnd();
 }
}

origin: net.wetheinter/xapi-core-api

public final void add(final ReceivesValue<X> provider){
 ProviderAdapter<X> adapter = new ProviderAdapter<X>();
 adapter.set(provider);
 providers.give(adapter);
}
origin: net.wetheinter/xapi-core-model

public Iterable<ModelField> getAllSerializable() {
 final Fifo<ModelField> fifo = X_Collect.newFifo();
 for (final ModelField field : fields.values()) {
  final Serializable serial = field.getSerializable();
  if (serial == null) {
   final ClientToServer c2s = field.getClientToServer();
   if (c2s != null && c2s.enabled()) {
    fifo.give(field);
    continue;
   }
   final ServerToClient s2c = field.getServerToClient();
   if (s2c != null && s2c.enabled()) {
    fifo.give(field);
    continue;
   }
  } else {
   // class is marked serializable
   fifo.give(field);
  }
 }
 return fifo.forEach();
}
xapi.collect.apiFifogive

Javadoc

Analagous to add(), however, we do not use the standard naming convention, to avoid interface clashes with adapter types in collection libraries that may wish to override our Fifo with their own type.

Popular methods of Fifo

  • forEach
  • isEmpty
    Fastest way to tell if the queue is drained.
  • clear
    Removes all items in the queue. head = tail;
  • join
  • remove
    Manually remove the item from queue. O(n) performance.
  • take
    Analagous to poll(); retrieves and removes head. We avoid the use of standard queue naming methods,
  • contains
    Check if this queue contains the given item. O(n) performance. You may want to use a Set unless you
  • size
    Return a count of items in the queue. Default implementation uses a counter; subclasses may have O(n

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JOptionPane (javax.swing)
  • JTextField (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
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