📄 filteritem.java
字号:
/* * The contents of this file are subject to the Dyade Public License, * as defined by the file DYADE_PUBLIC_LICENSE.TXT * * You may not use this file except in compliance with the License. You may * obtain a copy of the License on the Dyade web site (www.dyade.fr). * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific terms governing rights and limitations under the License. * * The Original Code is CmisJava API, including the java package * fr.dyade.cmis, released September 5, 2000. * * The Initial Developer of the Original Code is Dyade. The Original Code and * portions created by Dyade are Copyright Bull and Copyright INRIA. * All Rights Reserved. *//* Copyright 1996-2000 by Institut National de Recherche en Informatique * et en Automatique (INRIA) * All rights reserved. See COPYRIGHT in top-level directory. * * Authors: Laurent Andrey, Eric Dillon, Olivier Festor */// CVS Info//---------------------------------------------------------------------------////// $Id: FilterItem.java,v 1.2 2000/09/05 13:30:40 festor Exp $// $Source: /local/resedas/CVS-Repository/CmisJavaApi/src/fr/dyade/cmis/api/types/FilterItem.java,v $//---------------------------------------------------------------------------//// Todo//---------------------------------------------------------------------------//// Add true derived classes ?package fr.dyade.cmis.api.types;/** * Java representation for the ASN.1 FilterItem datatype. * <p> * The implementation follows the implementation of the ISMc_filter_item as * described in the Open Master C-fmkapi. * <p> * We provide several constants (ie. static constructors) to build a <code>FilterItem</code> that will be used within a <code>Filter</code> Object. * <menu> * <li> <a href="#EQUALITY">EQUALITY</a>, * <li> <a href="#GREATEROREQUAL">GREATEROREQUAL</a>, * <li> <a href="#LESSOREQUAL">LESSOREQUAL</a>, * <li> <a href="#SUBSETOF">SUBSETOF</a>, * <li> <a href="#SUPERSETOF">SUPERSETOF</a>, * <li> <a href="#NONNULLSETINTERSECTION">NONNULLSETINTERSECTION</a>, * <li> <a href="#PRESENT">PRESENT</a>, * <li> <a href="#SUBSTRINGS">SUBSTRINGS</a>. * </menu> * Each of these static constructors may be used as follows:<br> * <code>FilterItem myFilterItem = FilterItem.PRESENT(myAttributeId);</code><br> * * @see fr.dyade.cmis.api.types.FilterItem * @version cvs $Id: FilterItem.java,v 1.2 2000/09/05 13:30:40 festor Exp $ */public class FilterItem extends CMISType { // The codes used to forward to the fmkapi through the JNI. // These codes are the ASN1 tags of the X711 CMISFilterItem definition (pg 23) private static final short EQUALITY_CODE = 0; private static final short SUBSTRINGS_CODE = 1; private static final short GREATEROREQUAL_CODE = 2; private static final short LESSOREQUAL_CODE = 3; private static final short PRESENT_CODE = 4; private static final short SUBSETOF_CODE = 5; private static final short SUPERSETOF_CODE = 6; private static final short NONNULLSETINTERSECTION_CODE = 7; /** Basic constructor. * Reserved for JNI c mapper. That must carefully fulfill the created object. */ private FilterItem() { } private FilterItem( short pCode, Attribute pAttribute) { fT = pCode; fAttribute = pAttribute; } private FilterItem( short pCode, SubStrings pSubStrings) { fT = pCode; fSubStrings = pSubStrings; } private FilterItem( short pCode, AttributeId pAttributeId) { fT = pCode; fAttributeId = pAttributeId; } /** * Creates a instance of a "EQUALITY" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "EQUALITY" */ public static final FilterItem EQUALITY(Attribute pAttribute) { return (new FilterItem(EQUALITY_CODE, pAttribute)); } /** * Creates a instance of a "GREATEROREQUAL" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "GREATEROREQUAL" */ public static final FilterItem GREATEROREQUAL(Attribute pAttribute) { return (new FilterItem(GREATEROREQUAL_CODE, pAttribute)); } /** * Creates a instance of a "LESSOREQUAL" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "LESSOREQUAL" */ public static final FilterItem LESSOREQUAL(Attribute pAttribute) { return (new FilterItem(LESSOREQUAL_CODE, pAttribute)); } /** * Creates a instance of a "SUBSETOF" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "SUBSETOF" */ public static final FilterItem SUBSETOF(Attribute pAttribute) { return (new FilterItem(SUBSETOF_CODE, pAttribute)); } /** * Creates a instance of a "SUPERSETOF" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "SUPERSETOF" */ public static final FilterItem SUPERSETOF(Attribute pAttribute) { return (new FilterItem(SUPERSETOF_CODE, pAttribute)); } /** * Creates a instance of a "NONNULLSETINTERSECTION" <code>FilterItem</code> with the corresponding <code>Attribute</code> * @param pAttribute The <code>Attribute</code> to use for "NONNULLSETINTERSECTION" */ public static final FilterItem NONNULLSETINTERSECTION(Attribute pAttribute) { return (new FilterItem(NONNULLSETINTERSECTION_CODE, pAttribute)); } /** * Creates a instance of a "PRESENT" <code>FilterItem</code> with the corresponding <code>AttributeId</code> * @param pAttributeId The <code>AttributeId</code> to use for "PRESENT" */ public static final FilterItem PRESENT(AttributeId pAttributeId) { return (new FilterItem(PRESENT_CODE, pAttributeId)); } /** * Creates a instance of a "SUBSTRINGS" <code>FilterItem</code> with the corresponding <code>SubStrings</code> * @param pSubStrings The <code>SubStrings</code> to use for "SUBSTRINGS" */ public static final FilterItem SUBSTRINGS(SubStrings pSubStrings) { return (new FilterItem(SUBSTRINGS_CODE, pSubStrings)); } /** * Returns the <code>Attribute</code> defined for the EQUALITY, GREATEROREQUAL, LESSOREQUAL, SUBSETOF, SUPERSETOF, NONNULLSETINTERSECTION <code>FilterItem</code> * @return the <code>Attribute</code> used for the <code>FilterItem</code> */ public Attribute getAttribute() { return fAttribute; } /** * Returns the <code>SubString</code> defined for SUBSTRINGS <code>FilterItem</code> * @return the <code>SubStrings</code> used for the <code>FilterItem</code> */ public SubStrings getSubStrings() { return fSubStrings; } /** * Returns the <code>AttributeId</code> defined for PRESENT <code>FilterItem</code> * @return the <code>AttributeId</code> used for the <code>FilterItem</code> */ public AttributeId getAttributeId() { return fAttributeId; } public String toString() { switch (fT) { case EQUALITY_CODE: return "<EQUALITY " + fAttribute.toString() +">"; case SUBSTRINGS_CODE: return "<SUBSTRINGS " + fSubStrings.toString() +">"; case GREATEROREQUAL_CODE: return "<GREATEROREQUAL "+ fAttribute.toString() +">"; case LESSOREQUAL_CODE: return "<LESSOREQUAL "+ fAttribute.toString() +">"; case PRESENT_CODE: return "<PRESENT "+ fAttributeId.toString() +">"; case SUBSETOF_CODE: return "<SUBSETOF "+ fAttribute.toString() +">"; case SUPERSETOF_CODE: return "<SUPERSETOF "+ fAttribute.toString() +">"; case NONNULLSETINTERSECTION_CODE: return "<NONNULLSETINTERSECTION "+fAttribute.toString() +">"; default: return "<BAD FILTER_ITEM CODE>"; } } private Attribute fAttribute; private SubStrings fSubStrings; private AttributeId fAttributeId; // added for performance purpose through JNI private short fT; } // FilterItem
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -