Package de.desy.tine.stringUtils

Examples of de.desy.tine.stringUtils.WildcardMatch


      public int call(String devName, TDataType dout, TDataType din, TAccess devAccess)
      {
        String[] namlst;
        if (devName.compareTo("*") != 0 && devName.indexOf("*") != -1)
        { // query for a subset of device names ...
          WildcardMatch wc = new WildcardMatch(devName);
          TDevice dev;
          LinkedList<String> nl = new LinkedList<String>();
          String dn;
          int n = 0, mask = 0;
          if (din != null && din.dArrayLength == 1 && din.dFormat == TFormat.CF_INT32)
          {
            int[] msk = new int[1];
            din.getData(msk);
            mask = msk[0];
          }
          for (int i=0; i<deviceList.getNumberOfDevices(); i++)
          {
            if ((dev=deviceList.getDevice(i)) == null) continue;
            if (dev.isOffline()) continue;
            if (mask > 0 && !dev.isMaskSet(mask)) continue;
            dn = dev.getName();
            if (!wc.matches(dn)) continue;
            nl.add(dn);
            n++;
          }
          namlst = nl.toArray(new String[n]);
        }
View Full Code Here


    return rc;
  }
  public boolean isDeviceSetLocal(String devName, String propertyName)
  {
    TExportProperty prp = propertyList.getFirstProperty(propertyName);
    WildcardMatch wc = new WildcardMatch(devName);   
    String tgt;
    TDevice[] dlst = getDeviceList().getDeviceList();
    for (int i=0; i<dlst.length; i++)
    {
      if ((tgt=dlst[i].getRedirection()) != null)
      {
        if (wc.matches(tgt)) return false;
      }
    }   
    if ((tgt=prp.getDescription().getRedirection()) != null)
    {
      if (wc.matches(tgt)) return false;     
    }
    return true; /* appears to be local so-far */   
  }
View Full Code Here

      public int call(String devName, TDataType dout, TDataType din, TAccess devAccess)
      {
        String[] namlst;
        if (devName.compareTo("*") != 0 && devName.indexOf("*") != -1)
        { // query for a subset of device names ...
          WildcardMatch wc = new WildcardMatch(devName);
          TDevice dev;
          LinkedList<String> nl = new LinkedList<String>();
          String dn;
          int n = 0, mask = 0;
          if (din != null && din.dArrayLength == 1 && din.dFormat == TFormat.CF_INT32)
          {
            int[] msk = new int[1];
            din.getData(msk);
            mask = msk[0];
          }
          for (int i=0; i<deviceList.getNumberOfDevices(); i++)
          {
            if ((dev=deviceList.getDevice(i)) == null) continue;
            if (dev.isOffline()) continue;
            if (mask > 0 && !dev.isMaskSet(mask)) continue;
            dn = dev.getName();
            if (!wc.matches(dn)) continue;
            nl.add(dn);
            n++;
          }
          namlst = nl.toArray(new String[n]);
        }
View Full Code Here

    return rc;
  }
  public boolean isDeviceSetLocal(String devName, String propertyName)
  {
    TExportProperty prp = propertyList.getFirstProperty(propertyName);
    WildcardMatch wc = new WildcardMatch(devName);   
    String tgt;
    TDevice[] dlst = getDeviceList().getDeviceList();
    for (int i=0; i<dlst.length; i++)
    {
      if ((tgt=dlst[i].getRedirection()) != null)
      {
        if (wc.matches(tgt)) return false;
      }
    }   
    if ((tgt=prp.getDescription().getRedirection()) != null)
    {
      if (wc.matches(tgt)) return false;     
    }
    return true; /* appears to be local so-far */   
  }
View Full Code Here

      public int call(String devName, TDataType dout, TDataType din, TAccess devAccess)
      {
        String[] namlst;
        if (devName.compareTo("*") != 0 && devName.indexOf("*") != -1)
        { // query for a subset of device names ...
          WildcardMatch wc = new WildcardMatch(devName);
          TDevice dev;
          LinkedList<String> nl = new LinkedList<String>();
          String dn;
          int n = 0, mask = 0;
          if (din != null && din.dArrayLength == 1 && din.dFormat == TFormat.CF_INT32)
          {
            int[] msk = new int[1];
            din.getData(msk);
            mask = msk[0];
          }
          for (int i=0; i<deviceList.getNumberOfDevices(); i++)
          {
            if ((dev=deviceList.getDevice(i)) == null) continue;
            if (dev.isOffline()) continue;
            if (mask > 0 && !dev.isMaskSet(mask)) continue;
            dn = dev.getName();
            if (!wc.matches(dn)) continue;
            nl.add(dn);
            n++;
          }
          namlst = nl.toArray(new String[n]);
        }
View Full Code Here

    return rc;
  }
  public boolean isDeviceSetLocal(String devName, String propertyName)
  {
    TExportProperty prp = propertyList.getFirstProperty(propertyName);
    WildcardMatch wc = new WildcardMatch(devName);   
    String tgt;
    TDevice[] dlst = getDeviceList().getDeviceList();
    for (int i=0; i<dlst.length; i++)
    {
      if ((tgt=dlst[i].getRedirection()) != null)
      {
        if (wc.matches(tgt)) return false;
      }
    }   
    if ((tgt=prp.getDescription().getRedirection()) != null)
    {
      if (wc.matches(tgt)) return false;     
    }
    return true; /* appears to be local so-far */   
  }
View Full Code Here

    return cc;
  }
  public static String getRegionMatch(String device)
  {
    if (ritems == null) return null;
    WildcardMatch wc;
    for (RegionItem ri : ritems)
    {
      wc = new WildcardMatch(ri.pat);
      if (wc.matches(device)) return ri.reg;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of de.desy.tine.stringUtils.WildcardMatch

Copyright © 2018 www.massapicom. 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.