Example usage for java.lang Character MIN_VALUE

List of usage examples for java.lang Character MIN_VALUE

Introduction

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

Prototype

char MIN_VALUE

To view the source code for java.lang Character MIN_VALUE.

Click Source Link

Document

The constant value of this field is the smallest value of type char , '\u005Cu0000' .

Usage

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.LINE_SEPARATOR == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }/*w w  w .j a  v a 2  s. c o m*/
    }
}

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.START_PUNCTUATION == Character.getType(ch)) {

            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from w ww. ja v a 2s.  co  m
    }
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println((int) Character.MIN_VALUE);
    System.out.println((int) Character.MAX_VALUE);
}

From source file:Main.java

public static void main(String[] args) {
    String s = String.format("\\u%04x", (int) Character.MIN_VALUE);
    System.out.println(s);/*w w  w .  j  av  a 2  s  .c  o m*/

}

From source file:com.taobao.tdhs.jdbc.util.StringUtil.java

public static int indexOfIgnoreCaseRespectMarker(int startAt, String src, String target, String marker,
        String markerCloses, boolean allowBackslashEscapes) {
    char contextMarker = Character.MIN_VALUE;
    boolean escaped = false;
    int markerTypeFound = 0;
    int srcLength = src.length();
    int ind = 0;/*from   w  w w. j  a va 2  s .co  m*/

    for (int i = startAt; i < srcLength; i++) {
        char c = src.charAt(i);

        if (allowBackslashEscapes && c == '\\') {
            escaped = !escaped;
        } else if (contextMarker != Character.MIN_VALUE && c == markerCloses.charAt(markerTypeFound)
                && !escaped) {
            contextMarker = Character.MIN_VALUE;
        } else if ((ind = marker.indexOf(c)) != -1 && !escaped && contextMarker == Character.MIN_VALUE) {
            markerTypeFound = ind;
            contextMarker = c;
        } else if ((Character.toUpperCase(c) == Character.toUpperCase(target.charAt(0))
                || Character.toLowerCase(c) == Character.toLowerCase(target.charAt(0))) && !escaped
                && contextMarker == Character.MIN_VALUE) {
            if (startsWithIgnoreCase(src, i, target))
                return i;
        }
    }
    return -1;
}

From source file:net.jofm.format.Format.java

public Format(Pad pad, char padWith, int length, String format) {
    if (pad == Pad.DEFAULT) {
        this.pad = DEFAULT_PAD;
    } else {//from ww w. j  a v  a 2  s.  c o m
        this.pad = pad;
    }

    if (padWith == Character.MIN_VALUE) {
        this.padWith = DEFAULT_PADWITH;
    } else {
        this.padWith = padWith;
    }

    this.length = length;
    this.format = format;
}

From source file:BlogRocksteady2.bean.NewPostBean.java

public String createPost() {

    Post newPost = new Post();
    newPost.setMvpost(Character.MIN_VALUE);
    newPost.setPostContent(content);//from w  w w  .  j  a  va 2s. c o m

    if (headerImage != null) {
        InputStream is;
        try {
            is = headerImage.getInputStream();
            byte[] img = IOUtils.toByteArray(is);
            newPost.setHeaderImage(img);
        } catch (IOException ex) {
            Logger.getLogger(NewPostBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    newPost.setTitle(title);
    newPost.setPostGps(latitude + "," + longitude);
    newPost.setPostedBy(loginBean.getUsuario());
    newPost.setPostDate(Calendar.getInstance().getTime());
    postFacade.create(newPost);

    return "blog.xhtml?faces-redirect=true";
}

From source file:com.questdb.net.http.handlers.QueryHandlerSmallBufferTest.java

@Test(expected = MalformedChunkCodingException.class)
public void testColumnValueTooLargeForBuffer() throws Exception {
    StringBuilder allChars = new StringBuilder();
    for (char c = Character.MIN_VALUE; c < 0xD800; c++) { //
        allChars.append(c);/*from w  w  w  .ja  v  a 2 s . co m*/
    }

    String allCharString = allChars.toString();
    QueryHandlerTest.generateJournal("xyz", allCharString, 1.900232E-10, 2.598E20, Long.MAX_VALUE,
            Integer.MIN_VALUE, new Timestamp(-102023));
    String query = "select x, id from xyz \n limit 1";
    QueryHandlerTest.download(query, temp);
}

From source file:jp.furplag.util.commons.ObjectUtilsTest.java

@Test
public void testNewInstanceClassOfT() {
    try {/*from   www  .j a v a 2 s .  c  o m*/
        assertFalse("primitive : boolean", newInstance(boolean.class));
        assertTrue("primitive : byte", 0 == newInstance(byte.class));
        assertTrue("primitive : char", Character.MIN_VALUE == newInstance(char.class));
        assertTrue("primitive : double", 0d == newInstance(double.class));
        assertTrue("primitive : float", 0f == newInstance(float.class));
        assertTrue("primitive : int", 0 == newInstance(int.class));
        assertTrue("primitive : long", 0L == newInstance(long.class));
        assertTrue("primitive : short", 0 == newInstance(short.class));
        assertEquals("primitive : void", null, newInstance(void.class));

        assertArrayEquals("primitive array", new int[] {}, newInstance(int[].class));
        assertEquals("primitive wrapper", null, newInstance(Long.class));
        assertEquals("object", new EntityOfTest(), newInstance(EntityOfTest.class));
        assertArrayEquals("array", new String[] {}, newInstance(String[].class));

        assertEquals("interface", new ArrayList<Object>(), newInstance(List.class));
    } catch (Exception e) {
        fail(e.getMessage());
    }

    try {
        newInstance(InterfaceOfTest.class);
        fail("Interface");
    } catch (Exception e) {
    }
    try {
        newInstance(AbstractEntityOfTest.class);
        fail("Abstract");
    } catch (Exception e) {
    }
}

From source file:jp.furplag.util.commons.ObjectUtils.java

/**
 * substitute for {@link java.lang.Class#newInstance()}.
 *
 * @param type the Class object, return false if null.
 * @return empty instance of specified {@link java.lang.Class}.
 * @throws IllegalArgumentException//w ww .j a va2  s.c  o  m
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws InvocationTargetException
 * @throws ClassNotFoundException
 * @throws NegativeArraySizeException
 */
@SuppressWarnings("unchecked")
public static <T> T newInstance(final Class<T> type) throws InstantiationException {
    if (type == null)
        return null;
    if (type.isArray())
        return (T) Array.newInstance(type.getComponentType(), 0);
    if (Void.class.equals(ClassUtils.primitiveToWrapper(type))) {
        try {
            Constructor<Void> c = Void.class.getDeclaredConstructor();
            c.setAccessible(true);

            return (T) c.newInstance();
        } catch (SecurityException e) {
        } catch (NoSuchMethodException e) {
        } catch (InvocationTargetException e) {
        } catch (IllegalAccessException e) {
        }

        return null;
    }

    if (type.isInterface()) {
        if (!Collection.class.isAssignableFrom(type))
            throw new InstantiationException(
                    "could not create instance, the type \"" + type.getName() + "\" is an interface.");
        if (List.class.isAssignableFrom(type))
            return (T) Lists.newArrayList();
        if (Map.class.isAssignableFrom(type))
            return (T) Maps.newHashMap();
        if (Set.class.isAssignableFrom(type))
            return (T) Sets.newHashSet();
    }

    if (type.isPrimitive()) {
        if (boolean.class.equals(type))
            return (T) Boolean.FALSE;
        if (char.class.equals(type))
            return (T) Character.valueOf(Character.MIN_VALUE);

        return (T) NumberUtils.valueOf("0", (Class<? extends Number>) type);
    }
    if (ClassUtils.isPrimitiveOrWrapper(type))
        return null;
    if (Modifier.isAbstract(type.getModifiers()))
        throw new InstantiationException(
                "could not create instance, the type \"" + type.getName() + "\" is an abstract class.");

    try {
        Constructor<?> c = type.getDeclaredConstructor();
        c.setAccessible(true);

        return (T) c.newInstance();
    } catch (SecurityException e) {
    } catch (NoSuchMethodException e) {
    } catch (InvocationTargetException e) {
    } catch (IllegalAccessException e) {
    }

    throw new InstantiationException("could not create instance, the default constructor of \"" + type.getName()
            + "()\" is not accessible ( or undefined ).");
}