易截截图软件、单文件、免安装、纯绿色、仅160KB

the org.apache.log4j.PatternLayout java doc


A flexible layout configurable with pattern string.
The goal of this class is to format

a LoggingEvent

and return the results as a String. The results depend on the conversion
pattern
.
The conversion pattern is closely related to the conversion pattern of the
printf function in C. A conversion pattern is composed of literal text and
format control expressions called conversion specifiers
.
You are free to insert any literal text within the conversion pattern.

Each conversion specifier starts with a percent sign (%) and is followed by
optional format modifiers
and a conversion character
. The
conversion character specifies the type of data, e.g. category, priority, date,
thread name. The format modifiers control such things as field width, padding,
left and right justification. The following is a simple example.
Let the conversion pattern be "%-5p [%t]: %m%n"
and assume that the
log4j environment was set to use a PatternLayout. Then the statements
Category root = Category.getRoot();
root.debug("Message 1");
root.warn("Message 2");

would yield the output
DEBUG [main]: Message 1
WARN [main]: Message 2

Note that there is no explicit separator between text and conversion
specifiers. The pattern parser knows when it has reached the end of a conversion
specifier when it reads a conversion character. In the example above the
conversion specifier %-5p
means the priority of the logging event should
be left justified to a width of five characters. The recognized conversion
characters are
Conversion Character
Effect
c
Used to output the category of the logging event. The category conversion
specifier can be optionally followed by precision specifier
, that is a
decimal constant in brackets.
If a precision specifier is given, then only the corresponding number of
right most components of the category name will be printed. By default the
catego


相关文档:

JAVA截屏程序(第二版)

摘自:千里冰封
/*
 * CaptureScreen.java
 *
 * Created on 2007年8月30日, 下午12:46
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package hadeslee.swing;
/**
 *
 * @author lbf
 * ......

JAVA笔记(二)

在类中定义的方法在返回值前加上static修饰符就可以在main方法中调用了。如果不用static那就需要在main方法中创建对象,使用对象来调用对象的方法。
public class Test{
 public static void main(String[] args){
  Test t=new Test();
  int b=1;
  int c=2;
  int[] ......

JAVA笔记(三)

面向对象的思想
anything is Object(万物皆对象)
抽象,从对具体的对象中抽取有用信息。
对象有其固有属性,对象的方法,即对象的行为(对象能做什么)
对象本身是简单的(功能简单),多个对象可以组成复杂的系统(对象之间彼此调用对方的方法)
对象应当是各司其职(功能简单),各尽所能(把自己的功能作到最好) ......

java设计模式 策略模式

定义:定义了算法族,分别封装起来,让它们之间可以互相替换,此模式让算法的变化独立于使用算法的客户。
适用性
许多相关的类仅仅是行为有异。“策略”提供了一种用多个行为中的一个行为来配置一个类的算法。
需要使用一个算法的不同变体。例如,你可能会定义一些反映不容的空间/时间权衡的算法。当这些变体实 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号