Search in sources :

Example 11 with Integer

use of java.lang.Integer in project geode by apache.

the class TypeRegistry method defineType.

/**
   * Create a type id for a type that may come locally, or from a remote member.
   */
public int defineType(PdxType newType) {
    Integer existingId = this.typeToId.get(newType);
    if (existingId != null) {
        int eid = existingId;
        newType.setTypeId(eid);
        return eid;
    }
    int id = this.distributedTypeRegistry.defineType(newType);
    newType.setTypeId(id);
    PdxType oldType = this.idToType.get(id);
    if (oldType == null) {
        this.idToType.put(id, newType);
        this.typeToId.put(newType, id);
        if (logger.isInfoEnabled()) {
            logger.info("Caching {}", newType.toFormattedString());
        }
    } else if (!oldType.equals(newType)) {
        Assert.fail("Old type does not equal new type for the same id. oldType=" + oldType + " new type=" + newType);
    }
    return id;
}
Also used : Integer(java.lang.Integer)

Example 12 with Integer

use of java.lang.Integer in project intellij-community by JetBrains.

the class A method test.

void test() {
    Integer integer = null;
    int i = integer.to < caret > String().length();
}
Also used : Integer(java.lang.Integer)

Example 13 with Integer

use of java.lang.Integer in project intellij-community by JetBrains.

the class X method m.

void m() {
    Integer i1 = new Integer(0);
    Integer i2 = new Integer(2);
    boolean b = i1.equals(i2);
}
Also used : Integer(java.lang.Integer)

Example 14 with Integer

use of java.lang.Integer in project commoncrawl-examples by commoncrawl.

the class ArcRecord method setArcRecordHeader.

/**
   * <p>Parses and sets the ARC record header fields.</p>
   * <p>Currently, this method expects the ARC record header string to contain
   * the following fields, in order, separated by space:
   * <ul>
   * <li>URL</li>
   * <li>IP Address</li>
   * <li>Archive Date</li>
   * <li>Content Type</li>
   * <li>Content Length</li>
   * </ul>
   * </p>
   * <p>For more information on the arc file format, see
   * {@link http://www.archive.org/web/researcher/ArcFileFormat.php}.</p>
   *
   * @param arcRecordHeader The first line of an ARC file entry - the header
   *                        line for an ARC file item.
   */
public void setArcRecordHeader(String arcRecordHeader) throws IllegalArgumentException, ParseException {
    if (arcRecordHeader == null || arcRecordHeader.equals(""))
        throw new IllegalArgumentException("ARC v1 record header string is empty.");
    String[] metadata = arcRecordHeader.split(" ");
    if (metadata.length != 5) {
        LOG.info(" [ " + arcRecordHeader + " ] ");
        throw new IllegalArgumentException("ARC v1 record header must be 5 fields.");
    }
    SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
    this._url = metadata[0];
    this._ipAddress = metadata[1];
    this._archiveDate = format.parse(metadata[2]);
    this._contentType = metadata[3];
    this._contentLength = (new Integer(metadata[4])).intValue();
}
Also used : Integer(java.lang.Integer) SimpleDateFormat(java.text.SimpleDateFormat) IllegalArgumentException(java.lang.IllegalArgumentException)

Example 15 with Integer

use of java.lang.Integer in project storio by pushtorefresh.

the class BoxedTypesMethodsConstructorIgnoreNullStorIOContentResolverGetResolver method mapFromCursor.

/**
     * {@inheritDoc}
     */
@Override
@NonNull
public BoxedTypesMethodsConstructorIgnoreNull mapFromCursor(@NonNull Cursor cursor) {
    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }
    BoxedTypesMethodsConstructorIgnoreNull object = new BoxedTypesMethodsConstructorIgnoreNull(field1, field2, field3, field4, field5, field6);
    return object;
}
Also used : Integer(java.lang.Integer) Float(java.lang.Float) Long(java.lang.Long) Boolean(java.lang.Boolean) Double(java.lang.Double) Short(java.lang.Short) NonNull(android.support.annotation.NonNull) Override(java.lang.Override)

Aggregations

Integer (java.lang.Integer)19 Double (java.lang.Double)9 Float (java.lang.Float)9 Override (java.lang.Override)9 Short (java.lang.Short)9 NonNull (android.support.annotation.NonNull)8 Boolean (java.lang.Boolean)8 Long (java.lang.Long)8 ArrayList (java.util.ArrayList)2 List (java.util.List)2 IllegalArgumentException (java.lang.IllegalArgumentException)1 String (java.lang.String)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayDeque (java.util.ArrayDeque)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1