Beispiel #1
0
 @Override
 public IAttribute findAttributeIgnoreCase(String name) {
   if (attributes != null) {
     for (IAttribute attribute : attributes) {
       if (StringUtils.isSameStringIgnoreCase(name, attribute.getName())) {
         return attribute;
       }
     }
   }
   return null;
 }
Beispiel #2
0
  @Override
  public IGroup getGroupWithAttribute(final String attributeName, final String value) {
    List<IGroup> groups = getGroupList();
    IAttribute attr;
    for (IGroup group : groups) {
      attr = group.getAttribute(attributeName);
      if (attr.getStringValue().equals(value)) {
        return group;
      }
    }

    return null;
  }
Beispiel #3
0
 @Override
 public IGroup getGroupWithAttribute(String attributeName, String value) {
   if (name != null) {
     for (IGroup group : groupList) {
       IAttribute attribute = group.getAttribute(name);
       if (attribute != null) {
         if (StringUtils.isSameString(value, attribute.getStringValue())) {
           return group;
         }
       }
     }
   }
   return null;
 }
Beispiel #4
0
 @Override
 public IDataItem getDataItemWithAttribute(String name, String value) {
   if (name != null) {
     for (IDataItem item : itemList) {
       IAttribute attribute = item.getAttribute(name);
       if (attribute != null) {
         if (StringUtils.isSameString(value, attribute.getStringValue())) {
           return item;
         }
       }
     }
   }
   return null;
 }
Beispiel #5
0
 @Override
 public String getDescription() {
   IAttribute attr = getAttribute("long_name");
   if (attr == null) {
     attr = getAttribute("description");
   }
   if (attr == null) {
     attr = getAttribute("title");
   }
   if (attr == null) {
     attr = getAttribute("standard_name");
   }
   return attr.getStringValue();
 }
Beispiel #6
0
  @Override
  public void setDimensions(String dimString) {
    IGroup parent = getParentGroup();

    List<String> dimNames = java.util.Arrays.asList(dimString.split(" "));
    List<IDataItem> items = parent.getDataItemList();

    for (IDataItem item : items) {
      IAttribute attr = item.getAttribute("axis");
      if (attr != null) {
        try {
          IDimension dim =
              new BasicDimension(item.getName(), item.getData(), false, item.isUnlimited(), false);
          if ("*".equals(dimString)) {
            setDimension(dim, attr.getNumericValue().intValue());
          } else if (dimNames.contains(attr.getName())) {
            setDimension(dim, attr.getNumericValue().intValue());
          }
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
Beispiel #7
0
 @Override
 public boolean removeAttribute(final IAttribute a) {
   boolean result = true;
   attributeMap.remove(a.getName());
   return result;
 }
Beispiel #8
0
 @Override
 public void addOneAttribute(final IAttribute attribute) {
   attributeMap.put(attribute.getName(), attribute);
 }