Example usage for java.lang Character Character

List of usage examples for java.lang Character Character

Introduction

In this page you can find the example usage for java.lang Character Character.

Prototype

@Deprecated(since = "9")
public Character(char value) 

Source Link

Document

Constructs a newly allocated Character object that represents the specified char value.

Usage

From source file:com.pagecrumb.proxy.wrapper.StringOutputStream.java

@Override
public void write(int b) throws IOException {
    sb.append((char) b);
    Character c = new Character((char) b);
    //log.debug(c.toString());
    //log.debug(sb.toString()); // progressive logging
}

From source file:com.redhat.rhn.domain.monitoring.notification.Criteria.java

/**
 * @return Returns the inverted./*from   w  ww  . j  av a  2s . co m*/
 */
private boolean isInverted() {
    return !new Character('0').equals(inverted);
}

From source file:com.sun.faces.application.ResetUniqueRequestIdBean.java

public String getReset() {
    FacesContext context = FacesContext.getCurrentInstance();
    LRUMap lruMap = new LRUMap(15);
    context.getExternalContext().getSessionMap().put(RIConstants.LOGICAL_VIEW_MAP, lruMap);
    StateManagerImpl stateManagerImpl = (StateManagerImpl) context.getApplication().getStateManager();
    setPrivateField("requestIdSerial", StateManagerImpl.class, stateManagerImpl, new Character((char) -1));

    return reset;
}

From source file:com.redhat.rhn.common.util.CharacterMap.java

/**
* Add charIn and intIn to the map./* www .  j a v  a 2s.  co m*/
* @param charIn Character to add
* @param intIn Integer to add
*/
public void put(char charIn, int intIn) {
    innerMap.put(new Character(charIn), new Integer(intIn));
}

From source file:Main.java

/**
 * <p>Converts an array of primitive chars to objects.</p>
 *
 * <p>This method returns <code>null</code> for a <code>null</code> input array.</p>
 *
 * @param array a <code>char</code> array
 * @return a <code>Character</code> array, <code>null</code> if null array input
 *///from w  w  w  .j  a  v a2  s  .  c om
public static Character[] toObject(char[] array) {
    if (array == null) {
        return null;
    } else if (array.length == 0) {
        return EMPTY_CHARACTER_OBJECT_ARRAY;
    }
    final Character[] result = new Character[array.length];
    for (int i = 0; i < array.length; i++) {
        result[i] = new Character(array[i]);
    }
    return result;
}

From source file:org.joda.primitives.iterator.impl.TestArrayCharIterator.java

@Override
public Iterator<Character> makeFullIterator() {
    char[] data = new char[] { new Character((char) 2), new Character('a'), new Character('@'),
            new Character('Z'), new Character((char) 5000), new Character((char) 202),
            new Character(Character.MIN_VALUE), new Character(Character.MAX_VALUE) };
    return new ArrayCharIterator(data);
}

From source file:org.edc.sstone.text.Alphabet.java

private void mapLetters(String keys, String values) {
    char k, v;/*from  w ww.j  av  a2 s.c  o  m*/
    for (int i = 0; i < keys.length(); i++) {
        k = keys.charAt(i);
        v = values.charAt(i);
        letterMap.put((int) k, new Character(v));
    }
}

From source file:org.osaf.cosmo.eim.json.JsonStreamReaderTest.java

public void testReadUnicode() throws Exception {
    Reader in = testHelper.getReader("json/unicode-record-set.json");
    JsonStreamReader reader = new JsonStreamReader(in);
    EimRecordSet recordSet = reader.nextRecordSet();
    EimRecord record = recordSet.getRecords().get(0);

    String unicode = "";
    String unicodeResult = ((TextField) record.getFields().get(0)).getText();

    for (int x = 0; x < unicode.length(); x++) {
        Character j = new Character(unicode.charAt(x));
        Character s = new Character(unicodeResult.charAt(x));
        assertEquals(j, s);//from   ww w. j a v a 2s. c o m
    }
    assertEquals(unicode, unicodeResult);
}

From source file:net.sf.dynamicreports.report.builder.datatype.CharacterType.java

@Override
public Character stringToValue(String value, Locale locale) throws DRException {
    if (StringUtils.isNotEmpty(value)) {
        return new Character(value.charAt(0));
    }/*from   w w w.  ja  v  a2s . c  o  m*/
    return null;
}

From source file:Main.java

/**
 * <p>Inserts the specified element at the specified position in the array. 
 * Shifts the element currently at that position (if any) and any subsequent
 * elements to the right (adds one to their indices).</p>
 *
 * <p>This method returns a new array with the same elements of the input
 * array plus the given element on the specified position. The component 
 * type of the returned array is always the same as that of the input 
 * array.</p>/*from w w  w  . ja  va  2s . c  o m*/
 *
 * <p>If the input array is <code>null</code>, a new one element array is returned
 *  whose component type is the same as the element.</p>
 * 
 * <pre>
 * ArrayUtils.add(null, 0, 'a')            = ['a']
 * ArrayUtils.add(['a'], 0, 'b')           = ['b', 'a']
 * ArrayUtils.add(['a', 'b'], 0, 'c')      = ['c', 'a', 'b']
 * ArrayUtils.add(['a', 'b'], 1, 'k')      = ['a', 'k', 'b']
 * ArrayUtils.add(['a', 'b', 'c'], 1, 't') = ['a', 't', 'b', 'c']
 * </pre>
 * 
 * @param array  the array to add the element to, may be <code>null</code>
 * @param index  the position of the new object
 * @param element  the object to add
 * @return A new array containing the existing elements and the new element
 * @throws IndexOutOfBoundsException if the index is out of range 
 * (index < 0 || index > array.length).
 */
public static char[] add(char[] array, int index, char element) {
    return (char[]) add(array, index, new Character(element), Character.TYPE);
}