congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
T2ReferenceType.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
net.sf.taverna.t2.reference.T2ReferenceType

Best Java code snippets using net.sf.taverna.t2.reference.T2ReferenceType.equals (Showing top 20 results out of 315)

origin: net.sf.taverna.t2.component/component-activity

private Set<T2Reference> getErrors(T2Reference ref) {
  Set<T2Reference> result = new HashSet<T2Reference>();
  if (ref.getReferenceType().equals(ReferenceSet)) {
    // nothing
  } else if (ref.getReferenceType().equals(IdentifiedList)) {
    IdentifiedList<T2Reference> originalList = listService.getList(ref);
    for (T2Reference subValue : originalList)
      if (subValue.containsErrors())
        result.addAll(getErrors(subValue));
  } else {
    result.add(ref);
  }
  return result;
}
origin: net.sf.taverna.t2.component/component-activity

private T2Reference findFirstFailure(T2Reference value) {
  IdentifiedList<T2Reference> originalList = listService.getList(value);
  for (T2Reference subValue : originalList) {
    if (subValue.getReferenceType().equals(ErrorDocument))
      return subValue;
    if (subValue.getReferenceType().equals(IdentifiedList))
      if (subValue.containsErrors())
        return findFirstFailure(subValue);
    // No need to consider value
  }
  return null;
}
origin: net.sf.taverna.t2.workbench.views/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference, InvocationContext context) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));            
  } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) {
    ListService listService = context.getReferenceService().getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments.addAll(getErrorDocuments(listReference, context));
    }
  }
  return errorDocuments;
}

origin: net.sf.taverna.t2.lang/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference,
    ReferenceService referenceService) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = referenceService
        .getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));
  } else if (reference.getReferenceType().equals(
      T2ReferenceType.IdentifiedList)) {
    ListService listService = referenceService.getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments
          .addAll(getErrorDocuments(listReference, referenceService));
    }
  }
  return errorDocuments;
}
origin: net.sf.taverna.t2/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference,
    ReferenceService referenceService) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = referenceService
        .getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));
  } else if (reference.getReferenceType().equals(
      T2ReferenceType.IdentifiedList)) {
    ListService listService = referenceService.getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments
          .addAll(getErrorDocuments(listReference, referenceService));
    }
  }
  return errorDocuments;
}
origin: net.sf.taverna.t2.core/reference-impl

/**
 * Drill inside an error document reference to get the error one deeper than
 * this as long as it is at least depth 1.
 */
T2ReferenceImpl getDeeperErrorReference() {
  if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    if (getDepth() == 0) {
      throw new AssertionError("Error identifier already has depth 0, cannot decrease");
    }
    T2ReferenceImpl result = new T2ReferenceImpl();
    result.setContainsErrors(true);
    result.setDepth(getDepth() - 1);
    result.setLocalPart(getLocalPart());
    result.setNamespacePart(getNamespacePart());
    result.setReferenceType(T2ReferenceType.ErrorDocument);
    return result;
  }
  throw new AssertionError(
      "Attempt to get a deeper reference on something that isn't an error ref");
}
origin: net.sf.taverna.t2.core/reference-impl

public boolean delete(
    IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      sessionFactory.getCurrentSession().delete(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
  return true;
}

origin: net.sf.taverna.t2.component/component-activity

private T2Reference considerReference(T2Reference value,
    List<T2Reference> exceptions) {
  if (!value.containsErrors()) {
    return value;
  } else if (!value.getReferenceType().equals(IdentifiedList)) {
    return replaceErrors(value, exceptions);
  } else if (exceptionHandling.failLists()) {
    T2Reference failure = findFirstFailure(value);
    T2Reference replacement = replaceErrors(failure, value.getDepth(),
        exceptions);
    return replacement;
  } else {
    IdentifiedList<T2Reference> originalList = listService
        .getList(value);
    List<T2Reference> replacementList = new ArrayList<T2Reference>();
    for (T2Reference subValue : originalList)
      replacementList.add(considerReference(subValue, exceptions));
    return referenceService.register(replacementList, value.getDepth(),
        true, context);
  }
}
origin: net.sf.taverna.t2/t2reference-impl

/**
 * Drill inside an error document reference to get the error one deeper than
 * this as long as it is at least depth 1.
 */
T2ReferenceImpl getDeeperErrorReference() {
  if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    if (getDepth() == 0) {
      throw new AssertionError(
          "Error identifier already has depth 0, cannot decrease");
    }
    T2ReferenceImpl result = new T2ReferenceImpl();
    result.setContainsErrors(true);
    result.setDepth(getDepth() - 1);
    result.setLocalPart(getLocalPart());
    result.setNamespacePart(getNamespacePart());
    result.setReferenceType(T2ReferenceType.ErrorDocument);
    return result;
  }
  throw new AssertionError(
      "Attempt to get a deeper reference on something that isn't an error ref");
}
origin: net.sf.taverna.t2/reference-impl

/**
 * Drill inside an error document reference to get the error one deeper than
 * this as long as it is at least depth 1.
 */
T2ReferenceImpl getDeeperErrorReference() {
  if (getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    if (getDepth() == 0) {
      throw new AssertionError(
          "Error identifier already has depth 0, cannot decrease");
    }
    T2ReferenceImpl result = new T2ReferenceImpl();
    result.setContainsErrors(true);
    result.setDepth(getDepth() - 1);
    result.setLocalPart(getLocalPart());
    result.setNamespacePart(getNamespacePart());
    result.setReferenceType(T2ReferenceType.ErrorDocument);
    return result;
  }
  throw new AssertionError(
      "Attempt to get a deeper reference on something that isn't an error ref");
}
origin: net.sf.taverna.t2.core/reference-impl

@PutIdentifiedOperation
public void store(IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      sessionFactory.getCurrentSession().save(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
}
origin: net.sf.taverna.t2/reference-impl

  @PutIdentifiedOperation
  public void store(ErrorDocument theDocument) throws DaoException {
    if (theDocument.getId() == null) {
      throw new DaoException(
          "Supplied error document set has a null ID, allocate "
              + "an ID before calling the store method in the dao.");
    } else if (theDocument.getId().getReferenceType().equals(
        T2ReferenceType.ErrorDocument) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.ErrorDocument, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theDocument instanceof ErrorDocumentImpl) {
      try {
        sessionFactory.getCurrentSession().save(theDocument);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied ErrorDocument not an instance of ErrorDocumentImpl");
    }
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(ErrorDocument theDocument) throws DaoException {
    if (theDocument.getId() == null) {
      throw new DaoException(
          "Supplied error document set has a null ID, allocate "
              + "an ID before calling the store method in the dao.");
    } else if (theDocument.getId().getReferenceType().equals(
        T2ReferenceType.ErrorDocument) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.ErrorDocument, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theDocument instanceof ErrorDocumentImpl) {
      try {
        sessionFactory.getCurrentSession().save(theDocument);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied ErrorDocument not an instance of ErrorDocumentImpl");
    }
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        sessionFactory.getCurrentSession().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2/reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        sessionFactory.getCurrentSession().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2.core/reference-impl

public boolean delete(
    IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      getHibernateTemplate().delete(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
  return true;
}

origin: net.sf.taverna.t2.core/reference-impl

@PutIdentifiedOperation
public void store(IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      getHibernateTemplate().save(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(ErrorDocument theDocument) throws DaoException {
    if (theDocument.getId() == null) {
      throw new DaoException(
          "Supplied error document set has a null ID, allocate "
              + "an ID before calling the store method in the dao.");
    } else if (theDocument.getId().getReferenceType().equals(
        T2ReferenceType.ErrorDocument) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.ErrorDocument, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theDocument instanceof ErrorDocumentImpl) {
      try {
        getHibernateTemplate().save(theDocument);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied ErrorDocument not an instance of ErrorDocumentImpl");
    }
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        getHibernateTemplate().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2/reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        getHibernateTemplate().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
net.sf.taverna.t2.referenceT2ReferenceTypeequals

Popular methods of T2ReferenceType

  • toString

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now