/*
(non-Javadoc)

@see
javax.persistence.criteria.CriteriaBuilder#size(javax.persistence.criteria
.Expression)
505504
@Override
    public <C extends Collection<?>> Expression<Integer> size(Expression<C> arg0)
    {
        // TODO Auto-generated method stub
        return null;
    }
1250830
public int size() {
        int retval=0;
        for(int i=0; i < index; i++)
            if(messages[i] != null)
                retval++;
        return retval;
    }
609480
@Override
	public int getVariableSize()
	{
		int size = 0;
		for (MappedConst mc : con)
		{
			int m = max(mc.getInds());
			if (m > size) size = m;
		}
		return size + 1;
	}
150918
public void setPreferredCacheSize(long size) {
        int intSize = (int) size;
        activator.setCachePreferredMaxSize(intSize);
        wrapperManager.setWrapperCacheSize(2 * intSize);
    }
406551
public void setSize( String size, boolean isProperty ) {
        this.size = size;
        if (isProperty) {
            graphic.setSize(ff.property(size));
        } else {
            graphic.setSize(ff.literal(size));
        }
    }
987056
public static int estimatedSizeOf(Collection<QueryableEntry> result) {
        if (result instanceof AndResultSet) {
            return ((AndResultSet) result).estimatedSize();
        } else if (result instanceof OrResultSet) {
            return ((OrResultSet) result).estimatedSize();
        }
        return result.size();
    }
184837
@Override
    public int size() {
        /*
         * It is possible for a thread to be interrupted or reschedule between the read of the producer and
         * consumer indices, therefore protection is required to ensure size is within valid range. In the
         * event of concurrent polls/offers to this method the size is OVER estimated as we read consumer
         * index BEFORE the producer index.
         */
        long afterCIndex = lvConsumerIndex();
        while (true) {
            final long beforeCIndex = afterCIndex;
            final long currentProducerIndex = lvProducerIndex();
            afterCIndex = lvConsumerIndex();
            if (beforeCIndex == afterCIndex) {
                return (int) (currentProducerIndex - afterCIndex);
            }
        }
    }
1027804
@Override
	public long getSize() throws IOException {
		if (length < 0) {
			try {
				if (activeMethod != null) {
					length = activeMethod.getResponseContentLength();
				} else {
					acquireLength();
				}
			} catch (URISyntaxException e) {
				throw new IOException(e);
			}
		}
		return length;
	}
517749
public void setSize(org.kie.dmn.model.api.dmndi.Dimension value) {
        this.size = value;
    }
548372
public static void sizeToContents (JTable table)
    {
        TableModel model = table.getModel();
        TableColumn column = null;
        Component comp = null;
        int ccount = table.getColumnModel().getColumnCount(),
            rcount = model.getRowCount(), cellHeight = 0;

        for (int cc = 0; cc < ccount; cc++) {
            int headerWidth = 0, cellWidth = 0;
            column = table.getColumnModel().getColumn(cc);
            try {
                comp = column.getHeaderRenderer().getTableCellRendererComponent(
                    null, column.getHeaderValue(), false, false, 0, 0);
                headerWidth = comp.getPreferredSize().width;
            } catch (NullPointerException e) {
                // getHeaderRenderer() this doesn't work in 1.3
            }

            for (int rr = 0; rr < rcount; rr++) {
                Object cellValue = model.getValueAt(rr, cc);
                comp = table.getDefaultRenderer(model.getColumnClass(cc)).
                    getTableCellRendererComponent(table, cellValue, false, false, 0, cc);
                Dimension psize = comp.getPreferredSize();
                cellWidth = Math.max(psize.width, cellWidth);
                cellHeight = Math.max(psize.height, cellHeight);
            }
            column.setPreferredWidth(Math.max(headerWidth, cellWidth));
        }

        if (cellHeight > 0) {
            table.setRowHeight(cellHeight);
        }
    }
190088
@Override
	public int size() {

		if (allElementsInCache) {
			return orderedCache.size();
		} else {
			int count = 0;
			try (final RocksBytesIterator iterator = orderedBytesIterator()) {
				while (iterator.hasNext()) {
					iterator.next();
					++count;
				}
			}
			return count;
		}
	}
866436
public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) {
        if (!validateSimpleExpression()) {
            throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" +
                    propertyName + "] and size [" + size + "] not allowed here."));
        }

        propertyName = calculatePropertyName(propertyName);
        addToCriteria(Restrictions.sizeEq(propertyName, size));
        return this;
    }
481432
@Override
    public int size ()
    {
        // dumb implementation. You should override.
        int size = 0;
        for (Interator it = interator(); (size < Integer.MAX_VALUE) && it.hasNext(); it.nextInt()) {
            size++;
        }
        return size;
    }
344875
private static int computeFieldSize(AttributeValue value) throws DBaseFileException, AttributeException {
		final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
		return dbftype.getFieldSize(value.getString());
	}
916018
public NumberExpression<Integer> length() {
        if (length == null) {
            length = Expressions.numberOperation(Integer.class, Ops.STRING_LENGTH, mixin);
        }
        return length;
    }
78330
public static int size(DataBuffer buffer, int dimension) {
        int rank = rank(buffer);
        if (dimension >= rank)
            throw new IllegalArgumentException("Invalid dimension " + dimension + " for rank " + rank + " array");
        return buffer.getInt(1 + dimension);
    }
719019
public long size(Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "size",
                        new Object[] { transaction });

        long listLength; // For return;

        synchronized (this) {
            synchronized (availableSizeLock) {
                listLength = availableSize;
            } // synchronized (availableSizeLock).

            if (transaction != null) {
                Token nextToken = head;
                // Add links ToBeAdded within the transaction.
                while (nextToken != null) {
                    Link nextLink = (Link) nextToken.getManagedObject();
                    if (nextLink.state == Link.stateToBeAdded
                        && nextLink.lockedBy(transaction))
                        listLength++;
                    nextToken = nextLink.next;
                } // while (nextToken != null).
            } // if (transaction != null)
        } // synchronized (this).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "size",
                       "returns listLength=" + listLength + "(long)");
        return listLength;
    }