Пример #1
0
 @Override
 public final boolean isEnabled(int position) {
   ItemType item = getItem(position);
   if (!mTabsClickable && !item.isHeader()) return false;
   if (item.isHeader()) return item.getActionCallback() != null;
   return item.isClickable();
 }
Пример #2
0
  /**
   * Statische Funktion die ein XML-Trefferdokument erzeugt
   *
   * @param feedDetails Vector der NewsItems-Objekte enthält
   * @param strWhichInputType Zeichenkette für den XML-Dateinamen
   * @throws JAXBException
   */
  public static void write_XML_File(Vector<NewsItems> feedDetails, String strWhichInputType)
      throws JAXBException {
    TrefferDokument trefferDokument = new TrefferDokument();

    for (int i = 0; i < feedDetails.size(); i++) {

      /*
       * Hier werden die Klassen benutzt, die mittels xjc erstellt
       * worden. gut nachzuvollziehen, wenn sich die assignment2.xsd
       * angeschaut wird.
       */
      TrefferType type = new TrefferType();
      ItemType item = new ItemType();

      item.setTitle(feedDetails.get(i).getTitle());
      item.setDescription(feedDetails.get(i).getDescription());

      type.getItem().add(item);
      trefferDokument.getTreffer().add(type);

      JAXBContext jc = JAXBContext.newInstance(ObjectFactory.class);
      Marshaller m = jc.createMarshaller();
      /*
       * Output wird für eine gewohnte Lesbarkeit formatiert
       */
      m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

      m.marshal(trefferDokument, new File(strWhichInputType + ".xml"));
    }
  }
Пример #3
0
  private void reg(Material material, ItemType type) {
    if (material.isBlock() != (type instanceof BlockType)) {
      throw new IllegalArgumentException(
          "Cannot mismatch item and block: " + material + ", " + type);
    }

    if (idToType.containsKey(material.getId())) {
      throw new IllegalArgumentException(
          "Cannot use "
              + type
              + " for "
              + material
              + ", is already "
              + idToType.get(material.getId()));
    }

    idToType.put(material.getId(), type);
    type.setId(material.getId());

    if (material.isBlock()) {
      nextBlockId = Math.max(nextBlockId, material.getId() + 1);
      if (type.getClass() != BlockType.class) {
        ((BlockType) type).setPlaceSound(Sound.DIG_STONE);
      }
    } else {
      nextItemId = Math.max(nextItemId, material.getId() + 1);
    }
  }
Пример #4
0
  public List<ItemType> getAllItemType() {
    List<ItemType> typeList = new ArrayList<ItemType>();
    con = new DBConnection();
    try {

      cstmt = con.connection.prepareCall("{call  getAllItemType()}");
      ResultSet rs = cstmt.executeQuery();

      while (rs.next()) {

        ItemType objItemType = new ItemType();
        objItemType.setTypeName(rs.getString("TypeName"));
        objItemType.setTypeID(rs.getInt("TypeID"));

        typeList.add(objItemType);
      }
      rs.close();
    } catch (Exception ex) {
      ex.getMessage();
    } finally {

      con.closeConnection();
    }
    return typeList;
  }
 public static void normaliseWeights(Collection<ItemType> items) {
   double weightSum = 0;
   for (ItemType item : items) {
     weightSum += item.weight;
   }
   for (ItemType item : items) {
     item.weight /= weightSum;
   }
 }
Пример #6
0
  public void addConfig(String itemName, Class<?> type, String pattern, boolean base64) {
    if (configMap == null) {
      configMap = new HashMap<String, ItemType>();
    }

    ItemType typeItem = new ItemType();
    typeItem.pattern = pattern;
    typeItem.base64 = base64;
    typeItem.type = type;

    configMap.put(itemName, typeItem);
  }
Пример #7
0
  public static boolean checkPremise(Node premise, ItemType first_entity, ItemType second_entity)
      throws Exception {
    Element rule_firstentity = findElement(premise.getChildNodes(), "firstentity");
    Element rule_secondentity = findElement(premise.getChildNodes(), "secondentity");

    if (checkItem(rule_firstentity, first_entity) && checkItem(rule_secondentity, second_entity)) {
      first_entity.var = rule_firstentity.getAttribute("var");
      second_entity.var = rule_secondentity.getAttribute("var");
      return true;
    }

    return false;
  }
Пример #8
0
 private void setupHeader(ItemType header, View view) {
   TextView title = (TextView) view.findViewById(android.R.id.title);
   if (title == null)
     throw new RuntimeException(
         "Your header layout must contain a TextView with the ID @android:id/title.");
   TextView subtitle = (TextView) view.findViewById(android.R.id.content);
   if (subtitle == null)
     throw new RuntimeException(
         "Your header layout must contain a TextView with the ID @android:id/content.");
   title.setText(header.getTitle());
   if (header.getContent() != null && !header.getContent().trim().isEmpty()) {
     subtitle.setVisibility(View.VISIBLE);
     subtitle.setText(header.getContent());
   } else subtitle.setVisibility(View.GONE);
   TextView button = (TextView) view.findViewById(android.R.id.button1);
   if (button == null)
     throw new RuntimeException(
         "The header layout must contain a TextView with the ID @android:id/button1.");
   if (header.getActionCallback() != null) {
     button.setVisibility(View.VISIBLE);
     button.setBackgroundColor(mAccentColor);
     String titleTxt = header.getActionTitle();
     if (header.getActionTitle() == null || header.getActionTitle().trim().isEmpty())
       titleTxt = getContext().getString(R.string.see_more);
     button.setText(titleTxt);
   } else button.setVisibility(View.GONE);
 }
 /**
  * Construct an atomic value given its lexical representation and the name of the required
  * built-in atomic type.
  *
  * <p>This method cannot be used to construct values that are namespace-sensitive (QNames and
  * Notations)
  *
  * @param lexicalForm the value in the lexical space of the target data type. More strictly, the
  *     input value before the actions of the whitespace facet for the target data type are
  *     applied.
  * @param type the required atomic type. This must either be one of the built-in atomic types
  *     defined in XML Schema, or a user-defined type whose definition appears in a schema that is
  *     known to the Processor. It must not be an abstract type.
  * @throws SaxonApiException if the type is unknown, or is not atomic, or is namespace-sensitive;
  *     or if the value supplied in <tt>lexicalForm</tt> is not in the lexical space of the
  *     specified atomic type.
  */
 public XdmAtomicValue(String lexicalForm, ItemType type) throws SaxonApiException {
   net.sf.saxon.type.ItemType it = type.getUnderlyingItemType();
   if (!it.isAtomicType()) {
     throw new SaxonApiException("Requested type is not atomic");
   }
   if (((AtomicType) it).isAbstract()) {
     throw new SaxonApiException("Requested type is an abstract type");
   }
   if (((AtomicType) it).isNamespaceSensitive()) {
     throw new SaxonApiException("Requested type is namespace-sensitive");
   }
   if (((AtomicType) it).isBuiltInType()) {
     ConversionResult cv =
         StringValue.convertStringToBuiltInType(
             lexicalForm, (BuiltInAtomicType) it, new Name11Checker());
     try {
       setValue(cv.asAtomic());
     } catch (ValidationException e) {
       throw new SaxonApiException(e);
     }
   } else {
     Configuration config =
         ((ConstructedItemType) type).getProcessor().getUnderlyingConfiguration();
     ConversionResult result =
         new StringValue(lexicalForm)
             .convert((AtomicType) it, true, config.getConversionContext());
     try {
       setValue(result.asAtomic());
     } catch (ValidationException e) {
       throw new SaxonApiException(e);
     }
   }
 }
Пример #10
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = prime + id.hashCode();
   result = prime * result + name.hashCode();
   return prime * result + itemType.hashCode();
 }
  @Override
  public CombinedHistoryItem onCreateViewHolder(ViewGroup viewGroup, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
    final View view;

    final ItemType itemType = ItemType.viewTypeToItemType(viewType);

    switch (itemType) {
      case CLIENT:
        view = inflater.inflate(R.layout.home_remote_tabs_group, viewGroup, false);
        return new CombinedHistoryItem.ClientItem(view);

      case HIDDEN_DEVICES:
        view = inflater.inflate(R.layout.home_remote_tabs_hidden_devices, viewGroup, false);
        return new CombinedHistoryItem.BasicItem(view);

      case NAVIGATION_BACK:
        view = inflater.inflate(R.layout.home_combined_back_item, viewGroup, false);
        return new CombinedHistoryItem.HistoryItem(view);

      case SECTION_HEADER:
        view = inflater.inflate(R.layout.home_header_row, viewGroup, false);
        return new CombinedHistoryItem.BasicItem(view);

      case CHILD:
      case HISTORY:
        view = inflater.inflate(R.layout.home_item_row, viewGroup, false);
        return new CombinedHistoryItem.HistoryItem(view);
      default:
        throw new IllegalArgumentException("Unexpected Home Panel item type");
    }
  }
Пример #12
0
  @Override
  public View onViewCreated(int index, View recycled, ItemType item) {
    if (item.isHeader()) {
      setupHeader(item, recycled);
      return recycled;
    }

    TextView title = (TextView) recycled.findViewById(android.R.id.title);
    if (title != null) onProcessTitle(title, item, mAccentColor);
    TextView content = (TextView) recycled.findViewById(android.R.id.content);
    if (content != null) onProcessContent(content, item);
    ImageView icon = (ImageView) recycled.findViewById(android.R.id.icon);
    if (icon != null) {
      if (onProcessThumbnail(icon, item)) {
        icon.setVisibility(View.VISIBLE);
      } else {
        icon.setVisibility(View.GONE);
      }
    }
    View menu = recycled.findViewById(android.R.id.button1);
    if (menu != null) {
      if (onProcessMenu(menu, item)) {
        menu.setVisibility(View.VISIBLE);
      } else {
        menu.setOnClickListener(null);
        menu.setVisibility(View.INVISIBLE);
      }
    }
    invalidatePadding(index, recycled);
    return recycled;
  }
Пример #13
0
  private void handleItemType(ItemType type, Request request, Response response)
      throws ActionHandlerException {
    if (request.getRequestParts().length > 2) {
      String name = request.getRequestParts()[2];
      AbstractItem item = null;
      try {
        item = type.getItem(name, request.getDB());
      } catch (CouldNotLoadItemException e) {
        throw new ActionHandlerException(e);
      }

      /* Authorization */
      checkAuthorization(
          item, request.getUser(), Authorizer.Authorization.get(request.isRequestPost()));

      request.getContext().put("title", item.getDisplayName());

      if (item instanceof Actionable) {
        actions(item, 3, request, response);
      } else {
        if (request.getRequestParts().length > 2) {
          throw new ActionHandlerException("No such action, " + request.getRequestURI());
        } else {
          executeThing(request, response, item, "index");
        }
      }

    } else {
      /* TODO, what? */
    }
  }
Пример #14
0
 protected boolean onProcessMenu(final View view, final ItemType Tab) {
   if (Tab.getPopupMenu() < 0) {
     // Menu for this Tab is disabled
     return false;
   }
   int menuRes = mPopupMenu;
   if (Tab.getPopupMenu() != 0) menuRes = Tab.getPopupMenu();
   if (menuRes < 0) {
     // No menu for the adapter or the Tab
     return false;
   }
   setupTouchDelegate(getContext(), view);
   view.setOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           int menuRes = mPopupMenu;
           if (Tab.getPopupMenu() != 0) menuRes = Tab.getPopupMenu();
           // Force the holo light theme on every Tab's popup menu
           Context themedContext = getContext();
           themedContext.setTheme(POPUP_MENU_THEME);
           PopupMenu popup = new PopupMenu(themedContext, view);
           MenuInflater inflater = popup.getMenuInflater();
           inflater.inflate(menuRes, popup.getMenu());
           popup.setOnMenuItemClickListener(
               new PopupMenu.OnMenuItemClickListener() {
                 @Override
                 public boolean onMenuItemClick(MenuItem item) {
                   if (Tab.getPopupMenu() > 0 && Tab.getPopupListener() != null) {
                     // This individual Tab has it unique menu
                     Tab.getPopupListener().onMenuItemClick(Tab, item);
                   } else if (mPopupListener != null) {
                     // The Tab does not have a unique menu, use the adapter's default
                     mPopupListener.onMenuItemClick(Tab, item);
                   }
                   return false;
                 }
               });
           popup.show();
         }
       });
   return true;
 }
  public static MatrixCursorColumns fromCursor(Context context, Cursor cursor) {
    MatrixCursorColumns values = new MatrixCursorColumns();
    FormatUtilities format = new FormatUtilities(context);
    String display;
    Money value;

    values.id = (int) cursor.getLong(cursor.getColumnIndex(MatrixCursorColumns.ID));
    values.name = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.NAME));
    values.allocation = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.ALLOCATION));

    String valueString = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.VALUE));
    if (!TextUtils.isEmpty(valueString)) {
      value = MoneyFactory.fromString(valueString);
      display = format.getValueFormattedInBaseCurrency(value);
    } else {
      display = "";
    }
    values.value = display;

    values.currentAllocation =
        cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.CURRENT_ALLOCATION));

    valueString = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.CURRENT_VALUE));
    if (!TextUtils.isEmpty(valueString)) {
      value = MoneyFactory.fromString(valueString);
      display = format.getValueFormattedInBaseCurrency(value);
    } else {
      display = "";
    }
    values.currentValue = display;

    // difference %
    valueString = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.DIFFERENCE_PERCENT));
    if (!TextUtils.isEmpty(valueString)) {
      // value = MoneyFactory.fromString(valueString);
      display = valueString;
    } else {
      display = "";
    }
    values.differencePercent = display;

    valueString = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.DIFFERENCE));
    if (!TextUtils.isEmpty(valueString)) {
      value = MoneyFactory.fromString(valueString);
      display = format.getValueFormattedInBaseCurrency(value);
    } else {
      display = "";
    }
    values.difference = display;

    String typeString = cursor.getString(cursor.getColumnIndex(MatrixCursorColumns.TYPE));
    values.type = ItemType.valueOf(typeString);

    return values;
  }
  @Override
  public int getItemViewType(int position) {
    if (isInChildView()) {
      if (position == 0) {
        return ItemType.itemTypeToViewType(ItemType.NAVIGATION_BACK);
      }
      return ItemType.itemTypeToViewType(ItemType.CHILD);
    } else {
      final int numClients = remoteClients.size();
      if (position < numClients) {
        if (!hiddenClients.isEmpty() && position == numClients - 1) {
          return ItemType.itemTypeToViewType(ItemType.HIDDEN_DEVICES);
        }
        return ItemType.itemTypeToViewType(ItemType.CLIENT);
      }

      final int sectionPosition =
          transformAdapterPositionForDataStructure(ItemType.SECTION_HEADER, position);
      if (sectionHeaders.get(sectionPosition) != null) {
        return ItemType.itemTypeToViewType(ItemType.SECTION_HEADER);
      }

      return ItemType.itemTypeToViewType(ItemType.HISTORY);
    }
  }
Пример #17
0
  /**
   * Gives the player the specified amount of the specified item
   *
   * @param player The player to give items to
   * @param itemName The partial or complete name of the item
   * @param amount The number of items to give
   */
  private void moar(Player player, String itemName, int amount) {
    // TODO: Do not ignore the amount parameter
    ItemStack newItem = null;
    BlockType block = BlockType.lookup(itemName);
    if (block == null) {
      ItemType item = ItemType.lookup(itemName);
      if (item == null) {
        return;
      } else {
        newItem = new ItemStack(item.getID());
        newItem.setAmount(newItem.getType().getMaxStackSize());
      }
    } else {
      newItem = new ItemStack(block.getID());
      newItem.setAmount(newItem.getType().getMaxStackSize());
    }

    // FIXME: Shouldn't use nulls in Java... but it works
    if (newItem != null) {
      player.getInventory().addItem(newItem);
    }
  }
Пример #18
0
  /**
   * Register a new, non-Vanilla ItemType. It will be assigned an ID automatically.
   *
   * @param type the ItemType to register.
   */
  public void register(ItemType type) {
    int id;
    if (type instanceof BlockType) {
      id = nextBlockId;
    } else {
      id = nextItemId;
    }

    while (idToType.containsKey(id)) {
      ++id;
    }

    idToType.put(id, type);
    type.setId(id);

    if (type instanceof BlockType) {
      nextBlockId = id + 1;
    } else {
      nextItemId = id + 1;
    }
  }
 public void removeLight(Location loc, ItemType type, Player player) {
   type.deleteLightSource(loc, player);
 }
Пример #20
0
 protected boolean onProcessContent(TextView content, ItemType Tab) {
   content.setText(Tab.getContent());
   return false;
 }
 private ItemType getItemTypeForPosition(int position) {
   return ItemType.viewTypeToItemType(getItemViewType(position));
 }
 public void createLight(ItemType type, Player player, int level) {
   type.createLightSource(player, level);
 }
 public void createLight(Location loc, ItemType type, Player player, int level) {
   type.createLightSource(loc, player, level);
 }
Пример #24
0
  public static void processConsequent(
      Node premise, Node consequent, ItemType first_entity, ItemType second_entity)
      throws Exception {
    Element rule_firstentity = findElement(consequent.getChildNodes(), "firstentity");
    Element rule_secondentity = findElement(consequent.getChildNodes(), "secondentity");

    String rule_className = rule_firstentity.getAttribute("className");
    if (rule_className.compareTo("") != 0) {
      first_entity.className = rule_className; // override new class
    }

    String rule_quantifier = rule_firstentity.getAttribute("quantifier");
    if (rule_quantifier.compareTo("") != 0) {
      int index = rule_quantifier.indexOf("valueOf");
      if (index != -1) {
        String var = rule_quantifier.substring(index + 8, rule_quantifier.indexOf(")", index + 8));
        Element process_entity = findElementbyVar(premise.getChildNodes(), var);
        if (process_entity != null
            && process_entity.getNodeName().compareToIgnoreCase("firstentity") == 0) {
          first_entity.quantifier = first_entity.value;
        } else if (process_entity != null
            && process_entity.getNodeName().compareToIgnoreCase("secondentity") == 0) {
          first_entity.quantifier = second_entity.value;
        }

      } else first_entity.quantifier = rule_quantifier; // override new class
    }

    String rule_delete = rule_firstentity.getAttribute("delete");
    if (rule_delete.compareTo("yes") == 0) {
      first_entity.delete = true; // override new class
    }

    // second entity
    rule_className = rule_secondentity.getAttribute("className");
    if (rule_className.compareTo("") != 0) {
      second_entity.className = rule_className; // override new class
    }

    rule_quantifier = rule_secondentity.getAttribute("quantifier");
    if (rule_quantifier.compareTo("") != 0) {
      int index = rule_quantifier.indexOf("valueOf");
      if (index != -1) {
        String var = rule_quantifier.substring(index + 8, rule_quantifier.indexOf(")", index + 8));
        Element process_entity = findElementbyVar(premise.getChildNodes(), var);
        if (process_entity != null
            && process_entity.getNodeName().compareToIgnoreCase("firstentity") == 0) {
          second_entity.quantifier = first_entity.value;
        } else if (process_entity != null
            && process_entity.getNodeName().compareToIgnoreCase("secondentity") == 0) {
          second_entity.quantifier = first_entity.value;
        }

      } else second_entity.quantifier = rule_quantifier; // override new class
    }

    rule_delete = rule_secondentity.getAttribute("delete");
    if (rule_delete.compareTo("yes") == 0) {
      second_entity.delete = true; // override new class
    }
  }
  public List<Item> fetchItemForHoldings(int holdingsId) throws Exception {
    List<Item> itemList = new ArrayList<Item>();
    Map<String, Item> itemHashMap = new HashMap<>();
    itemPreparedStatement.setInt(1, holdingsId);
    ResultSet resultSet = itemPreparedStatement.executeQuery();
    Set<String> highDensityStorageSet = null;
    Set<String> donorNoteSet = null;
    Set<String> itemNoteSet = null;
    Set<String> statisticalSearchSet = null;
    org.kuali.ole.docstore.common.document.content.instance.Item itemObj = null;

    while (resultSet.next()) {
      String id = resultSet.getString("ITEM_ID");
      if (itemHashMap.containsKey(id)) {
        itemObj =
            (org.kuali.ole.docstore.common.document.content.instance.Item)
                itemHashMap.get(id).getContentObject();
      } else {
        itemObj = new org.kuali.ole.docstore.common.document.content.instance.Item();
        Item item = new Item();
        itemList.add(item);
        item.setId("wio-" + resultSet.getString("ITEM_ID"));
        item.setContentObject(itemObj);
        Location location =
            getLocationDetails(
                resultSet.getString("LOCATION"), resultSet.getString("LOCATION_LEVEL"));
        itemObj.setLocation(location);
        CallNumber callNumber = new CallNumber();
        callNumber.setNumber(resultSet.getString("CALL_NUMBER"));
        callNumber.setPrefix(resultSet.getString("CALL_NUMBER_PREFIX"));
        ShelvingOrder shelvingOrder = new ShelvingOrder();
        if (resultSet.getString("SHELVING_ORDER") != null
            && !"null".equals(resultSet.getString("SHELVING_ORDER"))) {
          shelvingOrder.setCodeValue(resultSet.getString("SHELVING_ORDER"));
          shelvingOrder.setFullValue(resultSet.getString("SHELVING_ORDER"));
        }
        callNumber.setShelvingOrder(shelvingOrder);
        ShelvingScheme shelvingScheme = new ShelvingScheme();
        if (callNumberType.get(resultSet.getString("CALL_NUMBER_TYPE_ID")) != null) {
          String[] strings =
              callNumberType.get(resultSet.getString("CALL_NUMBER_TYPE_ID")).split("[|]");
          shelvingScheme.setCodeValue(strings[0]);
          shelvingScheme.setFullValue(strings[1]);
        }
        callNumber.setShelvingScheme(shelvingScheme);
        itemObj.setCallNumber(callNumber);
        itemObj.setBarcodeARSL(resultSet.getString("BARCODE_ARSL"));
        itemObj.setEnumeration(resultSet.getString("ENUMERATION"));
        itemObj.setChronology(resultSet.getString("CHRONOLOGY"));
        itemObj.setCopyNumber(resultSet.getString("COPY_NUMBER"));
        AccessInformation accessInformation = new AccessInformation();
        accessInformation.setBarcode(resultSet.getString("BARCODE"));
        Uri uri = new Uri();
        uri.setValue(resultSet.getString("URI"));
        accessInformation.setUri(uri);
        itemObj.setAccessInformation(accessInformation);
        itemObj.setPurchaseOrderLineItemIdentifier(
            resultSet.getString("PURCHASE_ORDER_LINE_ITEM_ID"));
        itemObj.setVendorLineItemIdentifier(resultSet.getString("VENDOR_LINE_ITEM_ID"));
        itemObj.setFund(resultSet.getString("FUND"));
        itemObj.setPrice(resultSet.getString("PRICE"));
        itemObj.setItemStatusEffectiveDate(
            convertDateFormat(resultSet.getString("ITEM_STATUS_DATE_UPDATED")));
        if (resultSet.getString("FAST_ADD") != null) {
          itemObj.setFastAddFlag(
              resultSet.getString("FAST_ADD").equalsIgnoreCase("Y") ? Boolean.TRUE : Boolean.FALSE);
        }
        itemObj.setCheckinNote(resultSet.getString("CHECK_IN_NOTE"));
        if (resultSet.getString("CLAIMS_RETURNED") != null) {
          itemObj.setClaimsReturnedFlag(
              resultSet.getString("CLAIMS_RETURNED").equalsIgnoreCase("Y")
                  ? Boolean.TRUE
                  : Boolean.FALSE);
        }
        String claimsReturnFlagCreatedDate = resultSet.getString("CLAIMS_RETURNED_DATE_CREATED");
        itemObj.setClaimsReturnedFlagCreateDate(convertDateFormat(claimsReturnFlagCreatedDate));
        itemObj.setClaimsReturnedNote(resultSet.getString("CLAIMS_RETURNED_NOTE"));
        itemObj.setCurrentBorrower(resultSet.getString("CURRENT_BORROWER"));
        itemObj.setProxyBorrower(resultSet.getString("PROXY_BORROWER"));
        String dueDateTime = resultSet.getString("DUE_DATE_TIME");
        itemObj.setDueDateTime(convertDateFormat(dueDateTime));
        String originalDueDate = resultSet.getString("ORG_DUE_DATE_TIME");
        itemObj.setOriginalDueDate(convertDateFormat(originalDueDate));
        String checkOutDateTime = resultSet.getString("CHECK_OUT_DATE_TIME");
        itemObj.setCheckOutDateTime(convertDateFormat(checkOutDateTime));
        itemObj.setDamagedItemNote(resultSet.getString("ITEM_DAMAGED_NOTE"));
        if (resultSet.getString("ITEM_DAMAGED_STATUS") != null) {
          itemObj.setItemDamagedStatus(
              resultSet.getString("ITEM_DAMAGED_STATUS").equalsIgnoreCase("Y")
                  ? Boolean.TRUE
                  : Boolean.FALSE);
        }
        if (resultSet.getString("MISSING_PIECES") != null) {
          itemObj.setMissingPieceFlag(
              resultSet.getString("MISSING_PIECES").equalsIgnoreCase("Y")
                  ? Boolean.TRUE
                  : Boolean.FALSE);
        }
        itemObj.setMissingPiecesCount(resultSet.getString("MISSING_PIECES_COUNT"));
        itemObj.setMissingPieceFlagNote(resultSet.getString("MISSING_PIECES_NOTE"));
        itemObj.setMissingPieceEffectiveDate(resultSet.getString("MISSING_PIECES_EFFECTIVE_DATE"));
        itemObj.setNumberOfPieces(resultSet.getString("NUM_PIECES"));
        itemObj.setDescriptionOfPieces(resultSet.getString("DESC_OF_PIECES"));
        itemObj.setNumberOfRenew(resultSet.getInt("NUM_OF_RENEW"));
        highDensityStorageSet = new HashSet<>();
        itemNoteSet = new HashSet<>();
        statisticalSearchSet = new HashSet<>();
        donorNoteSet = new HashSet<>();

        ItemStatus itemStatus = new ItemStatus();
        if (itemStatusMap.containsKey(resultSet.getString("ITEM_STATUS_ID"))) {
          String[] strings = itemStatusMap.get(resultSet.getString("ITEM_STATUS_ID")).split("[|]");
          itemStatus.setCodeValue(strings[0]);
          itemStatus.setFullValue(strings[1]);
        }

        itemObj.setItemStatus(itemStatus);
        ItemType itemType = new ItemType();
        if (itemTypeMap.containsKey(resultSet.getString("ITEM_TYPE_ID"))) {
          String[] strings = itemTypeMap.get(resultSet.getString("ITEM_TYPE_ID")).split("[|]");
          itemType.setCodeValue(strings[0]);
          itemType.setFullValue(strings[1]);
        }
        itemObj.setItemType(itemType);
        ItemType tempItemType = new ItemType();
        if (itemTypeMap.containsKey(resultSet.getString("TEMP_ITEM_TYPE_ID"))) {
          String[] strings = itemTypeMap.get(resultSet.getString("TEMP_ITEM_TYPE_ID")).split("[|]");
          tempItemType.setCodeValue(strings[0]);
          tempItemType.setFullValue(strings[1]);
        }
        itemObj.setTemporaryItemType(tempItemType);
        item.setContentObject(itemObj);
        item.setCreatedBy(resultSet.getString("CREATED_BY"));
        item.setCreatedOn(resultSet.getString("DATE_CREATED"));
        if (resultSet.getString("STAFF_ONLY") != null) {
          item.setStaffOnly(
              (resultSet.getString("STAFF_ONLY").equalsIgnoreCase("Y")
                  ? Boolean.TRUE
                  : Boolean.FALSE));
        }
        item.setUpdatedBy(resultSet.getString("UPDATED_BY"));
        item.setUpdatedOn(resultSet.getString("DATE_UPDATED"));
        item.setLastUpdated(resultSet.getString("DATE_UPDATED"));
      }
      if (itemNoteSet.add(resultSet.getString("ITEM_NOTE_ID"))) {
        Note note = new Note();
        note.setValue(resultSet.getString("NOTE"));
        note.setType(resultSet.getString("TYPE"));
        itemObj.getNote().add(note);
      }
      if (resultSet.getString("STAT_SEARCH_CODE_ID") != null
          && statisticalSearchSet.add(resultSet.getString("STAT_SEARCH_CODE_ID"))) {
        String[] strings =
            statisticalSearchCodeMap.get(resultSet.getString("STAT_SEARCH_CODE_ID")).split("[|]");
        StatisticalSearchingCode statisticalSearchingCode = new StatisticalSearchingCode();
        statisticalSearchingCode.setCodeValue(strings[0]);
        statisticalSearchingCode.setFullValue(strings[1]);
        itemObj.getStatisticalSearchingCode().add(statisticalSearchingCode);
      }
      if (donorNoteSet.add(resultSet.getString("ITEM_DONOR_ID"))) {
        DonorInfo donorInfo = new DonorInfo();
        donorInfo.setDonorCode(resultSet.getString("DONOR_CODE"));
        donorInfo.setDonorNote(resultSet.getString("DONOR_NOTE"));
        donorInfo.setDonorPublicDisplay(resultSet.getString("DONOR_DISPLAY_NOTE"));
        itemObj.getDonorInfo().add(donorInfo);
      }
      if (highDensityStorageSet.add(resultSet.getString("ITEM_DONOR_ID"))) {
        HighDensityStorage highDensityStorage = new HighDensityStorage();
        highDensityStorage.setRow(resultSet.getString("HIGH_DENSITY_ROW"));
        itemObj.setHighDensityStorage(highDensityStorage);
      }
    }
    resultSet.close();
    return itemList;
  }
 public static ItemType viewTypeToItemType(int viewType) {
   if (viewType >= ItemType.values().length) {
     Log.e(LOGTAG, "No corresponding ItemType!");
   }
   return ItemType.values()[viewType];
 }
 public boolean isEnabled(ItemType type) {
   return type.isEnabled();
 }
 public void setEnabled(ItemType type, boolean enable) {
   type.setEnabled(enable);
   Bukkit.getLogger().info(this.Name + type.getName() + " Enabled...");
 }
 public static int itemTypeToViewType(ItemType itemType) {
   return itemType.ordinal();
 }
 public void removeLight(ItemType type, Player player) {
   type.deleteLightSource(player);
 }