Examples of ISelector


Examples of com.codestreet.selector.ISelector

  public Collection getMessages(MessageFactory messageFactory, String selector) throws JMSException, IOException {
    final Collection messages = xmlHelper.fromXML(messageFactory, new FileInputStream(file));

    if (selector != null) {
      try {
        final ISelector selectorImpl = Selector.getInstance(selector);
        for (final Iterator iter = messages.iterator(); iter.hasNext();) {
          final Message message = (Message) iter.next();
          if (selectorImpl.eval(ValueProvider.valueOf(message), null) == Result.RESULT_FALSE) {
            iter.remove();
          }
        }
      } catch (InvalidSelectorException e) {
        throw new HermesException(e);
View Full Code Here

Examples of com.esri.gpt.control.livedata.selector.HttpRequestListenerMap.ISelector

        rf.register(exactMap, setters.getDefinitiveSetter(), url);
      }
    }

    final String exactUrl = url;
    exactMap = exactMap.select(new ISelector() {
      public boolean eligible(HttpRequestDefinition httpReqDef) {
        return httpReqDef.getUrl().equalsIgnoreCase(exactUrl);
      }
    });
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

     */
    protected static void parseDomain(Format out, Repository in, Resource selected, Configuration conf) throws RepositoryException {
      RepositoryConnection conn = in.getConnection();
        RepositoryResult<Statement> domainsI = conn.getStatements(selected, FresnelCore.propertyFormatDomain, (Value) null, false);
      while (domainsI.hasNext()) {
        ISelector domain = null;
        Value domainNode = domainsI.next().getObject();
        if (domainNode instanceof Resource) {
          if (((Resource) domainNode).equals(AllPropertiesSet.getSchemaResource())) {
            domain = new AllPropertiesSelector();
          } else {
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

   */
  protected static void parseDomain(Format out, Repository in, Resource selected, Configuration conf) throws RepositoryException {
    RepositoryConnection conn = in.getConnection();
        RepositoryResult<Statement> domainsI = conn.getStatements(selected, FresnelCore.instanceFormatDomain, (Value) null, false);
    while (domainsI.hasNext()) {
      ISelector domain = null;
      Value domainNode = domainsI.next().getObject();
      if (domainNode instanceof Resource) {
        // This is an instance selector
        domain = new InstanceSelector((URI) domainNode);
      } else if (domainNode instanceof Literal) {
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

   */
  protected static void parseDomain(Format out, Repository in, Resource selected, Configuration conf) throws RepositoryException {
    RepositoryConnection conn = in.getConnection();
        RepositoryResult<Statement> domainsI = conn.getStatements(selected, FresnelCore.classFormatDomain, (Value) null, false);
    while (domainsI.hasNext()) {
      ISelector domain = null;
      Value domainNode = domainsI.next().getObject();
      if (domainNode instanceof Resource) {
        // This is a type selector
        domain = new TypeSelector((URI) domainNode);
      } else if (domainNode instanceof Literal) {
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

  private void addInstanceLens(Lens lens) {
    this._lenses.add(lens);
    this._all.put(lens.getIdentifier(), lens);

    for (Iterator<ISelector> di = lens.getDomainSet().iterator(); di.hasNext(); ) {
      ISelector domain = di.next();
      // TODO other valid selector types may need to be integrated, such as FSE/SPARQL selectors
      if (domain instanceof InstanceSelector) {
        InstanceSelector is = (InstanceSelector) domain;
        LensMatchSet lms = this._instanceLensMatches.getMatch(is.getInstance());
        if (null == lms) {
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

    // matches are found (all lenses are executed).
    Vector<Resource> validStarts = new Vector<Resource>();
    if (grouping.hasPrimaries()) {
      Iterator<ISelector> primariesIt = grouping.getPrimaries().iterator();
      while (primariesIt.hasNext()) {
        ISelector primary = primariesIt.next();
        if (primary.canSelectResources()) {
          try {
            Iterator<Resource> valids = primary.selectResources(in);
            while (valids.hasNext()) {
              validStarts.add(valids.next());
            }
          } catch (InvalidResultSetException e) {
            // not a valid exception at this point
          }
        }
      }
    } else {
      validStarts = null;
    }

    Iterator<Lens> li = grouping.getLenses().iterator();
    while (li.hasNext()) {
      Lens lens = li.next();
      Iterator<ISelector> di = lens.getDomainSet().iterator();
      while (di.hasNext()) {
        ISelector select = di.next();
        if (select.canSelectResources()) {
          try {
            Iterator<Resource> ri = select.selectResources(in);
            while (ri.hasNext()) {
              Resource res = (Resource) ri.next();
              if (null == validStarts || (null != validStarts && validStarts.contains(res))) {
                if (this._lensMatches.containsKey(res)) {
                  LensMatchSet match = this._lensMatches.getMatch(res);
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

    // matches are found (all lenses are executed).
    Vector<Resource> validStarts = new Vector<Resource>();
    if (grouping.hasPrimaries()) {
      Iterator<ISelector> primariesIt = grouping.getPrimaries().iterator();
      while (primariesIt.hasNext()) {
        ISelector primary = primariesIt.next();
        if (primary.canSelectResources()) {
          try {
            Iterator<Resource> valids = primary.selectResources(in);
            while (valids.hasNext()) {
              validStarts.add(valids.next());
            }
          } catch (InvalidResultSetException e) {
            // not a valid exception at this point
          }
        }
      }
    } else {
      validStarts = null;
    }

    LensMatchSet match = null;

    Iterator<Lens> li = grouping.getLenses().iterator();
    while (li.hasNext()) {
      Lens lens = li.next();
      Iterator<ISelector> di = lens.getDomainSet().iterator();
      while (di.hasNext()) {
        ISelector select = di.next();
        if (select.canSelectResources()) {
          if (select.canSelect(in, focus)) {
            if (null == validStarts || (null != validStarts && validStarts.contains(focus))) {
              if (this._lensMatches.containsKey(focus)) {
                match = this._lensMatches.getMatch(focus);
                match.add(lens);
              } else {
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

    while (fi.hasNext()) {
      Format format = fi.next();
     
      Iterator<ISelector> di = format.getDomainSet().iterator();
      while (di.hasNext()) {
        ISelector selects = di.next();
        if (selects.canSelectResources()) {
          /*
           * Only ClassFormat and InstanceFormat select resources,
           * so the vast amount of property formats can be skipped
           */
          if (!(format instanceof ClassFormat || format instanceof InstanceFormat))
            continue;
         
          try {
            Iterator<Resource> ri = selects.selectResources(in);
            while (ri.hasNext()) {
              Resource res = ri.next();
              if (this._formatResourceMatches.containsKey(res)) {
                ResourceFormatMatchSet match = this._formatResourceMatches.get(res);
                match.addClassFormat(format);
              } else {
                ResourceFormatMatchSet match = new ResourceFormatMatchSet(res);
                match.addClassFormat(format);
                this._formatResourceMatches.put(res, match);
              }
            }
          } catch (InvalidResultSetException e) {
            // TODO
          }
        } else if (selects.canSelectStatements()) {
          // inefficient - should really ask the model via sparql or something
          // about all the predicates it contains
          try {
            Iterator<Statement> si = selects.selectStatements(select.getModel(), null);
            while (si.hasNext()) {
              URI prop = si.next().getPredicate();
              if (this._formatPropertyMatches.containsKey(prop)) {
                PropertyFormatMatchSet match = this._formatPropertyMatches.get(prop);
                match.addPropertyFormat(format);
              } else {
                PropertyFormatMatchSet match = new PropertyFormatMatchSet(prop);
                match.addPropertyFormat(format);
                this._formatPropertyMatches.put(prop, match);
              }
            }
            si = selects.selectStatements(select.getNotModel(), null);
            while (si.hasNext()) {
              URI prop = si.next().getPredicate();
              if (this._formatPropertyMatches.containsKey(prop)) {
                PropertyFormatMatchSet match = this._formatPropertyMatches.get(prop);
                match.addPropertyFormat(format);
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.ISelector

        if (primaryObj instanceof Resource && RDFList.isRDFList(in, (Resource) primaryObj)) {
          List primaries = new RDFList(in, (Resource) primaryObj).asJavaList();
          Iterator primaryDomains = primaries.iterator();
          while (primaryDomains.hasNext()) {
            Value domainNode = (Value) primaryDomains.next();
            ISelector domain = null;
            if (domainNode instanceof Resource) {
              // This is a type selector
              domain = new TypeSelector((Resource) domainNode);
            } else if (domainNode instanceof Literal) {
              Literal domainL = (Literal) domainNode;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.