���̃h�L�������g�̓I���W�i���� Java �R�[�f�B���O�W���� C++ �p�ɕύX�������̂ł��D
�I���W�i���Fhttp://www.objectclub.jp/community/codingstandard/CodingStd.pdf
�t�B�[�h�o�b�N�����}���܂��D
�t�B�[�h�o�b�N��: [email protected]
add/remove
insert/delete
get/set
start/stop
begin/end
send/receive
first/last
get/release
put/get
up/down
show/hide
source/target
open/close
source/destination
increment/decrement
lock/unlock
old/new
next/previous
//////////////////////////////////////////////////////////////////////////////
// ���e �t�@�C���̐���
// �쐬�E�C�� 2001/12/01 ����
// �C�� 2002/07/01 ���� �C�����e
// ���쌠 ��Ж� 2001-2002
//////////////////////////////////////////////////////////////////////////////
#include <iostream>
// �N���X�̐���
class Stack
{
public:
// �v�f�̒lj�
// @param item �lj�����v�f
void push(Object item) {
if (itemCapacity <= itemCount) {
// ...
} else {
// ...
}
}
// �擪�v�f�̎擾�D�擪�v�f�͎�菜�����D
// @return �擪�v�f
Object pop() {
// ...
return top;
}
};
double length = Math::sqrt(Math::pow(Math::random(), 2.0) + Math::pow(Math::random(), 2.0));
// ���j(1)
double xSquared = Math::pow(Math::random(), 2.0);
double ySquared = Math::pow(Math::random(), 2.0);
double length = Math::sqrt(xSquared + ySquared);
// ���j(2)
double length = Math::sqrt(Math::pow(Math::random(), 2.0,
Math::pow(Math::random(), 2.0);
// ���j(3)
return (this == obj
|| (this->parameter == obj->parameter
&& this->field == obj->field));
class LongNameClassImplemenation :
public AbstractImplementation,
public Serializable, public Cloneable
{
void longNameInternalIOMethod(int a, int b)
throw IOException {
// �c
}
void longMethodSignature(int a, int b, int c,
int d, int e, int f) {
// �c
}
// �c
}
Stack stack;
stack.itemCount = 79; // �����œ�����Ԃ�����Ă��܂��D
Point point;
point.x = 30; // ������Ԃ̐������͕���Ȃ��D
class PoorInitialization
{
private:
static std::string name;
public:
PoorInitialization()
{
name = �ginitial_name�h;
}
};
String PoorInitialization::name = "initial_name";
void f(int start) {
int i, j; // �����l�Ȃ��̐錾
// �����̃R�[�h
// ...
i = start + 1;
j = i + 1;
// i, j���g��
}
void f(int start) {
// �����̃R�[�h
// ...
// �g���O�C�͂��߂Đ錾�Ə�����
int i = start + 1;
int j = i + 1;
// i, j���g��
}
void f(int N, int delta) {
int i; // �����l�Ȃ��̐錾
for (i = 0; i < N; i++) {
// i���g��
}
for (i = 0; i < N; i++) {// �܂�i���g��
if (...) {
break;
}
}
if (i != N) { // �Ō�܂ʼn�������̔����i���g���Ă���
// ...
}
i = N - delta*2; // �܂��܂��ė��p
// ...
}
void f(int N, int delta) {
for (int i = 0; i < N; i++) {
// i���g��
}
for (int i = 0; i < N; i++) {
// �ʂ�i���g��
if (...) {
found = true;
break;
}
}
if (found) {
// ...
}
int total = N - delta*2; // �ʂ̈Ӗ�����ϐ�
// ...
}
void moveX(Point p, int dx) {
p.setX(p.getX() + dx); // ������ύX���Ă���(�Ȃ�ׂ�������)
}
void moveX(Point p, int dx) {
p = Point(p.getX() + dx, p.getY());
// ����͌Ăяo�����ɓ`���Ȃ�
}
void reset(int x_, int y_) {
x = x_;
y = y_;
}
void reset(int x, int y) { // �������� x_, y_ �ȂǂƂ��Ȃ�
this->x = x;
this->y = y;
}
/*
* �헪:
* 1. �܂�node��T��
* 2. clone����
* 3. inserter��clone��lj��v��
* 4. ����������Cnode���폜
*/
int index = -1; // -1��invalid�Ȓl���Ӗ�����
�Q�l: ���̕�������ɂ悢�D
static const int INVALID= -1;
int index = INVALID;
return cond == 0 ? a < b && b < c : d == 1;
�ǂ���:return (cond == 0) ? ((a < b) && (b < c)) : (d == 1);
������:
// �P�ʍs�����邪�C���Ԃ������邵�N���ǂ߂Ȃ��D
for (int i = 1; i <= N; i++)
for (int j = 1; j <= N; j++)
M[i-1][j-1] = (i/j)* (j/i);
Copyright © 1997-2008 Sho's Software