コード例 #1
0
 public boolean isBottomObject(Object object) {
   MappedObjectState mappedObjectState =
       (MappedObjectState) mappedObjectStateAdapterFactory.adapt(object, MappedObjectState.class);
   if (mappedObjectState != null)
     return !isTopToBottom() ? mappedObjectState.isInput() : mappedObjectState.isOutput();
   return false;
 }
コード例 #2
0
 public Collection<? extends Mapping> getMappings(Object object) {
   MappedObjectState mappedObjectState = getMappedObjectState(object);
   if (mappedObjectState == null) {
     return Collections.emptySet();
   } else {
     return mappedObjectState.getMappings();
   }
 }
コード例 #3
0
  public void deregister(Mapping mapping) {
    for (Object input : mapping.getInputs()) {
      MappedObjectState mappedObjectState = getMappedObjectState(input);
      if (mappedObjectState != null) {
        mappedObjectState.getMappings().remove(mapping);
      }
    }

    for (Object output : mapping.getOutputs()) {
      MappedObjectState mappedObjectState = getMappedObjectState(output);
      if (mappedObjectState != null) {
        mappedObjectState.getMappings().remove(mapping);
      }
    }
  }
コード例 #4
0
  public void refreshMappedObjectStates(Mapping subtree) {
    for (Object input : subtree.getInputs()) {
      for (Iterator<?> objects = domain.treeIterator(input); objects.hasNext(); ) {
        Object object = objects.next();
        MappedObjectState mappedObjectState = getMappedObjectState(object);
        if (mappedObjectState != null) {
          mappedObjectState.setInput();
        }
      }
    }

    for (Object output : subtree.getOutputs()) {
      for (Iterator<?> objects = domain.treeIterator(output); objects.hasNext(); ) {
        MappedObjectState mappedObjectState = getMappedObjectState(objects.next());
        if (mappedObjectState != null) {
          mappedObjectState.setOutput();
        }
      }
    }

    for (Iterator<Mapping> mappings = subtree.treeIterator(); mappings.hasNext(); ) {
      Mapping mapping = mappings.next();
      for (Object input : mapping.getInputs()) {
        MappedObjectState mappedObjectState = getMappedObjectState(input);
        if (mappedObjectState != null) {
          mappedObjectState.getMappings().add(mapping);
        }
      }

      for (Object output : mapping.getOutputs()) {
        MappedObjectState mappedObjectState = getMappedObjectState(output);
        if (mappedObjectState != null) {
          mappedObjectState.getMappings().add(mapping);
        }
      }
    }
  }
コード例 #5
0
 public boolean isOutputObject(Object object) {
   MappedObjectState mappedObjectState =
       (MappedObjectState) mappedObjectStateAdapterFactory.adapt(object, MappedObjectState.class);
   return mappedObjectState != null && mappedObjectState.isOutput();
 }