本文整理汇总了Java中javax.swing.text.html.parser.Entity类的典型用法代码示例。如果您正苦于以下问题:Java Entity类的具体用法?Java Entity怎么用?Java Entity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Entity类属于javax.swing.text.html.parser包,在下文中一共展示了Entity类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defEntity
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
/**
* Creates, adds into the internal table and returns the
* character entity like <code>&lt;</code>
* (means '<code><</code>' );
* This method inactivates the recursive refenrences to the same
* entity.
* @param name The entity name (without heading & and closing ;)
* @param type The entity type
* @param character The entity value (single character)
* @return The created entity
*/
public Entity defEntity(String name, int type, String data)
{
int r;
String eref = "%" + name + ";";
do
{
r = data.indexOf(eref);
if (r > 0)
{
data = data.substring(0, r) + data.substring(r + 1);
}
}
while (r > 0);
return super.defEntity(name, type, data);
}
示例2: overlaps
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public final boolean overlaps( final com.artemis.Entity a, int x, int y)
{
final Bounds b1 = bm.getSafe(a);
final Pos p1 = pm.getSafe(a);
if ( b1==null || p1 ==null)
return false;
final float minx = p1.x + b1.minx;
final float miny = p1.y + b1.miny;
final float maxx = p1.x + b1.maxx;
final float maxy = p1.y + b1.maxy;
final float bminx = x;
final float bminy = y;
final float bmaxx = x + 1;
final float bmaxy = y + 1;
return
!(minx > bmaxx || maxx < bminx ||
miny > bmaxy || maxy < bminy );
}
示例3: resolveNamedEntity
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
/**
* Return string, corresponding the given named entity. The name is passed
* with the preceeding &, but without the ending semicolon.
*/
protected String resolveNamedEntity(final String a_tag)
{
// Discard &
if (!a_tag.startsWith("&"))
throw new AssertionError("Named entity " + a_tag +
" must start witn '&'."
);
String tag = a_tag.substring(1);
try
{
Entity entity = dtd.getEntity(tag);
if (entity != null)
return entity.getString();
entity = dtd.getEntity(tag.toLowerCase());
if (entity != null)
{
error("The name of this entity should be in lowercase", a_tag);
return entity.getString();
}
}
catch (IndexOutOfBoundsException ibx)
{
/* The error will be reported. */
}
error("Unknown named entity", a_tag);
return a_tag;
}
示例4: blockaded
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
/** Check if screen coordinates are blockaded. */
public boolean blockaded(int x, int y, Team team) {
for (com.artemis.Entity entity : getActives()) {
if ( !mBlockade.get(entity).passableBy.contains(team) && overlaps(entity, x, y) ) {
// blockades can be passable by teams.
return true;
}
}
return false;
}
示例5: getEntity
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
private String getEntity(final char ch) {
boolean useName = ch == '<' || ch == '>' || ch == '&' || ch == '"';
Entity entity = (Entity)getDTD().entityHash.get(new Integer(ch));
if (entity == null) {
return null;
} else if (useName) {
return "&" + entity.getName() + ";";
} else {
return "&#" + Integer.toString(ch) + ";";
}
}
示例6: testName2type
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public void testName2type()
{
assertEquals("PUBLIC", Entity.name2type("PUBLIC"), DTDConstants.PUBLIC);
assertEquals("SDATA", Entity.name2type("SDATA"), DTDConstants.SDATA);
assertEquals("PI", Entity.name2type("PI"), DTDConstants.PI);
assertEquals("STARTTAG", Entity.name2type("STARTTAG"), DTDConstants.STARTTAG);
assertEquals("ENDTAG", Entity.name2type("ENDTAG"), DTDConstants.ENDTAG);
assertEquals("MS", Entity.name2type("MS"), DTDConstants.MS);
assertEquals("MD", Entity.name2type("MD"), DTDConstants.MD);
assertEquals("SYSTEM", Entity.name2type("SYSTEM"), DTDConstants.SYSTEM);
assertEquals("surely unknown ", Entity.name2type("audrius"),
DTDConstants.CDATA
);
}
示例7: testPublicSystemGeneralParameter
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public void testPublicSystemGeneralParameter()
{
int[] pu_sy = new int[] { DTDConstants.PUBLIC, DTDConstants.SYSTEM, 0 };
int[] gen_par =
new int[] { DTDConstants.GENERAL, DTDConstants.PARAMETER, 0 };
for (int ps = 0; ps < pu_sy.length; ps++)
{
for (int gp = 0; gp < gen_par.length; gp++)
{
Entity e = new Entity(null, 0, null);
e.type = pu_sy [ ps ] | gen_par [ gp ];
assertEquals(e.isGeneral(), gen_par [ gp ] == DTDConstants.GENERAL);
assertEquals(e.isParameter(),
gen_par [ gp ] == DTDConstants.PARAMETER
);
assertEquals((e.type & DTDConstants.SYSTEM) != 0,
pu_sy [ ps ] == DTDConstants.SYSTEM
);
assertEquals((e.type & DTDConstants.PUBLIC) != 0,
pu_sy [ ps ] == DTDConstants.PUBLIC
);
assertEquals((e.type & DTDConstants.GENERAL) != 0,
gen_par [ gp ] == DTDConstants.GENERAL
);
assertEquals((e.type & DTDConstants.PARAMETER) != 0,
gen_par [ gp ] == DTDConstants.PARAMETER
);
}
}
}
示例8: render
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
setRotationAngles(f, f1, f2, f3, f4, f5);
Shape1.render(f5);
}
示例9: readEntity
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public Entity readEntity(final int id) {
throw new NoSuchEntityException(id);
}
示例10: LoadEntityResult
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public LoadEntityResult(final Entity entity) {
this.entity = entity;
results = Results.NO_RESULT;
}
示例11: getEntity
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
public Entity getEntity() {
return entity;
}
示例12: processEntities
import javax.swing.text.html.parser.Entity; //导入依赖的package包/类
@Override
protected void processEntities(ImmutableBag<com.artemis.Entity> entities) {
}