001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.text.feed; 020 021public class El { 022 023 public static short QUANTITY_0_1=0; 024 public static short QUANTITY_0_N=4; 025 public static short QUANTITY_1=8; 026 public static short QUANTITY_1_N=16; 027 public static final short QUANTITY_AUTO = QUANTITY_0_1; 028 029 private Attr[] attrs; 030 private short quantity; 031 private boolean hasChildren; 032 033 034 public El(short quantity,Attr[] attrs,boolean hasChildren) { 035 this.quantity=quantity; 036 this.attrs=attrs; 037 this.hasChildren=hasChildren; 038 } 039 040 public El(short quantity,Attr[] attrs) { 041 this(quantity,attrs,false); 042 } 043 044 public El(short quantity,Attr attr,boolean hasChildren) { 045 this(quantity,new Attr[]{attr},hasChildren); 046 } 047 048 public El(short quantity,Attr attr) { 049 this(quantity,new Attr[]{attr}); 050 } 051 052 public El(short quantity,boolean hasChildren) { 053 this(quantity, (Attr[])null,hasChildren); 054 } 055 public El(short quantity) { 056 this(quantity, (Attr[])null); 057 } 058 059 /** 060 * @return the hasChildren 061 */ 062 public boolean isHasChildren() { 063 return hasChildren; 064 } 065 066 /** 067 * @return the attrs 068 */ 069 public Attr[] getAttrs() { 070 return attrs; 071 } 072 /** 073 * @return the quantity 074 */ 075 public short getQuantity() { 076 return quantity; 077 } 078 public boolean isQuantity(short quantity) { 079 return this.quantity==quantity; 080 } 081 082}