Tabnine Logo
ModelUtils.addToCollection
Code IndexAdd Tabnine to your IDE (free)

How to use
addToCollection
method
in
org.apache.stanbol.entityhub.servicesapi.util.ModelUtils

Best Java code snippets using org.apache.stanbol.entityhub.servicesapi.util.ModelUtils.addToCollection (Showing top 5 results out of 315)

origin: apache/stanbol

/**
 * Copies all elements of the parsed Iterator to a {@link ArrayList}.
 * To use other Set implementations that {@link ArrayList} you can use 
 * {@link #addToCollection(Iterator, Collection)
 * @param <T> the generic type of the returned Collection
 * @param it the Iterator with elements compatible to T
 * @return the collection containing all elements of the iterator
 * @throws IllegalArgumentException if the parsed {@link Iterator} is <code>null</code>
 */
public static <T> Collection<T> asCollection(Iterator<? extends T> it){
  return addToCollection(it, new ArrayList<T>());
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.servicesapi

/**
 * Copies all elements of the parsed Iterator to a {@link ArrayList}.
 * To use other Set implementations that {@link ArrayList} you can use 
 * {@link #addToCollection(Iterator, Collection)
 * @param <T> the generic type of the returned Collection
 * @param it the Iterator with elements compatible to T
 * @return the collection containing all elements of the iterator
 * @throws IllegalArgumentException if the parsed {@link Iterator} is <code>null</code>
 */
public static <T> Collection<T> asCollection(Iterator<? extends T> it){
  return addToCollection(it, new ArrayList<T>());
}
/**
origin: apache/stanbol

public RdfQueryResultList(FieldQuery query,Graph resultGraph) {
  if(query == null){
    throw new IllegalArgumentException("Parameter Query MUST NOT be NULL!");
  }
  if(resultGraph == null){
    throw new IllegalArgumentException("Parameter \"Graph resultGraph\" MUST NOT be NULL");
  }
  this.query = query;
  this.resultGraph = resultGraph;
  List<RdfRepresentation> results = (List<RdfRepresentation>)ModelUtils.addToCollection(
    ClerezzaQueryUtils.parseQueryResultsFromGraph(resultGraph),
    new ArrayList<RdfRepresentation>());
  //sort the list based on the score
  Collections.sort(results,RESULT_SCORE_COMPARATOR);
  this.results = Collections.unmodifiableList(results);
      
}
@Override
origin: org.apache.stanbol/org.apache.stanbol.entityhub.query.clerezza

public RdfQueryResultList(FieldQuery query,Graph resultGraph) {
  if(query == null){
    throw new IllegalArgumentException("Parameter Query MUST NOT be NULL!");
  }
  if(resultGraph == null){
    throw new IllegalArgumentException("Parameter \"Graph resultGraph\" MUST NOT be NULL");
  }
  this.query = query;
  this.resultGraph = resultGraph;
  List<RdfRepresentation> results = (List<RdfRepresentation>)ModelUtils.addToCollection(
    ClerezzaQueryUtils.parseQueryResultsFromGraph(resultGraph),
    new ArrayList<RdfRepresentation>());
  //sort the list based on the score
  Collections.sort(results,RESULT_SCORE_COMPARATOR);
  this.results = Collections.unmodifiableList(results);
      
}
@Override
origin: apache/stanbol

results = new LinkedHashSet<Object>();
for(Iterator<String> properties = r.getFieldNames();properties.hasNext();){
  results.addAll(ModelUtils.addToCollection(r.get(properties.next()), results));
org.apache.stanbol.entityhub.servicesapi.utilModelUtilsaddToCollection

Javadoc

Adds the elements of the Iterator to the parsed Collection

Popular methods of ModelUtils

  • asCollection
    Copies all elements of the parsed Iterator to a ArrayList. To use other Set implementations that Arr
  • checkValues
    Processes a value parsed as object to the representation. This processing includes: * Removal of nu
  • getRepresentationInfo
    String representation of the parsed Representation inteded for DEBUG level loggings.
  • getNamespaceLocalName
    Splits up a URI in local name and namespace based on the following rules * If URI starts with "u
  • asSet
    Copies all elements of the parsed Iterator to a HashSet. To use other Set implementations that HashS
  • addToSet
    Adds the elements of the Iterator to the parsed Set
  • getAboutRepresentation
    Getter for the id of the Entity the parsed Representationare RdfResourceEnum#aboutRepresentation.
  • randomUUID
    TODO: Maybe we need a better way to generate unique IDs

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JTable (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer alternatives
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