method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ebc5e1e7-4109-451c-9416-cad00be82a9e | 0 | public void setId(UUID value) {
this._id = value;
} |
40c8e265-dcf0-4a50-83ee-04f812a388ad | 4 | public static boolean hasEnhancements(String prestige, List<Integer> requiredList, int tier){
List<Enhancement> el = new ArrayList<Enhancement>();
//check prestige trees
ClassTree ct = (ClassTree) getTree(prestige);
List<Integer> integerList = new ArrayList<Integer>();
//fetch all enhancement ids and... |
27ee1164-10a3-4113-91e4-e76c02386135 | 0 | public void addReplace(int i, String s) {
this.replaces.add(i, s);
} |
8325dc29-479f-4402-8f11-8215e20e9bea | 9 | final public void Function() throws ParseException {
int reqArguments = 0;
String identString = "";
ASTFunNode jjtn001 = new ASTFunNode(JJTFUNNODE);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
identString = Identifier();
if... |
27ed9025-655b-45a2-bbab-b71fc4d189bc | 4 | private Spatial getRandomRoamLocation(Spatial actualSpatial, int minimumDistance, int maxDistance) {
int randomX = Helpers.randomBetween(-Helpers.randomBetween(minimumDistance, maxDistance), Helpers.randomBetween(minimumDistance, maxDistance));
int randomY = Helpers.randomBetween(-Helpers.randomBetween(minimumDista... |
80572503-ee69-4997-abef-eb86dfdbcece | 1 | public static void openLink(URI link) {
try {
Class desktopClass = Class.forName("java.awt.Desktop");
Object o = desktopClass.getMethod("getDesktop", new Class[0]).invoke(null, new Object[0]);
desktopClass.getMethod("browse", new Class[] { URI.class }).invoke(o, new Object[] { link });
} catch... |
2521cd5c-8ac5-46f3-896f-3aa857d9a202 | 8 | public static List<String> getFieldFromGetter(Class clazz) {
List<String> rst = new ArrayList<String>();
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
String name = method.getName();
if (name.startsWith("get") || name.startsWith("is") || M... |
aa2e5dda-00f8-4e7b-a4d2-e6712a0220c5 | 1 | void move(boolean dir) {
if (dir)
y += speed;
else
y -= speed;
} |
11f88be4-05c8-4810-a0f5-45877b0e7f9d | 8 | public void mouseDragged(MouseEvent evt)
{
Point p = evt.getPoint();
mousePoint = p;
int xOffset = 0;
for (int i=0; i<slotList.size(); ++i)
{
Slot slot = slotList.get(i);
if (slot.isSelected())
slot.setDragged(true);
}
... |
b8e02638-ccf5-4131-919b-904a7d6d7915 | 0 | public String[] getVariables() {
return (String[]) myVariables.toArray(new String[0]);
} |
9d437492-058f-4243-8fa2-70e75efedd34 | 4 | public static boolean containsInstance(Collection<?> collection,
Object element) {
if (collection != null) {
for (Object candidate : collection) {
if (candidate == element) {
return true;
}
}
}
return false;
} |
9f906d2a-6a8b-4095-8bf8-a9d6e504153c | 8 | public void putAll( Map<? extends Character, ? extends V> map ) {
Iterator<? extends Entry<? extends Character,? extends V>> it = map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Character,? extends V> e = it.next();
this.put( e.getKey(), e.getVa... |
32317757-1042-4e46-871b-9b6a4d1727f5 | 4 | public long getDateLength() {
if (this.getPayloadLenExtendedContinued() > 0){
return this.getPayloadLenExtendedContinued();
}
if (this.getPayloadLenExtended() > 0){
return this.getPayloadLenExtended();
}
if (this.getPayloadLen() == HAS_EXTEND_DATA || this.getPayloadLen() == HAS_EXTEND_DATA_CONTINUE){... |
1880ffc1-ab7a-48ce-ab28-012121fe00b3 | 9 | public Spinner getClosestOfSameType(Spinner a, boolean same) {
Float min = null;
Spinner closest = null;
for (Spinner spinner : newSp) {
if (spinner.getId() != a.getId()) {
if (same) {
if (spinner.getType() == a.getType()) {
... |
2dca097c-0423-4719-8631-d9006efcd379 | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... |
12ba0b7a-17a8-4695-a458-bda550824199 | 5 | public void info()
{
System.out.println("\nInfo:\nstate_bits:(R)eferenced | (A)vailable | (P)inned");
int numBuffers = mgr.getNumBuffers();
for ( int i = 0; i < numBuffers; ++i ) {
if (((i + 1) % 9) == 0)
System.out.println("\n");
System.out.println( "(" + i + ") "... |
775a9dd5-11cc-48a3-9e32-85f620f8b729 | 0 | @Id
@Column(name = "FUN_CEDULA")
public long getFunCedula() {
return funCedula;
} |
eacd45b1-8ab6-4cf9-930a-4c7461579401 | 7 | private void clean(){
if(infiles.size() > 1){
System.err.println("Trimming is done one file at a time, only the first file will be used.");
}
String seqtype = "test";
if(seqtypeset == "aa"){
seqtype = "aa";
}else if (seqtypeset == "nucleotide"){
seqtype = "nucleotide";
}
phyutility.trimsites.Trim... |
95aadfb0-b51e-4aec-aa34-71d7a3a5acaf | 2 | @Override
public List<String> getSuggestions(CommandInvocation invocation)
{
List<Parameter> suggs = new ArrayList<>();
try
{
ParsedParameters parsed = new ParsedParameters();
invocation.setProperty(parsed);
parse(invocation, parsed.value(), suggs);
... |
3286593f-0446-4d0d-83c0-d0bc8b882a80 | 0 | public Object get() {
return t;
} |
f78367e7-0897-499a-b452-be5be97d1e93 | 6 | public void addItemEventHandler() {
// add chosen item to the shopping cart.
StockItem stockItem = (StockItem)productSelectionJComboBoxField.getSelectedItem();
if (stockItem != null) {
int quantity;
try {
quantity = Integer.parseInt(quantityField.getText()... |
81b02244-4b36-4d6b-9038-be891bf8e0b5 | 9 | public TableViewPanel(String title) {
GridBagLayout layout = new GridBagLayout();
GridBagConstraints constraints = new GridBagConstraints();
setLayout(layout);
setBorder(BorderFactory.createTitledBorder(title));
tableModel = new TableDisplay(cols, data);
myTable = new JTable(tableModel){
... |
d8f482be-7724-4da8-ad34-5ae9f42ae6ef | 2 | public Account getAccount(Integer id) {
Account account = null;
PreparedStatement pStmt = null;
ResultSet rs = null;
try {
pStmt = conn.prepareStatement("SELECT * FROM ACCOUNT WHERE id = ?;");
pStmt.setInt(1, id);
rs = pStmt.executeQuery();
while (rs.next()) {
account = new Acco... |
e3c5f41c-0ed4-4196-9585-b25efd508534 | 7 | public HttpResponse getResponse(CrawlDatum datum) throws Exception {
HttpResponse response = new HttpResponse(url);
HttpURLConnection con;
if (proxy == null) {
con = (HttpURLConnection) url.openConnection();
} else {
con = (HttpURLConnection) url.openConnection(p... |
5c4b441b-5dde-447e-861a-d744b389c2b8 | 7 | @Override
Object look(DspState vd, InfoMode vm, Object vr) {
InfoResidue0 info = (InfoResidue0) vr;
LookResidue0 look = new LookResidue0();
int acc = 0;
int dim;
int maxstage = 0;
look.info = info;
look.map = vm.mapping;
look.parts = info.partitions;
... |
4e6e7964-f726-4610-aa3b-fc755ec7ac14 | 5 | public static void main(String[] args) {
//Trietreen testausta:
Trietree trietree = new Trietree();
trietree.add("sukka");
trietree.add("saapas");
trietree.add("aita");
trietree.add("aasi");
trietree.add("b");
trietree.add("s");
trietree.add("susi"... |
b22cd002-e2bb-4e05-aa12-14e60a931c81 | 1 | public void start(){
if (start == -1){
start = Time.getTime();
}
} |
136ecabb-ab90-4f14-99e9-260cab1a7c1b | 4 | @Override
public void render(float interpolation) {
Fonts.get("Arial").drawString(renderName, pos.x, pos.y, 20, isComplete() ? 0xffffff : 0xff7777);
for(GuiEditorInspectorSection sec : set)
sec.render(interpolation);
Vector2 mouse = Remote2D.getMouseCoords();
Vector2 mouseVec = mouse.add(new Vector2(0,ed... |
33389564-a03b-45b6-b638-b6c94575ffd1 | 5 | protected ByteChunk getCurrentChunk() {
while( !ended && (currentChunk == null || currentChunkPosition >= currentChunk.getSize()) ) {
if( chunks.hasNext() ) {
currentChunk = (ByteChunk)chunks.next();
currentChunkPosition = 0;
} else {
ended = true;
}
}
if( ended ) return null;
return curren... |
8fd236c5-6ba3-4d8c-9a8b-2a611072767c | 5 | public static int deleteMstxCol(String mid, String uid) {
int result = 0;
Connection con = DBUtil.getConnection();
PreparedStatement pstmt = null;
try {
pstmt = con.prepareStatement("delete from mstx_col where mid=? and uid=?");
pstmt.setString(1, mid);
pstmt.setString(2, uid);
result = pstmt.execut... |
d351b43c-4280-407e-9918-5e1cb3ffef76 | 2 | private void initEmptyNodes() {
for (int i = 0; i <= width; i++) {
for (int j = 0; j <= higth; j++) {
nodes[i][j] = (T) nodeFactory.createNode(i, j);
}
}
} |
36a63f02-f2ca-4106-804d-5e316cf868eb | 2 | public CommonUtil() {
if (ratingsMap == null) {
ratingsMap = new HashMap<Integer, String>();
populateRatingMap();
}
if (skillsMap == null) {
skillsMap = new HashMap<Integer, String>();
populateSkillMap();
}
} |
cdb8db1c-55b0-48f6-a621-1a29b48c787c | 2 | public static AirSubmodesOfTransportEnumeration fromValue(String v) {
for (AirSubmodesOfTransportEnumeration c: AirSubmodesOfTransportEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} |
5f46ed91-911c-476f-afa2-0b39b9cf9905 | 2 | public boolean type(char key, java.awt.event.KeyEvent ev) {
if (key == 27) {
close();
}
if (key == 10) {
// позволяет "нажать" кнопку Ok нажав клавишу Enter
okClicked = true;
hide();
}
return (super.type(key, ev));
} |
f7852318-32bf-4347-a43a-59c91c095712 | 8 | private void findIps(String s, int start, int remainingParts, StringBuilder result, List<String> results) {
int maxLen = remainingParts * 3;
int remainingLen = s.length() - start;
if (remainingLen > maxLen || remainingLen < remainingParts) {
return;
}
if (remainingPa... |
d87a8d71-5e99-4fec-90e0-fd40be39187a | 0 | public void test() {
Prototype p = PrototypeManager.getManager().getPrototype("prototype.ConcretePrototype");
Prototype pClone = PrototypeManager.getManager().getPrototype("prototype.ConcretePrototype");
System.out.println(p);
System.out.println(pClone);
} |
fb08b128-cccd-4c2a-b843-c64fea7b1468 | 8 | public static void main(String[] args) {
KeyboardReader read = new KeyboardReader();
Employee e;
String name;
int type;
double rate;
int hours;
String prompt;
e = new Employee();
while (true){
System.out.println("Enter employee data: ");
name = read.readLine(" name (or <enter> to quit)... |
793437bb-0b12-43c9-8565-3a00e0b3fb8a | 9 | final synchronized void method2888(int i, int i_0_, int i_1_) {
if (i == 0)
method2926(i_0_, i_1_);
else {
int i_2_ = method2904(i_0_, i_1_);
int i_3_ = method2889(i_0_, i_1_);
if (anInt8970 == i_2_ && anInt8974 == i_3_)
anInt8972 = 0;
else {
int i_4_ = i_0_ - anInt8976;
if (anInt8976 -... |
74b06d46-36c3-42c6-bd81-d7643ffb4dab | 9 | public void render() {
int minX = (int) Math.floor(offsetX / Tile.SIZE);
int maxX = (int) Math.ceil((offsetX + SplitMan.WIDTH) / Tile.SIZE);
int minY = (int) Math.floor(offsetY / Tile.SIZE);
int maxY = (int) Math.ceil((offsetY + SplitMan.HEIGHT) / Tile.SIZE);
for(int i = 0; i < sizeX; i++) {
for(int j = 0;... |
ff842d01-6c8c-408d-8254-b643a38d0bc3 | 0 | @Test
public void testReadField_null()
{
Assert.assertNull(ReflectUtils.readField(new Bean(), "_field5"));
} |
07e2f198-efb7-43c1-be1d-3e2492ac95b4 | 7 | public void exits(MOB mob, List<String> commands)
{
if(mob.location().roomID().equals(""))
{
mob.tell(L("This command is invalid from within a GridLocaleChild room."));
mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
return;
}
if(commands.size()<3)
{
... |
55229ad5-b27e-4adf-a55b-550dc20ae341 | 6 | public void Liides() {
final Frame tippAken;
tippAken = new Frame();
tippAken.setSize(300, 150);
tippAken.setTitle("URLi sisestamine");
tippAken.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
tippAken.dispose();
}
});
Label kysimus = new Label("Sisesta URL!")... |
5e0d06fd-9ead-4e80-9aca-2fe87abc2d58 | 5 | public void setVolume(double value) {
if ( (value <0) || (value >1) ) return;
this.volume = value;
if (this.midiSequencer instanceof Synthesizer) {
Synthesizer synthesizer = (Synthesizer)this.midiSequencer;
MidiChannel[] channels = synthesizer.getChannels();
for (int i=0; i<channels.length;... |
b02b5b46-2194-455e-9781-4924a1e0adce | 5 | public static <V> PositionalList<Edge<Integer>> MST(Graph<V,Integer> g) {
// tree is where we will store result as it is computed
PositionalList<Edge<Integer>> tree = new LinkedPositionalList<>();
// pq entries are edges of graph, with weights as keys
PriorityQueue<Integer, Edge<Integer>> pq = new HeapP... |
1b32bda0-c453-4c86-9258-70b27a730e19 | 8 | private void corner(CalcioPiazzato a){
a.tipo="corner";
Giocatore p=null;//portiere
Giocatore[] att=null;//giocatori in area per provare a segnare
Giocatore dif=null;//difensore sul corner
//selezione tiratori e portieri
if(a.team.equals("casa")){
a.tiratore=match.getCasa().getTiratore();
p=match.getO... |
197b6167-de92-4457-af00-5d70a45cfed5 | 6 | @Override
protected void decode( ChannelHandlerContext ctx, ByteBuf in, List<Object> out ) throws Exception
{
int byteSize = in.readableBytes();
if(byteSize == 0 || !ctx.channel().isOpen())
return;
int id = Utils.readVarInt(in);
int conState = ctx.channel().attr(Utils.connectionState).get();
switch(c... |
f0382f75-e4d3-4e76-afc3-0aa16a439401 | 2 | @Override
public final void logicUpdate(GameTime gameTime) {
countdownTimer.decreaseTimer(gameTime.getElapsedTimeMilli());
/**
* When the timer is finished we must make sure that we first create one
* of the random entities that this spawner can possibly create, and
* then call the reset time method.
*... |
085a1a85-3402-438e-82d4-3f08efd0a9ed | 6 | public static void main(String args[]){
Game game = new ConnectFour();
OthelloAI C4AI;
OthelloAI C4AI2;
C4AI2 = new OthelloAI(game, "test1",Color.blue);
C4AI = new OthelloAI(game,"test2",Color.red);
if(C4AI.getGame() == game){System.out.println("Set Game Success");}
if(C4AI.getPlayerName() == "test2")Sy... |
392872af-3203-4191-aa31-65f9484b2d55 | 5 | protected void printTopKChild4Stn(String filePrefix, int topK) {
String topKChild4StnFile = filePrefix + "topChild4Stn.txt";
try {
PrintWriter pw = new PrintWriter(new File(topKChild4StnFile));
// m_LM.generateReferenceModel();
for (_Doc d : m_trainSet) {
if (d instanceof _ParentDoc) {
_ParentDo... |
61bb8cf4-0cc5-4ea5-96ea-e04c27d35de9 | 3 | @Override
public void render(final Graphics g) {
g.setColor(Color.black);
g.g().drawRect(0, 0, tiles[0].length * TILE_SIZE, tiles.length * TILE_SIZE);
for (int y = 0; y < tiles.length; y++) {
for (int x = 0; x < tiles[0].length; x++) {
tiles[y][x].render(g, x * TILE_SIZE, y * TILE_SIZE);
}
}
for ... |
f95533cf-f5bd-4a91-8029-8a67184c9206 | 4 | public boolean sendBlockRemoved(int var1, int var2, int var3, int var4) {
int var5 = this.mc.theWorld.getBlockId(var1, var2, var3);
int var6 = this.mc.theWorld.getBlockMetadata(var1, var2, var3);
boolean var7 = super.sendBlockRemoved(var1, var2, var3, var4);
ItemStack var8 = this.mc.thePlayer.ge... |
a93a3b97-521f-4b45-aad8-c360bf1d22e7 | 5 | private static int getBlockVal(int tilesetBankOffset, int[] rom, int add) {
if (add >= 0 && add < 0x4000)
return rom[add];
if (add >= 0 && add < 0x8000
&& add + tilesetBankOffset < rom.length)
return rom[add + tilesetBankOffset];
return 0x10000; // huge
} |
8f4db7a7-99a7-4266-b8a5-76466414292e | 8 | private boolean checkPourIntoBakingContainer(State state, ObjectInstance pouringContainer,
ObjectInstance receivingContainer) {
/**
* If the container is empty then we only want to add in ingredients that we must
* bake, as per the recipe.
* Conversely, if the container is not empty:
* a) If it contain... |
f2c9766b-fe01-4b26-98bc-08372b348276 | 7 | Battle (LivingThing inpla1, LivingThing inpla2, DuskEngine inengGame)
{
try
{
engGame = inengGame;
vctSide1 = new Vector();
vctSide2 = new Vector();
thnFront2 = inpla2;
while (thnFront2 != null)
{
addToBattle(thnFront2,2);
thnFront2 = thnFront2.thnFollowing;
}
thnFront2 = inpla2.thn... |
037c8476-d1d0-42b8-9c71-a250bec51e00 | 9 | public int checkBJN()
{
if(cornerMap.get("B").equals("B")
&& cornerMap.get("J").equals("J")
&& cornerMap.get("N").equals("N"))
{
return SOLVED;
}
if(cornerMap.get("B").equals("J")
&& cornerMap.get("J").equals("N")
&& cornerMap.get("N").equals("B"))
{
return CW;
}
if(cornerMap.get("B... |
12ac38e5-7ecf-469d-9f57-7e5c6abdd329 | 3 | private Token emitTerminal(Token terminal)
{
if(root == null)
{
root = current = new ParseNode(null, terminal);
return terminal;
}
ParseNode newNode = new ParseNode(null, terminal);
newNode.Parent = current;
if(current.FirstChild == null)
current.FirstChild = newNode;
else
{
ParseNode lastC... |
15d7a40e-2f75-4ba2-bbfb-1ab9c358e75f | 4 | public void mouseDragged(MouseEvent e) {
Point2D.Double p = new Point2D.Double(0,0); // Change mouse coordenates from
MyWorldView.SPACE_INVERSE_TRANSFORM.transform(e.getPoint(),p);// pixels to meters.
if (currentElement instanceof Ball) {
System.out.println("Dragging Ball");
((Ball)cur... |
24e8ce63-0998-42c0-bda4-deb59581e443 | 5 | public void actualiza() {
long tiempoTranscurrido = System.currentTimeMillis() - tiempoActual;
//Guarda el tiempo actual
tiempoActual += tiempoTranscurrido;
//obs1.setPosX(obs1.getPosX() - 15);
principal.actualiza(tiempoActual);
// if(obs1.getPosX() <= 0){
... |
13f74526-47ef-40e3-8a65-616357665c0a | 6 | public boolean getBoolean(String key) throws JSONException {
Object o = get(key);
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String)o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE) ||
(o ins... |
c7d7799a-f597-446b-a43a-8b7e7a72bb9a | 7 | public void setPieceMaterial()
{
switch(this.pieceMatId)
{
case 1 :
lightPieceMat = factory.loadGold();
darkPieceMat = factory.loadPurpleMarble();
break;
case 2 :
lightPieceMat = factory.loadRosewood();
darkPieceMat = factory.loadBrownwood();
break;
case 3 :
lightPieceMat = factory.loadI... |
8d1d9af3-b45f-4737-8ce9-dfb28ceb616a | 1 | public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
} |
f6da846c-c7af-44b7-b6b4-4d7047a7ee33 | 2 | public int playFinal(User user) {
if (i >= user.getUpperBound()) {
return -1;
}
if (user.theNumberIs(i)) {
found = true;
return i;
}
i++;
return -1;
} |
b93be96a-23c7-4392-b91f-aa2dc8dc90aa | 0 | public ProgressDownload(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
pack();
} |
629ddc36-5944-423a-a35d-bba4eaaa6522 | 5 | public static Day getRow(LocalDate lDate) throws SQLException {
log.entry("getRow (DayManager)");
String sql = "SELECT * FROM Day WHERE id_day = ?";
ResultSet rs = null;
Date theDate = DateManager.localDateToSqlDate(lDate);
try (
PreparedStatement stmt = conn.prepareStatement(sql);
){
stmt... |
68979b22-112c-4de7-b823-c5f301f014c2 | 9 | public void onServerJoin(ServerJoinEvent e){
handleMessage("DistributedHashTable - onServerJoin: server " + e.getServerId() + " joind");
joinServerId = e.getServerId();
// skip if back up successor comes back online
if(joinServerId == this.backupSuccessor.getKey())
return;
// run the update on a worker... |
ad0721b6-08b2-4a34-a06a-2b7fe1f12d8d | 4 | @Override
public void editElection(User user, String electionID,
Date openNominations, Date start, Date end,
String electoratelectionID) {
DnDElection el = (DnDElection) electionMap.get(electionID);
if (el.getElectionState() == ElectionState.NOT_STARTED
&& el.getManagerSet().contains(user)) {
el.setSt... |
9ada06c8-ed17-40cf-bc25-8879a7c22eb4 | 3 | private void updateIndexValues()
{
// calculate the current sample (frame) index
int curFrame = (int)(currentPixelPosition * framesPerPixel);
// update the display of the current sample (frame) index
indexValue.setText(Integer.toString(curFrame + base));
// update the number of samples p... |
260ca160-ac4c-4fa8-b900-5ec0e7109095 | 7 | final void ZA(int i, float f, float f_93_, float f_94_, float f_95_,
float f_96_) {
anInt7633++;
boolean bool = (anInt7808 ^ 0xffffffff) != (i ^ 0xffffffff);
if (bool || ((OpenGlToolkit) this).aFloat7832 != f
|| f_93_ != ((OpenGlToolkit) this).aFloat7871) {
((OpenGlToolkit) this).aFloat7832 = f;
a... |
ee0587aa-3dcf-4b8a-be21-3e61dbc4cb0e | 5 | public synchronized String getAnnotationClientMethod(String fileSource)
{
FileInputStream fIn = null;
FileChannel fChan = null;
long fSize;
ByteBuffer mBuf;
String content = "";
try
{
fIn = new FileInputStream(fileSource);
fChan = fIn.g... |
acf31c62-1d8c-4fd0-a316-993881ec4c4e | 2 | public PaneContainer() {
status = READY;
addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
if (evt.getClickCount() == 2 && getComponentCount() > 1) {
remove(getSelectedIndex());
revalidate();
repaint();
}
}
});
} |
cd000b0f-88d5-45aa-a678-d53188f3aa4d | 7 | private void applyDiscount()
{
isQuantum= false;
try
{
if(!regularDiscount.isSelected() && !quantumDiscount.isSelected())
this.shop.setDiscountStrategy(new NoDiscount());
if(regularDiscount.isSelected())
this.shop.setDiscountStrategy(new RegularCustomerDiscount());
if(quantumDiscount.isSelected(... |
f9127e2a-2a4a-4b6f-b59c-e1ade91f4a3a | 8 | public String[] parse(String[] argv){
Option opt;
StrOption stropt;
BoolOption boolopt;
ArrayList<String> rest = new ArrayList<String>();
for(int i = 0; i < argv.length; i++){
if(cache.containsKey(argv[i])){
opt = cache.get(argv[i]);
... |
1230cc5c-6026-4367-a261-f9e14ee81464 | 1 | public double getDouble(String key, double _default)
{
return containsKey(key) ? get(key).doubleValue() : _default;
} |
d21b6326-7e20-4c98-807b-a89de7060c6e | 0 | public Product getP() {
return p;
} |
9a31205b-041a-4b55-9a86-90a556c18124 | 0 | public String getTime() {
return time;
} |
fe2fb990-d6c0-4a0c-8cdb-4e7c708d9a1e | 2 | @Override
public int compare(TreeRow o1, TreeRow o2) {
int i1 = o1.getIndex();
int i2 = o2.getIndex();
if (i1 < i2) {
return -1;
}
if (i1 > i2) {
return 1;
}
return 0;
} |
d92d879e-e410-4f93-b76e-9f09263eccc0 | 7 | public void checkValidity(){
if (rootUrl == null) throw new IllegalArgumentException("rootUrl is not set!");
if (sourceDir == null) throw new IllegalArgumentException("sourceDir is not set!");
if (!sourceDir.exists()) throw new IllegalArgumentException("sourceDir does not exist!");
if (!sourceDir.isDirectory())... |
5283c9df-f826-494d-af41-93f19ba4e0b4 | 7 | protected static String getMethodName(ITestResult tr) {
String method_name=tr.getMethod().getMethodName();
Object[] params=tr.getParameters();
if(params != null && params.length > 0) {
String tmp=null;
if(params[0] instanceof Class<?>)
tmp=((Class<?>)param... |
bc7537b4-3381-45ab-8a98-2a34190dcc02 | 5 | public int listxattr(ByteBuffer path, final ByteBuffer list) {
if (xattrSupport == null) {
return handleErrno(Errno.ENOTSUPP);
}
String pathStr = cs.decode(path).toString();
if (log != null && log.isDebugEnabled()) {
log.debug("listxattr: path=" + pathStr);
... |
81df0407-da61-4c34-bf92-097ad16fc52b | 9 | protected void start() {
ServerSocket servSocket;
System.out.println("Webserver starting up on port " + port + " !");
try {
servSocket = new ServerSocket(port);
} catch (Exception e) {
System.out.println("Error: " + e);
return;
}
System.out.println("Waiting for connection...");
String cookie =... |
e40a0276-4494-4886-a76b-932536db788c | 8 | public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... |
3bbcf5fc-382c-4e34-8a83-8ff8fd2f637f | 9 | protected double[] getNumericFeatureArrayFromMethods(Object o)
{
ResizableDoubleArray arr = new ResizableDoubleArray();
if(this.numericFeatureMethods == null)
{
this.initNumericFeatureMethods(o);
}
for(String methodName : this.numericFeatureMethods)
{
Method m = null;
try
{
m = o.getClas... |
aa8a05c5-8a82-4b3b-be91-5ac6df317492 | 8 | public static void main(String[] args) {
System.out.println("Message Sender (1.10) for MessagingTool");
System.out.println("Copyright (c) 1998, 2004 by Yoshiki Shibata." +
" All rights reserved\n");
// Make sure there are only two arguments: recipients and message
if (args.length != 2 && args.length ... |
7821180a-1146-43d7-961d-013858778333 | 0 | public void setWebPage(String webPage) {
WebPage = webPage;
} |
be716df1-7766-4912-98f4-94eb7c734af6 | 7 | public static void menuModifyAge(HousePetList hpArray)
{
@SuppressWarnings("resource")
Scanner console = new Scanner(System.in);
int hpChipID = -1;
double newAge = -1;
boolean modifiedAge = false;
/* display list of HousePets to user so they can view the chip... |
83614b21-71a3-4e23-89c0-42aa51eef467 | 2 | public Object buscar(Integer busca) {
String sql = "SELECT * FROM PRODUTO WHERE idProduto = ?";
try {
conn = GerenciaConexaoBD.getInstance().getConnection();
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, busca);
ResultSet rs = stmt.executeQuery();
Produto produto = new Produ... |
abe299da-62ef-4973-a6d4-4c02e9cff15b | 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... |
fe304360-8a9e-410d-9327-35fb105cff9c | 9 | public static int[] rank(String[] h) {
int[] r;
if ((r = RF(h))[0] == 10) {
return r;
} else if ((r = SF(h))[0] == 9) {
return r;
} else if ((r = FK(h))[0] == 8) {
return r;
} else if ((r = FH(h))[0] == 7) {
return r;
} else if ((r = F(h))[0] == 6) {
return r;
} else if ((r = S(h))[0] == 5)... |
36445a1b-07e1-4b98-97dd-806b46b65470 | 6 | @Override
public void execute() throws Exception {
while (!getTerminate()) {
try {
this.suspendWait();
interation();
try {
this.getThread().yield();//Чучуть врямя другим
sleepTerm(getSleep());
... |
a51d5297-b92d-4864-9540-5712b0fdc204 | 3 | public boolean newBid(String amount, Account buyer) {
try {
if (bidsCatalog.size() > 0) {
Bid current = this.getLatestBid();
if (Double.parseDouble(current.getAmount()) > Double
.parseDouble(amount)) {
return false;
}
}
Bid bid = new Bid(amount, buyer);
bidsCatalog.add(bid);
retu... |
9c5e5a5a-8b77-4fd2-a21f-fff27d324f5b | 2 | public void activateServiceMode(Player player)
{
if(null != player)
{
if(playersOnWarmup.containsKey(player.getName()))
{
// set player in service mode only, if he has held the items for the full warm-up duration
playersOnWarmup.remove(player.getName());
... |
4dc82811-8184-4552-9369-b0adc5277472 | 0 | public int getVerdes() {
return verdes;
} |
45721b79-9ef5-4bd5-aa56-a88544d04aee | 8 | private Map<String, Cluster> readFile(String labelPath, String dataPath, String phase) {
System.out.println("read the " + phase + " file ..... ");
// read the label file
System.out.println("Reading label from file " + phase + ".label ");
List<String> classRecords = IOUtils.readFile(labelPath);
documentClass ... |
d0c36f2c-a7ff-4e5e-a978-25ed5287c86b | 6 | * @return Stella_Object
*/
public static Stella_Object conceiveTerm(Stella_Object tree) {
try {
{ Stella_Object standardizedtree = Logic.standardizePropositionTree(tree);
Stella_Object operator = null;
Stella_Object term = null;
if (Stella_Object.consP(standardizedtree)) {
... |
9a56f3c0-00e8-47f6-ba1e-59f1c677a221 | 3 | public static Shape getShape(String seme){
if(seme.equals("quadri")){
return getQuadri();
}else if(seme.equals("fiori")){
return getFiori();
}else if (seme.equals("picche")) {
return getPicche();
}
else return getCuori();
} |
2653bbd7-71cc-442a-89d8-a4faca0b0374 | 7 | private static int parseArgs(String[] args, HamaConfiguration conf,
BSPJob bsp) {
conf.set(inputMatrixAPathString, args[0]);
conf.setInt(inputMatrixARows, Integer.parseInt(args[1]));
conf.setInt(inputMatrixACols, Integer.parseInt(args[2]));
conf.set(inputMatrixBPathString, args[3]);
conf.setInt(inputMatrix... |
6995fff9-7484-4774-97ef-3a097eb4268e | 4 | private void calculateVacation() {
if (employee.isCallWorker()) {
double gewerkt = 0;
double ziekte = 0;
for (int i = 0; i < model.getColumnCount(); i++) {
if (model.getColumnName(i).equalsIgnoreCase("Gewerkt")) {
gewerkt = Double.parseDoub... |
2feae600-47b9-4035-9021-0b8f7d302ced | 1 | public Def def(final Expr expr) {
final Def def = (Def) defs.get(expr);
if (SSAPRE.DEBUG) {
System.out.println(" def for " + expr + " is " + def);
}
return def;
} |
52ef47b8-7b0a-440a-9462-38d6a12d3f46 | 1 | public void testDividedBy_int() {
Months test = Months.months(12);
assertEquals(6, test.dividedBy(2).getMonths());
assertEquals(12, test.getMonths());
assertEquals(4, test.dividedBy(3).getMonths());
assertEquals(3, test.dividedBy(4).getMonths());
assertEquals(2, test.divi... |
d2df76ca-ec31-4287-be6b-c6050ce4dcb3 | 9 | private void axisInfoAction() throws DocumentException,
XmlTypeErrorException {
Document document = DocumentHelper.createDocument();
Element root = document.addElement("properties");
AxisInfoXmlDriver axisInfoXmlDriver = new AxisInfoXmlDriver(xmlRequest);
String cubeIdentifie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.