text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setHistorialClinicoidHistorialClinico(Historialclinico historialClinicoidHistorialClinico) {
this.historialClinicoidHistorialClinico = historialClinicoidHistorialClinico;
} | 0 |
private void checkTransitionObject(Object[] action) {
if (action.length != 3 || action[0] == null || action[1] == null || action[2] == null
|| !(action[STATE_POS] instanceof State) || !(action[CHAR_POS] instanceof Character) || !(action[DIR_POS] instanceof Direction)) {
throw new InvalidTransitionException("Ac... | 7 |
public void evaluate_void(Object[] dl) throws Throwable {
if (Debug.enabled)
Debug.println("Wrong evaluateXXXX() method called,"+
" check value of getType().");
return;
}; | 1 |
public void postCollide()
{
if (cam.collideY)
{
speedY = 0;
}
else
{
speedY -= gravity;
}
if (cam.speedY <= 0 && cam.collideY)
{
jumpDelay = 0;
}
} | 3 |
static final byte[] method878(String string, int i) {
anInt1571++;
int i_2_ = string.length();
if ((i_2_ ^ 0xffffffff) == -1)
return new byte[0];
int i_3_ = ~0x3 & 3 + i_2_;
int i_4_ = i_3_ / 4 * 3;
if (i_3_ + -2 >= i_2_
|| Class186_Sub1.method1399(7, string.charAt(i_3_ + -2)) == -1)
i_4_ -= 2;
el... | 6 |
public boolean validMovement(int myXCoor, int myYCoor, int targXCoor, int targYCoor, Board board){
double slope = Math.abs(super.getSlope(myXCoor,myYCoor,targXCoor,targYCoor));
if ((slope == 0.0 || slope == 1.0 || slope == 10.0) && (Math.abs(myXCoor - targXCoor) == 1 || Math.abs(myYCoor - targYCoor) == 1))
retur... | 5 |
public void setRemarks(String remarks) {
this.remarks = remarks;
} | 0 |
private void buildQueue(GeneralTreeNode<T> cur) {
if (cur != null)
queue.add(cur);
while (!queue.isEmpty()) {
GeneralTreeNode<T> tmp = queue.poll();
OutputQueue.add(tmp);
Iterator<GeneralTreeNode<T>> it = tmp.getChildren();
while (it.hasNext()) {
queue.add(it.next());
}
}
} | 3 |
public Tile getTile(int x, int y) {
if (0 > x || x >= width || 0 > y || y >= height)
return Tile.VOID;
return Tile.tiles[tiles[x + y * width]];
} | 4 |
public void execute(String path) {
IndexWriter writer = null;
IndexSearcher searcher = null;
try {
File indexDir = new File(System.getProperty("java.io.tmpdir"), "akka-index");
writer = openWriter(indexDir);
StopWatch stopWatch = new LoggingStopWa... | 9 |
public void setOption(int a){
option = a;
} | 0 |
public static int[][] houseWalls(Direction side,int xLoc, int yLoc, int size)
{
int yOffSet = 0;
int xOffSet = 0;
switch (side) {
case UP:
yOffSet = -(size * 20);
break;
case LEFT:
xOffSet = -(size * 20);
bre... | 7 |
public void testForID_String() {
assertEquals(DateTimeZone.getDefault(), DateTimeZone.forID((String) null));
DateTimeZone zone = DateTimeZone.forID("Europe/London");
assertEquals("Europe/London", zone.getID());
zone = DateTimeZone.forID("UTC");
assertSame(DateTi... | 5 |
@Override
protected void doAction() {
Point3D pos = this.attackingBody.getPosition();
for (WorldObject wo : Environment.getInstance().getMap()[pos.x+this.direction.dx][pos.y+this.direction.dy][pos.z].getObjects()) {
if (wo instanceof InsectBody) {
InsectB... | 5 |
public void testTree1() {
Map refCounts = synchronizeTree(new HashMap());
TreeNode key = new TreeNode("leaf");
TreeNode[] value = new TreeNode[]{};
refCounts.put(key, value);
setTree(new TreeNode("dummy"));
try {
Map result = synchronizeTree(((Question2)answer... | 7 |
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
// Read serialized form from the stream.
ColorSpace cs = null;
// Switch on first int which is a flag indicating the class.
switch((int)in.readInt()) {
case COLORMODEL_NULL:
... | 9 |
@Basic
@Column(name = "PRP_FECMOD")
public Date getPrpFecmod() {
return prpFecmod;
} | 0 |
private void parseSqlFindKeywords(boolean allKeywords) {
selectPos = textParser.findWordLower("select");
if (selectPos == -1) {
String msg = "Error parsing sql, can not find SELECT keyword in:";
throw new RuntimeException(msg + sql);
}
String possibleDistinct = textParser.nextWord();
i... | 9 |
public static void initialDisplay()
{
System.out.print("Would you like to do: Add Sale (Add), Remove Sale (Remove), Finish Sale (Finish), " +
"Management Functions (Management) or Exit?: ");
String salesDisplayChoice = sc.next();
switch (salesDisplayChoice.toUpperCase())
{
case "ADD":... | 5 |
public int[][] generateMatrix(int n) {
int[][] array= new int[n][n];
int index = 1;
for (int i=0;index <=n*n ;i++ ){
//up
for (int j=0;j < n ;j++ ) {
if(array[i][j] == 0)
array[i][j] = index ++;
}
//right
... | 9 |
public static void main(String[] args) {
// [max p, max # solutions]
int[] max = new int[2];
for(int p = 5; p < 1001; p++) {
int numSols = 0;
for(int c = 1; c < p/2; c++)
for(int a = 1; a < c; a++) {
double b = Math.sqrt(c*c - a*a);
if( Math.abs(b - (int)b) < .001 && a < (int)b && a+((i... | 7 |
@Test
public void thirtyTwoFIsEqualToZeroC(){
ScaledQuantity fahrenheit = new ScaledQuantity(32, Temperature.Fahrenheit);
ScaledQuantity celsius = new ScaledQuantity(0, Temperature.Celsius);
assertEquals(fahrenheit, celsius);
assertEquals(celsius, fahrenheit);
assertEquals(f... | 0 |
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
if (instrument != this.instrument || period != this.period) {
// 対象の通貨ではない、かつ、対象の時間間隔でない場合は何もしない
return;
}
// 既に注文があるときは何もしない
if (this.aliveOrder != null && this.aliveOrder.getState() != Stat... | 9 |
public void addText(String text)
{
class temp implements Runnable
{
public temp (String text)
{
this.text = text;
}
private String text;
@Override
public void run()
{
try ... | 0 |
private void moveDown() {
int[] rows = table.getSelectedRows();
DefaultTableModel model = (DefaultTableModel) table.getModel();
if (model.getRowCount() >= 2) {
model.moveRow(rows[0], rows[rows.length - 1], rows[0] + 1);
table.setRowSelectionInterval(rows[0] + 1,
rows[rows.length - 1] + 1);
}
} | 1 |
public static Item get(int index){
if(index >= 0 && index < 90) return inventory[index];
return null;
} | 2 |
private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
Categoria c = new Categoria();
if (!(txCodigo.getText().equals("")) || (txCodigo.getText().equals(null))){
c.setId_tipo(Integer.parseInt(txCodigo.getText()));
}
... | 7 |
public static void setTextures(boolean enabled)
{
if(enabled)
glEnable(GL_TEXTURE_2D);
else
glDisable(GL_TEXTURE_2D);
} | 1 |
@Override
public boolean equals(
Object obj )
{
if( this == obj ) return true;
if( obj == null ) return false;
if( getClass() != obj.getClass() ) return false;
Range other = (Range) obj;
if( end != other.end ) return false;
if( start != other.start ) retur... | 5 |
public static Type getObjectType(final String internalName) {
if (isPrimitiveType(internalName)) {
return getType(internalName);
}
char[] buf = internalName.toCharArray();
return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
} | 2 |
public static void main(String[] args) {
Domino d = new Domino();
d.crearDomino();
d.barajarFicha();
d.imprimirLista(Domino.listaFicha);
d.repartirFichas();
System.out.println("Humano");
d.imprimirLista(Domino.listaFichaHumano);
System.out.println... | 2 |
public static void main(String[] args) {
try {
SQLHelper sQLHelper = new SQLHelper();
sQLHelper.sqlConnect();
//sQLHelper.runUpdate("insert into teacher values('10060120','haha','zheng','jjhsjl')");
ResultSet rs = sQLHelper.runQuery("select * from teacher");
... | 2 |
protected void makeSinCosTables()
{
// First determine max k.
int pmax = -Integer.MAX_VALUE;
int localnu1 = nu1;
int localn2 = n2;
int k = 0;
for (int l = 1; l <= nu; l++)
{
while (k ... | 8 |
public static Complex[] convolve(Complex[] x, Complex[] y) {
Complex ZERO = new Complex(0, 0);
Complex[] a = new Complex[2*x.length];
for (int i = 0; i < x.length; i++) a[i] = x[i];
for (int i = x.length; i < 2*x.length; i++) a[i] = ZERO;
Complex[] b = new Complex[2*y.... | 4 |
public void run() {
try {
PrintWriter out = null;
BufferedReader in = null;
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String clientMsg = null;
while ((clientMsg = in.readLine()) != null) {
int type = -1;
... | 7 |
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if(command.getName().equalsIgnoreCase("vanish")){
if(enabled){
if(sender instanceof Player){
Player p = (Player) sender;
if(p.hasPermission("tcl.vanish")){
for(Player pl : Bukkit.getOnlinePlayers()... | 5 |
public HashMap<String,Warp> loadWarps() throws SQLException {
HashMap<String,Warp> warps = new HashMap<String,Warp>();
sql.initialise();
if(!sql.doesTableExist("BungeeWarps")){
System.out.println("Table 'BungeeWarps' does not exist! Creating table...");
sql.standardQuery("CREATE TABLE BungeeWarps (W_I... | 2 |
public static Image trimTextImage(Image im, int width, int height)
{
/*
Due to the slight inaccuracy of the font sizes, a text image may
not need all the height allocated to it. This method will crop and
image so that all rows that are totally transparent are eliminated.... | 5 |
private void drawShape(Graphics g,Boolean pack) {
if (currentshape == shape.LINE)
{
//packet
if(pack)
{
Packet p=new Packet(diffrentShapes.LINE, currentColor, startX, startY, currentX, currentY);
try {
oos.writ... | 5 |
public Item genItem(int i,int items) {
int val2=rand.nextInt(100000000);
String val3 = items + " / " + i;
Item item = new Item(i,val2,val3);
return item;
} | 0 |
public int compareTo(Object o) {
int result;
int major;
int minor;
int revision;
int [] maj = new int [1];
int [] min = new int [1];
int [] rev = new int [1];
// do we have a string?
if (o instanceof String) {
parseVersion((Str... | 7 |
@Override
public boolean equals(Object o) {
if (o == this)
return true;
if (o == null)
return false;
if (!getClass().equals(o.getClass()))
return false;
final Virus v = (Virus) o;
return getName().equalsIgnoreCase(v.getName());
} | 3 |
public static Object[] toObjectArray(Object source) {
if (source instanceof Object[]) {
return (Object[]) source;
}
if (source == null) {
return new Object[0];
}
if (!source.getClass().isArray()) {
throw new IllegalArgumentException("Source is not an array: "
+ source);
}
int length = Array.... | 6 |
public boolean containsCard(Card card) {
for(int i = 0; i < this.getNumCards(); i++)
if(this.getCard(i).equals(card))
return true;
return false;
} | 2 |
private void setSplitPaneBounds(){
splitPane.setBounds(5, menuBar.getHeight() + menuBarWithButtons.getHeight(),
getWidth() - 15, getHeight() - menuBar.getHeight() - menuBarWithButtons.getHeight()-55 );
upperSplit.setDividerSize(5);
splitPane.setDividerSize(5);
upperSplit.... | 0 |
public BlockOrientation getOrientation() {
IntBuffer orientationBuf = IntBuffer.allocate(1);
IntBuffer writingDirectionBuf = IntBuffer.allocate(1);
IntBuffer textlineOrderBuf = IntBuffer.allocate(1);
FloatBuffer deskewAngleBuf = FloatBuffer.allocate(1);
iterator.getOrien... | 6 |
@Override
public boolean equals(Object obj) {
Horario h = (Horario)obj;
return dia.equals(h.getDia())&&de.equals(h.getDe())&&hasta.equals(h.getHasta());
} | 2 |
public void run() {
while(true) {
int com = readOneCommand(is);
System.out.println("Read : " + com + " from player " + p.getId());
switch (com) {
case Protocol.SEND_CARD: { // 1
int suit = readOneCommand(is);
int value = readOneCommand(is);
monitor.sendPlayedCard(new Card(suit, value, p));
... | 7 |
private void createOr(String in1, String in2, String out)
{
OrGate or = new OrGate();
// Connect the first input
// Check if the in wire is an input
if (stringToInput.containsKey(in1))
{
Wire inWire = new Wire();
stringToInput.get(in1).connectOutput(inWire);
or.connectInput(inWire);
}
// Check ... | 8 |
public boolean estCleValable(String k) {
String[] keys=k.split(" ");
if(keys.length==2 && keys[0]!="" && keys[1]!="") {
if(this.estClePubliqueValable(keys[0]) && this.estClePriveValable(keys[1])) {
return true;
}
else {
return false;
}
}
else {
return false;
}
} | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public MainPage(String title) {
super(title);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
Toolkit tk = Toolkit.getDefaultToolkit();
this.setSize(tk.getScreenSize());
this.setVisible(true);
} | 0 |
public boolean mouseup(Coord c, int button) {
c = new Coord((int) (c.x / getScale()), (int) (c.y / getScale()));
Coord mc = s2m(c.add(viewoffset(sz, this.mc).inv()));
if (grab != null) {
try {
grab.mmouseup(mc, button);
return (true);
} catch (GrabberException e) {
}
}
if ((cam != null) && ca... | 4 |
protected void creerCommunication() throws IOException {
this.communication = new Socket(this.nomServeur, this.portServeur);
this.fluxEntree = new BufferedReader(new InputStreamReader(communication.getInputStream()));
this.fluxSortie = new PrintStream(communication.getOutputStream());
// Crée un fil d'exécut... | 5 |
private void setHH(Household houseHold) {
// txtAcc1.setEnabled(false);
txtAcc1.setEditable(false);
// txtAcc2.setEnabled(false);
txtAcc2.setEditable(false);
// txtAcc3.setEnabled(false);
txtAcc3.setEditable(false);
// txtAcc4.setEnabled(false);
txtAcc4.setEditable(false);
// txtTutor1.setEnabled(fal... | 2 |
@Override
public Position getStart() {
return start;
} | 0 |
private void updateGrid(boolean cheat)
{
char[][] grid = wordSearch.getGrid();
for (Word word : wordPositions)
{
Point[] points = word.getPoints(wordSearch);
if (points == null) continue;
for (int i = 0; i < points.length; i++)
{
Point point = points[i];
grid[point.x][point.y] = word.getWor... | 7 |
public String getCommand(int x) {
String y;
if (x == 1) {
y = "attack";
}
else if (x == 2) {
y = "defend";
}
else if (x == 3) {
y = "fire";
}
else if (x == 4) {
y = "blizzard";
}
else if (x == 5) {
y = "thunder";
}
else if (x == 6) {
y = "flood";
}
else if (x == 7) {
y =... | 7 |
public Layer getLayer() {
return layer;
} | 0 |
public Method findIsMethod(Field field) {
if(field == null)
return null;
if(getFieldDetailStore().isSetMethodPresentFor(field)) {
return getFieldDetailStore().setMethodOf(field);
}
String getterName = createMethodName("is", field.getName());
... | 4 |
private static String maxComSubStr(int i, int j, String strA, int[][] intA) {
if (i == 0 || j == 0) {
return "";
}
if (intA[i][j] == 1) {
return maxComSubStr(i - 1, j - 1, strA, intA) + strA.charAt(i-1);
} else if (intA[i][j] == 2) {
return maxComSubSt... | 4 |
@Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface.isInstance(this)) {
return (T) this;
}
throw new SQLException("DataSource of type [" + getClass().getName() +
"] cannot be unwrapped as [" + iface.getName() + "]");
} | 1 |
public String subPath(int start, int end) {
if (start < 0 || end < start || end > path_.length()) {
throw new IndexOutOfBoundsException();
}
return path_.substring(start, end);
} | 3 |
@Override
public int hashCode() {
int result = stock != null ? stock.hashCode() : 0;
result = 31 * result + (int) (price ^ (price >>> 32));
result = 31 * result + (seller != null ? seller.hashCode() : 0);
result = 31 * result + (buyer != null ? buyer.hashCode() : 0);
result =... | 4 |
protected void readAttributes(XMLStreamReader in) throws XMLStreamException {
super.readAttributes(in);
name = in.getAttributeValue(null, "username");
nationID = in.getAttributeValue(null, "nationID");
if (!isUnknownEnemy()) {
nationType = getSpecification().getNationType(in.... | 8 |
public int[] plusOne(int[] digits) {
int[] array = new int[digits.length + 1];
int val = 1;
for(int i =digits.length-1 ; i>=0 ;i--){
val = digits[i]+val;
array[i+1] = val % 10;
val = val /10;
}
array[0] = val;
return (val == 0)? Arrays.... | 2 |
public static int getCharacterID() {
String value = properties.getProperty(CHARACTER_ID);
if (value == null) {
return GameCharacter.LordLard.ordinal();
}
int id = GameCharacter.LordLard.ordinal();
try {
id = Integer.parseInt(value);
} catch (NumberFormatException e) {}
if (id < 0 || id >= GameCharac... | 4 |
public void keyReleased(KeyEvent e)
{
switch(e.getKeyCode())
{
case KeyEvent.VK_LEFT: Kontroller.left = false;
break;
case KeyEvent.VK_RIGHT: Kontroller.right = false;
break;
case KeyEvent.VK... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
@Override
public boolean click(MainView parent, int x, int y, int camx, int camy) {
if (x >= this.x && x <= this.x + 200 && y >= this.y && y <= this.y + 300) {
handleClick(parent, x - this.x, y - this.y);
return true;
}
else if (coaster == null) {
int[] po... | 6 |
tuple<node,Long> findInLB(int[] k, node cnode) throws valid_not_checked, pval_error, make_key_error
{
if (cnode.lfilledB==0)
return new tuple<node,Long>(null,(long)0);
long dist,min,dist1,dist2,dist3;
int in;
node minnode,tnode;
minnode=null;
min=0;
if (min<0) min+=(long)Math.pow(2,common.bkeyLength)... | 8 |
public ArrayList<Double> IDWT(ArrayList<Double> _dwt) {
ArrayList<Double> _temp = new ArrayList<Double>(_dwt.size());
//Initialize _temp
_temp = (ArrayList<Double>) _dwt.clone();
for (int j = 2; j <= _dwt.size(); j = j * 2) {
for (int i = 0; i < j / 2; i += 1) {
... | 2 |
public void testFactory_standardSecondsIn_RPeriod() {
assertEquals(0, Seconds.standardSecondsIn((ReadablePeriod) null).getSeconds());
assertEquals(0, Seconds.standardSecondsIn(Period.ZERO).getSeconds());
assertEquals(1, Seconds.standardSecondsIn(new Period(0, 0, 0, 0, 0, 0, 1, 0)).getSeconds());... | 1 |
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
rd = new BufferedReader(new FileReader("d:\\programDATA\\Minimum Scalar Product\\A-large-practice.in"));
wr = new PrintWriter(new FileWriter("d:\\programDATA\\Minimum Scalar Product\\A-large-practice.out"));
int num;
... | 9 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
calcCellSize();
if (antSim == null) {
return;
}
for (int x = 0; x < antSim.getWidth(); x++) {
for (int y = 0; y < antSim.getHeight(); y++) {
if (map[x][y] ==... | 5 |
public void onEnable() {
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new JPBungee());
this.getConfig().options().copyDefaults(true);
this.saveConfig();
Jum... | 7 |
public void save()
{
DataOutputStream fos;
try {
if (!bufferedStrokes.isEmpty())
{
JOptionPane.showMessageDialog(rootPane, "Please wait for the file to buffer!");
return;
}
File lll = new File("maps");
... | 4 |
private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | 5 |
public static final Instances stratify(Instances data, int folds, Random rand){
if(!data.classAttribute().isNominal())
return data;
Instances result = new Instances(data, 0);
Instances[] bagsByClasses = new Instances[data.numClasses()];
for(int i=0; i < bagsByClasses.length; i++)
bagsByC... | 8 |
private void processGetReplica(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] data = (Object[]) ev.get_data();
if (data == null) {
return;
}
String filename = (String) data[0]; // get file name
Integer sender = (Integer)... | 3 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if(!jTextArea1.getText().trim().startsWith("-----BEGIN SIGNED CHEQUE-----") && !jTextArea1.getText().trim().startsWith("-----BEGIN SIGNED VOUCHER-----")){
JOptionPane.showMessageDialog(th... | 7 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WildcardString other = (WildcardString) obj;
return (0==compareTo(other));
} | 2 |
public static boolean checkIssue(Status status, int assignee)
throws DAOException {
boolean emptyAssignee;
if (assignee == 0) {
emptyAssignee = true;
} else {
emptyAssignee = false;
}
boolean statusNew;
if (status.getId() == 1) {
statusNew = true;
} else {
statusNew = false;
}
if (st... | 6 |
@Override
public TreeRow next() {
if (hasNext()) {
if (mIterator == null) {
TreeRow row = mRows.get(mIndex++);
if (row instanceof TreeContainerRow) {
TreeContainerRow containerRow = (TreeContainerRow) row;
if (containerRow.getChildCount() > 0 && mPanel.isOpen(containerRow)) {
mIterator = n... | 5 |
public void read(InputStream is)
throws IOException {
//Given the small size of MIDI files read all
//data into a ByteArrayStream for further processing
byte[] fileData = new byte[is.available()];
is.read(fileData);
ByteArrayInputStream bais =
new Byte... | 7 |
private String nodeHtmlString(TeaNode parent) {
String line = "<br/>|";
for (int i = 0; i < parent.level; i++) {
line += "-";
}
if (!parent.label.equals("")) {
line += "[" + parent.label + "]";
}
if (parent.classValue == null) {
line += parent.attribute;
} else {
line += " -> " + parent.classV... | 4 |
private int getAmount(Location location, GoodsType goodsType) {
if (goodsType != null) {
if (location instanceof Building) {
Building building = (Building) location;
ProductionInfo info = building.getProductionInfo();
return (info == null || info.getPr... | 6 |
@Override
public List<Position> getPositions() {
List<Position> positions = new ArrayList<Position>();
if (getPosition() != null)
positions.add(getPosition());
positions.addAll(otherPositions);
return positions;
} | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReportScoreMessage that = (ReportScoreMessage) o;
if (score != that.score) return false;
if (!level.equals(that.level)) return false;
i... | 6 |
public String[] getOptions() {
Vector<String> result;
result = new Vector<String>();
result.add("-mean-prec");
result.add("" + getMeanPrec());
result.add("-stddev-prec");
result.add("" + getStdDevPrec());
result.add("-col-name-width");
result.add("" + getColNameWidth(... | 7 |
@Override
public synchronized void sendNow() {
packageDTO.setPacketNr(packageDTO.getPacketNr() + 1);
packageDTO.setTimestamp(TimeUtil.getSynchroTimestamp());
logger.trace("sending Paket #" + packageDTO.getPacketNr());
for (Connection c : kryoServer.getConnections()) {
if (c.isIdle())
c.sendUDP(package... | 2 |
public void draw(Graphics g) {
g.setColor(Color.BLUE);
g.drawRect(bounds.left(),bounds.top(),bounds.width()-1,bounds.height()-1);
if (nodes.get(0) != null) {
for (int i = 0; i < 4; i++) {
nodes.get(i).draw(g);
}
}
} | 2 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Room target=mob.location();
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("The aura of harm is already here."));
return false;
}
final Ability ... | 7 |
public File getTransactionFile(File file) throws IOException {
if (mStarted == 0) {
throw new IllegalStateException(NO_TRANSACTION_IN_PROGRESS);
} else if (file == null) {
throw new IllegalArgumentException(MAY_NOT_BE_NULL);
} else if (file.isDirectory()) {
throw new IllegalArgumentException(MAY_NOT_BE_D... | 4 |
@Override
public void addInheritence(String inher) {
if (!inheritence.contains(inher)) {
inheritence.add(inher);
}
} | 1 |
public void testPlus_Seconds() {
Seconds test2 = Seconds.seconds(2);
Seconds test3 = Seconds.seconds(3);
Seconds result = test2.plus(test3);
assertEquals(2, test2.getSeconds());
assertEquals(3, test3.getSeconds());
assertEquals(5, result.getSeconds());
as... | 1 |
public static char[][] AbrirTablaTrancicion(){
try{
File archivo = new File("src/txts/Tebla.txt");
BufferedReader txt = new BufferedReader(new FileReader(archivo));
String s = "";
String aux;
int largo = 0, alto = 0;
do {
au... | 6 |
public static synchronized ResourceBundle getResourceBundle() {
if (bundle == null) {
bundle = ResourceBundle.getBundle("messages");
}
return bundle;
} | 1 |
public static void openURL(final String link) {
try {
Desktop.getDesktop().browse(new URI(link));
} catch (IOException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
e.printStackTrace();
}
} | 2 |
public UserOperator restart() {
stop();
run();
return this;
} | 0 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.