Exemplo n.º 1
0
  private static void assertAttributes(Object value, String... keys) {
    if (!(value instanceof RAbstractVector)) {
      Assert.assertEquals(0, keys.length);
      return;
    }

    RAbstractVector vector = (RAbstractVector) value;
    Set<String> expectedAttributes = new HashSet<>(Arrays.asList(keys));

    DynamicObject attributes = vector.getAttributes();
    if (attributes == null) {
      Assert.assertEquals(0, keys.length);
      return;
    }
    Set<Object> foundAttributes = new HashSet<>();
    for (RAttributesLayout.RAttribute attribute : RAttributesLayout.asIterable(attributes)) {
      foundAttributes.add(attribute.getName());
      foundAttributes.add(attribute.getValue());
    }
    Assert.assertEquals(expectedAttributes, foundAttributes);
  }
Exemplo n.º 2
0
 protected boolean containsMetadata(RAbstractVector vector) {
   return vector instanceof RVector && hasDimNode.execute(vector)
       || (copyAllAttributes && vector.getAttributes() != null)
       || getNamesNode.getNames(vector) != null
       || getDimNamesNode.getDimNames(vector) != null;
 }
Exemplo n.º 3
0
 protected boolean containsMetadata(RAbstractVector vector, RAttributeProfiles attrProfiles) {
   return vector instanceof RVector && vector.hasDimensions()
       || (copyAllAttributes && vector.getAttributes() != null)
       || vector.getNames(attrProfiles) != null
       || vector.getDimNames(attrProfiles) != null;
 }